show code js

2013年9月26日 星期四

php odbc ready


example use access file mdb.

1.create a access file format mdb
(1)open this mdb and create some table and row data(type;table)
(2)set the IUSR read of permission for this mdb file on windows operation system
2.open \Windows\SysWOW64\odbcad32.exe
(1)click system data source of tag
(2)click new
(3)choose Microsoft Access Driver (*.mdb) before click done
(4)set data source name
(5)database file choose your access.mdb
(6)click advance and set account and password
(7)click option and set your config
3.use php odbc function

2013年9月17日 星期二

install pear to php on windows system


  1. Install pear in php on windows
  2. Download http://pear.php.net/go-pear.phar
  3. goto php directory
  4. open cmd and run php go-pear.phar to start installing pear module
  5. when it is done you can find PEAR_ENV.reg and double click it.
  6. it will change php.ini when it is done to restart your web server.
  7. Test pear, create and run php file, it will show bool(true)
  • <?php
  • require_once 'System.php';
  • var_dump(class_exists('System', false));
  • ?>
  1. If you want to install module of pear, you can open cmd and goto php directory, run pear install module_name.
  2. ex: pear install MDB2
  3. Test MDB2 module, create and run php file, it will show bool(true)
  • <?php
  • ini_set('include_path','c:\php\pear');
  • require_once 'MDB2.php';
  • var_dump(class_exists('MDB2', false));
  • ?>


2013年9月14日 星期六

SMALL ERP PART1 - Production and Quality Management System

in 2006 year, I had programming a small production management system, it includes produce line management, PMC management, Process management and multi-language. let an manually factory to be automation. The manager can constantly to get newest information from factory, produce information and quality information.
They can continuous development and adaptation of policies and decision-making.

This is a general workstation of type, and it main job is record the production and NG information. Them will show on the control management panel.
Inside this GUI, we make a anti-error control to create right data.


For the second workstation of type, the product will merge manufacturer number(barcode) and optics data (from optical apparatus) in this workstation and it will become a end product before.
And it had an important mission. It guide a product manufacture specification that use it to check optics data and set an quality level for this product.
After, this product will to go to final visual inspection of workstation to decide view level.
Both optics and view level to decide end product final level of quality.



Well, we can see both production and quality information in system panel anytime. let us full control and management this factory to be best.

After end producing, we have second work must to do.
More defective products must to be analytics. if we have no any data, we can not do this job. if we can not, those will add more cost on our operating, and we can not to control quality of production, and our customers maybe feeback more problem to us and we can not find out any troubleshooting.



More important, we can to formulate a right action to control or find out the problem.


Warehouse Management System Part2 料件管理

庫存的管理,採用購物車的方式,讓來領用的人員,不論是生手或熟手,都可以按圖辨識是否他需要的料件。
點擊料件後,可以詳細的看更大的圖片及料件的資訊,依下圖的資訊可以知道,此料件由系統來依照>系統庫存量決策>料件安全存量+領用量+交期+重要性,來決定購買時機、購買量及交期。
當料件低於安全存量的%(x整體庫存策略%)之多少時會由系統採用觸發方式計算出要購買的量及交期,另會增加近期領用情況,若有大幅領用時,會增加購量,反之則減少購量。
最後配合重要性是否必買及交期的長久,是否要多買或少買及指定的交期日是那一天。
使用公式約略如: 購買決策 * (購買量 > 單筆採購最低量) = 料件安全庫存量 * 整體庫存策略 * 領用率(領用量 / 安全庫存量)
當然還有其他資訊參考,如上次盤點時間、系統CHECK時間、修改時間、上次購買的日期與數量,以及使用在那些設備上。

並且使用購物車的方式讓USER快速的選擇他要使用的零件,結算時就產成領料列表,完成領用後就進行扣帳及記錄。
並且列出各主類別的料件,可以快速的知道有那些料件,也可以知道1廠庫存量及2廠或另外其他廠的庫存量,以便調料,達到料件料號整合,不致於有同料多號、同料不同廠庫存的情況,有效的降低料件庫存及週轉率。

部份的料件是可以循環或再生使用、維修使用,這樣的料件就進入維修管理系統中,管制每料號的庫存品進出廠維修的情況,讓該料號的庫存可以同品出同品進,防止該品項被調換,進而可以計算出維修次數及分析(應用於異常維修,可能是其他原因造成設備連續或同情況損壞,或是評估該件品已達維修次數不堪再維修使用,應改買新品使用,或是維修費用超過該品件的1/2應進行報廢等等,還有保固的分析,可以節省大量的維修費用),追蹤每件料件出廠維修的時間、維修的內容、費用的申請核鎖及回廠的時間,並將這些資訊應用在分析上進而提供決策用。

庫存的料件,除了維修便還有借用情況,管制調借的流程及資訊,避免借出後即成為呆帳。

料件經分析後不再有維修的價值,即進行報廢的處理,並予以記錄,有效管制報廢品。

另外,還寫了儲位管理,透過建立料件時所給的尺寸、及數量,在已建立的儲位資料中,系統可以告知這樣的料件及量可以自動配置暨有的空儲位,不用人工去找去搜尋,並且按儲位表去調出每個位置的料件資訊,可應用在大型的庫儲品,不用跑到儲位上去看是什麼料件有多少量或是什麼樣子,除了熟手可以更快取得儲位內的料件資訊外,更易於新手取得這樣的資訊。



2013年9月13日 星期五

Warehouse Management System Part1-庫存盤點

為了提昇盤點的速度、準確度及帳目管理,當時購置了一台約一萬五至二萬左右的離線盤點機,機器可以提供電子檔下載及上傳。



上傳後可以利用盤點機掃描Barcode或輸入料號後,進行手動或連續盤點,手動就是沒有條碼時輸入料號,自動就是掃描條碼,然後輸入庫存量,待所有料件清點完後即可將儲存在盤點機的資料下載,再透過程式進行帳目校對,比對差異或列出帳目。


將盤點好的資料由盤點機下載後開始進行帳目校對,當然可以應用在差異比對、或任何的應用上,但主要對庫存盤點工作進行改善,三千多項三萬多件可以在單人只花二小時盤點完成,並獨立完成帳目差異比對及庫存帳目核對,大幅提昇工作效率並可提昇精確度。


校對帳目完成後,當然是要輸出總帳冊進行結算囉。這樣的功能大約是2005年時就撰寫的,用以應付資本額超過十億的電子工廠全廠設備料件的庫存盤存管理。

phpbb3 with ldap

We want to use Windows Server 2012 Active Directory Service be user data in phpbb3, let employee login with AD account & password.

More information from internet by google, but I use inside tool from system.
You can find ADSI editor in system tool folder, let you know how to get them.

Important:just a account use in system to find out account list, when this profile of account has not set some parameters, phpbb3 will feeback can not find this parameter and let ldap config to save with fail

Just record config:

LDAP SERVER: ldap://your_server (AD Server)
LDAP PORT: 389 (or 3268)
LDAP BASE DN: DC=your_domain,DC=local
LDAP uid: sAMAccountName
LDAP Filter:
LDAP email parameter:mail
LDAP user account:CN=Administrator,CN=Users,DC=your_domain,DC=local
LDAP password: keyin password of "LDAP user account"

HP Server with Windows Server 2012 part1

今年組了一台新的HP Server DL360p Gen8,配有雙CPU共12核心、8GB RAM ECC/REG、二顆SAS 300GB HDD作Raid1及8顆風扇。
與已往不同的是,HP不在使用SmartCD,前導程式已經燒錄在ROM裡面,唯一美中不足的是出廠若沒有更新,就得要自已更新並有網際網路服務,但也是可以先下載再更新。

這台另配有很棒的功能iLO不過是一般授權,在使用RDP時只有限定的時間。網路介面共有4個含iLO共5個,另配有雙PS可負載平衡或併用。

話說回來,導引程式必須先進行更新,然後才可以進行驅動程式更新,否則預設的導引程式無法安裝最新的Windows Server 2012,而這版開始的2012似乎不在有R2這個後續版本,因為常見的DFS服務已直接內建在這個版本裡面。


當然,新裝機後要進行一連串的測試,進入ID即可進行全機測試,測試後發現在吵音方面HP改善不少,以往風扇全開的吵雜聲變低了很多。



測試完畢後就開始進行導引、驅動的更新,以便抓到HDD並進行RAID配置。順序不可以錯誤,最好網路要穩定否則最好直接到HP網站下載並燒錄成CD來安裝。


待續......


2013年9月5日 星期四

台彩樂透小程式

機器出的都不是很滿意,只好自已操刀了

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

威力彩(第二區)小全餐

http://www.hiboheaven.com/lottery.php

A:第2區第1~6注為1~38號隨機不重覆
B:第2區第7注為前6注所剩2個號碼再搭1~38號隨機不重覆4個號碼
C:第2區第8注為1~38號隨機不重覆
D:本程式僅供娛樂用途,無法影響中獎率及未提供任何獎金。
E:本程式僅個人開發娛樂用途,與台灣彩券無任何關係。
F:本站將不對此程式負任何責任,禁止非法、惡意使用。
G:若發生任何事件,本站得隨時終止本程式。
H:投訴請寄 service{at}hiboheaven{dot}com

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

大樂透小全餐

http://www.hiboheaven.com/lottery2.php

A:第1~8注為1~49號隨機不重覆
B:第9注為前8注所剩1個號碼再搭1~49號隨機不重覆5個號碼
C:第10注為1~49號隨機不重覆
D:本程式僅供娛樂用途,無法影響中獎率及未提供任何獎金。
E:本程式僅個人開發娛樂用途,與台灣彩券無任何關係。
F:本站將不對此程式負任何責任,禁止非法、惡意使用。
G:若發生任何事件,本站得隨時終止本程式。
H:投訴請寄 service{at}hiboheaven{dot}com

MySQL優化PartII加速及防死機

show VARIABLES like '%max_connect_errors%';
set global max_connect_errors = 1844674407370954751;

show VARIABLES like '%connect_timeout%';
set global connect_timeout = 60;

show VARIABLES like '%skip_name_resolve%';
[mysqld]
skip-name-resolve
;此項若是設定後將無法使用domain指定主機,必須以ip指定主機位置,且只能於ini或cnf中設定無法直接修改,修改後請重新啟動MySQL,請留意
;留意事項(1)增加為ip的登入帳號(2)連結mysql的字串使用domain的均改為ip

show VARIABLES like '%slave_net_timeout%';
set global slave_net_timeout = 30;

show VARIABLES like '%net_read_timeout%';
set global net_read_timeout = 60;

show VARIABLES like '%net_write_timeout%';
set global net_write_timeout = 120;