Archive for the ‘Programmers’ category
Stay Cool
April 19th, 2012সুন্দরী হ্যাকার
March 22nd, 2012ক্রিস্টিনা ভ্লাদিমিরভনা ভেচিন্সকায়া (Russian: Кристина Владимировна Свечинская,জন্ম : February 16, 1989) একজন রাশিয়ান অর্থ পাচারকারী হ্যাকার।নিউ ইয়র্ক ইউনিভার্সিটির ছাত্রী থাকাকালীন সময়ে তিনি বেশ কিছু ব্রিটিশ ও আমেরিকান ব্যাংক থেকে অর্থ পাচার এবং নকল পাসপোর্ট ব্যবহারের দায়ে অভিযুক্ত হন।অভিযোগ অনুযায়ী তিনি ব্যাংক অ্যাকাউন্ট আক্রমনের কাজে Zeus Trojan Horse ব্যবহার করেছিলেন এবং আমেরিকা ও ওয়াছভিয়াতে অন্তত ৫ টি অ্যাকাউন্ট খোলেন,যেখানে পাচারকৃত ৩৫০০০$ পৌছেছিল।ধারনা করা হয় যে,তিনি আরো ৯ জনের সাথে ৩ মিলিয়ন ডলার সরিয়েছিলেন।তিনি তার আবেদনময়ী অথচ সাধারন উপস্থিতি তাকে বিশ্বের সবচেয়ে আবেদনময়ী হ্যাকার হিসেবে পরিচিতি এনে দিয়েছে।
ইংরেজিতে পারদর্শী ক্রিস্টিনা স্তাভ্রপল স্টেট ইউনিভার্সিটিতে পড়াশুনা করছিলেন।তার মা জানান,তার বাবার মৃত্যুর পর তাদের পরিবার ১২০০০ রুবলের বেতন দ্বারা চলছিল।তিন বছর পর ক্রিস্টিনা একটি ফাস্টফুডের দোকানে কাজ নেন।কিন্তু এই উপার্জন যথেষ্ট না হওয়াই তিনি একজন হ্যাকারের অর্থ পাচারকারী হিসেবে নিযুক্ত হন।এসময় তাকে ৮-১০% শেয়ার দেওয়া হত।তিনি ২০১০ সালে গ্রেপ্তার হন।
ডাটা স্ট্রাকচার: ডিসজয়েন্ট সেট
March 20th, 2012In computing, a disjoint-set data structure is a data structure that keeps track of a set of elements partitioned into a number of disjoint (nonoverlapping) subsets. A union-find algorithm is an algorithm that performs two useful operations on such a data structure:
- Find: Determine which subset a particular element is in. This can be used for determining if two elements are in the same subset.
- Union: Join two subsets into a single subset.
Because it supports these two operations, a disjoint-set data structure is sometimes called a union-find data structure or merge-find set. The other important operation, MakeSet, which makes a set containing only a given element (a singleton), is generally trivial. With these three operations, many practical partitioning problems can be solved (see the Applications section).
In order to define these operations more precisely, some way of representing the sets is needed. One common approach is to select a fixed element of each set, called its representative, to represent the set as a whole. Then, Find(x) returns the representative of the set that x belongs to, andUnion takes two set representatives as its arguments.
Disjoint-set linked lists
A simple approach to creating a disjoint-set data structure is to create a linked list for each set. The element at the head of each list is chosen as its representative.
MakeSet creates a list of one element. Union appends the two lists, a constant-time operation. The drawback of this implementation is that Find requires Ω(n) or linear time to traverse the list backwards from a given element to the head of the list.
This can be avoided by including in each linked list node a pointer to the head of the list; then Find takes constant time, since this pointer refers directly to the set representative. However, Union now has to update each element of the list being appended to make it point to the head of the new combined list, requiring Ω(n) time.
When the length of each list is tracked, the required time can be improved by always appending the smaller list to the longer. Using this weighted-union heuristic, a sequence of m MakeSet, Union, and Find operations on n elements requires O(m + nlog n) time. For asymptotically faster operations, a different data structure is needed.
Analysis of the naive approach
We now explain the bound
above.
Suppose you have a collection of lists, each node of a list contains an object, the name of the list to which it belongs, and the number of elements in that list. Also assume that the sum of the number of elements in all lists is
(i.e. there are
elements overall). We wish to be able to merge any two of these lists, and update all of their nodes so that they still contain the name of the list to which they belong. The rule for merging the lists
and
is that if
is larger than
then merge the elements of
into
and update the elements that used to belong to
, and vice versa.
Choose an arbitrary element of list
, say
. We wish to count how many times in the worst case will
need to have the name of the list to which it belongs updated. The element
will only have its name updated when the list it belongs to is merged with another list of the same size or of greater size. Each time that happens, the size of the list to which
belongs at least doubles. So finally, the question is “how many times can a number double before it is the size of
?” (then the list containing
will contain all
elements). The answer is exactly
. So for any given element of any given list in the structure described, it will need to be updated
times in the worst case. Therefore updating a list of
elements stored in this way takes
time in the worst case. A find operation can be done in
for this structure because each node contains the name of the list to which it belongs.
A similar argument holds for merging the trees in the data structures discussed below, additionally it helps explain the time analysis of some operations in the binomial heap and Fibonacci heap data structures.
Disjoint-set forests
Disjoint-set forests are data structures where each set is represented by a tree data structure, in which each node holds a reference to its parent node (see spaghetti stack). They were first described by Bernard A. Galler and Michael J. Fischer in 1964, although their precise analysis took years.
In a disjoint-set forest, the representative of each set is the root of that set’s tree. Find follows parent nodes until it reaches the root. Union combines two trees into one by attaching the root of one to the root of the other. One way of implementing these might be:
function MakeSet(x)
x.parent := x
function Find(x)
if x.parent == x
return x
else
return Find(x.parent)
function Union(x, y)
xRoot := Find(x)
yRoot := Find(y)
xRoot.parent := yRoot
In this naive form, this approach is no better than the linked-list approach, because the tree it creates can be highly unbalanced; however, it can be enhanced in two ways.
The first way, called union by rank, is to always attach the smaller tree to the root of the larger tree, rather than vice versa. Since it is the depth of the tree that affects the running time, the tree with smaller depth gets added under the root of the deeper tree, which only increases the depth if the depths were equal. In the context of this algorithm, the term rank is used instead of depth since it stops being equal to the depth if path compression (described below) is also used. One-element trees are defined to have a rank of zero, and whenever two trees of the same rank r are united, the rank of the result is r+1. Just applying this technique alone yields a worst-case running-time of
per MakeSet, Union, or Find operation. Pseudocode for the improved MakeSet and Union:
function MakeSet(x)
x.parent := x
x.rank := 0
function Union(x, y)
xRoot := Find(x)
yRoot := Find(y)
if xRoot == yRoot
return
// x and y are not already in same set. Merge them.
if xRoot.rank < yRoot.rank
xRoot.parent := yRoot
else if xRoot.rank > yRoot.rank
yRoot.parent := xRoot
else
yRoot.parent := xRoot
xRoot.rank := xRoot.rank + 1
The second improvement, called path compression, is a way of flattening the structure of the tree whenever Find is used on it. The idea is that each node visited on the way to a root node may as well be attached directly to the root node; they all share the same representative. To effect this, as Find recursively traverses up the tree, it changes each node’s parent reference to point to the root that it found. The resulting tree is much flatter, speeding up future operations not only on these elements but on those referencing them, directly or indirectly. Here is the improved Find:
function Find(x)
if x.parent != x
x.parent := Find(x.parent)
return x.parent
These two techniques complement each other; applied together, the amortized time per operation is only
, where
is the inverse of the function
, and
is the extremely fast-growing Ackermann function. Since
is the inverse of this function,
is less than 5 for all remotely practical values of
. Thus, the amortized running time per operation is effectively a small constant.
In fact, this is asymptotically optimal: Fredman and Saks showed in 1989 that
words must be accessed by any disjoint-set data structure per operation on average.
Applications
Disjoint-set data structures model the partitioning of a set, for example to keep track of the connected components of an undirected graph. This model can then be used to determine whether two vertices belong to the same component, or whether adding an edge between them would result in a cycle. The Union-Find algorithm is used in high-performance implementations of Unification.
This data structure is used by the Boost Graph Library to implement its Incremental Connected Components functionality. It is also used for implementing Kruskal’s algorithm to find the minimum spanning tree of a graph.
Note that the implementation as disjoint-set forests doesn’t allow deletion of edges—even without path compression or the rank heuristic.
Different ways of thinking
March 19th, 2012A program is a list of tasks to be performed by definition. But it can also be defined as a way of mapping a large task to shorter tasks. A computer always performs a program as a list of tasks. I take this question as a theoretical one. In my opinion the difference is the problem solver’s way of thinking. Let’s see a real world example. Assume, we have to sort a set of values. In case we try to solve it as a list of tasks, we probably come to a result, similar to the bubble sort algorithm. Paul E. Black (2009) gives a definition of bubble sort algorithm: “Sort by comparing each adjacent pair of items in a list in turn, swapping the items if necessary, and repeating the pass through the list until no swaps are done.”. This algorithm is an iterative way of solving the given problem. What happens when we try to map the large task to shorter tasks? Although there are a lot of sources where I can find this algorithm, I chose the same source because I think this dictionary is very useful. Conrado Martinez (2009) gave a definition of Quicksort algorithm: ” Pick an element from the array (the pivot), partition the remaining elements into those greater than and less than this pivot, and recursively sort the partitions.”. Divide et impera. Nice and elegant solution of the same problem. We can see the difference in the way of thinking. Both of them can give us a solution and both ways have it’s pros and cons. Recursion’s main drawback is the intensive memory usage. It is especially important in Java, my favourite programing language. Although Shawn Bayern (2001) writes about a very nice method of reducing the size of needed memory while keeping the code nice. I also have to mention another practical aspect. Although recursive algorithms are usually more elegant and many times it’s more easy to solve problem using them, they are usually slower as shiman (2008) wrote in his blog with some nice examples. He also summarizes the main cause of using the recursion: “Q: Then why use recursion?? A: It makes the code beautiful – recursion is a beauty of programming. Sometimes it is much simpler to write the recursive version.”
Reference list:
Conrado Martinez (2009) quicksort in Dictionary of Algorithms and Data Structures [Online]. Available from: http://www.itl.nist.gov/div897/sqg/dads/HTML/quicksort.html (Accessed: 15 October 2009)
Paul E. Black (2009) bubble sort in Dictionary of Algorithms and Data Structures [Online]. Available from: http://www.itl.nist.gov/div897/sqg/dads/HTML/bubblesort.html (Accessed: 15 October 2009)
Shawn Bayern (2001) Synchronized Recursion [Online]. Available from: http://www.ddj.com/architect/184404657 (Accessed: 15 October 2009)
shiman (2008) Recursion VS Iteration (Looping) : Speed & Memory Comparison [Online]. Available from: http://shiman.wordpress.com/2008/05/28/recursion-vs-iteration/ (Accessed: 15 October 2009)
Professional responsibility
March 19th, 2012The question was: “What responsibility do computing professionals have to society at large and to other members of their profession? Do they have any responsibilities or are their working lives solely measured in terms of their adherence to company policy and goals? How does this translate into the broader area of business ethics?”Maybe I seem profane in many’s eyes, but I do think, that computing professionals don’t have any special responsibilities. We’re not special, although many of us like to think so. In my oppinion all our responsibilities are determined by our actual role. This profession nowadays is not a single one. When I started to work, all IT experts had to be able to write programs, install software, in most cases train people. Nowadays you cannot be trainer, engineer, developer, help-desk professional in the same time. Even those categories are split into numerous other categories. In my oppinion, our work is glued to work of others, our roles have their pair amongst the old, existing roles. Let’s take some examples: IT trainer – teacher, software developer – engineer, user support – mechanic, etc. Of course I don’t say, that every role existed in the past. I believe, that the responsibility’s roots are the same now and were the same in the past.
We are responsible fo our acts as we are human. Computer professionals’ responsibility is for example to defend the children from the dangers on the internet. But all humans are responsible to defend the children from dangers in the world. Stefan C. Dombrowski & Karen L. Gischlar (n.d) for example suggest a kind of parent-children “contract” in order to make sure both the parents and the children have the same knowledge about the rules. A good resource of articles is the website of the Computer Professionals for Social Responsibility. For example the user nbrigham wrote on this website ” Strict copyright laws may protect the interests of companies selling intellectual property products, but these same laws could limit public access to information.” which shows that many times there isn’t just one good and one bad way. In my oppinion IT professionals working for a company has to follow the company’s directions and work for it’s goals, unless the company works illegally or making unethicaly products, for example virus or troyan software. But this also not different for non-it professionals. They should not take part in making of any illegal or unethical product or service.
My oppinion is that responsibility and ethics are not derived from a profession, they are derived from the humanity.
References:
Stefan C. Dombrowski & Karen L. Gischlar (n.d) Keeping Children Safe on the Internet: Guidelines for Parents [Online] Available from:http://www.nasponline.org/publications/cq/cq342internetsafety_ho.aspx (Accessed: 07. February 2010)
Computer Professionals for Social Responsibility (2008) Intellectual Property [Online] Available from: http://cpsr.org/issues/ip/index.html (Accessed: 07. February 2010)
পেটাবাইট
March 3rd, 2012১ পেটাবাইট = ২ টু দি পাওয়ার ৫০, যা প্রায় ১,১২৫,৮৯৯,৯০৬,৮৪২,৬২৪ বাইটের সমান।
তবে সহজভাবে হিসাবের জন্য ১ পেটাবাইট = ১০ টু দি পাওয়ার ১৫, যা প্রায় ১,০০০,০০০,০০০,০০০,০০০ বাইটের সমান। আর পেবিবাইট হল ১,১২৫,৮৯৯,৯০৬,৮৪২,৬২৪ বাইট। পেটাবাইট ও পেবিবাইটের মধ্যে দ্বন্দ্ব দূর করার জন্য পেটাবাইটের এই মান ধরা হয়।
এক পেবিবাইট ১,০২৪ টেরাবাইটের সমান এবং এর পরবর্তী এককটি হল এক্সাবাইট। বড় হার্ডড্রাইভ অথবা অনেকগুলো হার্ড ড্রাইভ একসাথে পরিমাপের জন্য এই এককটি ব্যবহার করা হয়। আবার বড় ডাটা কালেকশন পরিমাপে ও পেটাবাইট একক ব্যবহার করা হয়।
পেটাবাইটের ইংরেজি সংক্ষিপ্ত রূপঃ PB
কিভাবে আপনি সমাধান করবেন?
March 1st, 2012আপনার সামনে দশটি স্বচ্ছ প্লাস্টিকের বাক্স লাইন করে সাজানো আছে। প্রতিটি বাক্সে আছে ছোট ছোট অনেকগুলি কয়েন। প্রতিটি কয়েনের ওজন দশ গ্রাম করে। দশটি বাক্সের মধ্যে কেবলমাত্র একটি বাক্স আছে, যেখানকার কয়েনগুলোতে সমস্যা আছে। দশ গ্রামের বদলে সেখানকার প্রতিটি কয়েনের ওজন এগারো গ্রাম করে। কিন্তু সেটা দেখে বুঝবার কোনো উপায় নেই, একমাত্র ওজন করেই বুঝা সম্ভব। এখন ওজন মাপবার জন্য আপনাকে একটা মেশিন দেয়া হলো। সেই ওজন মাপবার মেশিনে আপনি যাই ওজন করতে চান না কেন, একবার ওজন করতে পারবেন। একবার কোনো কিছু ওজন করে ফেললে, মেশিনটা আপনার কাছ থেকে সরিয়ে নেয়া হবে। আপনি যে-কোনো বাক্স থেকে যতখুশি কয়েন নিতে পারেন, যা খুশি ওজন করতে পারেন। এখন সমস্যাটা হচ্ছে, যা খুশি ওজন করুন না কেন, একবারমাত্র ওজন করে আপনাকে বলতে হবে, ঠিক কোন বাক্সের কয়েনগুলিতে সমস্যা আছে। কিভাবে আপনি সমাধান করবেন?
.
.
.
.
.
.
.
.
.
.
.
.
.
বাক্সগুলোতে নং দিন- ১,২,৩, ৪…..১০।
১নং বাক্স থেকে ১টা , ২নং বাক্স থেকে ২ টা , ৩ নং বাক্স থেকে ৩টা , এভাবে ১০ নং বাক্স থেকে ১০ টা কয়েন নিন। মোট -৫৫ টা কয়েন ওজন দিন। ৫৫০ গ্রামের উপরে যত গ্রাম পাবেন , সেই নং বাক্সের কয়েনগুলোতে সমস্যা আছে।
SQLyog
June 29th, 2011My SQL Server Instalations
June 27th, 2011Share Price Board
June 15th, 2011Share Price Board এ click কের যিদ IP Settings Box আেস তাহলে মেন কেরেত হেব েয control panel েথেক Share Price Board Related Software েযমন (Share Price Board, dotnetfx( 3.5) SP1, WinPcap_4_1_2) এর েকান একিট Software Remove করা হেয়েছ.
এই Problem Solve করেত হেল েয Software িট control panel েথেক remove ক্রা হেয়েছ তা আবার Install করেত হেব
Top 7 programmers bad habits
June 11th, 20111.- The all code is crap, except mine, attitude.
I have bad news for you buddy, all code is crap. No matter how much effort you put on it, there is always a majority of programmers who are going to think that your code sucks and that they could have done it 10 times better. I have already covered this topic in previous posts, you can find more information of what exactly I mean when I say that all the code is crap here and here.
How to fix it: Don’t criticise others people code, it could be yours the one in the spotlight, try to make objective and professional observations instead, but don’t judge. Be humble and try to learn from everyone around you, hopefully then your code won’t be so bad.
2.- The “I fix that in a second” catastrophe.
Taking shortcuts is very tempting, everyone has done it. There are actually situations where they are necessary, but in overall, they are dangerous, very dangerous and should be avoided. A shortcut which goes wrong may save you a few hours, but may cause months of pain.
How to fix it: Don’t trust yourself when carrying delicate activities. Ask someone else to review what you are doing. Make sure that if you are about to take a shortcut, you make very clear to the stakeholders what the reasons and the risks are. Try to get a manager to sign off every time you are about to take a shortcut, aka “cover your ass”.
3.- The “That will only take a second” misconception.
Being Barcelona my hometown, I am very proud of the Sagrada Familia Cathedral, which is very well know for its beautiness, and also for the time is estimated it will take to complete, (in construction since 1882), but that’s probably because they didn’t ask a programmer to estimate, otherwise the estimate would probably have been somewhere around 2 weeks.
How to fix it: For starters, is important to understand that accurate estimations in software development for non trivial solutions are impossible, we can only guess. Also remember that is very likely that you will find so many things which you didn’t foresee when you start developing that is worth multiplying the estimate to cover for those, I usually go with 1.5 or 2.
4.- The ego spiral.
Many programmers discussions look more like rooster fights than human discussions. This usually happens in design and architectural meetings. It is actually quite easy to detect this ego spirals, you just have to substitute most of what the contenders are saying with COC! COC! COCOCOOCCC! COOC!
How to fix it: Leave your ego at home. Big egos are one of the biggest non technical issues for any programmer. Keep in mind some basic considerations when making decisions.
5.- “It wasn’t me!”
In my opinion, other bad habit from most programmers is the lack of accountability. We always have an excuse… It’s like if we were saying that under normal conditions we would never make a mistake, which honestly is quite hard to believe.
How to fix it: No need to cry, or to perform seppuku, (aka harakiri), when we make a mistake. Having a healthy attitude where we can you just say something like: “yeah, sorry, now we need to do this to fix this issue, my fault” is a very professional attitude, and it will help you to build a reputation and to be better considered by your colleagues.
6.- The demotivated genius.
Repetitive and simple tasks are not the best motivators, but they need to be done, programmers tend to get demotivated and very unproductive when they need to complete them.
How to fix it: Discipline. Unfortunately, there isn’t any other remedy I can think of.
7.- The premature programmer.
If programming was sex, there would be a lot of unsatisfied computers. You can just not go in, do things halfway through and then fall sleep. One of the concepts that I find most programmers struggling with is the concept of “Done”. Remember that done means: tested (and not only unit tested), documented, committed, merged…
How to fix it: This one is tricky, the complexity of non apparent necessary tasks to fully complete some functionality is quite high and usually requires discipline and training. Probably the two easiest ways to help a programmer understand if some code is done are peer reviews and demos.
SVN এর ব্যবহার
June 9th, 2011Programming এর একটি বড় সমস্যা হল Code এর Version manage করা। এই কাজটি সহজ করার জন্য আমরা বিভিন্ন software user করে থাকি। এমনই একটি software হল TortoiseSVN.
এটি ব্যবহার করের জন্য প্রথমেই আমাদের সফটওয়্যারটি ডাউনলোড করে ইন্সটেল করে নিতে হবে। এর পর এডমিন এর কাছ থেকে নির্দিষ্ট URL নিয়ে তা থেকে মাউস এ রাইট বাটন ক্লিক করে SVN Checkout করতে হবে। তাহলে লোকাল কম্পিউটারে SVN এর ফোল্ডার structure তইরি হবে। নতুন তউরি হওয়া এই ফোল্ডার গুলর মদ্দে trunk ফোল্ডার এ আমাদের প্রয়োজনীয় ফাইল রেখে back এ গিয়ে পুর ফোল্ডার এর উপর মউসে রাইট বাটন ক্লিক করে চম্মিত দিতে হবে।
তাহলেই সমস্ত কাজ সেরভের এ আছটি ভার্সন নাম্বার দিয়ে সেভ হইএ থাকবে। পরবরতিতে যে কন সময় আমরা এই ভার্সন টি ডাউনলোড করে নিতে পারব।
![exactlyvvv[1]](http://blog.onnorokomsoftware.com/wp-content/uploads/2012/04/exactlyvvv1.jpg)

























![homer-simpson-doh[1]](http://blog.onnorokom.com/wp-content/uploads/2011/06/homer-simpson-doh1-212x300.jpg)
![chicken-dance[1]](http://blog.onnorokom.com/wp-content/uploads/2011/06/chicken-dance1.gif)