30 May, 2009

Common Visual Studio 2008 tips I use

It's urly when using mouse just to open a simple dialog that you use frequently. So I note it down here :-)


Debug > Attach to Process : Ctrl + Alt + P
Use Ctrl + Alt + down arrow key to navigate your tab within solution

04 December, 2008

Automatically commit to SVN server

I have three pc boxes to play around: laptop, desktop and company box.  I use all of them in parts of a day: working hours for company, laptop at home and sometime with dekstop (while my brother uses the laptop). In that case, there're a lot of personal data that I need it have to be avaiable on all boxes (of course it should be synchronized too). The free SVN hosting of Google Code came at right time . I really love that service, except it allows anynomous to browse repository tree (I have some private data) but it isn't matter.


The issue shows up when you have three local copy for your repository. Sometime I save or add new file at company and forget commiting to server. Then I get to home and is unable to continue work  . Unfortunately, it happens usually because i don't own a good memory. Therefore, I need to find a solution for this problem.

First, I thought about finding a cool software that monitors changes in SVN local copy and commits automatically. And I failed. Even I can find out, I don't think it's freeware. So with that idea, I then tried to find an anternative way.  Eventually, I saw the sunligh at the end of tunnel ^^.

Why don't we use a combination between svn command line and Scheduled Task of Windows. That's the point I started writing two small script for updating and commiting task. It is somehow like this

===================
e:

cd "E:\GoogleCodeProject"

"c:\Program Files\Subversion\bin\svn.exe" commit -m "Automatically commit on dekstop"
====================


Afterthat, I created two task in Scheduled Task (remember start Scheduled Task service before). With updating script, I set it will be run when user login to windows. And with commiting script, I put it to the task which was set to run at 30m interval. But default Windows doesn't support that type, it only allows hourly, daily, monthly, ... Wait, the real supporting from Scheduled Task stayes in Advanced Setting


 


Finally, I got the acceptable solution. How wonderfull it is 

Blogged with the Flock Browser

26 September, 2008

test


public interface ILog
{
public void DoSomething();
public string Getting { get; }
}

15 March, 2008

no title

A guy (say MrQ) on group microsoft.public.dotnet.framework.aspnet have posted a funny question

MrQ
Hi,
Can I backup & restore my sql server database from aspx page located on a
client machine ?
Thank You.
First answer (say MrA)
Sure you can .

use BACKUP DATABASE sql statement..

Just remember do not connect to the DB you want to back up. Connect to
master DB

MrQ
Thank you for your reply.
How can I implment this?
MrA
I am afraid you cant. If you asking this
MrQ
Sure I know how to backup and restore a db using sql server 2000 or 2005. Im
asking about how can I provide a web form, using asp.net 2.0, to the client
that can let him or her do the same task remotely?
Hmm, he can use sql statement to play with sql server but don't know how to use it in .net

08 March, 2008

Newsgroup in general

I've heard about newsgroup concept when I started studying IT at the university. But I couldn't be well aware of what it is, how to use. And I got into it by chance today, see this quote

On the web there are thousands, probably millions, of discussion forums, dedicated to particular areas of interest. You use your browser to navigate to the "forum" web page of a site that interests you, where you can read what other people have written. You can usually post new messages to the forum after completing a web form to register your name, e-mail address, etc, at the forum.

A newsgroup isn't like that. A newsgroup is a completely different, very much older, type of forum. Newsgroups were invented over a quarter of a century ago, long before the World Wide Web existed. Newsgroups work with special software called "newsreaders" and "news servers" instead of web browsers and web servers.

If you're not really interested in how newsgroups work – you simply want to know how to read and post messages with a minimum of fuss – you'll be pleased to hear that Google provides a web-based interface to newsgroups that makes them look pretty-much like normal web-based discussion forums. It's called Google Groups. But bear in mind that the Google Groups way of doing things is quite cumbersome, and most newsgroup users prefer to use the newsreader software described next.

To connect directly (not via Google) to a newsgroup you'll need newsreader software installed on your PC. Many PCs come with a newsreader already installed - it's Microsoft Outlook Express, the same program that many people use for e-mail. Popular alternative newsreaders include Forte Agent and Mozilla Thunderbird.

The newsreader needs to be configured to connect via the Internet to a suitable news server. There are thousands of news servers round the world and it usually doesn't matter much which one you connect to. Many ISPs provide free news servers. Alternatively many alt.usage.english regulars make use of the inexpensive server provided at News.Individual.NET.

Having configured your newsreader to use an available news server, you can "subscribe" to any number of newsgroups. Subscription is free and no registration process or password is required – all you have to provide is the name(s) of the newsgroup(s) you're interested in. more

Then I google the phrase "news server free" and got a lot of useful results. Anyway, it took a long time to know what it is ^^

I can't hear what they said but it might be funny, right ^^

11 February, 2008

Some stuffs on the internet for you



When you begin using the Internet for working or home, surely you should utilize Internet's resources to improve productivity. Maybe you've never realized that your work can be better with some services on the net.

Let I give an example for you: when you're working, your task still wasn't completed but you need to go home at the moment. Of course you want to save current working progess in order to continue to work at home. But how can you save your progess ? Sure, Internet's resources will take this role.

As you can see in below example, your productivity can be improved when you use properly service on net. I will show you some stuffs for your convenience:

Storage
There're many ways to allow you to put something on a host and you can get it back latter. The simplest is using mail (Gmail, Yahoo) , or you can go to some storage services like Rapidshare, Megashare and Windows Live SkyDrive (it's free and I personally prefers SkyDrive to others ^^). If you want more, you can try Google Code or Google Page Creator and you only need using storing file feature.

Media file storage
You need put your images, music, flash on net. Yes, there're always a plenty of services to help you. But I only show you some helpful site: Picasa Web Albums ,Flickr for picture, Slide for making slide, imeem for music.

More ...
I know here're many, many stuffs on the Internet but it's great if you find it out by yourself. To me, I only knows these stuffs and need to find more, like you ^^


Powered by ScribeFire.

04 February, 2008

Convert a datetime string into DateTime object

The problem: you have a string presenting a datetime value and you want convert it into DateTime object.

An answer: of course, the simplest way is you can parse that string into your fields and contruct new DateTime object then. But if the string is something like "12/8/2008 23:17", so how can you parse this string into month,day,year,hour and minute.

But .Net Framework already support you for such task. You can use DateTime.ParseExact() for this purpose. Here is sample code

1 DateTime convertedDateTime = DateTime.ParseExact(

2 "20/08/2008 13:10",

3 "MM/dd/yyyy HH:mm",

4 System.Globalization.CultureInfo.CurrentCulture);

5 Console.WriteLine(string.Format("Day: {0}", convertedDateTime.Day));

6 Console.WriteLine(string.Format("Month: {0}", convertedDateTime.Month));

7 Console.WriteLine(string.Format("Hour: {0}", convertedDateTime.Hour));


Pay a little attention in line 3 & 4, you must provide exactly format of your date time string. Acctually, I don't know why we need an IFormatProvider in here :-) (so I use default one as you can see)

Hope this tip will help you


Powered by ScribeFire.

15 December, 2007

Software Development Process

Đây là một quy trình phát triển phần mềm điển hình trên thực tế đó pà con



Powered by ScribeFire.

01 December, 2007

welcome back, penguin



Đã lâu lắm rồi mình không đụng đến linux, dù chỉ là boot vào rồi gõ dăm lệnh cho đỡ buồn. Mình thích linux từ khi biết đến nó, lý do đơn giản là nó cho ta cảm giác được tự do khám phá (chính xác là khám phá). Hôm qua tự nhiên cài VMWare, rồi cài Slax vào và ngồi gõ chơi vậy, chắc ghiền quá rồi :(

Anh H.A nói mình nên ôn lại Java vì .NET có nguy cơ bị lung lay, tức là có thể nó không mạnh như ban đầu nữa - chắc tại cha BillGate nghỉ hưu non đây. Mình thích Java, đơn giản là nó không ràng buộc nhiều về platform, rõ ràng với Java thì OS nào cũng như nhau và SDK rất tốt, công nghệ liên quan cũng nhiều. Lý do chính là với Java thì mình đều lập trình trên Win hay Linux cũng được.

Không biết giờ phải bắt đầu xem gì bên Java đây, mình còn rất nhiều thứ bên .NET chưa xem hết. Sao 1 ngày chỉ có 24h thôi nhỉ :(

Dù sao thì giờ mình cũng biết cách config cho máy ảo truy cập mạng được rồi (dùng NAT vì máy mình không có card mạng). Từ đây thỉnh thoảng đi thăm nuôi chú chim cánh cụt thôi


Powered by ScribeFire.

14 November, 2007

Visual C# Team




Những con người này hiện đang viết ra thứ mà các công ty phần mềm sống nhờ vào Microsoft đang sử dụng. Ít ra mình cũng dùng nó hằng ngày

Powered by ScribeFire.

01 November, 2007

MVC fun

Theo cách nhìn truyền thống thì người ta viết theo mô hình dưới đây

Fullsize



Nhưng với MVC thì phải viết theo mô hình này

Fullsize


Thật là ngộ :)

Xem bài gốc


Powered by ScribeFire.

27 October, 2007

Sex toys


Tui đó pà con


Tiêu đề chỉ nhằm mục đích "hèn hạ" là câu khách, xin đừng quá thất vọng



Powered by ScribeFire.

23 October, 2007

Site navigation

Dùng kĩ thuật này giúp cho việc tạo menu, đánh dấu vị trí của user hiện tại trong website dễ dàng hơn. Nhìn chung thì không có gì khó, nguồn tham khảo chính là MSDN thôi
Có 1 điểm cần lưu ý là để hiển thị nhiều "root node" thì tham khảo thuộc tính ShowStartingNode của SiteMapDataSource và bạn sẽ gặp rắc rối nếu dùng control SiteMapPath trong khi dùng thuộc tính ShowStartingNode trên (hiển thị nhiều "root node"). Cách giải quyết chuyện này là bắt sự kiện SiteMapResolve trong Global

1 void Application_Start(object sender, EventArgs e)

2 {

3 SiteMap.SiteMapResolve += new SiteMapResolveEventHandler(SiteMap_SMR);

4 }

5

6 SiteMapNode SiteMap_SMR(object s, SiteMapResolveEventArgs e)

7 {

8 SiteMapNode cn, tn;

9 cn = tn = SiteMap.CurrentNode.Clone(true);

10 while (cn.ParentNode != null && cn.ParentNode.ParentNode != null)

11 cn = cn.ParentNode;

12

13 cn.ParentNode = null;

14 return tn;

15 }







Powered by ScribeFire.

02 October, 2007

hura, cài được VS rồi

Sau bao ngày cực khổ (1,5 ngày ) mình đã cài xong VS (mặc dù lúc cài bị cái lỗi trời ơi gì đâu không )
Sẵn đây viết bài này nhằm ghi lại cách giải quyết cho sau này (và cũng khoe luôn bộ emoticon mới kiếm ra )

Khi bạn install Visual Studio 2005 hay .NET Framework 2.0/3.0 mà gặp thông báo lỗi 1935 (hay 2908) thì giải quyết bằng 2 bước sau
  1. Dùng công cụ SubInACL để sửa quyền truy cập của các thư mục và key trong registry lại cho phép tài khoản hiện tại và tài khoản System truy cập được. Sau khi down tool về, cài đặt xong bạn tạo một file text với nội dung sau - đặt tên là gì cũng được, giả sử minh đặt là reset.bat
    cd /d "%programfiles%\Windows Resource Kits\Tools"
    subinacl /subkeyreg HKEY_LOCAL_MACHINE /grant=administrators=f /grant=system=f
    subinacl /subkeyreg HKEY_CURRENT_USER /grant=administrators=f /grant=system=f
    subinacl /subkeyreg HKEY_CLASSES_ROOT /grant=administrators=f /grant=system=f
    subinacl /subdirectories %SystemDrive% /grant=administrators=f /grant=system=f
    subinacl /subdirectories %windir%\*.* /grant=administrators=f /grant=system=f

    Lưu ý acc hiện tại mình là administrator , nên thay bằng tài khoản trong trường hợp của bạn. Script này chạy mất khoảng vài phút
  2. Bạn phải xóa mọi dữ liệu liên quan đến .NET framework, thật may là có tool hỗ trợ cho bạn làm việc này

Bài viết gốc để giải quyết vấn đề nằm tại đây, mình chỉ là dịch lại cho dễ hiểu thôi

P/S: Khi nhìn thấy cái thông báo VS cài đặt thành công mừng hết lớn


Powered by ScribeFire.

21 September, 2007

Tầng thứ 1

Sau một thời gian làm việc với ASP.NET với tư cách là code (chứ không phải PM ) thì mình thấy phải dùng tool hỗ trợ mới làm tốt được, chứ ngồi viết mã mà tự mình làm hết (theo kiểu "invent the wheel") thì hơi bị hâm
Cho đến giờ mình cũng được xếp khai sáng nhiều tool rất tuyệt, mà hay nhất là kĩ thuật object-relational mappingInvertsion of Control. Lúc còn đi học mà ngồi lọ mọ mấy cái thuộc tính của table trong code rồi viết câu lệnh sql inline thì oải thật.
Sẳn tiện quảng cáo lun, nếu viết ASP.NET thì nên khuyên cty sắm cái RadControls để mình viết khỏe hơn. Chứ dùng control sẵn có của M$ thì hơi xấu. Mình có thử qua các control khác như ComponentOne nhưng thấy thằng Rad là được nhất. Bà con ai đang làm trong cty nhỏ mà muốn câu khách nên năn nỉ xếp sắm cái này .
Giờ kĩ thuật code nâng cao rồi, không biết làm sao để nằm được quy trình đây
Thôi, phải làm tiếp. Tự nhiên mình khoái vụ convert database rồi


Powered by ScribeFire.

31 August, 2007

download software (old versions)

Hum nay định install cái yahoo 7.5 vào mà kiếm không ra link down, may mà vớ được site này. Ghi lại không thì quên mất
http://www.oldapps.com/


Powered by ScribeFire.

12 July, 2007

tại sao tôi không thể download bittorent được

Nhiều ngày nay, phải nói là gần 1 tháng nay tôi không thể down bit(torrent) được. Dù có được thì tốc độ rất chậm (2k/s). Tôi đã tìm nhiều bài viết tweak bit client lên nhưng vẫn không hiệu quả.
Và sáng nay vô tình tôi thấy được 1 manh mối half-open tcp. Google chút thì ra nguyên nhân: windows xp sp2 giới hạn kết nối tcp half-open. Tôi không rành lắm về mạng nhưng m$ nói là việc giới hạn này nhằm chống worm,spyware gì đó và việc này ảnh hưởng lớn đến hoạt động của các chương trình p2p.
Lần mò 1 hồi thì tìm thấy bài viết hướng dẫn cách mở rộng giới hạn này lên. Để cho bit client hoạt động tốt bạn cần làm 2 việc
  1. Đặt giới hạn half-open mới cho win xp. Cho ai muốn đọc tường tận thì vào đây , còn thích làm ngay thì download chương trình patch này về
  2. Sửa cấu hình chương trình bit client lại (giá trị kết nối tại trình client dĩ nhiên phải nhỏ hơn giới hạn mới 1 chút). Vào đây xem cách chỉnh (không phải cho mọi trình bit client nhưng cứ xem đã)



Powered by ScribeFire.

26 June, 2007

cảm xúc

Hôm nay đã dùng thử add-on ScribeFire để viết blog, ấn tượng ban đầu tốt.

Hết :D







Powered by ScribeFire.