Code Simplified – Viral Sarvaiya

Code Simplified – Viral Sarvaiya, Web Developer Friends, dot net Developer, Sql Server Developer

Archive for the ‘General’ Category

How to recover lost/missing system tray icon?

Posted by Viral Sarvaiya on June 10, 2011

Please follow the steps for recover Lost/missing system tray icon.

1. Back up the Registry by creating a restore point.
2. Go to Start > Run (or Windows-key + R), type in regedit and hit OK.
3. Navigate to the key HKEY_CURRENT_USER\Software\Cla sses\Local Settings\Software\Microsoft\Wi ndows\CurrentVersion \TrayNotify.
4. Delete the values IconStreams and PastIconsStream.
5. Open up the Task Manager (Ctrl + Shift + Esc), go to the Processes tab, select explorer.exe and click End Process.
6. Open the Applications tab and click New Task at the bottom-right of the window.
7. In the message box that pops up type in explorer.exe and hit OK.
8. Explorer.exe will reload, and the missing icons should now be back in the system-tray where they belong.
9. Then if the volume bar isnt there, go to taskbar properties (where the volume was gray) and simply tick the box.

Posted in General | Tagged: , , , | Leave a Comment »

My First Presantation in Industrial Experience.

Posted by Viral Sarvaiya on January 12, 2011

Hi,

Yesterday dated 11th January 2011, I have a presentation in my company. My presentation topic is “.Net 3.5 Mysteries”. In this presentation I have include

1.       Automatic  property

2.       Object and Collection Initializes

3.       Extension Methods

4.       Lambda Expressions

5.       Implicit Typing

6.       Anonymous Types

7.       Partial Methods

8.       LINQ  (Linq to sql, Linq to XML, Linq to object)

This is my first presentation after the industrial experience start.  It was very good, I get very feedback and whole presentation was full of interaction with people.

Thanks to Mr. Jay Joshi to present this presentation in last .Net Tech Talk and Mr. Ruchit Surti for handling great event of .Net Tach Talk and Mr. Bakir Padaniya to help to get some example for my presentation.

Hope this will continue and we share more knowledge to society.

click  for Download Presantation only and for code check the box.net flash widget from right panel file named “.Net 3.5 Mysteries.zip” of this blog.

Posted in General | Tagged: | Leave a Comment »

Google Music India Launched

Posted by Viral Sarvaiya on October 25, 2010

Google India has pulled the covers off the Google Music service in India, offering users access to live streaming of Hindi film songs online. This is not new, but the reach that Google has makes it the service to watch. The implementation of Google Music India is similar to that of Guruji.com, which has been sued by music label T-Series, but in Google’s case, they’ve partnered with companies that have licensed content legally: Music label Saregama, Web18 owned In.com and the Hungama-212 media JV – Saavn. Like Guruji, Google music search suggests albums, allows users to search artists, films and albums, and offers to even sort music by date. Google music search doesn’t have top 10 lists yet.

As you can see from the screenshot below, the music is played in a pop-up window, and a display ad is run as a footer there. There is probably a revenue share arrangement between the music licensee and Google. Remember that in case of songs that were being played at Songs.pk via Guruji, there were similar ads. Only, this music is legal, and like Guruji was doing, it is being hosted and played from the someone elses site.

Enjoy Music…

http://www.google.co.in/music

Posted in General | Tagged: , , , | 3 Comments »

Microsoft DOS tracert command

Posted by Viral Sarvaiya on August 12, 2010

About

The tracert command is used to visually see a network packet being sent and received and the amount of hops required for that packet to get to its destination.

Availability

MS-DOS 6.2
Windows 95
Windows 98
Windows ME
Windows NT
Windows 2000
Windows XP
Windows Vista
Windows 7

Sysntex

tracert    [-d] [-h maximum_hops] [-j host-list] [-w timeout] target_name

Options

-d  : Do not resolve addresses to hostnames.
-h  : maximum_hops    Maximum number of hops to search for target.
-j  : host-list    Loose source route along host-list.
-w  : timeout    Wait timeout milliseconds for each reply.

Example

C:\>tracert viralsarvaiya.wordpress.com

Tracing route to lb.wordpress.com [76.74.254.120]
over a maximum of 30 hops:

1     1 ms    <1 ms    <1 ms  192.168.2.1
2     4 ms     1 ms     1 ms  120.72.89.81
3     3 ms     2 ms     1 ms  59.145.238.93
4    10 ms    10 ms    10 ms  61.95.151.170
5    12 ms    11 ms    15 ms  61.95.151.170
6   255 ms   255 ms   255 ms  aes-static-122.36.144.59.airtel.in [59.144.36.122]
7   289 ms   255 ms   255 ms  xe-9-1-0.edge1.losangeles6.level3.net [4.26.0.61]
8   267 ms   263 ms   271 ms  ae-82-80.ebr2.losangeles1.level3.net [4.69.144.179]
9   288 ms   289 ms   287 ms  ae-3-3.ebr3.dallas1.level3.net [4.69.132.78]
10   292 ms   293 ms   291 ms  ae-1-60.edge9.dallas1.level3.net [4.69.145.16]
11   299 ms   298 ms   297 ms  peer-1-netw.edge9.dallas1.level3.net [4.59.118.6]
12   300 ms   299 ms   299 ms  10ge-ten1-3.sat-8500v-cor-2.peer1.net [216.187.124.178]
13   299 ms   300 ms   297 ms  216.187.124.110
14   296 ms   312 ms   300 ms  wordpress.com [76.74.254.120]

Trace complete.

Thanks You.

Posted in General | Tagged: , , , , | Leave a Comment »

scrollable div

Posted by Viral Sarvaiya on March 11, 2010

to view scroll in div tag just copy and paste below code.


<div style="width:100px; height:100px; overflow:auto;"> PUT YOUR TEXT HERE  </div>

when you html height becomes bigger then 100 px then scroll will come.

enjoy coding…..

Posted in General | Tagged: , , | Leave a Comment »

Useful RUN commands

Posted by Viral Sarvaiya on February 10, 2010

Here are some of the commands that can be executed from the Run dialog box in the Start menu to launch the following applications. I have picked up them over the years and am not sure of one particular source as a reference.

  • MSConfig – Microsoft configuration utility
  • Explorer – Windows explorer
  • Cmd – Command window
  • Inetmgr – IIS Manager
  • Services.msc – Windows services Administrator
  • Pbrush – Paint brush
  • Chrome – Google chrome browser.
  • Firefox – Firefox browser
  • ISqlw – Query analyzer
  • Eventvwr.msc – Event viewer
  • Dcomcnfg – Component services
  • Notepad – Notepad
  • Calc – Calculator
  • Winword – MS Word
  • Excel – MS Excel
  • Access – MS Access
  • Regedit – Registry editor
  • Taskmgr – task manager
  • Write – Wordpad
  • Osk – On screen keyboard
  • Logoff – logs of the user
  • Shutdown /s – shutdowns the system
  • Perfmon – Performance monitor
  • Mstsc – Remote desktop
  • Firewall.cpl – Windows firewall
  • odbcad32 – ODBC administrator

Posted in General | Tagged: , , | Leave a Comment »

Windows Keyboard Shortcuts

Posted by Viral Sarvaiya on February 10, 2010

Following are some keyboard shortcuts that use very often.

  • Ctrl + Enter – Auto complete a URL, prepends and appends a website name with “http://” and “.com”.
  • Shift + Enter – Auto completes a URL, prepends and appends a website name with “http://” and “.net”.
  • Ctrl + shift + Enter – Auto completes a URL, prepends and appends a website name with “http://” and “.org”.
  • Ctrl + Esc – Opens the Start menu.
  • Ctrl + Tab – Switch between open tabs in a MDI.
  • Ctrl + Shift + Tab – Switch between open tabs in a MDI in reverse order.
  • Ctrl + Shift + Esc – Opens windows task manager.
  • Ctrl + A – Make a selection.
  • Ctrl + T – Open a new tab in IE, Firefox, Chrome.
  • Ctrl + W – Close a tab in IE, Firefox, Chrome.
  • Ctrl + X – Cut
  • Ctrl + C – Copy
  • Ctrl + V – Paste
  • Ctrl + Z – undo
  • Ctrl + R – Redp
  • Ctrl + B – Bold
  • Ctrl + S – Save the file
  • Ctrl + U – Underline a selection
  • Ctrl + F – Find
  • Ctrl + H – Search and Replace
  • Ctrl + G – Go to line #
  • Ctrl + O – Opens file dialog box
  • Ctrl + P – Opens print manager
  • Ctrl + D – Bookmark a web page in a browser
  • Alt + Tab – Switch between open programs
  • Alt + Shift + Tab – Switch between open programs in reverse order.
  • Alt + Enter – Display properties (file, folder, etc).
  • Alt + F4 – Close a window.
  • Alt + Space – Display system menu of active window.
  • Alt + Home – Launch home page in a browser application.
  • F1 – open help file of the current application.
  • F2 – rename a file.
  • F5 – Refreshes the current window
  • Shift + F10 – Display context menu
  • Windows logo + E – open explorer
  • Windows logo + M – Minimize all windows
  • Ctrl + Alt + End – Security dialog in remote desktop
  • Ctrl + Alt + Break – Toggle full screen in remote desktop
  • Alt + Home – Display start menu

Posted in General | Tagged: , , , | 1 Comment »

List of HTTP headers

Posted by Viral Sarvaiya on November 13, 2009

HTTP Headers form the core of an HTTP request, and are very important in an HTTP response. They define various characteristics of the data that is requested or the data that has been provided. The headers are separated from the request or response body by a blank line. HTTP headers can be near-arbitrary strings, but only some are commonly understood.

Requests

Header Description Example
Accept Content-Types that are acceptable Accept: text/plain
Accept-Charset Character sets that are acceptable Accept-Charset: iso-8859-5
Accept-Encoding Acceptable encodings Accept-Encoding: compress, gzip
Accept-Language Acceptable languages for response Accept-Language: da
Accept-Ranges Allows the server to indicate its acceptance of range requests for a resource Accept-Ranges: bytes
Authorization Authentication credentials for HTTP authentication Authorization: Basic QWxhZGRpbjpvcGVuIHNlc2FtZQ==
Cache-Control Used to specify directives that MUST be obeyed by all caching mechanisms along the request/response chain Cache-Control: no-cache
Connection What type of connection the user-agent would prefer Connection: close
Cookie an HTTP cookie previously sent by the server with Set-Cookie (below) Cookie: $Version=1; UserId=JohnDoe
Content-Length The length of the request body in octets (8-bit bytes) Content-Length: 348
Content-Type The mime type of the body of the request (used with POST and PUT requests) Content-Type: application/x-www-form-urlencoded
Date The date and time that the message was sent Date: Tue, 15 Nov 1994 08:12:31 GMT
Expect Indicates that particular server behaviors are required by the client Expect: 100-continue
From The email address of the user making the request From: user@email.com
Host The domain name of the server (for virtual hosting), mandatory since HTTP/1.1 Host: en.wikipedia.org
If-Match Only perform the action if the client supplied entity matches the same entity on the server. This is mainly for methods like PUT to only update a resource if it has not been modified since the user last updated it. If-Match: "737060cd8c284d8af7ad3082f209582d"
If-Modified-Since Allows a 304 Not Modified to be returned if content is unchanged If-Modified-Since: Sat, 29 Oct 1994 19:43:31 GMT
If-None-Match Allows a 304 Not Modified to be returned if content is unchanged, see HTTP ETag If-None-Match: "737060cd8c284d8af7ad3082f209582d"
If-Range If the entity is unchanged, send me the part(s) that I am missing; otherwise, send me the entire new entity If-Range: "737060cd8c284d8af7ad3082f209582d"
If-Unmodified-Since Only send the response if the entity has not been modified since a specific time. If-Unmodified-Since: Sat, 29 Oct 1994 19:43:31 GMT
Max-Forwards Limit the number of times the message can be forwarded through proxies or gateways. Max-Forwards: 10
Pragma Implementation-specific headers that may have various effects anywhere along the request-response chain. Pragma: no-cache
Proxy-Authorization Authorization credentials for connecting to a proxy. Proxy-Authorization: Basic QWxhZGRpbjpvcGVuIHNlc2FtZQ==
Range Request only part of an entity. Range: bytes=500-999
Referer This is the address of the previous web page from which a link to the currently requested page was followed. Referer: http://en.wikipedia.org/wiki/Main_Page
TE The transfer encodings the user agent is willing to accept: the same values as for the response header Transfer-Encoding can be used, plus the “trailers” value (related to the “chunked” transfer method) to notify the server it accepts to receive additional headers (the trailers) after the last, zero-sized, chunk. TE: trailers, deflate;q=0.5
Upgrade Ask the server to upgrade to another protocol. Upgrade: HTTP/2.0, SHTTP/1.3, IRC/6.9, RTA/x11
User-Agent The user agent string of the user agent User-Agent: Mozilla/5.0 (Linux; X11)
Via Informs the server of proxies through which the request was sent. Via: 1.0 fred, 1.1 nowhere.com (Apache/1.1)
Warn A general warning about possible problems with the entity body. Warn: 199 Miscellaneous warning

Responses

Header Description Example
Accept-Ranges What partial content range types this server supports Accept-Ranges: bytes
Age The age the object has been in a proxy cache in seconds Age: 12
Allow Valid actions for a specified resource. To be used for a 405 Method not allowed Allow: GET, HEAD
Cache-Control Tells all caching mechanisms from server to client whether they may cache this object Cache-Control: no-cache
Content-Encoding The type of encoding used on the data Content-Encoding: gzip
Content-Language The language the content is in Content-Language: da
Content-Length The length of the response body in octets (8-bit bytes) Content-Length: 348
Content-Location An alternate location for the returned data Content-Location: /index.htm
Content-Disposition An opportunity to raise a “File Download” dialogue box for a known MIME type Content-Disposition: attachment; filename=fname.ext
Content-MD5 A Base64-encoded binary MD5 sum of the content of the response Content-MD5: Q2hlY2sgSW50ZWdyaXR5IQ==
Content-Range Where in a full body message this partial message belongs Content-Range: bytes 21010-47021/47022
Content-Type The mime type of this content Content-Type: text/html; charset=utf-8
Date The date and time that the message was sent Date: Tue, 15 Nov 1994 08:12:31 GMT
ETag An identifier for a specific version of a resource, often a Message Digest, see ETag ETag: "737060cd8c284d8af7ad3082f209582d"
Expires Gives the date/time after which the response is considered stale Expires: Thu, 01 Dec 1994 16:00:00 GMT
Last-Modified The last modified date for the requested object, in RFC 2822 format Last-Modified: Tue, 15 Nov 1994 12:45:26 GMT
Location Used in redirection, or when a new resource has been created. Location: http://www.w3.org/pub/WWW/People.html
Pragma Implementation-specific headers that may have various effects anywhere along the request-response chain. Pragma: no-cache
Proxy-Authenticate Request authentication to access the proxy. Proxy-Authenticate: Basic
Refresh Used in redirection, or when a new resource has been created. This refresh redirects after 5 seconds.
(This is a proprietary/non-standard header extension introduced by Netscape and supported by most web browsers.)
Refresh: 5; url=http://www.w3.org/pub/WWW/People.html
Retry-After If an entity is temporarily unavailable, this instructs the client to try again after a specified period of time. Retry-After: 120
Server A name for the server Server: Apache/1.3.27 (Unix) (Red-Hat/Linux)
Set-Cookie an HTTP cookie Set-Cookie: UserID=JohnDoe; Max-Age=3600; Version=1
Trailer The Trailer general field value indicates that the given set of header fields is present in the trailer of a message encoded with chunked transfer-coding. Trailer: Max-Forwards
Transfer-Encoding The form of encoding used to safely transfer the entity to the user. Currently defined methods are: chunked, compress, deflate, gzip, identity. Transfer-Encoding: chunked
Vary Tells downstream proxies how to match future request headers to decide whether the cached response can be used rather than requesting a fresh one from the origin server. Vary: *
Via Informs the client of proxies through which the response was sent. Via: 1.0 fred, 1.1 nowhere.com (Apache/1.1)
Warning A general warning about possible problems with the entity body. Warning: 199 Miscellaneous warning
WWW-Authenticate Indicates the authentication scheme that should be used to access the requested entity. WWW-Authenticate: Basic

Posted in ASP.NET, General | Tagged: , , , | 3 Comments »

What is Rss?

Posted by Viral Sarvaiya on August 12, 2009

What is RSS?

RSS stands for “Really Simple Syndication”. It is a way to easily distribute a list of headlines, update notices, and sometimes content to a wide number of people. It is used by computer programs that organize those headlines and notices for easy reading.

What problem does RSS solve?

Most people are interested in many websites whose content changes on an unpredictable schedule. Examples of such websites are news sites, community and religious organization information pages, product information pages, medical websites, and weblogs. Repeatedly checking each website to see if there is any new content can be very tedious.

Email notification of changes was an early solution to this problem. Unfortunately, when you receive email notifications from multiple websites they are usually disorganized and can get overwhelming, and are often mistaken for spam.

RSS is a better way to be notified of new and changed content. Notifications of changes to multiple websites are handled easily, and the results are presented to you well organized and distinct from email.

How does RSS work?

RSS works by having the website author maintain a list of notifications on their website in a standard way. This list of notifications is called an “RSS Feed“. People who are interested in finding out the latest headlines or changes can check this list. Special computer programs called “RSS aggregators” have been developed that automatically access the RSS feeds of websites you care about on your behalf and organize the results for you. (RSS feeds and aggregators are also sometimes called “RSS Channels” and “RSS Readers“.)

Producing an RSS feed is very simple and hundreds of thousands of websites now provide this feature, including major news organizations like the New York Times, the BBC, and Reuters, as well as many weblogs.

What information does RSS provide?

RSS provides very basic information to do its notification. It is made up of a list of items presented in order from newest to oldest. Each item usually consists of a simple title describing the item along with a more complete description and a link to a web page with the actual information being described. Sometimes this description is the full information you want to read (such as the content of a weblog post) and sometimes it is just a summary.

For example, the RSS information for headlines on a local news website could contain the following information:

Item 1:
Title: Sidewalk contract awarded
Description: The city awarded the sidewalk contract to Smith Associates. This hotly contested deal is worth $1.2 million.
Link: http://www.gardencitynews.com/contractawards/sidewalk.htm
Item 2:
Title: Governor to visit
Description: The governor is scheduled to visit the city on July 1st. This is the first visit since the election two years ago. The mayor is planning a big reception.
Link: http://www.gardencitynews.com/news/2004/06/gov-visit.htm

The RSS information is placed into a single file on a website in a manner similar to normal web pages. However, the information is coded in the XML computer language for use by a program (the RSS aggregator) and not by a person like a normal web page.

RSS aggregator programs

Think of an RSS aggregator as just a web browser for RSS content. RSS aggregators automatically check a series of RSS feeds for new items on an ongoing basis, making it is possible to keep track of changes to multiple websites without needing to tediously read and re-read each of the websites yourself. They detect the additions and present them all together to you in a compact and useful manner. If the title and description of an item are of interest, the link can be used to quickly bring the related web page up for reading.

Here is a screen shot of an RSS aggregator in action. On the left is a list of the RSS feeds being monitored, along with an indication of the number of unread items in each feed in parenthesis. On the right are the details of the most recent items in a selected RSS feed (in this case, the New York Times).

Boston Globe (10), CNET News.com, etc.

There are many RSS aggregators available. Some are accessed through a browser, some are integrated into email programs, and some run as a standalone application on your personal computer.

How do I find out if a website has an RSS feed?

It is getting more and more common for websites to have RSS feeds. They usually indicate the existence of the feed on the home page or main news page with a link to “RSS”, or sometimes by displaying an orange button with the letters “XML” or “RSS”. RSS feeds are also often found via a “Syndicate This” link. Text “RSS” links sometimes (there are lots of variations) point to a web page explaining the nature of the RSS feeds provided and how to find them. The buttons are often linked directly to the RSS feed file itself.

Once you know the URL of an RSS feed, you can provide that address to an RSS aggregator program and have the aggregator monitor the feed for you. Many RSS aggregators come preconfigured with a list to choose from of RSS feed URLs for popular news websites.

How is the RSS feed file produced?

Unless you are maintaining a website or want to create your own RSS feed for some other purpose, how the RSS feed is produced should not be of concern and you may skip this section.

The special XML-format file that makes up an RSS feed is usually created in one of a variety of ways.

Most large news websites and most weblogs are maintained using special “content management” programs. Authors add their stories and postings to the website by interacting with those programs and then use the program’s “publish” facility to create the HTML files that make up the website. Those programs often also can update the RSS feed XML file at the same time, adding an item referring to the new story or post, and removing less recent items. Blog creation tools like Blogger, LiveJournal, Movable Type, and Radio automatically create feeds.

Websites that are produced in a more custom manner, such as with Macromedia Dreamweaver or a simple text editor, usually do not automatically create RSS feeds. Authors of such websites either maintain the XML files by hand, just as they do the website itself, or use a tool such as Software Garden, Inc.’s ListGarden program to maintain it. There are also services that periodically read requested websites themselves and try to automatically determine changes (this is most reliable for websites with a somewhat regular news-like format), or that let you create RSS feed XML files that are hosted by that service provider.

Tying it all together

Here is a diagram showing how the websites, the RSS feed XML files, and your personal computer are connected:

Two web servers each with an RSS file being checked by an aggregator

The diagram shows a web browser being used to read first Web Site 1 over the Internet and then Web Site 2. It also shows the RSS feed XML files for both websites being monitored simultaneously by an RSS Feed Aggregator.

Other uses

In addition to notifying you about news headlines and changes to websites, RSS can be used for many other purposes. There does not even have to be a web page associated with the items listed — sometimes all the information you need may be in the titles and descriptions themselves.

Some commonly mentioned uses are:

  • Notification of the arrival of new products in a store
  • Listing and notifying you of newsletter issues, including email newsletters
  • Weather and other alerts of changing conditions
  • Notification of additions of new items to a database, or new members to a group

One RSS aggregator is all that you need to read all of the RSS feeds, be they headlines, alerts, changes, or other notifications. RSS is shaping up to be a very popular and useful means for communicating.

RSS Toolkit

The RSS toolkit includes support for consuming as well as publishing RSS feeds in ASP.NET applications. Features include:

  • RSS Data Source control to consume feeds in ASP.NET applications
    • Works with ASP.NET data bound controls
    • Implements schema to generate columns at design time
    • Supports auto-generation of columns at runtime (via ICustomTypeDescriptor implementation)
  • Caching of downloaded feeds both in-memory and on-disk (persisted across process restarts)
  • Generation of strongly typed classes for RSS feeds (including strongly typed channel, items, image, handler) based on a RSS URL (the toolkit recognizes RSS and RDF feeds) or a file containing RSS definition. Allows programmatically download (and create) RSS channels using strongly-typed classes. The toolkit includes:
    • Stand-alone command line RSS compiler
    • Build provider for .rssdl file (containing the list of feed URLs)
    • Build provider for .rss file (containing RSS XML)
  • Support for generation of RSS feeds in ASP.NET application including:
    • RSS HTTP handler (strongly typed HTTP handlers are generated automatically by the build providers) to generate the feed.
    • RSS Hyper Link control (that can point to RSS HTTP handler) to create RSS links
    • Optional secure encoding of user name into query string to allow generation of personalized feeds
  • Set of classes for programmatic consumption and generation of RSS feed in a late-bound way, without using strongly typed generated classes

The toolkit is packaged as an assembly (DLL) that can be either placed in GAC or in ‘bin’ directory of a web application. It is also usable from client (including WinForms) applications.

RSS Toolkit works in Medium Trust (RssToolkit.dll Assembly either in GAC or in ‘bin’) with the following caveats:

  • If the ASP.NET application consumes RSS feeds, the trust level must be configured to allow outbound HTTP requests.
  • To take advantage of disk caching, there must be a directory (configurable via AppSettings["rssTempDir"]) where the trust level policy would allow write access. However, disk caching is optional.

Click here to Download & more info…..

Posted in General | Tagged: , , , , | Leave a Comment »

 
Follow

Get every new post delivered to your Inbox.