Saturday, August 28, 2010
Wednesday, July 21, 2010
Step by step instructions for android on hd2
I've just got a very detail instruction to get android working on HTC HD2.
HSPL How To
Via: http://forum.xda-developers.com/showthread.php?p=7108995#post7108995
STEP BY STEP INSTRUCTIONS FOR TESTING ANDROID ON HD2Dual boot android and win mobile
1) Download an Android build (with or without sense user interface) (e.g. from gamesquare.co.uk)
2) Extract the contents to the ROOT of your sd card (Preferably format the card beforehand)
3) Launch any file manager from within windows mobile.
4) Launch haret.exe in the root of your sd (storage) card. Click Run (Preferably just after a soft reset)
Thats it!
Important Notes:
YOU WILL GET A BLACK/BLANK SCREEN (Linux text will disappear) if you don't have 2.xx.50.xx radio rom version. (2.xx.51.xx will not work)
Yes 51 radio versions are european and 50 radio versions are US, BUT 50 radio WILL WORK with your european HD2. In any case, you can always go back to your original radio. (Write down your version beforehand. You can get the info from HTC startup screen or from settings - phone information - software information
You don't need HSPL for linux boot. But you need HSPL if you need to change your radio to a 50 version. Your phone comes with original SPL only.
STEPS ONLY IF YOU GET BLACK SCREEN:
The following information is ONLY needed if your linux doesn't boot and freezes with black screen and you want to change your radio to a linux compatible one.
1) Get HSPL3 from: forum.xda-developers.com/showpost.php?p=6891358&postcount=1893 (Only if you don't have HSPL, if you don't know, then you don't have HSPL)
2) Get a 2.xx.50.xx radio rom from: forum.xda-developers.com/showthread.php?t=611787 (2.10.50.xx is fine)
3) Get Custom RUU from: forum.xda-developers.com/showpost.php?p=4798017&postcount=1
4) Install HSPL(connect your phone in activesync mode via usb cable)
5) Install 2.xx.50.xx radio via customruu. Don't worry about what CustomRUU says, you will not lose settings and data. (It won't hard reset when upgrading only the Radio ROM)
Thats it! Now you can run haret and boot android
PLEASE COPY PASTE THE LINKS BECAUSE I AM NOT ALLOWED TO POST LINKS.
HSPL How To
Via: http://forum.xda-developers.com/showthread.php?p=7108995#post7108995
Thursday, July 8, 2010
PDF libraries
http://www.pdfsharp.net/MainPage.ashx
http://www.pdfsharp.com/PDFsharp/index.php?option=com_content&task=view&id=12&Itemid=40
http://csharp-source.net/open-source/pdf-libraries
http://sourceforge.net/projects/itextsharp/
http://www.pdfsharp.com/PDFsharp/index.php?option=com_content&task=view&id=12&Itemid=40
http://csharp-source.net/open-source/pdf-libraries
http://sourceforge.net/projects/itextsharp/
Monday, July 5, 2010
Implement MultiTouch Behavior in Window Phone 7
There are two video demonstrate the implementation MultiTouch Behavior in Window Phone 7 by Microsoft MVP Laurent Bugnion, an author of Silverlight 4 Unleashed.
Here, quote from Laurent:
I just published two videos on Vimeo (see the embedded videos at the end of this post)
* One is a short video showing the highlights of the MultiTouch Behavior I have been working on. It shows what gestures are available, and how easy it is to add it to a Windows Phone 7 application.
* The other is a detailed 15’ video that explains exactly how the behavior can be used.
I am still polishing a few things up and should be ready to release V1 on Codeplex very soon.
* Scale, Rotate, Translate are supported.
* Possibility to show markers on the screen for demos/projections/videos.
* Debug mode with addition on-screen information.
* “Mock” mode for development without multitouch screen. Simulate fingers with just one mouse.
* Enable/disable Scale, Rotate, Translate X and Y individually.
* Constrain Scale with minimum and maximum value.
Not supported (but in the plan) are:
* Multiple elements: Right now, the gestures can only apply to one element on the screen.
* Friction/inertia.
* Constraining the element to the screen.
I will post more info as we progress. Stay tuned to this blog (“touch” tag), on my website http://www.galasoft.ch/touch or on Twitter (@LBugnion).
Credits
I want to thank Pete Blois (from the Microsoft Expression Blend team) for his help and some of the multitouch code, and the kind permission to open source it.
Also heartful thanks to Davide Zordan for starting this project on Codeplex and for the inspiration.
The first video is a demonstration of his MultiTouch behavior implemented in a demo applications:
The second video is a 15mins long tutorial showing you how to implement it in your application:
Source: Laurent Bugnion, mobiletechworld
Here, quote from Laurent:
I just published two videos on Vimeo (see the embedded videos at the end of this post)
* One is a short video showing the highlights of the MultiTouch Behavior I have been working on. It shows what gestures are available, and how easy it is to add it to a Windows Phone 7 application.
* The other is a detailed 15’ video that explains exactly how the behavior can be used.
I am still polishing a few things up and should be ready to release V1 on Codeplex very soon.
Features:
* Scale, Rotate, Translate are supported.
* Possibility to show markers on the screen for demos/projections/videos.
* Debug mode with addition on-screen information.
* “Mock” mode for development without multitouch screen. Simulate fingers with just one mouse.
* Enable/disable Scale, Rotate, Translate X and Y individually.
* Constrain Scale with minimum and maximum value.
Future plans:
Not supported (but in the plan) are:
* Multiple elements: Right now, the gestures can only apply to one element on the screen.
* Friction/inertia.
* Constraining the element to the screen.
More info
I will post more info as we progress. Stay tuned to this blog (“touch” tag), on my website http://www.galasoft.ch/touch or on Twitter (@LBugnion).
Credits
I want to thank Pete Blois (from the Microsoft Expression Blend team) for his help and some of the multitouch code, and the kind permission to open source it.
Also heartful thanks to Davide Zordan for starting this project on Codeplex and for the inspiration.
The Videos
The first video is a demonstration of his MultiTouch behavior implemented in a demo applications:
The second video is a 15mins long tutorial showing you how to implement it in your application:
Source: Laurent Bugnion, mobiletechworld
Tuesday, June 29, 2010
Learn Silverlight and Expression Blend in 5 days
Learn how to design and develop innovative user interfaces for Window Phone 7,..using Expression Blend 4.0
Head over: Learn Silverlight and Expression Blend in 5 days
Wednesday, June 23, 2010
Windows Phone 7 Design Resources
Windows Phone 7 Design Resources
I've just got good resources from:
davidcrow on June 21, 2010
davidcrow on June 21, 2010
Tools
- Expression Studio 4
- Blend 4 for Windows Phone
- Visual Studio 2010 & Developer Tools
- GIT Extensions for Visual Studio
Training Materials
- Using SketchFlow to Prototype for Windows Phone
- Prototyping RIAs in Silverlight with Expression SketchFlow
- Windows Phone 7 Developer Training Kit
- Expression Blend for WP7
- Windows Phone 7 Designing, Building & Deploying Tutorials (12 step tutorial)
UX Guidelines & Tools
- UX Guidelines for WP7
- Windows Phone 7 Design Template (CS4 PSD)
- Clarity Consulting’s WP7 Design Blog
Panorama Navigation
- Building a Windows Phone Panorama Control
- Panoramic Navigation on Windows Phone 7 with No Code
- Panorama and Pivot controls for Windows Phone 7
- WP7 Panorama Sample code
Icons
Tuesday, June 15, 2010
Working with Excel in .Net
There are two ways of reading and writing Excel. However, there are some differences between each of them. Sometime i found this helpful but sometime the other is better, so let me try to illustrate two ways in reading Excel file and their pros and cons.
- Use ADO.NET to Retrieve and Modify Records in an Excel Workbook
- Pros:
- Easy to use with ADO.net objects
- Easy in loading data into Dataset or Datable, Once we have a Datable, we can use Select method to filtering data.
- Easy in querying data by using SQL Select Statement
- Easy inserting or modifying data by using DataAdapter with SQL Insert and Update statement.
- Cons:
- Provide only basic features with basic purpose (Retrieve and Modify data only)
- Not able to format Excel Cell or Range
- There is a bug when writing or modifying data in Text type. Text value will be preceded by a single quote (').
- In some cases, it cannot read the value of some Cells. It always retrieve Null value, but in fact, the value do exist in the Cells (It happens mostly in formatted Cells)
- Not flexible regarding to Table Name. It's required to know Excel's SheetName as TableName to query from.
- Connection string:
- Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:\Book1.xls;Extended Properties="Excel 8.0;HDR=YES;"
- Excel 8.0 work for Microsoft Excel 8.0 (97), 9.0 (2000), 10.0 (2002) and also 11.0 (2003)
- Provider=Microsoft.ACE.OLEDB.12.0;Data Source=c:\myFolder\myOldExcelFile.xls;Extended Properties="Excel 12.0;HDR=YES";
- Excel 97-2007 Xls files with ACE OLEDB 12.0, this connection string to use the Office 2007 OLEDB driver
- Note:
The quota " in the string needs to be escaped using your language specific escape syntax.
c#, c++ \"
VB6, VBScript ""
xml (web.config etc) "
or maybe use a single quota '.
"HDR=Yes;" indicates that the first row contains columnnames, not data. "HDR=No;" indicates the opposite.
"IMEX=1;" tells the driver to always read "intermixed" (numbers, dates, strings etc) data columns as text. Note that this option might affect excel sheet write access negative. - Table Naming Conventions
There are several ways you can reference a table (or range) in an Excel workbook: - Use the sheet name followed by a dollar sign (for example, [Sheet1$] or [My Worksheet$]). A workbook table that is referenced in this manner includes the whole used range of the worksheet.
Select * from [Sheet1$] - Use a range with a defined name (for example, [MyNamedRange]):
Select * from [MyNamedRange] - Use a range with a specific address (for example, [Sheet1$A1:B10]):
Select * from [Sheet1$A1:B10] - Add and Update Records
- Directly run a command to insert or update records: To do this, you can create an OLEDbCommand object on your connection and set its CommandText property to a valid command to insert records:
- INSERT INTO [Sheet1$] (F1, F2) values ('111', 'ABC')
- UPDATE [Sheet1$] SET F2 = 'XYZ' WHERE F1 = '111'
- Make Changes In Dataset/Datable and Use OleDbDataAdapter:
- Set OleDbDataAdapter's InsertCommand to: INSERT INTO [Sheet1$] (F1, F2) values (?, ?)
- Set OleDbDataAdapter's UpdateCommand to: UPDATE [Sheet1$] SET F2 = ? WHERE F1 = ?
- Export data from another data source into an Excel workbook
- Use OLEDbCommand object, set CommandText property to: INSERT INTO [Sheet1$] IN 'C:\Book1.xls' 'Excel 8.0;' SELECT * FROM MyTable" or SELECT * INTO [Excel 8.0;Database=C:\Book1.xls].[Sheet1] FROM [MyTable]
- Create Workbooks and Tables
- To create a table in an Excel workbook, run the CREATE TABLE command:
- CREATE Tjavascript:void(0)ABLE Sheet1 (F1 char(255), F2 char(255))
- Sample Code
- Extra Source Code:
- Get Excel SheetName:
- Using Excel Object Library
Private m_sConn1 As String = "Provider=Microsoft.Jet.OLEDB.4.0;" & _ "Data Source=C:\ExcelData1.xls;" & _ "Extended Properties=""Excel 8.0;HDR=YES""" Private m_sConn2 As String = "Provider=Microsoft.Jet.OLEDB.4.0;" & _ "Data Source=C:\ExcelData2.xls;" & _ "Extended Properties=""Excel 8.0;HDR=YES""" Private m_sNorthwind = _ "C:\Program Files\Microsoft Office\Office10\Samples\Northwind.mdb" Private m_sAction As String Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load RadioButton1.Text = "Create_Workbook" RadioButton2.Text = "Retrieve_Records" RadioButton3.Text = "Add_Records" RadioButton4.Text = "Update_Records" RadioButton5.Text = "Update_Individual_Cells" RadioButton6.Text = "Use_External_Source" Button1.Text = "Go!" End Sub Private Sub RadioButtons_Click(ByVal sender As Object, ByVal e As System.EventArgs) _ Handles RadioButton1.Click, RadioButton2.Click, RadioButton3.Click, _ RadioButton4.Click, RadioButton5.Click, RadioButton6.Click m_sAction = sender.Text'Store the text for the selected radio button End Sub Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click Try ' Call the associated routine to add/update/modify the workbook. Select Case m_sAction Case "Create_Workbook" : Create_Workbook() Case "Retrieve_Records" : Retrieve_Records() Case "Add_Records" : Add_Records() Case "Update_Records" : Update_Records() Case "Update_Individual_Cells" : Update_Individual_Cells() Case "Use_External_Source" : Use_External_Source() End Select Catch ex As OleDbException Dim er As OleDbError For Each er In ex.Errors MsgBox(er.Message) Next Catch ex2 As System.InvalidOperationException MsgBox(ex2.Message) End Try End Sub Public Sub Create_Workbook() ' If the workbooks already exist, prompt to delete. Dim answer As MsgBoxResult If Dir("C:\ExcelData1.xls") <> "" Or Dir("C:\ExcelData2.xls") <> "" Then answer = MsgBox("Delete existing workbooks (C:\ExcelData1.xls and " & _ "C:\ExcelData2.xls)?", MsgBoxStyle.YesNo) If answer = MsgBoxResult.Yes Then If Dir("C:\ExcelData1.xls") <> "" Then Kill("C:\ExcelData1.xls") If Dir("C:\ExcelData2.xls") <> "" Then Kill("C:\ExcelData2.xls") Else Exit Sub End If End If '========================================================================== ' Create a workbook with a table named EmployeeData. The table has 3 ' fields: ID (char 255), Name (char 255) and Birthdate (date). '========================================================================== Dim conn As New OleDbConnection() conn.ConnectionString = m_sConn1 conn.Open() Dim cmd1 As New OleDbCommand() cmd1.Connection = conn cmd1.CommandText = "CREATE TABLE EmployeeData (Id char(255), Name char(255), BirthDate date)" cmd1.ExecuteNonQuery() cmd1.CommandText = "INSERT INTO EmployeeData (Id, Name, BirthDate) values ('AAA', 'Andrew', '12/4/1955')" cmd1.ExecuteNonQuery() conn.Close() '========================================================================== ' Create a workbook with a table named InventoryData. The table has 3 ' fields: Product (char 255), Qty (float) and Price (currency). '========================================================================== conn.ConnectionString = m_sConn2 conn.Open() Dim cmd2 As New OleDbCommand() cmd2.Connection = conn cmd2.CommandText = "CREATE TABLE InventoryData (Product char(255), Qty float, Price currency)" cmd2.ExecuteNonQuery() cmd2.CommandText = "INSERT INTO InventoryData (Product, Qty, Price) values ('Cola', 200, 1.35)" cmd2.ExecuteNonQuery() cmd2.CommandText = "INSERT INTO InventoryData (Product, Qty, Price) values ('Chips', 550, 0.89)" cmd2.ExecuteNonQuery() conn.Close() ' NOTE: You can ALTER and DROP tables in a similar fashion. End Sub Public Sub Retrieve_Records() '========================================================== 'Use a DataReader to read data from the EmployeeData table. '========================================================== Dim conn1 As New System.Data.OleDb.OleDbConnection(m_sConn1) conn1.Open() Dim cmd1 As New System.Data.OleDb.OleDbCommand("Select * From [EmployeeData$]", conn1) Dim rdr As OleDbDataReader = cmd1.ExecuteReader Debug.WriteLine(vbCrLf & "EmployeeData:" & vbCrLf & "=============") Do While rdr.Read() Debug.WriteLine(System.String.Format("{0,-10}{1, -15}{2}", _ rdr.GetString(0), rdr.GetString(1), _ rdr.GetDateTime(2).ToString("d"))) Loop rdr.Close() conn1.Close() '======================================================== 'Use a DataSet to read data from the InventoryData table. '======================================================== Dim conn2 As New OleDbConnection(m_sConn2) Dim da As New OleDbDataAdapter("Select * From [InventoryData$]", conn2) Dim ds As DataSet = New DataSet() da.Fill(ds) Debug.WriteLine(vbCrLf & "InventoryData:" & vbCrLf & "==============") Dim dr As DataRow For Each dr In ds.Tables(0).Rows'Show results in output window Debug.WriteLine(System.String.Format("{0,-15}{1, -6}{2}", _ dr("Product"), dr("Qty"), dr("Price"))) Next conn2.Close() End Sub Public Sub Add_Records() '========================================================================== ' Run an INSERT INTO command to add new records to the workbook. '========================================================================== Dim conn1 As New System.Data.OleDb.OleDbConnection(m_sConn1) conn1.Open() Dim cmd As New System.Data.OleDb.OleDbCommand() cmd.Connection = conn1 cmd.CommandText = "INSERT INTO [EmployeeData$] (ID, Name, BirthDate) values ('CCC', 'Charlie', '10/14/48')" cmd.ExecuteNonQuery() cmd.CommandText = "INSERT INTO [EmployeeData$] (ID, Name, BirthDate) values ('DDD', 'Deloris', '7/19/98')" cmd.ExecuteNonQuery() conn1.Close() '==================================================================== 'Use the InsertCommand object to add new records to the InventoryData 'table. '==================================================================== Dim conn2 As New OleDbConnection(m_sConn2) Dim da As New OleDbDataAdapter("Select * From [InventoryData$]", conn2) Dim ds As DataSet = New DataSet() da.Fill(ds, "MyExcelTable") ' Generate the InsertCommand and add the parameters for the command. da.InsertCommand = New OleDbCommand( _ "INSERT INTO [InventoryData$] (Product, Qty, Price) VALUES (?, ?, ?)", conn2) da.InsertCommand.Parameters.Add("@Product", OleDbType.VarChar, 255, "Product") da.InsertCommand.Parameters.Add("@Qty", OleDbType.Double).SourceColumn = "Qty" da.InsertCommand.Parameters.Add("@Price", OleDbType.Currency).SourceColumn = "Price" ' Add two new records to the dataset. Dim dr As DataRow dr = ds.Tables(0).NewRow dr("Product") = "Bread" : dr("Qty") = 390 : dr("Price") = 1.89 : ds.Tables(0).Rows.Add(dr) dr = ds.Tables(0).NewRow dr("Product") = "Milk" : dr("Qty") = 99 : dr("Price") = 2.59 : ds.Tables(0).Rows.Add(dr) ' Apply the dataset changes to the actual data source (the workbook). da.Update(ds, "MyExcelTable") conn2.Close() End Sub Public Sub Update_Records() '========================================================================== ' Run an UPDATE command to change a record in the EmployeeData ' table. '========================================================================== Dim conn1 As New System.Data.OleDb.OleDbConnection(m_sConn1) conn1.Open() Dim cmd As New System.Data.OleDb.OleDbCommand() cmd.Connection = conn1 cmd.CommandText = "UPDATE [EmployeeData$] " & _ "SET NAME = 'Aaron', BirthDate = '5/4/1975' WHERE ID = 'AAA'" cmd.ExecuteNonQuery() conn1.Close() '==================================================================== ' Use the UpdateCommand object to modify records in the InventoryData ' table. '==================================================================== Dim conn2 As New OleDbConnection(m_sConn2) Dim da As New OleDbDataAdapter("Select * From [InventoryData$]", conn2) Dim ds As DataSet = New DataSet() da.Fill(ds, "MyInventoryTable") ' Generate the UpdateCommand and add the parameters for the command. da.UpdateCommand = New OleDbCommand( _ "UPDATE [InventoryData$] SET Qty = ?, Price=? WHERE Product = ?", conn2) da.UpdateCommand.Parameters.Add("@Qty", OleDbType.Numeric).SourceColumn = "Qty" da.UpdateCommand.Parameters.Add("@Price", OleDbType.Currency).SourceColumn = "Price" da.UpdateCommand.Parameters.Add("@Product", OleDbType.VarChar, 255, "Product") ' Update the first two records. ds.Tables(0).Rows(0)("Qty") = 1000 ds.Tables(0).Rows(0)("Price") = 10.1 ds.Tables(0).Rows(1)("Qty") = 2000 ds.Tables(0).Rows(1)("Price") = 20.2 ' Apply the dataset changes to the actual data source (the workbook). da.Update(ds, "MyInventoryTable") conn2.Close() End Sub Public Sub Update_Individual_Cells() '========================================================================== ' Update individual cells on the EmployeeData worksheet; ' specifically, cells F3, G3, and I4 are modified. '========================================================================== ' NOTE: The connection string indicates that the table does *NOT* ' have a header row. Dim conn As New System.Data.OleDb.OleDbConnection(m_sConn1.Replace("HDR=YES", "HDR=NO")) conn.Open() Dim cmd As New System.Data.OleDb.OleDbCommand() cmd.Connection = conn cmd.CommandText = "UPDATE [EmployeeData$F3:G3] SET F1 = 'Cell F3', F2 = 'Cell G3'" cmd.ExecuteNonQuery() cmd.CommandText = "UPDATE [EmployeeData$I4:I4] SET F1 = 'Cell I4'" cmd.ExecuteNonQuery() conn.Close() End Sub Public Sub Use_External_Source() ' Open a connection to the sample Northwind Access database. Dim conn As New System.Data.OleDb.OleDbConnection( _ "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & m_sNorthwind & ";") conn.Open() Dim cmd As New System.Data.OleDb.OleDbCommand() cmd.Connection = conn '======================================================================= ' Run an INSERT..INTO command on the Northwind database to append ' the records from a table/query to an existing table in the Excel ' workbook. '======================================================================= cmd.CommandText = "INSERT INTO [EmployeeData$] IN 'C:\ExcelData1.xls' 'Excel 8.0;'" & _ "SELECT EmployeeID AS ID, FirstName AS Name, BirthDate FROM Employees" cmd.ExecuteNonQuery() '========================================================================== ' Run a SELECT..INTO command on the Northwind database to insert ' all the records from a table/query into a new sheet in the Excel ' workbook. '========================================================================== cmd.CommandText = "SELECT * INTO [Excel 8.0;Database=C:\ExcelData2.xls].[ProductSales]" & _ "FROM [Product Sales for 1997]" cmd.ExecuteNonQuery() conn.Close() End Sub
private String[] GetExcelSheetNames(string excelFile) { OleDbConnection objConn = null; System.Data.DataTable dt = null; try { // Connection String. Change the excel file to the file you // will search. String connString = "Provider=Microsoft.Jet.OLEDB.4.0;" + "Data Source=" + excelFile + ";Extended Properties=Excel 8.0;"; // Create connection object by using the preceding connection string. objConn = new OleDbConnection(connString); // Open connection with the database. objConn.Open(); // Get the data table containg the schema guid. dt = objConn.GetOleDbSchemaTable(OleDbSchemaGuid.Tables, null); if(dt == null) { return null; } String[] excelSheets = new String[dt.Rows.Count]; int i = 0; // Add the sheet name to the string array. foreach(DataRow row in dt.Rows) { excelSheets[i] = row["TABLE_NAME"].ToString(); i++; } // Loop through all of the sheets if you want too... for(int j=0; j < excelSheets.Length; j++) { // Query each excel sheet. } return excelSheets; } catch(Exception ex) { return null; } finally { // Clean up. if(objConn != null) { objConn.Close(); objConn.Dispose(); } if(dt != null) { dt.Dispose(); } } } References: http://support.microsoft.com/kb/316934
http://www.connectionstrings.com/excel
Tuesday, June 8, 2010
Import Textfile(.txt) to an existing excel file
The following uses ADO.NET to import into an existing Excel Worksheet named ReportSheet. The source
text file is ReportFile.txt.
Function ImportTextToExcel() As Boolean
Dim ExcelConnection As New
System.Data.OleDb.OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0;" & _
"Data Source=e:\My Documents\Book20.xls;Extended Properties=""Excel 8.0;HDR=NO;""")
ExcelConnection.Open()
Dim ImportCommand As New System.Data.OleDb.OleDbCommand("INSERT INTO [ReportSheet] (F1, F2,
F3, F4, F5, F6, F7, F8, F9, F10) SELECT * FROM [Text;HDR=NO;DATABASE=E:\My
Documents\TextFiles].[ReportFile.txt]", ExcelConnection)
ImportCommand.ExecuteNonQuery()
ExcelConnection.Close()
End Function
text file is ReportFile.txt.
Function ImportTextToExcel() As Boolean
Dim ExcelConnection As New
System.Data.OleDb.OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0;" & _
"Data Source=e:\My Documents\Book20.xls;Extended Properties=""Excel 8.0;HDR=NO;""")
ExcelConnection.Open()
Dim ImportCommand As New System.Data.OleDb.OleDbCommand("INSERT INTO [ReportSheet] (F1, F2,
F3, F4, F5, F6, F7, F8, F9, F10) SELECT * FROM [Text;HDR=NO;DATABASE=E:\My
Documents\TextFiles].[ReportFile.txt]", ExcelConnection)
ImportCommand.ExecuteNonQuery()
ExcelConnection.Close()
End Function
Another contest of Window Phone 7
Got a great idea for an app, but no programming skills? Microsoft has a new contest going on where you can send them some great application ideas... Then everyone else votes on which application sounds the best. Whomever wins gets their application built and made available for free on the Windows Phone 7 Marketplace. You also get $5000 and a Windows Phone 7 device. For more information and to enter, visit WindowsPhone7.com/INeedThisApp/
I've already entered one of my ideas. What do you think? Feel free to vote for it, even though it's highly unlikely that Microsoft would even be able to build that one by December.
I've already entered one of my ideas. What do you think? Feel free to vote for it, even though it's highly unlikely that Microsoft would even be able to build that one by December.
Friday, April 2, 2010
Develop games on the Window Phone 7 Series
Want to develop game on Window Phone 7 Series? Quick! Quick! Be the first of all to get yourself around the new OS. Guys from channel9 have created a tutorial on how to create game running on the platform.
Here is the table of content:
Overview
Exercise 1: XNA Games on the Windows Phone 7 Series
o Task 1 – Game Basics
o Task 2 – Game Resources
o Task 3 – Game Loop
o Task 4 – Game Input
o Task 5 – Alien Game Logic
Summary
There is also Window Phone Series "Rockstar" Awards will be given away to the developer team who win the competition range from first prize to third prize.
Award Finalists receive:
* First Prize: $8,000 USD, a trip to the Worldwide Finals in Warsaw, Poland from July 3-8, 2010, and a Windows Phone for each team member.
* Second Prize: $4,000 USD and a Windows Phone for each team member
* Third Prize: $3,000 USD and a Windows Phone for each team member
Deadline for application entry: May 24, 2010 at 11:59 P.M. GMT.
Detail info and how to register: go to here
Let me know if you are interested. I am thinking to build a team for this competition.
Here is the table of content:
Overview
Exercise 1: XNA Games on the Windows Phone 7 Series
o Task 1 – Game Basics
o Task 2 – Game Resources
o Task 3 – Game Loop
o Task 4 – Game Input
o Task 5 – Alien Game Logic
Summary
There is also Window Phone Series "Rockstar" Awards will be given away to the developer team who win the competition range from first prize to third prize.
Award Finalists receive:
* First Prize: $8,000 USD, a trip to the Worldwide Finals in Warsaw, Poland from July 3-8, 2010, and a Windows Phone for each team member.
* Second Prize: $4,000 USD and a Windows Phone for each team member
* Third Prize: $3,000 USD and a Windows Phone for each team member
Deadline for application entry: May 24, 2010 at 11:59 P.M. GMT.
Detail info and how to register: go to here
Let me know if you are interested. I am thinking to build a team for this competition.
Wednesday, March 24, 2010
Count total number of pages in pdf file (C#)
It is actually a simple solution to get a total number of pages in pdf file. I found it from devasp and I think it's worth to share.
using System.IO;
using System.Text.RegularExpressions;
public static int GetNoOfPagesPDF(string FileName)
{
int result = 0;
FileStream fs = new FileStream(FileName, FileMode.Open, FileAccess.Read);
StreamReader r = new StreamReader(fs);
string pdfText = r.ReadToEnd();
System.Text.RegularExpressions.Regex regx = new Regex(@"/Type\s*/Page[^s]");
System.Text.RegularExpressions.MatchCollection matches = regx.Matches(pdfText);
result = matches.Count;
return result;
}
using System.IO;
using System.Text.RegularExpressions;
public static int GetNoOfPagesPDF(string FileName)
{
int result = 0;
FileStream fs = new FileStream(FileName, FileMode.Open, FileAccess.Read);
StreamReader r = new StreamReader(fs);
string pdfText = r.ReadToEnd();
System.Text.RegularExpressions.Regex regx = new Regex(@"/Type\s*/Page[^s]");
System.Text.RegularExpressions.MatchCollection matches = regx.Matches(pdfText);
result = matches.Count;
return result;
}
Tuesday, March 16, 2010
Window Phone 7 Series Development Tools
In this Mix10 event, Microsoft has released a set of development tools for Window Phone 7 Series.
The Windows Phone Developer Tools CTP includes the following
Visual Studio 2010 Express for Windows Phone CTP
Windows Phone Emulator CTP
Silverlight for Windows Phone CTP
XNA 4.0 Game Studio CTP
Download here
The Windows Phone Developer Tools CTP includes the following
Visual Studio 2010 Express for Windows Phone CTP
Windows Phone Emulator CTP
Silverlight for Windows Phone CTP
XNA 4.0 Game Studio CTP
Download here
Friday, March 12, 2010
Android on HTC Window Mobile Phone
The XDAndroid project, Android Mobile OS for Window Mobile-Based HTC devices, has progressed tremendously and has archived many great performances for lots of Window-Mobile-Based devices to work with Android platform (sorry for HTC-HD2 users. Base on my understanding no any Android version working on HTC HD2 yet because of device driver issue). In the previous release, not many components worked, but in the recent release guys from pocketnow has tested with HTC touch pro and it works with call, sms, data.
Checkout the following links to get Android platform installed on your specific device.
Android on HTC Windows Phones:
• Touch Pro2 (GSM)
• Touch Pro2 (CDMA - must take SIM card out)
• Touch Diamond2/Pure
• Touch HD
• Touch Pro/Fuze (GSM)
• Touch Pro (CDMA)
• Touch Diamond (GSM)
• Touch Diamond (CDMA)
Via: pocketnow
Checkout the following links to get Android platform installed on your specific device.
Android on HTC Windows Phones:
• Touch Pro2 (GSM)
• Touch Pro2 (CDMA - must take SIM card out)
• Touch Diamond2/Pure
• Touch HD
• Touch Pro/Fuze (GSM)
• Touch Pro (CDMA)
• Touch Diamond (GSM)
• Touch Diamond (CDMA)
Via: pocketnow
Wednesday, March 10, 2010
Android Development Kits Hits Several New Update
At the same time of the announcement of Window Phone Series 7 which seems to rock the mobile market so much, Google Android is also working hard with its platform to bring developers realistic development features for their mobile development market.
The release of several update of development kits I believe will make the platform become more interesting to mobile companies and developers.
Below are several new update of development kit of Android in this March-2010.
- ADT 0.9.6: ADT Plugin for Eclipse hit version 0.9.6
- Android SDK, R5: The pakage include SDK Tools which provide developer the Development and Debugging Tools. If you are using the old version of SDK tools and want to upgrade to the new version, no need to download the whole SDK package again. You can just update the SDK tools by using the Android SDK and AVD Manager (via Eclipse or run "SDK Setup.exe" under SDK package folder)
- Android NDK,r3: Known as Android Native Development Kit currently hit Revision 3, bring new support for OpenGL ES 2.0 native library, will bring a new generation of fantastic 2D and 3D games like what we've seen in IPhone. NDK is used conjunction with Android SDK which mean we need to have Android SDK installed and you will likely use C/C++ language for coding.
Read more: http://developer.android.com
The release of several update of development kits I believe will make the platform become more interesting to mobile companies and developers.
Below are several new update of development kit of Android in this March-2010.
- ADT 0.9.6: ADT Plugin for Eclipse hit version 0.9.6
- Android SDK, R5: The pakage include SDK Tools which provide developer the Development and Debugging Tools. If you are using the old version of SDK tools and want to upgrade to the new version, no need to download the whole SDK package again. You can just update the SDK tools by using the Android SDK and AVD Manager (via Eclipse or run "SDK Setup.exe" under SDK package folder)
- Android NDK,r3: Known as Android Native Development Kit currently hit Revision 3, bring new support for OpenGL ES 2.0 native library, will bring a new generation of fantastic 2D and 3D games like what we've seen in IPhone. NDK is used conjunction with Android SDK which mean we need to have Android SDK installed and you will likely use C/C++ language for coding.
Read more: http://developer.android.com
Tuesday, March 2, 2010
Regular Expression Examples
Regex to get Class Name from CSS content:
Regex: \.[-]?[_a-zA-Z][_a-zA-Z0-9-]*|[^\0-\177]*\\[0-9a-f]{1,6}(\r\n[ \n\r\t\f])?|\\[^\n\r\f0-9a-f]*
Input:
.center {text-align: center;}
.smcap {font-variant: small-caps;}
.u {text-decoration: underline;}
#body { ...}
Output:
.center
.smcap
.u
Regex to get all element from CSS content:
Regex: \.[-]?[_a-zA-Z][_a-zA-Z0-9-]*|[^\0-\177]*\\[0-9a-f]{1,6}(\r\n[ \n\r\t\f])?|\\[^\n\r\f0-9a-f]*
Input:
.center {text-align: center;}
.smcap {font-variant: small-caps;}
.u {text-decoration: underline;}
#body { ...}
div.test div.yoyo {...}
Output:
.center
.smcap
.u
#body
div.test div.yoyo
Regex to get HTML element and its content
Regex:
<span\b[^>]*>(.*?)</span>
(wrong in case this: onetwoone).
and
<span\b[^>]*>(?:(?=([^<]+))\1|<(?!table\b[^>]*>))*?</span>
Input:
<p><span><a name="bookmark1" />dirt farmer's son</span></p>
Output:
<span><a name="bookmark1" />dirt farmer's son</span>
Regex: \.[-]?[_a-zA-Z][_a-zA-Z0-9-]*|[^\0-\177]*\\[0-9a-f]{1,6}(\r\n[ \n\r\t\f])?|\\[^\n\r\f0-9a-f]*
Input:
.center {text-align: center;}
.smcap {font-variant: small-caps;}
.u {text-decoration: underline;}
#body { ...}
Output:
.center
.smcap
.u
Regex to get all element from CSS content:
Regex: \.[-]?[_a-zA-Z][_a-zA-Z0-9-]*|[^\0-\177]*\\[0-9a-f]{1,6}(\r\n[ \n\r\t\f])?|\\[^\n\r\f0-9a-f]*
Input:
.center {text-align: center;}
.smcap {font-variant: small-caps;}
.u {text-decoration: underline;}
#body { ...}
div.test div.yoyo {...}
Output:
.center
.smcap
.u
#body
div.test div.yoyo
Regex to get HTML element and its content
Regex:
<span\b[^>]*>(.*?)</span>
(wrong in case this: onetwoone).
and
<span\b[^>]*>(?:(?=([^<]+))\1|<(?!table\b[^>]*>))*?</span>
Input:
<p><span><a name="bookmark1" />dirt farmer's son</span></p>
Output:
<span><a name="bookmark1" />dirt farmer's son</span>
Monday, February 22, 2010
Cross browser object check
HTML
<input type="button" onclick="handleViewHTMLContent(event);" id="button1" value="View Content" style="float: right;">
<input type="button" onclick="handleViewHTMLContent(event);" id="button2" value="View Content" style="float: right;">
Javascript
...
function handleViewHTMLContent(event) {
var button = event.srcElement || event.currentTarget; //IE : Firefox
alert(button.id);
}
<input type="button" onclick="handleViewHTMLContent(event);" id="button1" value="View Content" style="float: right;">
<input type="button" onclick="handleViewHTMLContent(event);" id="button2" value="View Content" style="float: right;">
Javascript
...
function handleViewHTMLContent(event) {
var button = event.srcElement || event.currentTarget; //IE : Firefox
alert(button.id);
}
Subscribe to:
Posts (Atom)