Saturday, November 27, 2010

How to avoid spam when giving out your email address

This article covers specifically when you need to / have to give out an email, but you want to maintain some sort of control over the spam that you might get. Typically your situation may be:
1) You register for some service /  forum / website / free software / etc that require you to give out a valid email.
2) The thing that you register for may need to send you the email for confirmation. This means you need to give them your email which you can check.
3) You are concerned that they will email you with junk, spam, malicious email at a later date.
4) You think that they have low security and that they do not keep your email safely such that your email address could end up to some malicious entities.
5) But you still need to register with them and need to give them your email anyway.

     ..... then READ ON ........

Before describing the steps on how to give out your email, yet maintain a level of control, here is a list of things that this article is not covering:
1) your email posted somewhere on the web and was discovered by web spiders / crawlers.
2) using various software to protect against spam.


     ..... Now for the Solutions ......
Here are 3 possible solutions to give your email to an untrustworthy company or person and how to deal with it later.


1. Create an email account solely for the purpose of potential spam mail. This is the email you give out to those that you do not trust will keep your email address safe and with respect. Over time, the list of receivers of this email may be so large that it can still be hard to maintain.

2. Obtain a third party service to manage your spam mail. One such service is pckingsford. To contact them, please email them with user name "help" and the domain is "pckingsford" dot "com". This is a free service but you need to arrange for them to handle your email.
For example,
  1. You register for something with company ABC, and they need to get your email.
  2. ABC tells you that they will send you an email, which you have to reply to confirm your registration.
  3. You contact Pckingsford and explain that you need to wait for an email from ABC and click on something in that email.
  4. PCKingsford will give you and email to use. When ABC sends the email to PCKingsford, it will then click on that email on your behalf.
  5. All future emails send by ABC to your PCKingsford email will be ignored until the next time that you notify them.

3. Make use of a feature in Google Gmail that lets you create multiple virtual gmail address.
For example, if your email is me@gmail.com, then when you register with company ABC, you can give them your email as me+ABC@gmail.com. Anyone sending an email to this address will be directed to your me@gmail.com inbox. The way this trick works is that although spam and virus may be send to me@gmail.com, those email will be listed as being from me+ABC@gmail.com. You can then use Google Gmail's filter to catch these emails in the future.

To use Gmail filter,
- go to the top right corner of gmail and press Settings.
- on the horizontal bar slightly below the top, click on Filters
- on the Filters, click the link "create a new filter"
- when creating the new filter, in the To field only, type me+ABC@gmail.com. Leave the other fields blank. Click Next Step.

- Under the Choose Action section, you can decide how you want to treat the emails send to you by ABC in the future. For example, you can delete it or apply a lable to it.

- Finally click on the Create Filter. From then on, me+ABC@gmail.com will be treated depending on the action chosen above.

Thursday, November 18, 2010

Matlab Function in Fortran - perms - permutation

Below is the Fortran implementation of the perms algorithm found in Matlab. It creates a matrix whose rows consist of all possible permutations of the n elements of vector vecIn.

There are many useful utility functions in Matlab and occassionally an important but rare (difficult to find source in the internet) algorithm such as this permutation algorithm. Hopefully there will be more Fortran version of Matlab utility functions appearing here in the future.

The one listed below is unpolished and unoptimized and not suitable for large inputs. It is a very basic implementation taken directly from the mathematical definition. It is also tested only for a small number of cases. Corrections, suggestions and comments are welcomed.




!/*
! * perms - All Possible permutations
! * 
! *     (C)  Copyright 2010 xTechNotes.blogspot.com
! * 
! *   This program is free software: you can redistribute it and/or modify
! *   it under the terms of the GNU General Public License as published by
! *   the Free Software Foundation, either version 3 of the License, or
! *   (at your option) any later version.
! *
! *    This program is distributed in the hope that it will be useful,
! *    but WITHOUT ANY WARRANTY; without even the implied warranty of
! *    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
! *    GNU General Public License for more details.
! *
! *    You should have received a copy of the GNU General Public License
! *    along with this program.  If not, see .
! */ 


    RECURSIVE subroutine perms(n, nfact, vecIn, vecOut)
        IMPLICIT NONE 
        INTEGER, INTENT(IN) :: n                ! number of elements of original vector
        INTEGER, INTENT(IN) :: nfact            ! Factorial(n)
        REAL, INTENT(IN) :: vecIn(n)            ! original vector to be permuted
        REAL, INTENT(OUT):: vecOut(nfact, n)    ! Permutations of original vector


        ! local variables         
        real :: vecInTmp(n)
        integer :: ii , mfact
        real :: dtmp
        
        vecOut = 0.0
        if (n .le. 0) then 
            return
        elseif ( n .eq. 1 ) then            
            vecOut(1,1) = vecIn(1)
        elseif ( n .eq. 2 ) then
            vecOut(1, :) = vecIn(:)
            vecOut(2, :) = (/vecIn(2), vecIn(1)/)
        else        
            ! ii = 1
            call factorial(n-1, mfact)
            vecOut(1:mfact, 1) = vecIn(1)
            call perms(n-1, mfact,  vecIn(2:n), vecOut(1:mfact, 2:n))
            
            do ii = 2, n
                vecInTmp = VecIn
                vecInTmp(1) = VecIn(ii)
                vecInTmp(ii) = VecIn(1)
                vecOut((ii-1)*mfact+1 : ii*mfact, 1) = vecInTmp(1)                
                call perms(n-1, mfact, vecInTmp(2:n), vecOut( (ii-1)*mfact+1 : ii*mfact, 2:n))
            enddo 
        
        endif    
        
    end subroutine perms

Friday, November 12, 2010

Matlab Function in Fortran - conv2 - Convolution in 2D

Below is the Fortran implementation of the Convolution 2D algorithm, or conv2 as found in Matlab. There are many useful utility functions in Matlab and occassionally an important but rare (difficult to find source in the internet) algorithm such as this convolution algorithm. Hopefully there will be more Fortran version of Matlab utility functions appearing here in the future.

The one listed below is unpolished and unoptimized and not suitable for large inputs. It is a very basic implementation taken directly from the mathematical definition of discrete convolution in 2D. It is also tested only for a small number of cases. Corrections, suggestions and comments are welcomed.




!/*
! * CONV2 - Convolution in 2D
! *
! *     (C)  Copyright 2010 xTechNotes.blogspot.com
! *
! *   This program is free software: you can redistribute it and/or modify
! *   it under the terms of the GNU General Public License as published by
! *   the Free Software Foundation, either version 3 of the License, or
! *   (at your option) any later version.
! *
! *    This program is distributed in the hope that it will be useful,
! *    but WITHOUT ANY WARRANTY; without even the implied warranty of
! *    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
! *    GNU General Public License for more details.
! *
! *    You should have received a copy of the GNU General Public License
! *    along with this program.  If not, see .
! */  
  
    subroutine conv2(nXi, nXj, nHi, nHj, nYi, nYj, X, H, Y)
        INTEGER, INTENT(IN) :: nXi, nXj, nHi, nHj           ! Dimensions of Input, Kernel
        INTEGER, INTENT(IN) :: nYi, nYj                     ! Dimensions of Output - MUST BE nXi+nHi-1, nXj+nHj-1
        REAL, INTENT(IN) :: X(0:nXi-1, 0:nXj-1)   ! Input
        REAL, INTENT(IN) :: H(0:nHi-1, 0:nHj-1)   ! Kernel
        REAL, INTENT(OUT) :: Y(0:nYi-1, 0:nYj-1)  ! Output
        integer :: im, in, ii, ij, ip, iq
      
        Y = 0.0d0
        if( nYi .ne. nXi+nHi-1  .or. nYj .ne. nXj+nHj-1 ) RETURN
      
        do in = 0, nYj-1
            do im = 0, nYi-1
                do ij = 0, nXj-1
                    do ii = 0, nXi-1
                    ip = im - ii
                    iq = in - ij
                    if (ip .ge. 0 .and. ip .le. nHi-1 .and. iq .ge. 0 .and. iq .le. nHj-1) then
                        Y(im, in) = Y(im, in) + X(ii, ij) * H(ip, iq)
                    endif                      
                    enddo
                enddo
            enddo
        enddo
        return
    end subroutine conv2

Tuesday, November 02, 2010

How to Improve Video Capture Quality

How to Improve Video Capture Quality
======================================
This step may require additional filters for VirtualDub. See the previous section for filters available for VirtualDub.

White Balance Filter - Jim Leonard
- to correct for white balance problems.
- Example: when the video in general looks orange, blue or too dark.
- may occur when white balance is on automatic mode, so different types of light having different temperatures causes this problem
- this filter can also be used to adjust Hue, Saturation, Intensity, Brightness, Contrast

Deinterlacing filter
- used to remove the effect of interlacing, ie. when not all frames are processed.
- fast motion causes edges of objects to look jagged.
- the filter will also make the video look far sharper

Sharpening Filter
- used when video seem to have soft edges or lack detail.

Dynamic Noise Reduction
- used when video is grainy

Chroma Noise Reduction Filter
- used when there is chroma noise; ie where rainbow effects shimmer across the screen.

VHS filter - flaXen
- used when video has timing issues and skips a bit
- try using the Stabilize section of this filter only

For instructions on Video Capture using VirtualDub, see:
http://xtechnotes.blogspot.com/2007/07/notesvideocapture.html



VirtualDub filters plugins
============================
Filter pack from Dee Mon:
http://www.infognition.com/VDFilterPack/
Jim Leonard's White Balance filter
http://neuron2.net/whitebalance/whitebalance.html
flaXen filter
http://neuron2.net/flaxen/flaxen.html

To use this filter, install Virtual Dub, then install these plugins into the VirtualDub's plugins folder.


VirtualDub MPEG2 codecs
========================
To use the Virtual Dub and encode with the MPEG2, the following codes need to be installed.
Panasonic VfW DV codec
http://www.free-codecs.com/download/panasonic_dv_codec.htm 
 Adaptec VfW DV codec
http://www.free-codecs.com/download/adaptec_dvsoft_codec.htm 

How to find hidden Web Sites, Pages

This is the beginning of a collection of resource about the techniques of searching the internet for websites that are not well known and do not come up on top searches. These information are not hidden deliberately but are just not well publicized or optimized to be found from regular search engines.

Some of the links are:
How To Find Hidden Web Pages
Uncovering the Hidden Web part 1