Manish Pansiniya's Blog

.NET, C#, Javascript, ASP.NET and lots more…:)

Archive for the ‘Time Saver’ Category

Dell laptop – FN function keys problem resolved

with 33 comments

As one of the problem I found with the laptop now a days is the keys those are with the Function keys. As a developer, we require to setup function key as priority instead of other keys. But by default, we need to press FN+Function key.

To change this behavior

1. First Solution:-

You can use the Function Key Behaviour setting in the System Setup (BIOS) utility to configure the media control keys. The options in the Function Key Behaviour setting are:

Multimedia Key First – This is the default option. Press any multimedia key directly. For function key, press <Fn> + the required function key.

Function Key First – Press any function key directly. For multimedia key, press <Fn> + the required multimedia key.

NOTE: Multimedia Key First option is active only in the operating system. During POST, press <F2> or <F12> directly.

2. Second Solution:-

Just go to Control Panel -> Hardware and Sound -> Adjust commonly used mobility settings -> Fn Key Behavior

Change it to "Function key"

Source: http://en.community.dell.com/forums/t/19281847.aspx

Advertisements

Written by Manish

March 5, 2010 at 6:49 pm

Posted in Time Saver

Tagged with , ,

Google’s Big ones in 2010 : Nexus One looks nice

leave a comment »

 

Google Voice

Google Wave

Google Chrome OS

Google Nexus One.

Written by Manish

February 1, 2010 at 11:31 am

Posted in Personal, Time Saver

Tagged with

"No such interface supported" + Log could not be created in SMTP Server

leave a comment »

While configuring SMTP server, I got the errors while clicking on Current Sessions. That error is “No Such Interface supported.”

Looking at that in detail and some blogs, I found that there are 2 problems:

1) Log is not created in SMTP log folder
2) We could not view current session as we got the error message “No Such Interface supported.”

Both problem is resolved by taking following steps:

1) Go to Server Manager and Install ODBC Logging module (You can search on net how to install Role Services Feature)

2) Stop and Start SMTP Server service. Enable logging in SMTP server.

3) connect SMTP server by telnet

4) Now, see if log is created in the respected log folder. If not, you can try the command to flush the log buffer

netsh http flush logbuffer

5) See if now log is created. It must be there. Else god will help you :).

Now for another part, you need to register the following dll.

C:\Windows\System32\inetsrv>regsvr32 smtpsnap.dll
C:\Windows\System32\inetsrv>regsvr32 smtpadm.dll

Stop and Start SMTP Service.

And, Voila the message is gone. If not, then Nobody can help you. Format the PC and install new OS. Just kidding guys. Enjoy!!! :P.

Written by Manish

January 8, 2010 at 6:20 pm

Uninstall Made Easy

leave a comment »

There are sometimes we madly install lot of software and then while uninstalling the software, we forgot which one is for which use. We need to run the software and see whether it is really useful or we just installed that for trial base.

So, the utility Software Informer is very handy tool on this part. It shows the list of the software which are old and need updates. Also, it has facility to see the description of the software and review of it by going on their website. Actually this tool is to find out the outdated software on your pc but it can be used to get the information on installed softies.

I find it cool to uninstall some of the garbage from my pc.

image

Written by Manish

January 4, 2010 at 11:29 am

Google Lab’s Javascript Closure

leave a comment »

Look at the Javascript library and Optimizer. If you are not willing to use the library,just look at the how Optimizer compresses and optimize your javascript.

http://code.google.com/closure/

Written by Manish

November 14, 2009 at 11:26 am

SubSonic Tutorial ( Learn basics )

with 10 comments

Following code uses version 2.2 and Northwind database as an example to illustrate the basics. You can use Linq queries also which is introduced from 2.1 pakala release. The same tutorial is in the following two files in case it is hard to read the following tutorial.

Insert the Record

 

//Fill the object to save. Please make sure that you fill all must (not null) object

Supplier sup = new Supplier();

sup.Address = "Test Address";

sup.City = "Ahmedabad";

sup.CompanyName = "IntelliPro";

sup.ContactName = "Test Contact";

sup.ContactTitle = "Manager";

sup.Country = "India";

sup.Fax = "01234567";

sup.HomePage = "http://www.xyz.com&quot;;

sup.Phone = "01293202";

sup.PostalCode = "380051";

sup.Region = "Test Region";

 

// call save

sup.Save();

 

Update the Record

 

//Fetch the object which is required to save. 30 is id of record

Supplier sup = new Supplier(30);

 

// Fill the property which needs to be saved.

sup.PostalCode = "380052";

sup.Region = "TestRegion2";

 

// call save

sup.Save();

 

Delete the Record

 

//If there are IsDelete flag then this function make true in this column. Else it delete the record from the database.

Supplier.Delete(30);

 

//In case you have IsDelete flag and you want to delete the function, use following code.

Supplier.Destroy(30);

 


 

Select all Record

 

// You can select all the record 2 ways.

// First using supplier object

SupplierCollection colSup = new SupplierCollection();

colSup.LoadAndCloseReader(Supplier.FetchAll());

 

// now colSup has all the record

 

// Second is just us collection’s Load method

SupplierCollection colSup = new SupplierCollection();

colSup.Load();

 

Select record by primary key

 

// 30 is primary key and in new object just pass it to the constructor

Supplier sup = new Supplier(30);

 

// if object successfully fetched from the database then following property will be true. So you can check to verify the record sometime whether record is loaded or not.

sup.IsLoaded

Select record by parameter other than primary key (but only one parameter)

 

 

SupplierCollection colSup = new SupplierCollection();

// It defaults to equal operation in FetchByParameter function

colSup.LoadAndCloseReader(Supplier.FetchByParameter (Supplier.Columns.Country,"India") );

 

// IF you want to use another comparision operator, you can use

colSup.LoadAndCloseReader(Supplier.FetchByParameter (Supplier.Columns.Country, SubSonic.Comparison.NotEquals,"India") );

 

 

// You can also apply order by at the end. To generate order by, you must use its static function Asc or Desc

// e.g. OrderBy.Asc or OrderBy.Desc and supply column name into the same.

colSup.LoadAndCloseReader(Supplier.FetchByParameter (Supplier.Columns.Country, SubSonic.Comparison.NotEquals,"India", OrderBy.Asc(Supplier.Columns.City) ) );

Following are the list of comparisions which we can use into comparing the parameter.

public enum Comparison

    {

        Equals = 0,

        NotEquals = 1,

        Like = 2,

        NotLike = 3,

        GreaterThan = 4,

        GreaterOrEquals = 5,

        LessThan = 6,

        LessOrEquals = 7,

        Blank = 8,

        Is = 9,

        IsNot = 10,

        In = 11,

        NotIn = 12,

        OpenParentheses = 13,

        CloseParentheses = 14,

        BetweenAnd = 15,

    }

Select record by parameter other than primary key (but more than one parameter)

 

// There are two methods for doing this. You can use any.

 

// First one is following

SupplierCollection colSup = new SupplierCollection();

 

colSup.Where(Supplier.Columns.City,"Ahmedabad");

colSup.Where(Supplier.Columns.CompanyName, Comparison.Like ,"Intelli");

 

// you can also use order by before calling Load function to order the result.

colSup.OrderByAsc(Supplier.Columns.PostalCode);

 

// Following statement load the records with above condition. Here one thing to note that

// It only uses where and that also with AND default. you cannot do OR here. For that

// you need to use second option

colSup.Load();

 

// Here is second method for doing the similar kind of thing

 

// Here you need to pass tablename or schema in the query.

// If Tables structure is available then you can pass Tables.Supplier else you can pass

// TableName.schema object

Query qry = new Query(Supplier.Schema);

 

// Query has many function and you can use multiple function for your query

qry.AddWhere(Supplier.Columns.City,"Ahmedabad");

qry.OR(Supplier.Columns.CompanyName, Comparison.Like ,"Intelli");

 

qry.OrderBy = OrderBy.Asc(Supplier.Columns.City);

 

SupplierCollection colSup = new SupplierCollection();

// It defaults to equal operation in FetchByParameter function

colSup.LoadAndCloseReader(qry.ExecuteReader());

 

 


 

Other Methods of the Query Objects

 

// Set order by. Its property. You can use order_by function as well.

qry.OrderBy

 

// Make In and Non In query

qry.IN

qry.NOT_IN

 

// And and OR condition

qry.AND

qry.OR

 

// Where condition

qry.AddWhere

 

// Find record between values

qry.AddBetweenValues

 

// Find record between dates

qry.AddBetweenAnd

 

You have other methods of query to execute other than execute reader.

You can use, Execute for update query, ExecuteDataSet for getting dataset and ExecuteScaler for scalar values.

Select from more than one table 

There is no method available in 2.0.3 for the join. So we will use only View right now. But there are other method in latest version of subsonic for directly making  Joins.

Suppose you wanted Invoices from the 5 tables joined, you can create the view Invoice and then you can use that object same way like tables and also you can query view to filter the data like tables.

Calling Stored Procedures

When you generate classes, the class is generated automatically for each stored procedure and views. For stored procedure SPs class is generated and all stored procedures are as static function so you can directly call without creating object as I have done below. You can find stored procedure in Northwind database.

StoredProcedure spSales =  SPs.SalesByCategory("Test","2009");

DataSet ds =  spSales.GetDataSet();

 

// Generally we use object’s collection to take the result in. So we can create one view like

// SalesByCategoryResult and take this result into it by calling funcitons like that

 

SalesByCategoryResultCollection colSup = new SalesByCategoryResultCollection();

colSup.LoadAndCloseReader(spSales.GetReader());

 

Customized Query (Which do not fit in any of above point)

 

There are two ways. Either you can make stored procedure and generate the SP function and use it or you can make the query as below.

// Make sql statement. But make sure that you do not hardcode any values. Below query can be made with subsonic

// but it is used just only for example.

string query = "SELECT * FROM " + Supplier.Schema.TableName + " WHERE " + Supplier.Columns.Address + " LIKE %abc%";

 

// Now create querycommand object with above query

QueryCommand qc = new QueryCommand(query);

 

// DataService class is used to run query command object. QueryCommand object is generally used for

// making parameterized queries which might not be fitted using query object. And you can take those

// Values in Collection

SupplierCollection colSup = new SupplierCollection();

colSup.LoadAndCloseReader(DataService.GetReader(qc));

Aggregate Functions

If you want to use aggregate function on some table, you can use it following way.

Query qry = new Query(Supplier.Schema);

 

// following returns Maximum supplierid in the table

int SupplierId = qry.GetMax(Supplier.Columns.SupplierID);

 

//There are other functions available for aggregate in query

qry.GetAverage

qry.GetCount

qry.GetMin

qry.GetSum

Written by Manish

November 7, 2009 at 10:46 pm

Posted in .NET, Time Saver

Tagged with , , ,

Send SMS through Bluetooth or Serial Port

with 6 comments

Just came across one requirement of sending SMS through Bluetooth or serial port. Actually when you connect any bluetooth USB to the pc, that program should have installed the model related to Bluetooth. I got that as follow:

image

Now, Download the microsoft SMS Sender application from following URL:

http://www.microsoft.com/downloads/details.aspx?displaylang=en&FamilyID=06A4F997-7F69-4891-8929-37B9041924A2

Run and Install it. When you run it, it will show the following screen:

image

Whatever model devices are there, it will be available for the selection. Once it is selected, write destination number and body and send the SMS. If you device ( Phone) is connected to the bluetooth, SMS will be delivered from your phone. Currently I believe only Nokia and Sony is supported by this application. I haven’t tested on other Phone.

The main thing is that, this application also support COMMAND LINE INTERFACE. So that you can use this application in your code to send the SMS through some port or bluetooth. wow!!!. Following are the command line option to send the SMS.

image

Written by Manish

June 29, 2009 at 4:56 pm

Posted in .NET, Time Saver, Tools

Tagged with , , ,