31/10/2013

How to configure Hotmail account with MS Outlook?

 Here is the steps to follow to correctly adjust their email account. PS: This is only valid for a Hotmail account. 

In Outlook: 
Tools => Options => Tab "Mail" => Email Accounts ... => New ... 
Choose "Microsoft Exchange, POP3, IMAP or HTTP Enter your name (the one you want) E-mail Address Password Confirm password Check "Manually configure server settings or additional server types" 
Select "Internet Mail" 
Account Type: POP3 Incoming mail server: pop3.live.com Outgoing mail server: smtp.live.com 
Info for connection, retype your email address in "Username" and password associated in the "Password" Check "Remember password" 
Click "More Settings ..." Tab "Outgoing Server" => check "My outgoing server (SMTP) requires authentication => Use same settings as my incoming mail server Tab "Advanced" => Incoming server (POP3): 995 Check "This server requires an encrypted connection (SSL) Outgoing server (SMTP): 25 Use the following type of encrypted connection: Automatic 
Finish your creation through multi-clicks OK - Next - Finish, and voila. 

20/10/2013

How to create a log file in VB.Net?

I was also in search of such vb.net code to create a log file and after lots of google , I got a vb.net code and did some modification to match my requirement and after modification my code is working fine. This code is just a class.
Imports System.IO

Public Class Classlogger
    Private Shared Sub Info(ByVal info As Object)
        'Gets folder & file information of the log file 
        Dim filename As String = "C:\Program Files\abc\log.rtf"
        ' Dim sw As StreamWriter
        Dim portfolioPath As String = My.Application.Info.DirectoryPath

        'Dim s As StreamWriter
        'Dim portfolioPath As String = My.Application.Info.DirectoryPath

        'Check for existence of logger file           
        If File.Exists(filename) Then
            Try
                Dim fs As FileStream = New FileStream(filename, FileMode.Append, FileAccess.Write)
                Dim sw As StreamWriter = New StreamWriter(fs)
                sw.WriteLine(vbCrLf & "--- " + vbCrLf + DateTime.Now + " " + info.ToString)
                sw.Close()
                fs.Close()
            Catch dirEx As DirectoryNotFoundException
                LogInfo(dirEx)
            Catch ex As FileNotFoundException
                LogInfo(ex)
            Catch Ex As Exception
                LogInfo(Ex)
            End Try
        Else
            'If file doesn't exist create one              
            Try

                'Dir = Directory.CreateDirectory("C:\Program Files\IRBn WMS")
                Dim fileStream As FileStream = File.Create(filename)
                Dim sw As StreamWriter = New StreamWriter(fileStream)
                sw.WriteLine(vbCrLf & "--- " + vbCrLf + DateTime.Now + info.ToString)
                sw.Close()
                fileStream.Close()
            Catch fileEx As FileNotFoundException
                LogInfo(fileEx)
            Catch dirEx As DirectoryNotFoundException
                LogInfo(dirEx)
            Catch ex As Exception
                LogInfo(ex)
            End Try
        End If
    End Sub
    Public Shared Sub LogInfo(ByVal ex As Exception)
        Try
            'Writes error information to the log file including name of the file, line number & error message description              
            Dim trace As Diagnostics.StackTrace = New Diagnostics.StackTrace(ex, True)
            Dim fileNames As String = trace.GetFrame((trace.FrameCount - 1)).GetFileName()
            Dim lineNumber As Int32 = trace.GetFrame((trace.FrameCount - 1)).GetFileLineNumber()
            Info(vbCrLf + "Error In: " + fileNames + vbCrLf + "Line Number:" + lineNumber.ToString() + vbCrLf + "Error Message: " + ex.Message)
        Catch genEx As Exception
            Info(ex.Message)
        End Try
    End Sub
    Public Shared Sub LogInfo(ByVal message As String)
        Try
            'Write general message to the log file      
            Info("Message: " + message)
        Catch genEx As Exception
            Info(genEx.Message)
        End Try
    End Sub


End Class

 and I called in a event 

Private Sub BtnCancel_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles BtnCancel.Click
        Try
          
        Catch ex As Exception
          
           
            Classlogger.LogInfo(ex)
           
        End Try
    End Sub

17/10/2013

Vb.Net code to know the basic information of your computer.

A self explanatory windows form is design to to capture the all the basic details like:

  • Computer Name
  •  UserName
  • Operating System
  • Operating System version.
  • OS Platform
  • Network Connection
  • Monitor Height
  • Monitor width
  • Available physical memory
  • Total Physical Memory etc
Just design the windows form as shown below and writ down the code as show :

Public Class Computer_detail

   

    'declaration of variable
    Dim processName As String
    'declaration of DT variable as Datatable
    Dim DT As New DataTable
    Dim percent As Integer

    Private Sub Timer1_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer1.Tick
        Dim availphyMem As Integer = My.Computer.Info.AvailablePhysicalMemory / 1000000
        Dim totlPhyMem As Integer = My.Computer.Info.TotalPhysicalMemory / 1000000
        Dim totVirtMem As Integer = My.Computer.Info.TotalVirtualMemory / 1000000
        'this line is for the name of computer
        Dim compname As String = My.Computer.Name
        'current username used on the machine
        Dim compuser As String = SystemInformation.UserName
        'display the Operating installedon this machine
        Dim OS As String = My.Computer.Info.OSFullName
        'show the platform of the operating installed
        Dim OSplatform As String = My.Computer.Info.OSPlatform
        'it display the Operating system version
        Dim osversion As String = My.Computer.Info.OSVersion
        'display the height and width of the machine
        Dim HeighMon As Integer = SystemInformation.PrimaryMonitorSize.Height
        Dim WidthMon As Integer = SystemInformation.PrimaryMonitorSize.Width

        'it loops trough all the processes happening running in this machine
        For Each p As Process In Process.GetProcesses
            'it display to the datagridview provided
            'DataGridView1.Rows.Add(p.ProcessName)
        Next
        'it check if the machine is connectd to the network or not
        If My.Computer.Network.IsAvailable Then
            TxtNetworkConnection.Text = "Connected"
        Else
            TxtNetworkConnection.Text = "Not Connected"

        End If
        'it get and set the maximum value of progressbar
        ProgressBar1.Maximum = availphyMem
        ProgressBar1.Value = availphyMem
        'this is the formula to get the percentage
        percent = (ProgressBar1.Value / totlPhyMem) * 100
        'it display the percentage in the label
        blpercent.Text = percent & "%"

        'it assign and display all the data from the variable above
        'and display the corresponding value into the textboxes provided
        txtComputerName.Text = compname
        txtComputerUserName.Text = compuser
        txtos.Text = OS
        txtosplatform.Text = OSplatform
        txtosversion.Text = osversion
        txtTotalMemory.Text = availphyMem & " MB"
        txtAphysicalmemory.Text = totlPhyMem & " MB"
        txtvirtualmemory.Text = totVirtMem & " MB"
        ProgressBar1.Maximum = totlPhyMem
        txtMonitorHeight.Text = HeighMon
        txtMonitorwidth.Text = WidthMon

    End Sub

    Private Sub Computer_detail_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
        'it starts the timer
        Timer1.Start()
        'create new column named "List of processes"
        DT.Columns.Add("List of Processe")
        'set the datasource of the datagridview to DT
        DataGridView1.DataSource = DT
    End Sub

End Class

12/09/2013

How to reserve, cancel or know the ship ticket status for Lakshadweep ship



1. Passengers interested to receive general SMS Messages/Alerts from the Port Department need to register their mobile number onetime in any of the ship ticketing counters. 
2. Passengers need to fill up their mobile number in the reservation slip each time they take ship ticket for any voyage specific messages. 
3. The mobile number will be printed on the Ticket and passengers need to verify the correctness of their mobile number before leaving the counter. 
4. It should be mandatory for the ticket issuing person to enter the mobile number of the passenger if it is written on the reservation slip. He/She has to enter the mobile number carefully. 
5. Passenger can cancel their ticket through SMS, only from the mobile number written on the reservation slip. 
6. Cancellation of ticket through SMS is allowed only upto the previous day of sailing the ship. 
7. As the SMS services are not guaranteed services, the Department will not be responsible for any non delivery of messages in time. Further claims are not entertained. 
8. All SMS requests has to be sent to the number 09212357123
Cancellation of ticket through SMS 
It involves two steps viz. Request and its Confirmation
i)Passenger send the SMS request to cancel the ticket (from the mobile number written on the reservation slip) in the following format 
 LSHIP C <Ptid Number> eg: LSHIP C KAEA0005 
ii)Passenger receives a One Time Password (OTP) as a reply SMS  Passenger send this password for confirmation in the following format 
 LSHIP C <One time password> eg: LSHIP C SEMB 
iii)Passenger receives the result of cancellation as an SMS with cancellation charge, refund amount etc. 
 iv)The refund amount can be collected from any of the ship ticketing counters if he/she produces the original ticket within 15 days from the sailing day of the ship from mainland. Other SMS Services
1. Ticket status thru SMS  
 LSHIP S <Ptid Number> eg: LSHIP S BAAJ0004 
2. Ticket availability thru SMS 
 LSHIP A <Ship code> eg: LSHIP A K 
 This will give the availability of all classes in M.V.Kavaratti in the next immediate voyages from main land to the first Island port. 
LSHIP A <ship code> <Origin code> <Destination code> 
 Eg: LSHIP A B KCH MCY 
 This will give the availability of all classes in M.V. Bharatseema in the next immediate voyage from Kochi to Minicoy. 
LSHIP A <Voyage number> <Origin code> <Destination code> 
 Eg: LSHIP A MAEE KCH KVT 
 This will give the availability of all classes in M.V.Minicoy voyage number MAEE 
from Kochi to Kavaratti. 
3. Ticket Fare thru SMS 
 LSHIP F R KCH KVT 
This will give the ticket fare of all classes of M.V.Arabian Sea from Kochi to Kavaratti. 
4. The Code list thru SMS 
LSHIP CODES 
This will give all the codes (Ship code, Island code etc.) using in the SMS Services 
5. SMS to get Voyage numbers 
LSHIP V <Ship Code> 
Eg: LSHIP V K 
This will give all the voyage numbers and voyage dates of the M.V.Kavaratti 
6. LSHIP HELP (For necessary help in SMS requests.) 
7. SMS to get Ship Programme
LSHIP P <Voyage number> eg: LSHIP P KABB 
LSHIP P <Ship Code> eg: LSHIP P K
For SMS Help, send SMS
LSHIP HELP 

11/09/2013

How Python keeps variables in a separate list from values? Lesson-3

For the purpose of this course, you may think of computer memory as a long list of storage locations where each location is identified with a unique number and each location houses a value. This unique number is called a memory address. Typically, we will write memory addresses as a number with an "id" as a prefix to distinguish them from other numbers (for example, id201 is memory address 201).
Variables are a way to keep track of values stored in computer memory. A variable is a named location in computer memory. Python keeps variables in a separate list from values. A variable will contain a memory address, and that memory address contains the value. The variable then refers to the value. Python will pick the memory addresses for you.

Some Terminology which are used in Python 

A value has a memory address.
A variable contains a memory address.
A variable refers to a value.
A variable points to a value.


Example: Value 8.5 has memory address id34.
Variable shoe_size contains memory address id34.
The value of shoe_size is 8.5.
shoe_size refers to value 8.5.
shoe_size points to value 8.5.

05/09/2013

Learn Numerical calculation and mathmatical operation in Python - Lesson -2

This course provides an introduction to computer programming intended for people with no programming experience. It covers the basics of programming in Python including elementary data types (numeric types, strings, lists, dictionaries and files), control flow, functions, objects, methods, fields and mutability. Here is a tentative list of topics.
WeekTopics
1Installing Python, IDLE, mathematical expressions, variables, assignment statement, calling and defining functions, syntax and semantic errors
2Strings, input/output, function reuse, function design recipe, docstrings
3Booleans, import, namespaces, if statements
4for loops, fancy string manipulation
5while loops, lists, mutability
6for loops over indices, parallel lists and strings, files
7tuples, dictionaries

This course lecture will be provided in the form of short duration video consisting of 2- 10 minutes and besides that you can explore lecture summary and can take advantage of  forum where you can put your problem and get solution /advise from expert. This course is basically conducted by University of Toronto and is available on www. coursera.org
Lecture No- 2 of 1st week
Python as a calculator

04/09/2013

Getting Started: Installing Python Programming Lesson-1

Programs are found in many places such as on your computer, your cell phone, or on the internet. A program is a set of instructions that are run or executed. There are many programming languages and, for this course, we will learn the use the Python programming language step by step. and the below mention video will teach you how and from where  to down load and install Python .



Introduction

How to install

26/08/2013

How to start SBI Mobile Banking on your Mobile?

State Bank FreedoM – Your Mobile Your Bank
Away from home, balance enquiries can be made and/or money sent to the loved ones or bills can be paid anytime 24x7!!! That is what State Bank Freedom offers -convenient, simple, secure, anytime and anywhere banking.

SBI Mobile Banking

1. Mobile Banking Service over Application/ Wireless Application Protocol (WAP)
The service is available on java enabled /Android mobile phones (with or without GPRS) /i-phones where the user is required to download the application on to the mobile handset. The service can also be availed via WAP on all phones (java/non java) with GPRS connection.
The following functionalities are available:
  • Funds transfer (within and outside the bank)
  • Immediate Payment Services (IMPS): Click here for details.
  • Enquiry services (Balance enquiry/ Mini statement)
  • Cheque book request
  • Demat Enquiry Service
  • Bill Payment (Utility bills, credit cards, Insurance premium), Donations, Subscriptions
  • Mobile /DTH Top up
  • M Commerce (Merchant payments, SBI life insurance premium)
Business Rules
•     All Current/ Savings Bank Account holders in P segment and Current  accountholders    in SME segment are eligible.
•      Transaction limit per customer per day is Rs.50,000/- with a calendar month  limit of Rs.2,50,000/- 
•      All customers can avail the Service irrespective of their telecom service provider.
•      The Service is free of charge. SMS/GPRS cost will be borne by the customer.

2. Mobile Banking Service over SMS:
The service is available on all phones (java/non java) with/without GPRS connection. No need to download the application. Ordinary SMS charges are applicable.
The following functionalities are available:
•      Enquiry Services (Balance Enquiry/Mini Statement)
•      Mobile Top up
•      DTH Top up/ recharge
•      IMPS- Mobile to Mobile Transfer
•      Change MPIN
Business Rules
•      All Current/ Savings Bank Account holders in P segment and Current accountholders    in SME segment are eligible.
•      Transaction limit per customer per day is Rs.1,000/- with a calendar month limit of Rs.5,000/- . However, customers desiring to transact up to Rs.5000/- per day or Rs25,000/- per month may do so after obtaining an One Time Password (OTP)
•      All customers can avail the Service irrespective of telecom service provider.
•      The Service is free of charge. SMS cost will be borne by the customer.
•      As a matter of abundant precaution, Customers are requested to delete all the messages sent to the number 9223440000, once the response for their request has been received.
3. Mobile Banking Service over USSD (Unstructured Supplementary Service Data)
The service is available on all phones (java/non java) with/without GPRS connection. No need to download the application.
The following functionalities are available:
•      Enquiry Services (Balance Enquiry/Mini Statement)
•      Mobile Top up
•      Funds Transfer (within Bank)
Business Rules
•      All Current/ Savings Bank Account holders in P segment and Current account holders   in SME segment are eligible.
•      Transaction limit per customer per day is Rs.1,000/- with a calendar month limit of Rs.5,000/- 
•      The Service is available for subscribers of select telecom operators only.
•      The Service is free of charge. USSD session charges will be borne by the customer.
•      The service is session based and requires a response from the user within a reasonable time.
What & How