Mar 31, 2011

How to user subversion in visual studio with Googlecode

Request:
  • ·         Google account (Create)
  • ·         A project in Google Code (Create)
  • ·         Ankhs (download)
  • ·         Visual studio
Step 1: Create the account Google code

Figure1: Form to register a project code in Google code
Completing the form registers account project Google code. You have two version control system. I recommend choosing the “subversion” version control system.
You can chose any Source code license with is suitable with you software and remember your project will be opening source now.
Finish by click to create project.

Figure2: main controller of Google code host
Step2:   Add your partners to Google code host
         You need add your partners to you Google code host. It will be useless if you do your project alone (never do that)
         Remember your partner need to have Google account. It is Google mail account
        You will have 3 the kind of developer
  • ·         Owner: who can change this project
  • ·         Committer: who can add more but cannot edit your project(I’m not sure)
  • ·         Contributor: as non-members

Figure3: Adding partners
Step 3: Get Link SVN
Click in the tab Source/Checkout. It will show you the link svn of your Google code project

Figure 4: Link SVN of your Google code host with username is your account
Step 4: Get password your account


Figure 5: Password to use in Google code svn
Step 5: create project in visual studio (installed Ankhs)
Create new project in Visual studio (VS)

Figure 6: creating project in visual studio
Step 6: add Project to SVN Google Code
Click right in your project and choice “Add solution to subversion” if you want add all solution to Google code (first time, I recommend that) or “Add selected solution subversion” if you want to add only selected project to Google code host


Figure 7: add svn to your project
Repository URL you get the link Google give you but you need some small edit this link
EX:

You have to remove “svn checkout” at the top and remove anything after “truck/”
Your link will be:
https://demo-googlecode-svn.googlecode.com/svn/trunk/

Figure8: insert information of Google code host (svn host)
Click ok and wait configuration box. Click ok again. It will ask you to login to your svn. This time you use the
·         Username is username of the Google account.
·         Password is pass Google code gave you(remember it is NOT the password of your Google account)

Your project will be ready to use svn

Figure 9: after add svn to project
Step 7: Commit editing in project
First time, you have to commit all you project (Solution) at the first time. After the first time after you finish you work and need to upload you code to svn host you do it again.
To commit:
Click right on your project and chose “commit solution Changes”

Figure 10:

Step 8: Update editing in project
You can get new code from you partner by click to you project and choice “Update Solution to Latest Version”

(Other functions of Google code host I will update later)


Agrond                

Mar 27, 2011

Enhance Entities Relationship (EER)

What is it?
       Enhance or External Entities Relationship like as its name. It is extended from Entities Relationship Diagram (ERD) which is a diagram show the relationship between entities.
What is difference with (Entities Relationship Diagram) ERD?
      There are three differences between EER and ERD. EER introduce three new concept. They are extension which are added to ERD
  1. Total mapping constraints
  2. Aggregation at the type level
  3. Generalizations and classifications
Firstly, this article will focus to Generalization and Classification (super/sub type)
What is super and sub type?
         Subtype entity is a special case of another entity called its supertype.
         Let’s exanimate some example of super/sub type
         
         Ex: A Company has many employees. They are in 3 groups: Engineer, Secretary and Programmer
         
         In this case, we will have Employee group is common group of Engineer, Secretary and Programmer groups. Employee group will keep common attribute(generalization) between Engineer, Secretary and Programmer such as EmployeeID, Employee_Name, Employee_Address, Employee_Phone
         Three groups Engineer, Secretary and Programmer have some difference attributes (specialization).For instance, Engineer has “Degree” attribute, Secretary has “Type_speed” attribute and Programmer has “Programming_language”.
How to show super/sub type in EER
          There is several ways to show super/sub type in EER. It is dependence what kind of ERD you used. This article introduce 2 kind which are popular in drawing ER
1.       UML language

2.       Information Engineering

How to covert super/sub type to physical database?
          It doesn’t have any rule to show super/sub type entity in database. But the accepted solution is creation each sub and super entity a table. Sub type entity tables will get foreign key from super type entity table and make them become primary key of them

In your example, we have 4 tables:




Physical diagram

View super and subtypes
          When you create each table for super and subtype, you can create view for sub by JOIN and use UNION to show the view of super entity
         Example query


JOIN
select * from Employee join Engineer on Employee.Employee_ID = Engineer.Employee_ID

UNION

select * from Employee join Engineer on Employee.Employee_ID = Engineer.Employee_ID
Union
select * from Employee join Secrectary on Employee.Employee_ID = Secrectary.Employee_ID
Union
select * from Employee join Programmer on Employee.Employee_ID = Programmer.Employee_ID

Continue……

Mar 19, 2011

Thêm font tiếng việt vào android(rooted)

Giới thiệu

  • Quả thật là một sai sót khi để bài viết về font tiếng việt mà quên đi không dịch sang tiếng việt thì thật là tệ.
  • Chắc hẳn các bạn cũng biết android hỗ trợ ngôn ngữ tiếng việt 100% thì việc gì cần phải thêm font tiếng việt vào android.
  • Lý do: là một số bản  cooking android được phát triển thiếu đi ngôn ngữ "hiếm" như tiếng việt (không hiểu sao đến giờ tôi yêu tiếng việt vô cùng)
  • Nguyên tắc: Android có một thư mục chứa font chữ ở /system/fonts.Trong thư mục này có file DroidSansFallback.ttf.File này dùng như một font chữ hỗ trợ cho font DroidSans.tff(Font chữ chính của android).Nếu gặp trường hợp không hiện thị được font chữ nào đó android sẽ tiến hành sử dụng font DroidSansFallback.tff.Nên việc thay thế nó sẽ không ảnh hưởng gì đến font chữ của hệ thống
Sau đây là những thứ bạn cần chuẩn bị
1.Font hỗ trợ tiếng việt.(ở đây đề nghị bộ font DejaVu font)download
2.Một chương trình root explorer ( root explorer) có thể tài về từ market của android
3.Android đã root(nhưng chắc chắn khi nào bạn cần thêm font tiếng việt thì android của bạn đã root rùi :D)

Bước 1:
  • Tải về và giải nén Deja Vu font bạn vừa download về.
  • Đổi tên DejaVuSans.ttf sang DroidSansFallback.ttf.
Bước 2:
  • Copy font vào thẻ nhớ(Bất kì chỗ nào nhưng bạn cần nhớ vị trí để tí nữa sẽ copy nó vào bộ nhớ máy).
        NB:Tôi để nghị là để ở vị trí ngoài cùng trên thẻ nhớ của bạn
Bước 3:
  •  Mở Root explorer vào thư mục trên thẻ nhớ nơi để font file lúc nãy bạn vừa copy vào.Và copy font chữ đó
           Chú ý: khi dùng root explorer đường dẫn để vào thẻ nhớ se là /sdcard
Bước 4:
  • Dùng Root exployrer vào thư mục /system/fonts.
  • Trong thư mục này bạn sẽ thấy có file DroidSansFallback.ttf, backup nó lại bằng cách đổi tên thành DroidSansFallback.ttf.bak
  • Mount thư mục sang chế độ R/W bằng cách ấn vào nút mount R/W ở góc trên bên phải.
          NB: Với thao tác này bạn có thể tiến hành chỉnh sửa thư mục trên máy.nhưng cũng đồng nghĩa bạn có thể gây hư hại cho hệ điều hành.
  • Paste font file vào thư mục này.
Bước 5:
  • Cuối cùng khởi động lại máy bạn sẽ thấy khác biệt ôi tiếng việt thân yêu đã xuất hiện
Tài liệu tham khảo

Agrond

Hướng dẫn cài đặt Mysql và php on IIS

1.     Giới thiệu

Chắc hản luôn có khó khăn cho bạn khi muốn thiết lập một php và mysql trên windown với IIS.Sau đây là tutorial  hướng dẫn cài đặt php+mysql trên IIS bằng tay

2.     Chuẩn bị cần thiết:

·         PHP(bản mới)
·         Mysql

Bước 1 Install MYSQL

Bước này tôi lướt qua nếu có thắc mắc về việc cài đặt MYSQL  vui long thao khảo link sau
Thiết lập MYSQL

Bước 2: Copy php vào máy tính

Bạn có thể đặt thư mục chứa php ở bất kì đâu trong ổ cứng của bạn nhưng tôi khuyên nên để ở vị trí
C:\php cho thuận tiện

Bước 3: thiết lập config

Đổi tên c:\php\php.ini-recommened thành c:\php\php.ini
Mở file ph.ini ra rồi tìm đến dòng
extension_dir =
gán giá trị vị trí lưu trữ phần mở rộng của php.Vì tôi đặt php ở ổ C:\ nên kết quả như sau
extension_dir = "c:\php\ext"
mở những external cần thiết ra.Ở đây tôi mở mysql,mysqlli,mssql .Việc mở đơn giản bằng cách bỏ dấu “;” ở đầu mỗi dòng sau
extension=php_mssql.dll
extension=php_mysql.dll
extension=php_mysqli.dll

Thêm vào đó di chuyển file php.ini từ thư mục c:\php\ vào trong c:\windows\  .bởi vì theo mặc định php sẽ tìm file config  php trong c:\windows\

Bước 4: thiết lập IIS

·         Mở IIS bằng cách mở Run và gõ “inetmgr”
·         Mở Handler mapping/add script map

Request path: *.php
Executable: C:\PHP\php5isapi.dll
Name:php


·         Mở ISAPI và CGI restriction/Add

ISAPI or CGI path: C:\PHP\php5isapi.dll
Description:php5


Bước 5 kiểm tra công việc

·         Mở trình xoạn thảo văn bản xoạn 1 file text với nội dung lưu dưới tên mở rộng là .php

<?php phpinfo();?>
·         Move file vào wwwroot của IIS
·         Mở IE và gõ localhost\{tenfile}.php


Vậy là chúng ta đã hoàn thành việc cài đặt php cùng với mysql external