Tuesday, August 31, 2004

Copernic Desktop Search

Copernic releases today a free Desktop Search solution. It allows users to search their personnal computer for files, e-mails and even images and music.

This product is one more evidence that many companies share the same plan to organize our desktop. There's indeed a rumor that Google is preparing such a product. Also, this is no secret that Microsoft plans to include enhanced searching in their next evolution of Windows. However, we'll have to wait until 2006 (and surely later) before Longhorn to be completed. Yahoo! is in the race, preparing a product that will index your destop as well as your Yahoo! mails and pictures. HotBot launch a desktop search earlier this year in the form of a Internet Explorer plug-in. Other companies (ex.: Enfish, ISYS, SowSoft, and many more) offer similar products but you have to pay for most of them.

This product remembers some early products like 1998's AltaVista Discovery that was indexing the desktop and proposing document summarization (using Inxight summarization Technology).

*** [Update Sept. 2nd] ***

I use Copernic Desktop Search since 3 days both on my laptop and my desktop computer.
Here are my impressions:

Pros:

  1. The program is robust, extra-fast and quietly runs in background.
  2. The default view shows documents by date. It has an unexpected side-effect. It is rapidly becoming part of my routine to check what I did recently to see what is todo. It gives a kick start when you sit in front of your computer.

Cons:

  1. I would have like to search e-mails and files at the same time. Unfortunatelly it is in two separate tabs and I have to perform two searches.
  2. I dislike the deskbar. It has no default search selected, you always have to select it by hand. Moreover, if you want to search the web, you are limited to alltheweb..

Wednesday, August 25, 2004

ASP.NET prompt before to leave a page

This little trick allows a web page to prompt the user (ex.: for saving) before to quit. The simple body attribute "onbeforeunload" do almost all the work but there is a little problem when a control needs to postback.

Using this client-side javascript:

<script language="JavaScript">
<!--

var bPrompt = true;

function DoNotPrompt(){
bPrompt = false;
}

function confirmIELeave() {
if (bPrompt) {
event.returnValue = "Do you want to quit without saving?";
}
}

//-->
</script>


and the Page attribute "onbeforeunload":

<body onbeforeunload="confirmIELeave()">


simply execute the "DoNotPrompt" function when a control that postback is clicked. For example:

SaveLinkbutton.Attributes.Add("onclick", "DoNotPrompt()");


Note that it will only works for IE. Mozilla, for instance, do not support the "onbeforeunload" event :(

Monday, August 23, 2004

BannerReport

This is an archive of publicities seen on the web.
BannerReport is a massive gallery of banner ads.
Here are some good ones:




Friday, August 20, 2004

Automating Copernic Enterprise Search using C# (PART II)

In a previous Post, it was shown how to create a collection of documents and issue a query using Copernic Enterprise Search.

Here's an addition that allow the indexing process to take into account meta-data such as the document language and the filetype. When creating a source, simply turn on meta-data and specify the ones you want:


public void AddSource(string pi_Collection, string pi_Name, string pi_Address)
{


CESAdmin.IPhysicalIndex myIndex = (CESAdmin.IPhysicalIndex)m_Admin.PhysicalIndexes[0];
CESAdmin.ICollection myCollection = (CESAdmin.ICollection)myIndex.Collections.get_ItemByName(pi_Collection);
myCollection.Sources.Add(pi_Name, pi_Address, "files");
m_Admin.Commit();

CESAdmin.ISource mySource = (CESAdmin.ISource)myCollection.Sources.get_ItemByName(pi_Name);
mySource.SetAdvancedProperty("IndexMeta", true);

CESAdmin.IField languageField = (CESAdmin.IField)mySource.Fields.get_ItemByName("syslanguage");
languageField.IncludeInQuery = true;

CESAdmin.IField sourceField = (CESAdmin.IField)mySource.Fields.get_ItemByName("syssource");
sourceField.IncludeInQuery = true;

CESAdmin.IField fileField = (CESAdmin.IField)mySource.Fields.get_ItemByName("sysfiletype");
fileField.IncludeInQuery = true;


}


Thursday, August 19, 2004

Goog Luck Google...


Tuesday, August 17, 2004

aspnetpro.com Hacked

asp.net PRO (informant communication group), editors of a specialized magazine about asp.net have been hacked (checked today). On the site of the magazine, that has a strong focus on secure applications, some pages are titled "Hacked By TheMax - Bys - #ByS - irc.brasnet.org".

The pages (ex.: http://www.aspnetpro.com/files/asp02156_u/ok5.asp) are mainly in spanish with the mention "BYS - Breaking Your Security".

Saturday, August 14, 2004

Workaholics Gene

Procrastinating primates can be turned into workaholics, thanks to gene therapy.
This may be a proof that genius are in fact mentally-ill persons.

Wednesday, August 11, 2004

Create a Windows Form that dock on the sides of the screen (c#)

I found this piece of code I created a year ago. It is about moving a window and dock it on the side of the screen like if there were a magnet (e.g.: WinAmp). Here's how you do it in C#:

Hey, I can mail you original code if copying this is tough (see my address on the right).

You'll need:



  1. A constant that define the size of the dock area:
    private int SCREEN_BORDER = 15;
  2. A bunch of member variables to keep the state (init them in the constructor as follow):
    m_WorkWidth = Screen.PrimaryScreen.WorkingArea.Width;
    m_WorkHeight = Screen.PrimaryScreen.WorkingArea.Height;
    m_WorkTop = Screen.PrimaryScreen.WorkingArea.Top;
    m_WorkLeft = Screen.PrimaryScreen.WorkingArea.Left;

    m_Moving = false;
    m_PosX = 0;
    m_PosY = 0;
    m_VerticalDock = false;
    m_VerticalDockPos = 0;
    m_HorizontalDock = false;
    m_HorizontalDockPos = 0;
  3. Remove the control bar of the form, you'll create control button by yourself (if required):
    Set the "FormBorderStyle" property to "None"
  4. Create a panel that takes all the space inside the form(I called it DarkPanel)
  5. Define the following DarkPanel event:
    DarkPanel_MouseUp
    DarkPanel_MouseDown
    DarkPanel_MouseMove
  6. Here's the code that glue everything together:

    private void DarkPanel_MouseDown(object sender,
    System.Windows.Forms.MouseEventArgs e)
    {
    StartMoving();
    }

    privatevoid DarkPanel_MouseUp(object sender, System.Windows.Forms.MouseEventArgs e)
    {
    StopMoving();
    }

    private void DarkPanel_MouseMove(object sender,
    System.Windows.Forms.MouseEventArgs e)
    {
    MoveForm();
    }

    private void StopMoving()
    {
    m_Moving = false;
    }

    private void StartMoving()
    {
    m_Moving = true;
    m_PosX = Cursor.Position.X;
    m_PosY= Cursor.Position.Y;
    m_VerticalDock = (NearLeftMagnet() NearRightMagnet());
    m_VerticalDockPos = m_PosX;
    m_HorizontalDock = (NearTopMagnet() NearBottomMagnet());
    m_HorizontalDockPos = m_PosY;
    }

    private void MoveForm()
    {
    if (m_Moving)
    {
    bool bInVerticalDock = m_VerticalDock;
    bool bInHorizontalDock = m_HorizontalDock;

    // Calculate new position in X
    int nDeltaX = Cursor.Position.X - m_PosX ;
    m_PosX = Cursor.Position.X;
    int nNewX = this.Left + nDeltaX;

    // Calculate new position in Y
    int nDeltaY = Cursor.Position.Y - m_PosY ;
    m_PosY = Cursor.Position.Y;
    int nNewY = this.Top + nDeltaY;

    // If the control was docked on the vertical axe, check if it can escape
    if (m_VerticalDock && Math.Abs(Cursor.Position.X - m_VerticalDockPos) > SCREEN_BORDER)
    {
    m_VerticalDock = false;
    nNewX = this.Left + Cursor.Position.X - m_VerticalDockPos;
    }
    // else, try to dock it
    else
    {
    m_VerticalDock = false;
    if (NearLeftMagnet())
    {
    nNewX = LeftDockPos();
    m_VerticalDock = true;
    }
    if
    (NearRightMagnet())
    {
    nNewX = RightDockPos();
    m_VerticalDock = true;
    }
    if (bInVerticalDock != m_VerticalDock)
    {
    m_VerticalDockPos = Cursor.Position.X;
    }
    }

    // If the control was docked on the horizontal axe, check if it can escape
    if (m_HorizontalDock && Math.Abs(Cursor.Position.Y - m_HorizontalDockPos) > SCREEN_BORDER)
    {
    m_HorizontalDock = false;
    nNewY = this.Top + Cursor.Position.Y - m_HorizontalDockPos;
    }
    // else, try to dock it
    else
    {
    m_HorizontalDock = false;
    if (NearTopMagnet())
    {
    nNewY = TopDockPos();
    m_HorizontalDock = true;
    }
    if (NearBottomMagnet())
    {
    nNewY = BottomDockPos();
    m_HorizontalDock = true;
    }
    if
    (bInHorizontalDock != m_HorizontalDock)
    {
    m_HorizontalDockPos = Cursor.Position.Y;
    }
    }

    // Move the form according to every constraints above...
    this.Location = new Point(nNewX, nNewY);
    }
    }
    private bool NearLeftMagnet()
    {
    return ((this.Left <= m_WorkLeft + SCREEN_BORDER && this.Left >= m_WorkLeft) (this.Left >= m_WorkLeft - SCREEN_BORDER && this.Left <= m_WorkLeft)); } private int LeftDockPos() { return m_WorkLeft; } private bool NearRightMagnet() { return ((this.Left >= m_WorkWidth + m_WorkLeft - this.Width - SCREEN_BORDER && this.Left <= m_WorkWidth + m_WorkLeft - this.Width) (this.Left <= m_WorkWidth + m_WorkLeft - this.Width + SCREEN_BORDER && this.Left >= m_WorkWidth + m_WorkLeft - this.Width));
    }

    private int RightDockPos()
    {
    return m_WorkWidth + m_WorkLeft - this.Width;
    }

    private bool NearTopMagnet()
    {
    return ((this.Top <= m_WorkTop + SCREEN_BORDER && this.Top >= m_WorkTop) (this.Top >= m_WorkTop - SCREEN_BORDER && this.Top <= m_WorkTop)); } private int TopDockPos() { return m_WorkTop; } private bool NearBottomMagnet() { return((this.Top >= m_WorkHeight + m_WorkTop - this.Height - SCREEN_BORDER && this.Top <= m_WorkHeight + m_WorkTop - this.Height) (this.Top <= m_WorkHeight + m_WorkTop - this.Height + SCREEN_BORDER && this.Top >= m_WorkHeight + m_WorkTop - this.Height));
    }

    private int BottomDockPos()
    {
    return m_WorkHeight + m_WorkTop - this.Height;
    }

Google' Reasons for Dutch Auction-IPO

Among programmers, the game theory is often well-known or at least ever heard-of. Funny enough, Google choosed to go for this geeky IPO style (for US resident only though).

But is it enough to motivates this kind of IPO mechanism? Surely not.

The Dutch Auction was named after a Holland way to sell flowers in public market. Now, Google sell part of its respected and Internet-users-prefered company.

It goes as follow:
  • Everyone place a secret bid.
  • The winners (and new owners of Google) are selected starting from the top bidder(s) until there is no more share for a lower bidder to enter.
  • The price the winners pay is the equivalent to the bid of the lowest bidder in.

In the game theory, this kind of auction is know to force participant to bid the highest they can afford and even more. Indeed, they want to bid high enough to win but think they'll pay less at the end.

In a conventionnal English auction, the highest bidder win and pay the full price. This time, participants are know to shade their bid. They'll never bet higher than what they can afford. Some can even go a little lower, hoping to enter last. No one want to pay twice the price of a lower bidders!

The game of shading and over-bidding is a natural phenomenon known as the Nash equilibrium strategy.

The real motivation of Google, however, may resides in the number of participants they'll attract. In a Ducth Auction, the more the bidders, the less each bidder should shade his bid.


Monday, August 09, 2004

IBM tells users not to install Windows XP update

Microsoft releases its SP2, with features like XP firewall enabled by default.
But why IBM don't want to deploy this service pack?

Here's a list of functionnalities:

  • Firewall enabled and more customizable;
  • OS was patch agains buffer overruns;
  • Some protection against malicious email attachments;
  • Better GUI when ActiveX prompt for installation;
  • Updates help files and user education center;

For the ordinary user, it can only be good.

For developers and organizations with custom softwares, it's gonna be a nightmare. At least, upcoming bugs source is known.

GUI changes and more browser security means lots of documentation to update too. Technical writers and webmaster: at your keyboard.


Sunday, August 08, 2004

Zip Zaps RC toys

I have a pejorative feeling about Radio Shack.
I can't explain why.
I mean:
you don't shop there for computers, you buy Dell;
you don't shop there for softwares, there are specialized shops and online places;
you don't shop there for electronics, you go to FutureShop...

You only go to RadioShack when you need some curiosities...

Back in 1984, the first curiosity I (my father) bought was a Tandy 1000ex computer. At that time, RadioShack WAS the place to buy a computer!

The second was the Armatron. Hours of fun.

Yesterday, I found a third curiosity.
I just didn't want to wait for long online-buy shipping time or to pay the high ThinkGeek shipping cost for a similar item.

I found the Zip Zaps RC cars.



Tuesday, August 03, 2004

Mozilla to pay bounty on bugs

The Mozilla Security Bug Bounty Program, launched yesterday [August 2nd], promises a reward of $500 to anyone who finds a "critical" security bug in Mozilla.

Monday, August 02, 2004

Automating Web Browsing

For some times, I searched how I could bypass sessions and cookies tricks and automate a web browser like if a human was browsing. This is useful for information extraction and automation of repetitive tasks like downloading all links on a page (when copyright allows it...). It poses no problem on most sites... but some jealously protect their data.

Here's how, in c#...

1- Create an application with an WebBrowser component:
in Visual Studio, the Web Browser can be added to the toolbox by right-clicking on the toolbox, and add the item "Web Browser" from COM components.

2- Navigate to a page

if your web Browser is called "axWebBrowser1":

object loc = "http://www.google.com";
object null_obj_str = "";
System.Object null_obj = 0;
axWebBrowser1.Navigate2(ref loc , ref null_obj, ref null_obj, ref
null_obj_str, ref null_obj_str);


3- Wait for this asynchrone call to be terminated:

3.1 Register the "navigate_completed" event:

axWebBrowser1.DocumentComplete +=new
AxSHDocVw.DWebBrowserEvents2_DocumentCompleteEventHandler(axWebBrowser1_DocumentComplete);

3.2 Declare the variable "bool LoadedPage;"

3.3 Add the axWebBrowser1_DocumentComplete method:

private void axWebBrowser1_DocumentComplete(object sender,
AxSHDocVw.DWebBrowserEvents2_DocumentCompleteEvent e)
{
LoadedPage = true;
}

3.4 Use this code to wait for the page to be loaded:

while (!LoadedPage) {
Application.DoEvents();
}
LoadedPage = false;


4- Get page source:

HTMLDocument myDoc = new HTMLDocumentClass();
myDoc = axWebBrowser1.Document as HTMLDocument;
string myHtmlString= myDoc.documentElement.innerHTML;

The HTMLDocument object is declared in adding a reference to the COM "Microsoft Internet Controls" and call:

using mshtml;

5- Parse page, find link you want or post a form:
This part is given as a lesson :p Seriously, it changes a lot depending on what you are automating.


Happy (automatic) navigation!

Sunday, August 01, 2004

DreamBank

DreamBank site is badly designed, the search engine is nothing but non-intuitive. However, the information is interesting (for most site, it is the opposite).

The site is about persons, from all ages, that describe their dreams.

Here's mine: I often dream that I have to write a really complex piece code. I spend all the night writing and re-writing the same lines of code, like a never ending recursion I would have to unroll by hands...

Here's what normal people dream about:

1. Chased or pursued, not injured
2. Sexual experiences
3. Falling
4. School, teachers, studying
5. Arriving too late, e.g., for a train
6. On the verge of falling
7. Trying to do something repeatedly
8. A person living as dead
9. Flying or soaring through the air
10. Sensing a presence vividly
11. Failing an examination
12. Being physically attacked
13. Being frozen with fright
14. A person now dead as living
15. Being a child again