My Slider

Image Slider By Humayoun Kabir Lets Express our emotion with blog Email me at humayounk@ymail.com #htmlcaption

সোমবার, ১০ জুন, ২০১৩

Facebook Tricks with Javascript



1. Select all Friends for an Invitation instantly
You can select all friends easyli just open any page or group click on suggest or invite and copy this code and paste in the url box. and hit Enter....thats it
javascript:elms=document.getElementById('friends').getElementsByTagName('li');for(var fid in elms){if(typeof elms[fid] === 'object'){fs.click(elms[fid]);}}
2. View the Hidden content of a page without making a Like
This trick is used to view the hidden content of any Facebook page without making a like to that page. This trick was also previous published in our recent post  How to view the hidden content of Facebook pages without making a Like, you can find even more tricks related to this topic in this post.
javascript:(function(){for(var%20t=document.getElementsByTagName("*"),l=t.length;l--;){t[l].style.visibility=""}}())
3. View Private Photos on Facebook
This trick is used to view the photos of people blocked due to privacy issue even without adding them on Facebook. Just go to the person’s page and enter the following code in the address bar. Now as soon as you hit the Enter key, the private photos are unveiled to you now.
javascript:(function(){CSS.removeClass(document.body,%20'profile_two_columns');
tab_controller.changePage("photos");})()
4.Edit any page
Javascript:document.body.contentEditable=”true”;document.designMode=”true”;void 0

I hope this will help to make some fun!! any feedback mail me : humayounk@ymail.com

সোমবার, ২২ অক্টোবর, ২০১২

C# Repository Pattern Example

First Of all I Would Like to mention The following content is not mine it's my mentor Redmond sir content. I just  use his content to present towards you to get an idea what is Repository pattern .The Repository Pattern is a pattern that is being used in software architecture  in  recent times. So you have to  understand what is this pattern about.

The Repository Pattern is a common construct to avoid duplication of data access logic throughout our application. This includes direct access to a database, ORM, WCF dataservices, xml files and so on. The sole purpose of the repository is to hide the nitty gritty details of accessing the data. We can easily query the repository for data objects, without having to know how to provide things like a connection string. The repository behaves like a freely available in-memory data collection to which we can add, delete and update objects.
The Repository pattern adds a separation layer between the data and domain layers of an application. It also makes the data access parts of an application better testable.
The example below show an interface of a generic repository of type T, which is a LINQ to SQL entity. It provides a basic interface with operations like Insert, Delete, GetById and GetAll. The SearchFor operation takes a lambda expression predicate to query for a specific entity.

The implementation of the IRepository interface is pretty straight forward. In the constructor we retrieve the repository entity by calling the datacontext GetTable(of type T) method. The resulting Table(of type T) is the entity table we work with in the rest of the class methods. e.g. SearchFor() simply calls the Where operator on the table with the predicate provided.
The generic GetById() method explicitly needs all our entities to implement the IEntity interface. This is because we need them to provide us with an Id property to make our generic search for a specific Id possible.

Since we already have LINQ to SQL entities with an Id property, declaring the IEntity interface is sufficient. Since these are partial classes, they will not be overridden by LINQ to SQL code generation tools.

We are now ready to use the generic repository in an application.

Once we get of the generic path into more entity specific operations we can create an implementation for that entity based on the generic version. In the example below we construct a HotelRepository with an entity specific GetHotelsByCity() method. You get the idea. ;-)

The code below shows a nice and clean implementation of the generic repository pattern for the Entity Framework. There’s no need for the IEntity interface here since we use the convenient Find extension method of the DbSet class.