Bug reporting

When you finish a website, or a project, you would like to get the feedback and to find the bugs you might have on your website as soon as possible.

There are some options to use:

1- Asking your users to send you email with screenshots.
2- Use online bug reporting tools.
3- Setup a bug reporting server and integrate it with your website or project.

The first option is the one usually people use, but the main problem with this solution is tracking the bugs is almost impossible, and the one who reported the bug will not be able to follow that.

Second solution is very good, but there is one problem that these system are built for testers and usually those who have IT background and understand how to report and do the testing, which is not good for normal users which is almost the case.

The third solution seems to be the best solution as you can configure that to suit you. But  setup and installing that system usually it takes more than the time you spent on your project.

There is also a very good and easy solution that you can use this website called TellMeBug which is designed for normal people to report bugs very easy, as they send email, you can add your project there and make it public, or private, or public with limited access,  depends on your project and add the project icon to your website. When your user clicks on that icon, it will come to your project on tellmebg and they can report the bug.

You will see the bug and you can assign it to your team member to work on that and update bug status.

 

Posted in Thinking | Leave a comment

How to write a simple FTP program with Delphi 2007

This is a simple program with Deplhi 2007,

you can download the exe file from (Download FTPUpload.exe)

unit Unit1;

interface

uses
  Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
  Dialogs, StdCtrls, Buttons, IdBaseComponent, IdComponent, IdTCPConnection,
  IdTCPClient, IdExplicitTLSClientServerBase, IdFTP, ExtCtrls, ComCtrls;

type
  TForm1 = class(TForm)
    Panel1: TPanel;
    IdFTP1: TIdFTP;
    btnAdd: TBitBtn;
    Label1: TLabel;
    ListBox1: TListBox;
    Label2: TLabel;
    txtUsername: TEdit;
    txtPassword: TEdit;
    Label3: TLabel;
    Label4: TLabel;
    btnStart: TButton;
    lblStatus: TLabel;
    txtServer: TEdit;
    Label5: TLabel;
    txtLogs: TMemo;
    OpenDialog1: TOpenDialog;
    ProgressBar1: TProgressBar;
    btnDelete: TBitBtn;
    Label6: TLabel;
    procedure btnStartClick(Sender: TObject);
    procedure IdFTP1Status(ASender: TObject; const AStatus: TIdStatus;
      const AStatusText: string);
    procedure IdFTP1Work(ASender: TObject; AWorkMode: TWorkMode;
      AWorkCount: Integer);
    procedure btnAddClick(Sender: TObject);
    procedure btnDeleteClick(Sender: TObject);
    procedure ListBox1Click(Sender: TObject);
  private
    { Private declarations }
  public
    { Public declarations }
  end;

var
  Form1: TForm1;

implementation

{$R *.dfm}

procedure TForm1.btnAddClick(Sender: TObject);
var
  i: Integer;
begin
  if (OpenDialog1.Execute) then
  begin
    for i := 0 to ListBox1.Count - 1 do
      if(ListBox1.Items.Strings[i] = OpenDialog1.FileName) then ListBox1.Items.Delete(i);
    ListBox1.Items.Append(OpenDialog1.FileName);
  end;
  btnStart.Enabled := ListBox1.Count > 0;
end;

procedure TForm1.btnDeleteClick(Sender: TObject);
begin
  ListBox1.Items.Delete(ListBox1.ItemIndex);
end;

procedure TForm1.btnStartClick(Sender: TObject);
var
  F : TFileStream;
  i : Integer;
  S : String;
begin
  IdFTP1.Host := txtServer.Text;
  IdFTP1.Username := txtUsername.Text;
  IdFTP1.Password := txtPassword.Text;
  btnStart.Enabled := False;
  try
    IdFTP1.Connect;
    IdFTP1.Login;
    for i:= 0 to ListBox1.Items.Count-1 do
    begin
      S := ListBox1.Items.Strings[i];
      if(FileExists(S)) then
      begin
        try
          lblStatus.Caption := 'Uploading '+ ExtractFileName(S);
          F := TFileStream.Create(S,fmOpenRead);
          ProgressBar1.Max := F.Size;
          ListBox1.Items.Strings[i] := '(Uploading) '+ S;
          IdFTP1.Put(F,ExtractFileName(S));
          ListBox1.Items.Strings[i] := '(Uploaded) '+ S;
        finally
          lblStatus.Caption := 'Upload completed';
          F.Free;
        end;
      end
      else
      begin
        ListBox1.Items.Strings[i] := '(Not found) '+ S;
      end;
    end;
  except on E:Exception do
    MessageDlg(e.Message,mtError,[mbOK],0);
  end;
  btnStart.Enabled := True;
end;

procedure TForm1.IdFTP1Status(ASender: TObject; const AStatus: TIdStatus;
  const AStatusText: string);
begin
  txtLogs.Lines.Append(DateTimeToStr(Now)+' : ' + AStatusText);
end;

procedure TForm1.IdFTP1Work(ASender: TObject; AWorkMode: TWorkMode;
  AWorkCount: Integer);
begin
  ProgressBar1.Position := AWorkCount;
  txtLogs.Lines.Append(DateTimeToStr(Now)+' : '+IntToStr(AWorkCount));
end;

procedure TForm1.ListBox1Click(Sender: TObject);
begin
  btnDelete.Enabled := (ListBox1.ItemIndex > -1);
  btnStart.Enabled := ListBox1.Count > 0;
end;

end.
Posted in Thinking | Leave a comment

How to link your personal email and your email in gmail

 

 

 

 

If you have two emails and you would like to check both emails in one email, here is the steps you need to follow:

In this article we assume you have one personal email and one work email, and we assume both are in gmail.

You need to login to your work email and go to mail setting

 

 

 

And click on Forwarding and POP/IMAP tab

 

There at the top you will see a section called Forwarding, click on button “Add a forwarding address”

Then you need to type your personal email address, which you would like all emails be forwarded to. After that you will receive a confirmation email on your personal email which you have to confirm,

After that you need to come back to this page, and enable that forward, as by default it will be disabled.

Once you have successfully activated your email forwarding, you need to login to your personal email and go to mail setting.

This time you need to click on a section called Accounts and Imports

A section called Send mail as: and click on  the link “Add another email address you own”

Then you will see a new window

In this new window you type your name and your work email address,
Also uncheck that checkbox, and click on “Next Step ”

Then on the next step choose the first option, and click “Next Step”, on the next step click on send verification, which you need to confirm that,

After you confirm that, you need to come back to mail setting in your personal email, where you setup the Send mail as,

And in section saying “Send mail as:” you need to make sure your work email that you set, is activated, and also from two radio button at the bottom you need to choose the top one:

“Reply from the same address message was sent to”

This option is when you replying to your work emails, from your personal email, they appear to be sent from your work email.

You may need to check this, and make sure it is working fine,

This is the quick way to setup, but there are some more professional way to do that, which I might explain that in an other article.

 

 

Posted in Thinking | Leave a comment

Vertically align in css for IE7+ and FF

Making a text vertically aligned is one the challenging tasks with css. Here is one quick solution which I found and it works fine in IE7+

solution is to use vertical-align: middle;

but this style doesn’t work as it expect to work, or as we think it should work.

here is the trick:

<div class=”verticalAlign”>
<span></span>
<p>Here is some text that will be middle aligned.</p>
</div>

.verticalAlign{
display: block;
height: 300px;
width: 400px;
}

.verticalAlign span{
display: inline-block;
display: inline !IE;
height: 300px;
width: 1px;
vertical-align: middle;
}
.verticalAlign p{
display: inline-block;
}

Here is some text that will be middle aligned.

Posted in Programming | 1 Comment

The ‘Microsoft.ACE.OLEDB.12.0′ provider is not registered on the local machine

I was trying to import one excel file (2010 version) into mssql server with SQL Server Management Studio and keep getting that error.

Solution which solved my problem:
I found this website http://blogs.msdn.com/b/farukcelik/archive/2010/06/04/accessing-excel-files-on-a-x64-machine.aspx  and followed the steps and didn’t work.

What I did was I installed Microsoft Access Database Engine 2010 Redistributable and still was getting the same error.

After that I saved that excel file as Excel 203 (with extension .xls) and now it worked fine.

Posted in Thinking | Leave a comment

Finish minesweeper game in 1Sec

Everyone has seen windows minesweeper game which is installed by default in all windows. But not everyone is familiar with the way it works.

It is very simple, the goal in this game is to find the mines, which are hidden behind the blocks, you can mark them by right clicking on the cell when you are sure it is mine, and when you think it is not mine, you can click on it, it will be revealed. then you will see it is empty of there will be number in that cell. The number in the cell represents total number of mine in cells connected to this cell, which are 8 in total, by calculation from these numbers you can reveal all the mines.

Remember it is counting the time and the one who finish it faster it is the winner.

Here is a small program which I have written to play that game for you, you can download it from here, it is called PlayMine.

Feel free to contact me if you have any comment or question, or even if you are interested to get the source code which is written in Delphi, don’t hesitate to contact me.

Have fun and surprise your friends by finishing the game in less than a second.

Posted in Programming, Thinking | 12 Comments

Style pdf file in PHP using html tags

I think most of php developers are familiar with FPDF, which is a great code to use in php when you want to generate pdf file.  You can download the code if you want from Here.

That is a really powerful code with many functions which you can create any type of pdf file, but when it comes to styling such as using bullets, making one word bold, or these type of things, you see it is very difficult to to make it.

Here is a very simple function which I wrote and added to FPDF, to be able to use simple html tags to style the pdf.

It is very simple to use, just you need to call this function with the $html set to your text.

The tags you can use at the moment are only two, but I if I get a chance I will add more tags.

At the moment you can use only <b>text to be bold</b> and <li> text to be bullet</li>, also make sure you include a surrounding <div> tag for your html tag.

The way it works, it looks for tags which knows, and apply the style when starts, and finish the style when it gets to closing tag. and that is the point it prints the out put. if you do not include the closing tag, you wont see anything in the result.

function Html($w,$h,$html,$align=”L”)

{

$l = strlen($html);

$s = ”;

$t = ”;

$i = 0;

$ct = ”;

$x0 = $this->GetX();

while($i<$l){

$c = $html[$i];

if($c == ‘<’){

$t = ”;

while(($c != ‘>’)and($i<$l)){

$c = $html[$i];

$t .= $c;

$i++;

}

if($t[1] == ‘/’){

if($ct == ‘<li>’){

$this->SetX($x0+2);

}else{

$this->SetX($x0);

}

$this->MultiCell($w,$h,$s,0,$align);

$s = ”;

$ct = ”;

}else{

$ct = $t;

}

switch ($t){

case ‘<b>’: $this->SetFont(”,’B',”);

break;

case ‘</b>’: $this->SetFont(”,”,”);

break;

case ‘<li>’:

$FSt = $this->FontStyle;

$FSi = $this->FontSizePt;

$this->SetFont(”,’B',20);

//$this->Cell(4,$h,’-',0);

$this->Cell(3,1,’.',0,0,’C');

$this->SetFont(”,$FSt,$FSi);

break;

case ‘</br>’: $s .= “\n”;//$this->Ln($h);

break;

}

}if($c == “\n”){

//$this->MultiCell($w,$h,$s);

//$this->Ln();

$s = ”;

$i++;

}

else{

$s .= ($i<$l)?$html[$i]:”;

$i++;

}

}

}

Posted in Programming | 3 Comments

Load CD or DVD image file into a virtual drive

Here is a quick tip how to load an iso file, which can be a DVD or CD image file into a drive, without installing any software.

1- as iso files are almost a zip file, first you need to extract the iso file contents into a folder, using any zip file, such 7Zip, which is my favourit.

2- Use command line to make a virtual drive from that folder, if your folder is called C:\MyISO
You can use this command to crate a virtual drive,

subst K: C:\MyISO

this will add a K drive and you can use it,

NOTE: this is a temporary drive, and will be removed if you log out or you restart, also if you want to remove this drive you can use subst K: /D

Posted in Tips | 1 Comment

POP3 mail client with delphi 2007

unit Unit1;

interface

uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, IdIOHandler, IdIOHandlerSocket, IdIOHandlerStack, StdCtrls, IdBaseComponent, IdComponent, IdTCPConnection,
IdTCPClient,  IdMessageClient, IdPOP3, IdMessage, ExtCtrls,IdAttachment,IdText,
IdExplicitTLSClientServerBase;

type
TForm1 = class(TForm)
IdPOP31: TIdPOP3;
Button1: TButton;
IdMessage1: TIdMessage;
Memo1: TMemo;
Button2: TButton;
Panel1: TPanel;
ListBox1: TListBox;
Splitter1: TSplitter;
Splitter2: TSplitter;
Panel2: TPanel;
Label1: TLabel;
Label2: TLabel;
Label3: TLabel;
Memo2: TMemo;
Label4: TLabel;
txtEmail: TEdit;
txtPassword: TEdit;
txtHost: TEdit;
Label5: TLabel;
Label6: TLabel;
Label7: TLabel;
procedure Button1Click(Sender: TObject);
procedure IdPOP31Status(ASender: TObject; const AStatus: TIdStatus;
const AStatusText: string);
procedure IdIOHandlerStack1Status(ASender: TObject;
const AStatus: TIdStatus; const AStatusText: string);
procedure ListBox1Click(Sender: TObject);
procedure Button2Click(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;

var
Form1: TForm1;

implementation

{$R *.dfm}

procedure TForm1.Button1Click(Sender: TObject);
begin
try
IdPOP31.Host := txtHost.Text;
IdPOP31.Username := txtEmail.Text;
IdPOP31.Password := txtPassword.Text;
IdPOP31.Connect;
finally
end;
end;

procedure TForm1.Button2Click(Sender: TObject);
var
i : integer;
begin
try
Memo1.Lines.Append(IntToStr(IdPOP31.CheckMessages));
for i := 1 to IdPOP31.CheckMessages do
begin
IdMessage1.Clear;
try
IdPOP31.RetrieveHeader(i,IdMessage1);
finally
ListBox1.Items.Append(IntToStr(i)+’-'+IdMessage1.Subject);
end;
end;
except on E:Exception do
Memo1.Lines.Append(‘E=>’+E.Message);
end;
end;

procedure TForm1.IdIOHandlerStack1Status(ASender: TObject;
const AStatus: TIdStatus; const AStatusText: string);
begin
Memo1.Lines.Append(‘IO=>’+AStatusText);
end;

procedure TForm1.IdPOP31Status(ASender: TObject; const AStatus: TIdStatus;
const AStatusText: string);
begin
Memo1.Lines.Append(AStatusText);
if(AStatus = hsConnected) then
try
IdPOP31.Login;
Button2.Enabled := IdPOP31.Connected;
except on E:Exception do
Memo1.Lines.Append(‘E=>’+E.Message);
end;
end;

procedure TForm1.ListBox1Click(Sender: TObject);
var
i : integer;
fn,p : string;
begin
p := ‘c:\temp\at\’;
i := ListBox1.ItemIndex+1;
IdMessage1.Clear;
try
IdPOP31.Retrieve(i,IdMessage1);
finally
Label1.Caption := ‘From => ‘+IdMessage1.From.Text;
Label2.Caption := ‘To => ‘+IdMessage1.Recipients.EMailAddresses;
label3.Caption := ‘Subject => ‘+IdMessage1.Subject;
end;
Memo2.Clear;
Label4.Caption := ‘Attachments => ‘;
for i := 0 to Pred(IdMessage1.MessageParts.Count) do
begin
if(IdMessage1.MessageParts.Items[i] is TIdAttachment) then
begin
fn := p+TIdAttachment(IdMessage1.MessageParts.Items[i]).FileName;
Label4.Caption := Label4.Caption + fn;
try
TIdAttachment(IdMessage1.MessageParts.Items[i]).SaveToFile(fn);
except on E:Exception do
Memo1.Lines.Append(‘E => ‘+E.Message);
end;
end
else
begin
if(IdMessage1.MessageParts.Items[i] is TIdText) then
begin
Memo2.Lines.AddStrings(TIdText(IdMessage1.MessageParts.Items[i]).Body);
end;
end;
end;
end;

end.

Posted in Programming | 50 Comments

Transfer file with remote desktop

Here are the steps you can use to share your local drive with remote computer that you are connected with remote desktop connection.

1- In remote desktop connection dialog window, click on Options.

2- In option dialog select local resources tab.

3- click on more button to see below dialog, which you can select which one of your local drive share with remote desktop.

when selected press ok, and then connect.

when connected on remote computer if you open My computer you can see your drive is shared and available there, which you can copy files into your drive.

Tips: as you are not shore about the remote computer try not to share your main drive, as some viruses might get transferred. you can plug a USB drive and try to share that USB drive, with remote computer.

Posted in Tips | 3 Comments