Sunday, March 25, 2007

Ajax.NET - A free library for the Microsoft .NET Framework

http://ajax.schwarz-interactive.de/csharpsample/default.aspx

Send feedback form with Unicode chars

[Ajax.AjaxMethod]

public string Test1(string firstName, string familyName, string email, string comment)

{

string html = "";



html += "Hello " + firstName + " " + familyName + " /> html += "Thank you for your comment /> html += System.Web.HttpUtility.HtmlEncode(comment);

html += " />

return html;

}





powered by performancing firefox

Friday, March 23, 2007

Count linkid

SELECT uli.title, li.link, uli.tags, LEFT (uli.dateAdded, 20) AS dateAdded, uli.topic, uli.rating, uli.visitedRate, uli.comment, uli.linkid AS linkID, (select count(uliCount.linkid) from userlinkinfo as uliCount where uliCount.linkid = uli.linkid group by uliCount.linkid) as counter FROM userLinkInfo AS uli, linkinfo as li WHERE (uli.userid =@userid) and uli.linkid = li.linkid ORDER BY uli.dateAdded DESC





powered by performancing firefox

First reader, second reader and 1st, 2nd accessor in my FYP



Date and time manipulation in SQL

Date and time manipulation in SQL server 2000



---------------- Selecting only the date part from a datetime column --------------

/* Creating a Test Table */

Create Table MyDateTest99

(

datetime

)

go

/* Inserting the test value into the table */

insert into MyDateTest99 values (getdate())

go

/* Selecting the result */

select convert(varchar,DateColumn,108) from MyDateTest99

go

/* Performing Cleanup */

drop table MyDateTest99

go





Style ID

Style Type

0 or 100 mon dd yyyy hh:miAM (or PM)
101 mm/dd/yy
102 yy.mm.dd
103 dd/mm/yy
104 dd.mm.yy
105 dd-mm-yy
106 dd mon yy
107 Mon dd, yy
108 hh:mm:ss
9 or 109 mon dd yyyy hh:mi:ss:mmmAM (or PM)
110 mm-dd-yy
111 yy/mm/dd
112 yymmdd
13 or 113 dd mon yyyy hh:mm:ss:mmm(24h)
114 hh:mi:ss:mmm(24h)
20 or 120 yyyy-mm-dd hh:mi:ss(24h)
21 or 121 yyyy-mm-dd hh:mi:ss.mmm(24h)
126 yyyy-mm-dd Thh:mm:ss.mmm(no spaces)
130 dd mon yyyy hh:mi:ss:mmmAM
131 dd/mm/yy hh:mi:ss:mmmAM








powered by performancing firefox

Thursday, March 22, 2007

CSS, HTML, JAVASCRIPT: HIGHLIGHTING TABLE ROWS UPON MOUSE OVERS

Writing Report

After finishing the implementation on the tag association and discussed with David Lee, I think it's time to write the Final Report right now or otherwise I cannot submit to Dr Yuen for advising or seek for improvement. Here is the reply got from him today morning.





Dear Victor,





Thanks for your hardwork[really encouraging!], I have amended some wordings of your TOC
and marked each section with a suggested weight (importance), you may
treat them as a reference during writing. The revised version is
attached for your reference. Overall, the TOC is comprehensive and
well organized.





Best Regards,


Joe Yuen




powered by performancing firefox

Wednesday, March 21, 2007

Creating a Pageable, Sortable DataGrid

Summary: Learn how to build a sortable DataGrid and a pageable
DataGrid; learn the steps necessary to combine these two techniques
into creating a single sortable, pageable DataGrid. The DataGrid Web
control allows ASP.NET developers the ability to quickly and easily
display data. In addition to being able to simply display data, the
DataGrid also allows for sorting, paging, and editing of its data.
While adding sorting or paging support to the DataGrid is relatively
straightforward, creating both a pageable and sortable DataGrid is a bit more challenging. (18 printed pages)



Creating a Pageable, Sortable DataGrid



powered by performancing firefox

How to preform paging with the Datagrid Windows controled by using VB.NET

How to preform paging with the Datagrid Windows controled by using VB.NET

Reference:



SUMMARY

The DataGrid Web control has built-in Automatic or Custom Paging
functionalities; however, the DataGrid Windows control lacks these features. This article demonstrates
how to build a simple paging mechanism for the DataGrid Windows control.



The code samples in this article make
use of DataSet objects. In ADO.NET, DataSet objects are filled in a single operation and reside in memory all
of the time. If you are working with a large DataSet, this article describes how to display the data in chunks or
pages programmatically.



This technique has some limitations. Please
see the Troubleshooting section for
more information.





powered by performancing firefox

Textbox highlight all using onclick and this.select()

Thanks to Carlos's Teaching.

How to select all and highlight the pre-typed text in the TextBox for better user experiences?



By using the code in Code Behind:

this.tbSeach.Attribute.Add("onclick","this.select()");



Design view:

ID="tbSearch" Text="Input keywords..." runat="server" ForeColor="DimGray" / />







powered by performancing firefox

Tuesday, March 20, 2007

Finish the Apriori Algorithm implementation, the major part of my FYP and course in Data Mining




hhahaa
Extremely Happy!
Thanks to Sandy who teach me the way to use the debugger, which is very important on debugging my complex codes
Here are the screen shots made by me and one from the Del.icio.us, a Yahoo! company:



Need to improve the usability and expect to be finished by this Friday.

Finish the Apriori Algorithm implementation


After the previous failure on implmentating the FP-Tree algorithm, I have switched to implment the Apriori Algorithm to archive the same purpose on search related tag during searching.

The screen captured as LHS:

Really a hard time and fill extremely high when finishing the implementation. I would like to say thankyou to my classmates, Ms Sandy Tsui who teach on using the debugger in VS.NET 2005.

Friday, March 02, 2007

One speedy way to translate the C++ code into C#

Why not compile your C++ as Managed C++ and then use a decompiler (like reflector http://www.aisto.com/roeder/dotnet/) to show the code as c#, then cut+paste.



I used this technique for quite a while when I was learning c# and it gave a good insight into the differences between .NET languages.



detail

Thursday, February 22, 2007

Frequent Pattern Mining Implementations

The Apriori, DIC, Eclat and Fp-growth algorithms generate all frequent itemsets for a given minimal upport threshold. The Rules algorithm generates all association rules for a given minimal confidence threshold. They are all implemented in C++ (using the Standard Template Library). A survey of most of these methods can be found in my "Survey on Frequent Pattern Mining".



download CPP: detail





powered by performancing firefox

Use SQL to modify the FP-Tree tecniques in Tradiational Chinese

Using Unsafe Code in C#

Using Unsafe Code in C#

Compiling error:

Unsafe code may only appear if compiling with /unsafe



Solution:

In VS.NET, choose

Project - Project Property - Build - General - click "allow unsafe code"







powered by performancing firefox

Thursday, February 15, 2007

Calling an unmanaged DLL from .NET (C#)

Calling an unmanaged DLL from .NET (C sharp)

OK, so this first example is going to
show how to call an unmanaged dll from .NET (C#). There's no better way
to explain how it all fits together than by example, so first off we're
going to create an unmanaged dll in C++. The function we're exporting
from the dll would obviously be of vital importance to your business in
the real world and contain a wealth of logic, but for the sake of
simplicity let's have a void function that takes a basic struct as an
argument and does nothing more than alter the fields within it.


The header file in your project should contain the following definitions:

detail







powered by performancing firefox

Wednesday, February 14, 2007

A Tree collection - the code project - C# programming

A Tree collection - the code project - C# programming



I needed a tree collection for something or other a while back. I couldn't
find one at CP, so I decided to roll my own -- after all, how hard could it be?
2000 lines of code later... I hope you can gain from my experience, and at least
use this code as a starting point. I included everything I could think of,
including a verbose event set.






powered by performancing firefox

Sunday, February 11, 2007

Code under Free Daa Mining Course Code

Ref: http://www.kdkeys.net/forums/thread/2043.aspx

This is a release implemented with C# for the .NET Framework. It is an old release (2001 version).

DISCUSS THIS RELEASE

Please post all questions and discussions about this release here: http://www.kdkeys.net/forums/thread/1803.aspx





APRIORI ALGORITHM

--------------------------------------------------------------------------------

The APriori Data Mining Algorithm is used to create association rules from sets of items.

The algorithm finds patterns of items that are frequently associated together.



--------------------------------------------------------------------------------

Introduction :

A set of items is defined as an itemset and represents items found in a dataset. An example of a set of items is {Computers, Books, Videos, DVDs, Games}.

The datasets can be obtained from real world databases representing shopping carts, retail transactions, data warehouses, sales, orders and purchases database tables or created artificially.



This form of data mining is known as association rule data mining. Association rule data mining discovers associations among items in a dataset.

An example of association rule data mining is market based analysis. Market based analysis is a form of association rule data mining that finds associations between items that different customers purchased during their visits to a sales outlet.



The kind of associations discovered during market based analysis association rule data mining show a pattern of items that customers tend to buy together. E.g. During a market based analysis of a shopping basket one may discover an association between computer books and CDs showing perhaps that customers that buy computer books tend to buy CDs. This can lead to a strategic placement of CDs and computer books so that more CDs will be sold when computer books are purchased.

If customers tend to purchase computer books and CDs together then having a sale on books can lift and increase the sale of computers.





--------------------------------------------------------------------------------

APriori Algorithm :

The APriori algorithm is used to analyze a list of transactions for items that are frequently purchased together. Considering a transaction where the sale of software is increased by the sale of e-books, Support and Confidence are two measures used to describe market based analysis association rules created with an APriori algorithm.

E.g. a Support measure of 1% and a Confidence measure of 50% means that 1% of transactions analyzed contain purchases of e-books and software and 50% of customers who bought an e-book also bought a software.

A set of items is known as an itemset. An itemset which contains k items is known as a k-itemset. E.g. a set of items {Books, CD, DVD, Video} is a 4-itemset.

The number of transactiobns that contain an itemset is known as the Frequency or Support Count of the itemset. If the number of transactions containing an itemset satisfies the minimum support count specified then the itemset is known as a Frequent Itemset.

E.g. the 2-itemset {Books, DVD} has a support count of 5 in the database of transactions below.



The database below contains 9 transactions. Find the support count and confidence for the the 2-itemset {Books, DVD}.

Using the market based analysis apriori algorithm ceate an assocation data mining rule between {Books} and {DVD}.

Firstly the number of transactions that contain the 2-itemset {Books, DVD} is 5. The number of transactions containing the itemset {Books} is 6.

Consequently the support for the 2-itemset {Books, DVD} is (5/9) * (100%) = 55.6%

The confidence for the 2-itemset {Books, DVD} is = (Support Count({Books, DVD}) / Support Count({Books}) * (100%) .

Consequently the confidence for the 2-itemset {Books, DVD} is = ((5/6) * 100%) = 83.3%

Transaction 1: {Books, CD, DVD}

Transaction 2: {CD, Games}

Transaction 3: {CD, DVD}

Transaction 4: {Books, CD, Games}

Transaction 5: {Books, DVD}

Transaction 6: {CD, DVD}

Transaction 7: {Books, DVD}

Transaction 8: {Books, CD, DVD, Video}

Transaction 9: {Books, CD, DVD}





The APriori Algorithm basically finds the support count and confidence of itemsets eliminating those itemsets that do not meet a minimum support count and confidence measure from a final list of rules created.

Considering the list of transactions above, the algorithm will perform the following steps for a minimum support count of 3 :

The APriori algorithm creates a list of unique items in a 1-itemset Candidate Itemset corresponding to {Books, CD, DVD, Games, Video}

The support count of each item in the list above is obtained and any item that does not satisfy the minimum support count is eliminated from further analysis creating a 1-itemset Frequent Itemset

The 1-itemset frequent itemset is joined with itself to create a 2-itemset candidate itemset

The steps taken for the 1-itemset candidate itemset is repeated for the 2-itemset candidate itemset

The steps above are repeated until a frequent itemset is empty and no new candidate itemsets can be generated

A confidence measure is created for each rule generated from the frequent itemsets.





powered by performancing firefox

Friday, February 09, 2007

Yahoo! developer network

Yahoo! Search Web Services

It's may be used in the searching services.





powered by performancing firefox

ASP.NET AJAX Control Toolkit installation manuel

ASP.NET AJAX Control Toolkit installation manuel

ref:http://ajax.asp.net/ajaxtoolkit/Walkthrough/Setup.aspx





powered by performancing firefox