Pages

Tuesday, September 28, 2010

Background music on your blog

On dashboard, choose to "Design", and go to "Edit HTML"
Go to end of html, and put the code given below just before

<embed Loop='true' autostart='true' hidden='true' src='http://music.djmaza.com/music/320/indian_movies/Anjaana%20Anjaani%20%282010%29/07%20-%20Anjaana%20Anjaani%20-%20Anjaana%20Anjaani%20%5Bwww.DJMaza.Com%5D.mp3'/>

Change the url with your favorite music or song.

Monday, September 27, 2010

Music in your post - Blogger


Anjana Anjani
aas pas khuda - Anjana Anjani

Here is how to add music player to your blog post.

You just have to add this script in HTML section of your post, or blogger template:
<script type="text/javascript" src="http://mediaplayer.yahoo.com/js"></script>

And put your songs as links in your post.
That's it..

See the link http://mediaplayer.yahoo.com

Thursday, September 23, 2010

Analog Clock in VB.Net


Here is the code to draw analog clock.

Declaration:

Private _padding As Integer = 10
  Private _center As Integer = 110
  Private _hourhand As Integer = 50
  Private _minutehand As Integer = 75
  Private _secondhand As Integer = 60
  Private _dimension As Integer = 200
  Public Property Dimension() As Integer
    Get
      Return _dimension
    End Get
    Set(ByVal value As Integer)
      If value Mod 2 = 1 Then value += 1
      _dimension = value
      _center = _dimension / 2
      _hourhand = (_dimension / 2) * 0.5
      _minutehand = (_dimension / 2) * 0.75
      _secondhand = (_dimension / 2) * 0.6
      _center = (_dimension / 2) + _padding
    End Set
  End Property


Drawing Function:

Sub DrawClock(ByVal g As Graphics, ByVal time As DateTime)
    g.Clear(BackColor)
    g.DrawRectangle(Pens.Black, New Rectangle(_padding, _padding, _dimension, _dimension))
    g.DrawEllipse(Pens.Black, New RectangleF(_center - 1, _center - 1, 2, 2))

    g.DrawString(time.ToString("dd ") & time.DayOfWeek.ToString.ToUpper.Substring(0, 3), Font, Brushes.Black, _dimension - _center / 2, _center)

    Dim hourAngle As Double = ((time.Hour + (time.Minute / 60)) Mod 12) * 2 * Math.PI / 12
    Dim minuteAngle As Double = time.Minute * 2 * Math.PI / 60
    Dim secondAngle As Double = time.Second * 2 * Math.PI / 60

    g.DrawLine(Pens.Red, _center, _center, _center + CInt(Math.Sin(hourAngle) * _hourhand), _center - CInt(Math.Cos(hourAngle) * _hourhand))
    g.DrawLine(Pens.Blue, _center, _center, _center + CInt(Math.Sin(minuteAngle) * _minutehand), _center - CInt(Math.Cos(minuteAngle) * _minutehand))
    g.DrawLine(Pens.Green, _center, _center, _center + CInt(Math.Sin(secondAngle) * _secondhand), _center - CInt(Math.Cos(secondAngle) * _secondhand))
  End Sub



To draw clock on form, just call the function like,
    DrawClock(CreateGraphics, Now)

Monday, September 13, 2010

Link Checker


Supported File Hosts:
  • RapidShare.com
  • MegaUpload.com
  • MegaShares.com
  • DepositFiles.com
  • Easy-Share.com
  • Netload.in
  • FileFactory.com
  • FileSonic.com
  • uGotFile.com
  • FreakShare.net
  • Letitbit.net
  • UL.to (Uploaded.to)
  • EnterUpload.com
  • ExtaBit.com
  • GigaSize.com
  • Uploading.com
  • HotFile.com
  • Storage.to
  • MediaFire.com
  • FileServe.com
  • FilesMonster.com




Rating UserControl in VB.Net

Create a UserControl with five pictureboxes named - PictureBox1,PictureBox2...PictureBox5.
Add following two images as resources. [or whichever you like]
  • Star = highlighted star
  • Star_Favorites = blank star





Here is the code for the UserControl


Public Class Rating
  Public Event Rated(ByVal favRating As Integer)

  Private _FavRating As Integer = 0
  Public ReadOnly Property FavouriteRating() As Integer
    Get
      Return _FavRating
    End Get
  End Property

  Private Sub Star_MouseClick(ByVal sender As Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles PictureBox1.MouseClick, PictureBox2.MouseClick, PictureBox3.MouseClick, PictureBox4.MouseClick, PictureBox5.MouseClick
    Dim favrating As Integer = Val(DirectCast(sender, PictureBox).Name.Replace("PictureBox", ""))
    _FavRating = favrating
    ShowRating(favrating)
    If e.Button = Windows.Forms.MouseButtons.Left Then
      RaiseEvent Rated(favrating)
    End If
  End Sub

  Private Sub Star_MouseHover(ByVal sender As Object, ByVal e As System.EventArgs) Handles PictureBox1.MouseHover, PictureBox2.MouseHover, PictureBox3.MouseHover, PictureBox4.MouseHover, PictureBox5.MouseHover
    Dim favrating As Integer = Val(DirectCast(sender, PictureBox).Name.Replace("PictureBox", ""))
    ShowRating(favrating)
  End Sub

  Private Sub Star_MouseLeave(ByVal sender As Object, ByVal e As System.EventArgs) Handles PictureBox1.MouseLeave, PictureBox2.MouseLeave, PictureBox3.MouseLeave, PictureBox4.MouseLeave, PictureBox5.MouseLeave
    If Not ClientRectangle.Contains(PointToClient(Cursor.Position)) Then
      ShowRating(FavouriteRating)
    End If
  End Sub

  Private Sub ShowRating(ByVal favrating As Integer)
    For i As Integer = 1 To 5
      If i <= favrating Then
        DirectCast(Controls.Find("PictureBox" & i.ToString, True)(0), PictureBox).Image = My.Resources.star
      Else
        DirectCast(Controls.Find("PictureBox" & i.ToString, True)(0), PictureBox).Image = My.Resources.Star_Favorites
      End If
    Next
  End Sub

End Class

Recent Tweets

Just use the following code to blog your recent tweets..
Replace the highlighted values with your required values.


<div style="margin-right: 0px;color=black">
<div id="twitter_div">
<ul id="twitter_update_list"></ul>
<a href="http://twitter.com/prerakpatel143" id="twitter-link" style="display: block; text-align: right;"></a></div>
<script src="http://twitter.com/javascripts/blogger.js" type="text/javascript">
</script>
<script src="http://twitter.com/statuses/user_timeline/prerakpatel143.json?callback=twitterCallback2&amp;count=5" type="text/javascript">
</script></div>


It will display your tweets as shown below


Prerak Patel

    Sunday, September 12, 2010

    Tumblr Themes

    Go to http://www.tumblr.com/customize
    You'll get option to customize themes.
    You can select any of the available themes, or you can set your custom HTML.
    Following images shows how to set your image as background instead of plain white background.

    To change background of page, you should place image url in content in this tag: 
    <meta name="image:Background" content="" />