Thursday, December 26, 2013

Edit file hpg_hba.conf

At a guess, you've tried to edit the file in a directory that doesn't actually exist, because the path on your system is different. It'd help if you showed the exact command you ran, the exact error message text, your version of PostgreSQL and how you installed Pg (Homebrew, EnterpriseDB packages, etc).

To edit pg_hba.conf - PostgreSQL Client Authentication Configuration File:

In psql, run:

SHOW hba_file;
and see what location it reports. That's the file you must edit. If you can't get into psql you must locate it in the file system; try:
cd
sudo find / -name pg_hba.conf
When you've found the correct path, you don't need to use su to edit it from a postgres login; just use:

sudo vim /path/to/pg_hba.conf
eg on my system:

sudo vim /usr/local/pgsql/data/pg_hba.conf
If you prefer to use a different editor, anything that can run from the command line should work, including most GUI editors.

Sunday, December 8, 2013

Làm ảnh GIF động với Photoshop

Đôi khi, dạo một vòng quanh các công ty thiết kế website, thiết kế đồ họa chuyên nghiệp bạn thấy hình ảnh này động, thay đổi, các mũi tên thay đổi nhiều màu, rất sinh động. Điền này tạo nên sức hấp dẫn cho website, gây sự chú ý và tăng sự quan tâm tới những sản phẩm mà website của doanh nghiệp bạn đang kinh doanh. Bạn có muốn mình cũng làm được như vậy không?



Hiện nay có rất nhiều chương trình phần mềm có thể giúp bạn làm được việc đó và cấp độ khó dễ cũng khác nhau. Bài viết này sẽ giúp bạn có thể làm được một tấm ảnh động với công cụ photoshop-một cách khá đơn giản.

Đầu tiên là khâu chuẩn bị, máy tính của bạn cần cài photoshop (phiên bản nào cũng được cả), hai nữa là một vài tấm hình để thay đổi.

Ví dụ, mình sẽ làm một ảnh gif động từ hai tấm ảnh ban đầu. Lưu ý, là nên cho kích cỡ của các tấm ảnh bằng nhau vì như vậy, khi gộp vào làm một tấm ảnh động, sẽ đẹp và không bị chỗ thừa chỗ thiếu. Để căn chỉnh lại kích thước của hình ảnh các bạn kích chuột phải vào mép trên của tấm ảnh chọn “Image size” rồi căn chỉnh chiều rộng và chiều cao của ảnh.




Tiếp theo bạn tạo ra một file mới có kích thước đúng bằng kích thước của hai tấm ảnh trên bằng cách. Chọn File>>>New. Một bảng khai báo hiện ra, bạn điền kích cỡ vào rồi nhấn OK.



Bây giờ bạn làm lần lượt đưa hai tấm ảnh ban đầu vào trong cùng 1 file. Bằng cách:
Chọn vào bức ảnh thứ nhất, ấn tổ hợp phím ctrl+A rồi ctrl+C. Rồi nhấn chuột trái vào file mới tạo ra và ấn tổ hợp phím ctrl+V.

Làm tương tự như vậy đối với bức ảnh thứ hai.

Sau đó bạn save file ảnh mới (lúc này đã chứa hai tấm ảnh ban đầu) dưới dạng file photoshop là .PSD để sau này tiện cho việc sửa chữa hoặc sử dụng lại. Để save lại, bạn chỉ cần ấn tổ hợp phím ctrl+S hoặc File>>>Save là xong.

Save xong bạn chuyển file ảnh vừa save sang Image ready bằng cách ấn tổ hợp phím Ctrl+Shift+M hoặc ấn vào đây.





Tiếp đó bạn chọn thẻ  Window trên thanh công cụ chọn tiếp thẻ Animation. Click vào dấu mũi tên nhỏ bên mép phải chọn tiếp Make Frames From Layers.








Việc cuối cùng bạn phải làm là đặt số lần cho thao tác chuyển ảnh là bao nhiêu (once or forever…) và thời gian xuất hiện của mỗi ảnh là bao nhiêu (0s,0.1s,0.2s…..)

Để kiểm tra xem bức ảnh vừa làm đã được đúng như ý muốn chưa bạn có thể ấn vào play để xem trước khi xuất ra một file ảnh gif động-bằng cách chọn File>>>Save Optimized (Ctrl+Alt+S)








Và đây là kết quả cuối cùng mình làm:

Saturday, December 7, 2013

Metro style for Visual Studio 2010 (Install NuGet ModernUI)

After install NuGet ModernUI for VS2010 you can design your application with Metro style (Windows 8 Style) with many controls.

Thursday, December 5, 2013

Máy tính tiền cảm ứng POS Terminal 809B

Overview

AGT-809 Series is an all-in-one, newly developed point-of-sale (POS) system integrated with 15” TFT/LCD touch screen. The system offers the best solution to retail and restaurant business. It is manufactured in Shenzhen using high-quality production methods under stringent QC procedures. Taking into consideration the three key features to the success of modern business: efficiency, accuracy and flexibility, this POS Terminal was built to satisfy both sellers and buyers.

Features &Benifits


Features
Benefits
Excellent cable management hides cables from view
l         eliminating accidental disconnection for a clean, professional look
Unique protective lock
l         Prevent the illegal copies of commercial information and achieve better protection for the data.
Multi-angle Tilting ranging from 0-90 degree
l         Better view for the user and good combination to the interface.
Stable Touch panel Firmware , Flexibility spindle to make available viewing angle
l          Compact design looks professional and comfortable use, stable and Flexibility
Waterproof user interface, excellent sealing properties with the thermal dissipation window design
l         Effectively improve reliability and prevent premature failure.

Slide in/out HDD replacement
    Easy do maintenance
Rich I/O ports provide excellent peripheral connectivity
meet wide application requirements

Specification


Model Name
AGT-809B
Display Type
15”  Touch screen POS
Colour
Black
Accessories options
ISO Track 1/2/3 Magnetic Stripe Reader & Customer pole display (VFD / LED8)
Motherboard part
 
Main board
Intel® Processor due core D425
CPU
Intel® pinetrail  D425 CPU  dual core 1.8G
Chipset
Intel  D525+NM10 chipset
Memory
DDRIII 1066/1333*1    2GB Standard memory
Hard driver
Standard 160G SATA 2.5 inch hard driver 
Display part
 
LCD panel size
15  inch  TFT LCD
Brightness
250cd /㎡
Resolution
1024*768(max)
Touch screen
Viewing Angle
L/R:140 U/D:130
Front I/O
USB(2.0) *2   power button*1  reset button*1
Rear I/O
PS2 mouse *1  PS2 keyboard*1
COM port*2
LTP printer*1
VGA out (15Pin D-sub)*1, duplicate and extend screen available
RJ-45 network *1   RTL8111C
USB(2.0)*4
Audio output *1
Microphone in*1
DC 12V output*1
OperationTemperature
0 ℃ to 40 ℃
StorageTemperature
-20 ℃ to 60 ℃
Power Supply
100V-250V /50-60HZ AC power source input huntkey brand
Packing dimension
470*410*310(mm) ;
Package: carton box with Foam packaging
NW: 6.5KG     GW:8.5KG
Loading quantity
20fcl:430PCS;  40fcl: 910PCS
Power Consumption
45W(max)
EMC/ Product Safety
FCC Class A / CE Mark / LVD / CCC
OS support
Windows XP Professional, Windows XP Embedded, WEPOS,Linux
Accessories

AC Power Cable
North American and European power cables included; Other regions available upon request.
Driver CD
1*CD disk for motherboard and touch function