Thứ Ba, 6 tháng 12, 2011

Google Search đã cho phép vẽ đồ thị ngay trong trình tìm kiếm

Google Search đã cho phép vẽ đồ thị ngay trong trình tìm kiếm


Với ô tìm kiếm của Google, ngoài việc nhập thông tin để tìm kiếm khắp Internet thì bạn còn có thể làm phép tính nhanh, thực hiện việc chuyển đổi đơn vị. Nay, Google tích hợp thêm một tính năng hữu ích nữa cho trình tìm kiếm của mình, đó là tính năng vẽ đồ thị. Chỉ đơn giản nhập vào một hàm số rồi nhấn Enter thì Google sẽ trả về đồ thị bên cạnh các liên kết dẫn đến những trang web khác. Hầu hết các hàm cơ bản, hàm số lũy thừa, hàm số mũ, hàm số lượng giác,... đều được Google hỗ trợ. Bạn có thể nhập hàm số ngay trong ô tìm kiếm có sẵn của trình duyệt hoặc truy cập vào trang Google.com rồi nhập thông tin. Các hàm được ngăn cách bởi dấu phẩy và các hàm có thể lồng vào nhau. Thậm chí chúng ta còn có thể đặt miền giá trị để vẽ đồ thị bằng cấu trúc "from...to...". Trên đồ thị, người dùng có thể di chuyển con trỏ chuột để biết tọa độ, phóng to, thu nhỏ hay di chuyển đồ thị tương tự như khi dùng Google Maps. Đây là một công cụ khá hữu ích cho học sinh, sinh viên và những người yêu thích toán học vì họ không cần đến phần mềm chuyên dụng hay máy tính bỏ túi để thực hiện thao tác vẽ đồ thị.

Vui: bạn hãy copy và dán dòng sau vào Google, sẽ thấy thú vị:
(sqrt(cos(x))*cos(200 x)+sqrt(abs (x))-0.7)*(4-x*x)^0.01, sqrt(9-x^2), - sqrt(9-x^2) from -4.5 to 4.5

Thứ Hai, 5 tháng 12, 2011

Tăng sóng Wifi bằng... vỏ lon bia

Cùng với sự phát triển của công nghệ thông tin, các thiết bị truyền dẫn tín hiệu ngày càng được thu gọn bớt dây dẫn và truyền dẫn tín hiệu mạng không dây đang là thứ được rất nhiều người quan tâm. Tuy nhiên các thiết bị phát sóng đơn giản có ăng ten khá bé và khả năng định hướng không tốt vì thế rất nhiều gia đình hiện nay muốn phủ sóng wifi trên 1 căn nhà khoảng 4 tầng vẫn phải sử dụng đến các thiết bị tiếp sóng (repeater) hay dùng đến 2 thiết bị phát sóng.
Vấn đề khá nhức nhối nhưng cách giải quyết lại rất đơn giản. Chỉ với 1 chiếc vỏ lon nước ngọt và khoảng 10 phút xử lý bạn đã có thể giúp sóng wifi truyền đi được xa hơn và có thêm khả năng định hướng phát sóng chính cho wifi.

Chuẩn bị

Tất cả các vật dụng đều rất dễ kiếm và rẻ tiền:
- 1 vỏ lon bia hay nước ngọt loại thông thường.
- Dao rọc giấy.
- Kéo.

Tiến hành

Đầu tiên bạn ngắt bỏ phần móc giật nắp lon.
Rồi rừa sạch lon bằng nước.
Tiếp theo bạn dùng dao rọc giấy cắt rời phần đáy lon theo đường màu đỏ như hình. Cố gắng tránh làm bẹp vỏ.
Với phần nắp bạn cũng cắt tương tự nhưng không cắt đứt vẫn để dính lại 1 đoạn khoảng 2 đến 3cm gần phần lỗ.
Và cắt 1 đường dọc thân lon ở vị trí xa lỗ nhất. sau đó mở 2 cánh ra bạn sẽ được 1 chiếc Parabol 1 chiều tự chế cực đơn giản.
Cuối cùng độn thêm 2 miếng đất sét hoặc giấy bìa vào phần nắp lon để đặt được trên mặt modem nếu cảm thấy xấu bạn có thể dùng luôn băng dính 2 mặt rồi dán trực tiếp lên mặt modem, nhớ xoay hướng của parabol về phía cần phát đi xa nhất bạn sẽ thấy được hiệu quả khi sử dụng.
Nếu bạn muốn phát khắp căn nhà 4 tầng, bạn có thể đặt router ở tầng 1 và hướng chảo lên trên hoặc đặt router trên tầng 4 rồi hướng chảo xuống dưới. Tốt nhất là bạn nên đặt ở tầng 4 vì nếu đặt tầng 1 thì sóng đáng ra được phát ở tầng 1 sẽ bị parabol hứng hết và phản lên trên khiến tầng dưới cùng gần modem nhất sóng sẽ không phải tốt nhất.
Chúc các bạn vui vẻ với thiết bị này.
Theo GenK (WikiHow)

Thứ Bảy, 3 tháng 12, 2011

Hướng dẫn tạo clip trong phần mềm VLC




Là một phần mềm nguồn mở, VLC Media player có thể chạy trên nhiều loại hệ điều hành. VLC có thể chơi nhiều loại định dạng kèm theo tiện ích ghi đĩa DVD. Đặc biệt, phần mềm này có thể chơi đĩa ngay trong định dạng ISO (định dạng lưu trữ CD, DVD trên ổ cứng) mà không cần đĩa thực. Người dùng VLC cũng có thể xem ngay file flash FLV trên trang chia sẻ video như YouTube mà không cần chuyển đổi.

Hôm nay mình sẽ giới thiệu cho các bạn các bước để thực hiện.
Vớinhững ngày nghỉsắp tới,sáng tạo này của bạn chứa đựng nhiều ý nghĩa cho người thân , gia đình , bạn bè và người yêu .bạn cómột bộ sưu tậpcác videocủagia đình, bạn bè,hoặc thậm chícác sự kiện, bạn có thểlàm dễ giàng với VLC. Bắt đầu bạn tải phần mềm VLC và cài đặt.

B1: Mở VLC và mở VIEW trên thanh công cụ trong mục này bạn chọn theo như trên màn hình




B2 : Mở video mà bạn muốn cắt lấy một từ nơi bạn lưu . Sử dụng thanh trượt để điều hướng đến thời gian bạn muốnbắt đầu ghi âm. các biểu tượng bên cạnh nằm ở bên phải của Advanced Controls, sẽ cho phép bạn xác định chính xác thời gian, bạn sẽ muốn bắt đầu ghi âm .






B3 :Bấm nút Record ở đầu bên trái của Advanced Controls. Bấm vào phím màu đỏ như trong anh để bắt đầu ghi âm , click vào Play và cho phép chơi các đoạn video thông qua các phần bạn muốn lưu. Vào cuối cùng là bạn bấm nút Record thêm một lần nữa.







Việc cắt video sẽ được lưu tự động của VLC. bạn có thể chia sẻ clip của bạn với bạn bè của bạn hoặc giữ làm kỉ nệm cho sau này.





Chúc các bạn thành công !

Chủ Nhật, 20 tháng 11, 2011

Windows 7 Ultimate - Compressed 916MB - MF


No Serial & No Activation Needed | Extracted Size: 3.47GB | Compressed Files for Download 916MB | Genuine version | FULLY UPDATABLE with Windows Update | Instructions and Installation notes included.

This is a High Compressed Files 916 MB When You Exctract Them You Will Get The Original Windows Size 3.47 GB | So You Can save more of your bandwidth using the above links and this may help people who have a bad internet/download speed.

Đây là bản Windows 7 đã rút gọn lại còn 916MB, khi giải nén ra sẽ có file .iso với dung lượng 3.47GB. Bạn có thể tiết kiệm băng thông khi dùng ADSL tính theo dung lượng và file này cũng có thể giúp đối với các bạn có mạng ADSL yếu.
INSTRUCTIONS :

Install:
- Download and extract using WinRAR.
- Use Nero or other burning app to burn the ISO image
- Burning speed should not be faster than 4x. Otherwise, it might not work.
- Restart your computer.
- Make sure you have selected your DVD-ROM/RW drive as a first boot device.

* Enter the BIOS pressing the DEL button, set the option, insert your Windows 7 installation and restart computer.
- The black screen will appear (image 01).
- Press any key to boot from CD or DVD.... (by pressing the key you are entering the setup)
- Select your language, time and currency and keyboard input (optionaly)
- Click install now
- Choose your edition (x86 is 32-bit, x64 is 64-bit) depending of CPU type you have.

*Choose x64 if you have 64-bit processor.
- Click "I accept".
- Click "Custom" (advanced).
- Choose your partition/hdd drive where Win7 should be installed and click format.

*You might get some error if you have two or more hard disks with different connectors (ATA and SATA).
If you get an error, turn off one of your hard disks and repeat the whole proces.
- After formatting, setup will continue automaticly and it will finish after 15-30 min.
- Next step would be username
- Type your password (if you want).
- When you get the screen for CD-KEY just ignore it leaving blank.

*Uncheck the box for automaticly activation and click next.
- Choose the third option for next step.
- Select your time zone.
- Select your current location (Home is recommended).
- The black CMD windows will appear. Wait a few seconds until computers restares once again.
- And that would be all about installation. You are in Windows now.

Activation:
It is not required, because it is OEM. Windows will be premanently activated.
However, it is well known that there is some problems with DELL and HP machines.
So if you have issues with pre-activation you will be forced to some activator to activate Windows 7.

INSTALLATION NOTES :

--> Remember when Windows is finalizing its installation, a black screen will appear (cmd), it will stay like this for about 2 to 10 mins Depending on the system you are using Then It Will say ***-***-***-***-**** Key installed successfully. Then it will restart automatically. After this, you can go to My computer's Properties, Windows is NOW activated!

--> FOR DELL and HP machines
80% : the activators will work meanwhile the other 20% depends on how old your laptop/computer, If you did an upgrade you will have to use an external activator because this version was made for a clean installation.

--> If you do not want to be forced to use an activator. I would do a custom install but you don't really have to format your driver due to the fact that Windows 7 will just overwrite your current windows and put the old windows in a folder called "Windows.old" where your previous windows installion files are kept. And it is optional if you choose to delete the old folder because the drivers are there after installation. Make sure you are connected to the internet before and after the installation.
Go for the fresh Installation if you dont really have important programs you can easily re-install at a later time. ( I RECOMMEND THIS )

Screenshot:



Download:
http://www.mediafire.com/?5j5kkk2btsps2
.

Chủ Nhật, 13 tháng 11, 2011

Writing a WCF Message Inspector

Lời giới thiệu
Đây là bài viết sưu tầm. Nội dung bài viết xoáy sâu vào việc viết một message trên wcf như thế nào? Bạn có thể dựa trên ý tưởng này để viết 1 chương trình kiểm tra user + ticket để đăng nhập hợp lệ từ phía client.
Nội dung
A WCF MessageInspector is a kind of a "message filter" that we can develop on the service or on the consumer side, in order to intercept and inspect the messages coming in or going out of the service layer infrastructure.

In order to define a Message Inspector on the consumer side we need to implement the IClientMessageInspector interface, while on the service side we need to implement the IDispatchMessageInspector interface. Here are their definitions:
public interface IClientMessageInspector
{
void AfterReceiveReply(ref Message reply, object correlationState);
object BeforeSendRequest(ref Message request, IClientChannel channel);
}
public interface IDispatchMessageInspector
{
object AfterReceiveRequest(ref Message request, IClientChannel channel, InstanceContext instanceContext);
void BeforeSendReply(ref Message reply, object correlationState);
}
As you can see both these interfaces define a couple of methods that allow to access the Message (System.ServiceModel.Channels.Message) just before sending it, regardless it is a Request (IClientMessageInspector) or a Response (IDispatchMessageInspector), and just after receiveing it, again regardless its direction.
It's very important to underline that the message provided to this methods is a "by reference" parameter, because this allows our Message Inspector implementations to change the message while it is moving along the service model pipeline. In fact the ref Message parameter can be used to read the SOAP message using one of the methods of the Message type (like ToString(), GetBody<T>(), GetReaderAtBodyContents(), etc.) or can be completely changed using a new Message instance, written through the writing methods of the Message type (WriteBody(...), WriteBodyContents(...), WriteMessage(...), etc.).
One of the most useful methods of the Message type is the CreateBufferedCopy one, which allows to create a MessageBuffer instance that is a buffered copy of the source message useful to XPath navigate its content. The MessageBuffer type allows also to recreate a Message instance from the buffer using the CreateMessage() method.
Here is an example of a service-side Message Inspector used to output to the Console any received and sent message:
public class ConsoleOutputMessageInspector : IDispatchMessageInspector
{
public object AfterReceiveRequest(ref Message request, IClientChannel channel, InstanceContext instanceContext)
{
MessageBuffer buffer = request.CreateBufferedCopy(Int32.MaxValue);
request = buffer.CreateMessage();
Console.WriteLine("Received:\n{0}", buffer.CreateMessage().ToString());
return null;
}

public void BeforeSendReply(ref Message reply, object correlationState)
{
MessageBuffer buffer = reply.CreateBufferedCopy(Int32.MaxValue);
reply = buffer.CreateMessage();
Console.WriteLine("Sending:\n{0}", buffer.CreateMessage().ToString());
}
}
As you can see I create a copy of the message instance, using the CreateBufferedCopy() method, and the I write it using the ToString() of the Message type.
Another example of Message Inspector could be the following one, used to write to the console every single SOAP Header contained in the message that moves through the message pipeline:
public class ConsoleOutputHeadersMessageInspector : IDispatchMessageInspector
{
public object AfterReceiveRequest(ref Message request, IClientChannel channel, InstanceContext instanceContext)
{
MessageBuffer buffer = request.CreateBufferedCopy(Int32.MaxValue);
request = buffer.CreateMessage();
Message originalMessage = buffer.CreateMessage();
foreach (MessageHeader h in originalMessage.Headers)
{
Console.WriteLine("\n{0}\n", h);
}
return null;
}

public void BeforeSendReply(ref Message reply, object correlationState)
{
MessageBuffer buffer = reply.CreateBufferedCopy(0x7fffffff);
reply = buffer.CreateMessage();
Message originalMessage = buffer.CreateMessage();
foreach (MessageHeader h in originalMessage.Headers)
{
Console.WriteLine("\n{0}\n", h);
}
}
}
Here I walk through each MessageHeader contained within the source Message browsing the Headers collection. One more time I work on a buffered copy of the message.
In order to configure these message inspectors we can use a custom behavior. Behaviros are classes that extend the service model defining custom extensions for: contracts, endpoints, services, operations. In these examples I defined two different kind of behaviors: one endpoint behavior and one servicebehavior.
Let's start from the EndpointBehavior:
public class ConsoleOutputBehavior : IEndpointBehavior
{
public void AddBindingParameters(ServiceEndpoint endpoint, BindingParameterCollection bindingParameters)
{
}

public void ApplyClientBehavior(ServiceEndpoint endpoint, ClientRuntime clientRuntime)
{
throw new Exception("Behavior not supported on the consumer side!");
}

public void ApplyDispatchBehavior(ServiceEndpoint endpoint, EndpointDispatcher endpointDispatcher)
{
ConsoleOutputMessageInspector inspector = new ConsoleOutputMessageInspector();
endpointDispatcher.DispatchRuntime.MessageInspectors.Add(inspector);
}

public void Validate(ServiceEndpoint endpoint)
{
}
}
As you can see I implement the IEndpointBehavior interface, which defines three methods (AddBindingParameter, ApplyClientBehavior, ApplyDispatchBehavior). The one I'm interested on is the ApplyDispatchBehavior that relates to the service-side. This method receives a parameter of type EndpointDispatcher that allows to add custom Message Inspectors instance to the service dispatching environment. Because we're defining an Endpoint Behavior, this behavior affects a single endpoint of a service. To map the behavior to the service endpoint we can use a custom configuration element in the configuration file of the service host. Otherwise we could apply the behavior directly through the ServiceHost instance. In this sample I used a custom configuration element. To do that we need a custom type describing the configuration element. It is a type inherited from BehaviorExtensionElement, like the following one:
public class ConsoleOutputBehaviorExtensionElement : BehaviorExtensionElement
{
protected override object CreateBehavior()
{
return new ConsoleOutputBehavior();
}

public override Type BehaviorType
{
get
{
return typeof(ConsoleOutputBehavior);
}
}
}
The implementation of the behavior extension element is really simple, it defines just the CreateBehavior method, used to create an instance of the behavior, and the BehaviorType property, to return the type of the behavior it defines and creates. In reality this class can define also custom properties useful to configure the behavior. In our example we don't do that, but we could add some configuration properties, too.
The previously declared extension element can be used in the .config file of the service host application, like in the following excerpt:
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<system.serviceModel>
<services>
<service name="DevLeap.WCF.MessageInspectors.Services.OrderService">
<endpoint
behaviorConfiguration="devleapBehavior"
address="http://localhost:8000/OrderService"
binding="wsHttpBinding" bindingConfiguration="devleapWsHttpBinding"
contract="DevLeap.WCF.MessageInspectors.Contracts.IOrderService" />
</service>
</services>
<extensions>
<behaviorExtensions>
<add name="consoleOutputBehavior" type="DevLeap.WCF.MessageInspectors.Extensions.ConsoleOutputBehaviorExtensionElement, DevLeap.WCF.MessageInspectors.Extensions, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null" />
</behaviorExtensions>
</extensions>

<behaviors>
<endpointBehaviors>
<behavior name="devleapBehavior">
<consoleOutputBehavior /> </behavior>
</endpointBehaviors>
</behaviors>
<bindings>
<wsHttpBinding>
<binding name="devleapWsHttpBinding">
<security mode="None" />
</binding>
</wsHttpBinding>
</bindings>
</system.serviceModel>
</configuration>
First of all we define the behaviorExtension element, inside which we define the new extension, through the add element. Keep in mind that we need to declare the fully qualified name of the extension element type inside the type attribute.
Then we declare the new custom behavior within the behaviors section of the configuration file.
While an Endpoint Behavior applies only to a single endpoint, we can also define a custom Service Behavior that applies to every single endpoint of a service. To do that we need to define a class that implements the IServiceBehavior interface. Here is an example:
[AttributeUsage(AttributeTargets.Class)]
public class ConsoleHeaderOutputBehavior : Attribute, IServiceBehavior
{
public void AddBindingParameters(ServiceDescription serviceDescription, ServiceHostBase serviceHostBase, Collection<ServiceEndpoint> endpoints, BindingParameterCollection bindingParameters)
{
}

public void ApplyDispatchBehavior(ServiceDescription serviceDescription, ServiceHostBase serviceHostBase)
{
for (int i = 0; i < serviceHostBase.ChannelDispatchers.Count; i++)
{
ChannelDispatcher channelDispatcher = serviceHostBase.ChannelDispatchers[i] as ChannelDispatcher;
if (channelDispatcher != null)
{
foreach (EndpointDispatcher endpointDispatcher in channelDispatcher.Endpoints)
{
ConsoleOutputHeadersMessageInspector inspector = new ConsoleOutputHeadersMessageInspector();
endpointDispatcher.DispatchRuntime.MessageInspectors.Add(inspector);
}
}
}
}

public void Validate(ServiceDescription serviceDescription, ServiceHostBase serviceHostBase)
{
}
}
The IServiceBehavior interface looks like the IEndpointBehavior, except the fact that it provides a different ApplyDispatchBehavior method definition. In fact a Service Behavior should apply its behavior to every single insatnce and endpoint published by the service to which it is applied. In this example I inherited the behavior class from the Attribute base class too, targeting it to class definitions. This way we can apply the behavior directly to the service definition, like shown in the following excerpt:
[ConsoleHeaderOutputBehavior]
public class OrderService : IOrderService
{
public OrderConfirmation InsertOrder(Order order)
{
OrderConfirmation result = new OrderConfirmation();
result.IdOrder = order.IdOrder;
result.ShipDateTime = DateTime.Now.AddDays(2);
return result;
}
}
So far you have seen how to define custom Message Inspector and how to map it to a single endpoint, using and Endpoint Behavior, or how to map it to an entire service, using a Service Behavior. You have also seen how to declare the behaviors using a custom configuration element or a custom behavior attribute. Hope you enjoyed this article, Here you can find the code sample used and described in this post.

Bài đăng phổ biến