You are currently browsing the FeradZ Blog blog archives for June, 2011


Backspace in Vim does not work

Soon I had a problem of the backspace key in vim. I am connecting to a remote machine through VNC. When I open Vim in Xterminal (xterm) and press the backspace key it prints ^? Instead of doing deleting the character before the cursor. I did waste few hours to find a fix and here it is:

 
Problem
In Vim when you press the backspace key it prints ^?
 
Solution 1
Try adding the following line in file .vimrc
set backspace=2
 
It did not work?
 
Solution 2
Add the following lines in your .vimrc file.
 
if &term=="xterm"
  set t_kb=<CTRL+V><BS>
  fixdel
endif

:fixdel
 
<CTRL+V> means to press the control key and “V”. Not to type the string as is
<BS> means to press the backspace key
This combination of keystrokes will generate the code mapped to backspace key.
 
And all the lines above essentially will make proper correct mapping for the backspace key.
 

It did not work? Then, I don’t know how you can fix it.

Why PayPal is better than Moneybookers

 

Before few days I had a small problem with both Moneybookers and PayPal. Here I will try to explain how PayPal promptly assisted me in solving my problem and Moneybookers did not. Although moneybookers seem to have tiny bit better commission fees, all these advantages are abolished at the moment when you hit some unexpected situation.
 
As I said, few days ago I had almost similar problem with both moneybookers and PayPal. A friend of mine wanted to send me money and he asked me whether to do it over moneybookers or PayPal. I had accounts on both. Although I always use PayPal, I never used moneybookers before – simply because the places which accept paypal are more than moneybookers. This time I checked the fees at the both and those at moneybookers seemed to be better – particularly the exchange rate between Euro and USD. I verified whether I can withdraw the money from Spain using moneybookers. I noticed that I have registered the account 5-6 years ago when I lived in Turkey – this meant that I could not withdraw the money immediately after the transaction. I had to first change my address from Turkey to Spain. I quickly checked whether I can do that from the web but it looked like that I had to pass over a procedure that might last for few days – namely to send a copy of an utility bill to moneybooker’s customer service and  wait until they change it. Because of it, I chose again to accept the payment on PayPal. However, in the mean time I started a procedure to change my address at moneybookers.
 
I sent the customer service utility bill which I have downloaded from the Movistar’s client portal – the same invoice that they sent me to my post but I don’t keep because I know that I always have the electronic copy. On the utility bill was written my address – to serve as an address verification. Moneybookers replied me that I am logging in to their website from different country than Spain and asked me to explain this. The explanation was simple. I logged in to moneybookers web site several times from my work. At work, all the traffic is intentionally rerouted through a proxy which exists from another country – this looks like that I log in from another country. Moneybookers answer was a template answer that they need an utility bill to verify my address. This was the email which actually made me angry – they already had a copy of my passport and the most recent utility bill which I had. I did send for second time the same utility bill plus a copy of my residence card in Spain. Moneybookers explicitly asked for an utility bill not older than 3 months – the utility bill I sent was from the last month (not older than 3 months) and the residence card did not have issue date.
 
This time moneybooker’s answer was ridicules. It was telling that they cannot accept the utility bill which I sent because it was PDF format and most probably downloaded from internet. They asked me to provide a document which was sent to me by post. Let me remind – the document which I sent them is very much the same (exact copy) which Movistar sends me by post. Actually all these meant to play the game of bureaucracy – print the document, then scan it and then send it. I did not wanted to play this stupid game and just asked to close my account.
 
If I am going to have such problems at the very beginning of using moneybookers, I just cannot imagine what other worse problems I can face. And all these took about a week – a period of time which cannot be acceptable for anybody who does a serious business!
 
On the other side how PayPal handled similar problem with address verification. I have two accounts in PayPal one registered in Spain and other in USA. I wanted to transfer the money from the US account and to the Spanish account and to close the US account. I could not do that because my US account was blocked because PayPal’s security system detected that I login both from Spain and other country thinking that it is a security problem. I contacted PayPal over email explaining the situation. They asked me to verify my identity. I sent them a copy of my passport. They unlocked my account and I could send the money from the US to the Spanish account and close the US account. All this finished in 24 hours.
 

So when I compare both moneybookers and PayPal. With moneybookers it took me one week or even more and I could not resolve my problem. With PayPal I resolved my problem in 1 day (24 hours). I don’t recommend moneybookers simply because you could have such unpleasant experience which if happens at the wrong moment would multiply. It is just too much bureaucracy at moneybookers which I cannot handle.

Visual Basic script – Applying a formula across a column

This VB script computes a formula accross a column and writes the formula on a range of cells in another column of an Excel file. It can be very useful to compute average / min / max of collection of numbers. Example is demonstrated:

RAW   Average
Index Value   Index Value (AVG)
1 21.95   1 22.73
1 21.21   2 21.82
1 25.02   3 20.91
2 23.66      
2 21.19      
2 20.63      
3 23.31      
3 19.59      
3 19.83      

To apply the script, first select the first cell where the formula should be written.

Sub ComputeAndWriteFormula(formulaName As String, sheetName As String, column As String, startRow As Integer, endRow As Integer, step As Integer)
' This function adds formula starting from starting from the current cell
' The formula will be build in the following way.
' =Formula(Sheet!Column<number>:Column<number+step>

    Dim sheet As String
    Dim formula As String
   
    If Len(sheetName) = 0 Then
        sheet = ""
    Else
        sheet = sheetName + "!"
    End If
   
    For ind = startRow To endRow Step step
        Dim startCell As String
        Dim endCell As String
        Dim endCellRow As Integer
        endCellRow = ind + step - 1
        startCell = column + Trim(Str(ind))
        endCell = column + Trim(Str(endCellRow))
        formula = "=" + formulaName + "(" + sheet + startCell + ":" + endCell + ")"
        ActiveCell.formula = formula
        ActiveCell.Offset(1, 0).Select
    Next
End Sub

Sub TestComputeAndWriteFormula()
    Call ComputeAndWriteFormula("AVERAGE", "raw", "E", 2, 313, 3)

End Sub

Spring and the flowers

Spring and the flowers by feradz
Spring and the flowers a photo by feradz on Flickr.

This is one of my favorite photos which I took when we went for hiking to Madara – a small village near Shumen (in Bulgaria). Madara is popular with the symbol of Bulgaria – Madara Rider.

I took the photo while my wife was picking flowers for her spring bouquet without she noticing me. I think the photo is very successful because of the excellent light, DoF and selective focus, and the composition. It very successfully conveys her happy mood.