12 十一月, 2009
Create PyGtk Programming Environment on Windows
Posted by: asd In: Code Snippet| Script| Unix| 程式設計
1. 安裝「python-2.5.4」
2. 安裝「PyGtk, PyOpenGL, PyGtkGlExt, PyWin32 all in one installer」
使用 「Glade」拉界面 ,「Pythonwin」 IDE debug,
12 十一月, 2009
Posted by: asd In: Code Snippet| Script| Unix| 程式設計
1. 安裝「python-2.5.4」
2. 安裝「PyGtk, PyOpenGL, PyGtkGlExt, PyWin32 all in one installer」
使用 「Glade」拉界面 ,「Pythonwin」 IDE debug,
Use Perl here documents to print multiple lines of output
example:
view plain
PERL:
print <<FOO;
Perl offers a convenient way of printing multiple lines of output through an interesting feature known as a "Perl here document".
A multiline Perl here document works like this:
<ol>
<li>The first line of your command will include the two characters <code><<</code> followed by a [...]
use stl set to simulate map
view plain
CODE:
#include <iostream>
#include <vector>
#include <algorithm>
#include <set>
#include <map>
using namespace std;
class compare
{
public:
//the error is over here
bool operator()(pair<int, int> p1, pair <int, int> p2) const
{
if (p1.second == p2.second)
return p1.first <p2.first;
else
return p1.second <p2.second;
}
};
typedef set<pair<int, int>, compare> MMap;
void main(int argc, char* argv[])
{
MMap D;
D.insert(make_pair<int, int>(1, 10));
D.insert(make_pair<int, int>(2, 2));
D.insert(make_pair<int, int>(3, 2));
D.insert(make_pair<int, int>(4, 3));
D.insert(make_pair<int, int>(5, 6));
MMap::const_iterator iter(D.begin());
MMap::const_iterator [...]
--AMR-NB--
- The fixed-point (TS26.073)
- The float (TS26.104)
- The specification(TS26.071)
--AMR-WB--
- The fixed-point (TS26.173)
- The float (TS26.204)
- The specification(TS26.171)
3GPP Specification 26-series
先安裝需用到的 module
#ppm-shell
#install DBI
#install DBD-ODBC
view plain
PERL:
#!/usr/bin/perl -w
use strict; # 使用變數前一定要定義
use DBI; # 使用DBI模組, 連結資料庫
use DBD::ODBC;
my $server='localhost\SQLEXPRESS';
my $database="your_db";
my $user="sa";
my $password="123456";
my $DSN = "driver={SQL Server};Server=$server;database=$database;uid=$user;pwd=$password;";
my $dbh = DBI->connect("dbi:ODBC:$DSN", { RaiseError => 1, AutoCommit => 1 }) || die "Can't connect: $DBI::errstr\n";
# 執行 sql 敘述
my $sql_statement = "select * from user_data";
my $sth = $dbh->prepare($sql_statement) || die "Can't prepare the [...]