mirror of
https://github.com/LCTT/TranslateProject.git
synced 2025-01-10 22:21:11 +08:00
20150604-2 选题
This commit is contained in:
parent
62df253c12
commit
217963ac06
@ -0,0 +1,33 @@
|
||||
Read about The Document Foundation achievements in 2014: download the Annual Report!
|
||||
================================================================================
|
||||
![](https://documentfoundation.files.wordpress.com/2015/06/tdf-report.jpg)
|
||||
|
||||
TDF ReportThe Document Foundation (TDF) is proud to announce its 2014 Annual Report, which can be downloaded from the following link: [http://tdf.io/report2014][1] (3.2 MB PDF). The version with HD images can be downloaded from [http://tdf.io/report2014hq][2] (15.9 MB PDF).
|
||||
|
||||
TDF Annual Report starts with a Review of 2014, with highlights about TDF and LibreOffice, and a summary of financials and budget.
|
||||
|
||||
Community, Projects & Events covers the LibreOffice Conference 2014 in Bern, Certification, Website and QA, Hackfests in Brussels, Gran Canaria, Paris, Boston and Tolouse, Native-Language Projects, Infrastructure, Documentation, Marketing and Design.
|
||||
|
||||
Software, Development & Code reports about the activities of the Engineering Steering Committee, LibreOffice Development, the Document Liberation Project and LibreOffice on Android.
|
||||
|
||||
The last section focuses on People, starting with Top Contributors, followed by TDF Staff, the Board of Directors and the Membership Committee, the Board of Trustees, or the body of TDF Members, and the Advisory Board.
|
||||
|
||||
TDF 2014 Annual Report has been edited by Sophie Gautier, Alexander Werner, Christian Lohmaier, Florian Effenberger, Italo Vignoli and Robinson Tryon, and designed by Barak Paz, with the help of the fantastic LibreOffice community.
|
||||
|
||||
To allow the widest distribution of the document, this is released with a CC BY 3.0 DE License, unless otherwise noted, to TDF Members and free software advocates worldwide.
|
||||
|
||||
[The German version of TDF Annual Report is available from [http://tdf.io/bericht2014][3]].
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: http://blog.documentfoundation.org/2015/06/03/read-about-the-document-foundation-achievements-in-2014-download-the-annual-report/
|
||||
|
||||
作者:italovignoli
|
||||
译者:[译者ID](https://github.com/译者ID)
|
||||
校对:[校对者ID](https://github.com/校对者ID)
|
||||
|
||||
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出
|
||||
|
||||
[1]:https://wiki.documentfoundation.org/File:TDF2014AnnualReport.pdf
|
||||
[2]:https://wiki.documentfoundation.org/File:TDF2014AnnualReportHQ.pdf
|
||||
[3]:https://wiki.documentfoundation.org/File:TDF2014AnnualReportDE.pdf
|
@ -0,0 +1,77 @@
|
||||
How To Install Unity 8 Desktop Preview In Ubuntu
|
||||
================================================================================
|
||||
![](http://itsfoss.itsfoss.netdna-cdn.com/wp-content/uploads/2015/06/Unity_8.jpeg)
|
||||
|
||||
If you have been following the news, Ubuntu will be switching to [Mir display server][1] along with [Unity 8][2] desktop. While it is still not certain if Unity 8 running on Mir will be available in [Ubuntu 15.10 Willy Werewolf][3], a preview version of Unity 8 is available for you to try and test. With the official PPA, it is really easy to **install Unity 8 in Ubuntu 14.04, 14.10 and 15.04**.
|
||||
|
||||
Until now, this Unity 8 desktop preview has been available via an [ISO][4] for (primarily) developers to test it. But Canonical has made it available through [LXC containers][5]. By using this method you get a Unity 8 desktop session running on Mir display server as any desktop environment. It’s like as if you [install Mate desktop in Ubuntu][6] and choose the desktop session from the LightDm login screen.
|
||||
|
||||
Curious to give Unity 8 a try? Let’s see how to install it.
|
||||
|
||||
**Note: It’s an experimental preview and may not work properly for everyone.**
|
||||
|
||||
### Install Unity 8 desktop in Ubuntu ###
|
||||
|
||||
Following are the steps to install and use Unity 8:
|
||||
|
||||
#### Step 1: Install Unity 8 in Ubuntu 12.04 and 14.04 ####
|
||||
|
||||
If you are running Ubuntu 12.04 and 14.04, you’ll have to use the official PPA to install Unity 8. Use the following command:
|
||||
|
||||
sudo apt-add-repository ppa:unity8-desktop-session-team/unity8-preview-lxc
|
||||
sudo apt-get update
|
||||
sudo apt-get upgrade
|
||||
sudo apt-get install unity8-lxc
|
||||
|
||||
#### Step 1: Install Unity 8 in Ubuntu 14.10 and 15.04 ####
|
||||
|
||||
If you are running Ubuntu 14.10 or 15.04, Unity 8 LXC is already in the sources. You just need to run the following commands:
|
||||
|
||||
sudo apt-get update
|
||||
sudo apt-get install unity8-lxc
|
||||
|
||||
#### Step 2: Set up Unity 8 desktop preview LXC ####
|
||||
|
||||
Once you have installed Unity 8 LXC, it’s time to set it up. Use the following command for this purpose:
|
||||
|
||||
sudo unity8-lxc-setup
|
||||
|
||||
It will take some time in set up, so have some patience. It downloads the ISO and then extracts it, and then any last bits of setup necessary to make it work. It will also install a slightly modified version of LightDM. Once everything is done, a restart is required.
|
||||
|
||||
#### Step 3: Select Unity 8 ####
|
||||
|
||||
After restarting, at login screen, click on the Ubuntu icon beside your login name:
|
||||
|
||||
![](http://itsfoss.itsfoss.netdna-cdn.com/wp-content/uploads/2014/08/Change_Desktop_Environment_Ubuntu.jpeg)
|
||||
|
||||
You should see the option of Unity 8 here. Select it:
|
||||
|
||||
![](http://itsfoss.itsfoss.netdna-cdn.com/wp-content/uploads/2015/06/Select_Unity8.jpeg)
|
||||
|
||||
### Uninstall Unity 8 LXC ###
|
||||
|
||||
If you find Unity 8 too buggy or if you don’t like it, you can simply switch back to the default Unity version in similar fashion. Additionally, you can also remove Unity 8 using this command:
|
||||
|
||||
sudo apt-get remove unity8-lxc
|
||||
|
||||
This will remove the Unity 8 option from LightDM screen but the set-up will remain there.
|
||||
|
||||
That’s all you need to do to install Unity 8 with Mir in Ubuntu. Do share what you think of Unity 8 when you try it out.
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: http://itsfoss.com/install-unity-8-desktop-ubuntu/
|
||||
|
||||
作者:[Abhishek][a]
|
||||
译者:[译者ID](https://github.com/译者ID)
|
||||
校对:[校对者ID](https://github.com/校对者ID)
|
||||
|
||||
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出
|
||||
|
||||
[a]:http://itsfoss.com/author/abhishek/
|
||||
[1]:http://en.wikipedia.org/wiki/Mir_%28software%29
|
||||
[2]:https://wiki.ubuntu.com/Unity8Desktop
|
||||
[3]:http://itsfoss.com/ubuntu-15-10-codename/
|
||||
[4]:https://wiki.ubuntu.com/Unity8DesktopIso
|
||||
[5]:https://wiki.ubuntu.com/Unity8inLXC
|
||||
[6]:http://itsfoss.com/install-mate-desktop-ubuntu-14-04/
|
171
sources/tech/20150604 How to access SQLite database in Perl.md
Normal file
171
sources/tech/20150604 How to access SQLite database in Perl.md
Normal file
@ -0,0 +1,171 @@
|
||||
How to access SQLite database in Perl
|
||||
================================================================================
|
||||
SQLite is a zero-configuration, server-less, file-based transactional database system. Due to its lightweight, self-contained, and compact design, SQLite is an extremely popular choice when you want to integrate a database into your application. In this post, I am going to show you how to create and access a SQLite database in Perl script. The Perl code snippet I present is fully functional, so you can easily modify and integrate it into your project.
|
||||
|
||||
![](https://farm1.staticflickr.com/552/18444614631_9e7fce8243_c.jpg)
|
||||
|
||||
### Preparation for SQLite Access ###
|
||||
|
||||
I am going to use SQLite DBI Perl driver to connect to SQLite3. Thus you need to install it (along with SQLite3) on your Linux system.
|
||||
|
||||
**Debian, Ubuntu or Linux Mint**
|
||||
|
||||
$ sudo apt-get install sqlite3 libdbd-sqlite3-perl
|
||||
|
||||
**CentOS, Fedora or RHEL**
|
||||
|
||||
$ sudo yum install sqlite perl-DBD-SQLite
|
||||
|
||||
After installation, you can check if the SQLite driver is indeed available by using the following script.
|
||||
|
||||
#!/usr/bin/perl
|
||||
|
||||
my @drv = DBI->available_drivers();
|
||||
print join("\n", @drv), "\n";
|
||||
|
||||
If you run the script, you should see SQLite in the output.
|
||||
|
||||
DBM
|
||||
ExampleP
|
||||
File
|
||||
Gofer
|
||||
Proxy
|
||||
SQLite
|
||||
Sponge
|
||||
|
||||
### Perl SQLite Access Example ###
|
||||
|
||||
Here is the full-blown Perl code example of SQLite access. This Perl script will demonstrate the following SQLite database management routines.
|
||||
|
||||
- Create and connect to a SQLite database.
|
||||
- Create a new table in a SQLite database.
|
||||
- Insert rows into a table.
|
||||
- Search and iterate rows in a table.
|
||||
- Update rows in a table.
|
||||
- Delete rows in a table.
|
||||
|
||||
use DBI;
|
||||
use strict;
|
||||
|
||||
# define database name and driver
|
||||
my $driver = "SQLite";
|
||||
my $db_name = "xmodulo.db";
|
||||
my $dbd = "DBI:$driver:dbname=$db_name";
|
||||
|
||||
# sqlite does not have a notion of username/password
|
||||
my $username = "";
|
||||
my $password = "";
|
||||
|
||||
# create and connect to a database.
|
||||
# this will create a file named xmodulo.db
|
||||
my $dbh = DBI->connect($dbd, $username, $password, { RaiseError => 1 })
|
||||
or die $DBI::errstr;
|
||||
print STDERR "Database opened successfully\n";
|
||||
|
||||
# create a table
|
||||
my $stmt = qq(CREATE TABLE IF NOT EXISTS NETWORK
|
||||
(ID INTEGER PRIMARY KEY AUTOINCREMENT,
|
||||
HOSTNAME TEXT NOT NULL,
|
||||
IPADDRESS INT NOT NULL,
|
||||
OS CHAR(50),
|
||||
CPULOAD REAL););
|
||||
my $ret = $dbh->do($stmt);
|
||||
if($ret < 0) {
|
||||
print STDERR $DBI::errstr;
|
||||
} else {
|
||||
print STDERR "Table created successfully\n";
|
||||
}
|
||||
|
||||
# insert three rows into the table
|
||||
$stmt = qq(INSERT INTO NETWORK (HOSTNAME,IPADDRESS,OS,CPULOAD)
|
||||
VALUES ('xmodulo', 16843009, 'Ubuntu 14.10', 0.0));
|
||||
$ret = $dbh->do($stmt) or die $DBI::errstr;
|
||||
|
||||
$stmt = qq(INSERT INTO NETWORK (HOSTNAME,IPADDRESS,OS,CPULOAD)
|
||||
VALUES ('bert', 16843010, 'CentOS 7', 0.0));
|
||||
$ret = $dbh->do($stmt) or die $DBI::errstr;
|
||||
|
||||
$stmt = qq(INSERT INTO NETWORK (HOSTNAME,IPADDRESS,OS,CPULOAD)
|
||||
VALUES ('puppy', 16843011, 'Ubuntu 14.10', 0.0));
|
||||
$ret = $dbh->do($stmt) or die $DBI::errstr;
|
||||
|
||||
# search and iterate row(s) in the table
|
||||
$stmt = qq(SELECT id, hostname, os, cpuload from NETWORK;);
|
||||
my $obj = $dbh->prepare($stmt);
|
||||
$ret = $obj->execute() or die $DBI::errstr;
|
||||
|
||||
if($ret < 0) {
|
||||
print STDERR $DBI::errstr;
|
||||
}
|
||||
while(my @row = $obj->fetchrow_array()) {
|
||||
print "ID: ". $row[0] . "\n";
|
||||
print "HOSTNAME: ". $row[1] ."\n";
|
||||
print "OS: ". $row[2] ."\n";
|
||||
print "CPULOAD: ". $row[3] ."\n\n";
|
||||
}
|
||||
|
||||
# update specific row(s) in the table
|
||||
$stmt = qq(UPDATE NETWORK set CPULOAD = 50 where OS='Ubuntu 14.10';);
|
||||
$ret = $dbh->do($stmt) or die $DBI::errstr;
|
||||
|
||||
if( $ret < 0 ) {
|
||||
print STDERR $DBI::errstr;
|
||||
} else {
|
||||
print STDERR "A total of $ret rows updated\n";
|
||||
}
|
||||
|
||||
# delete specific row(s) from the table
|
||||
$stmt = qq(DELETE from NETWORK where ID=2;);
|
||||
$ret = $dbh->do($stmt) or die $DBI::errstr;
|
||||
|
||||
if($ret < 0) {
|
||||
print STDERR $DBI::errstr;
|
||||
} else {
|
||||
print STDERR "A total of $ret rows deleted\n";
|
||||
}
|
||||
|
||||
# quit the database
|
||||
$dbh->disconnect();
|
||||
print STDERR "Exit the database\n";
|
||||
|
||||
A successful run of the above Perl script will create a SQLite database file named "xmodulo.db", and show the following output.
|
||||
|
||||
Database opened successfully
|
||||
Table created successfully
|
||||
ID: 1
|
||||
HOSTNAME: xmodulo
|
||||
OS: Ubuntu 14.10
|
||||
CPULOAD: 0
|
||||
|
||||
ID: 2
|
||||
HOSTNAME: bert
|
||||
OS: CentOS 7
|
||||
CPULOAD: 0
|
||||
|
||||
ID: 3
|
||||
HOSTNAME: puppy
|
||||
OS: Ubuntu 14.10
|
||||
CPULOAD: 0
|
||||
|
||||
A total of 2 rows updated
|
||||
A total of 1 rows deleted
|
||||
Exit the database
|
||||
|
||||
### Troubleshooting ###
|
||||
|
||||
If you attempt to access SQLite in Perl without installing SQLite DBI driver, you will encounter the following error. You must install DBI driver as describe at the beginning to fix this error.
|
||||
|
||||
Can't locate DBI.pm in @INC (@INC contains: /usr/local/lib64/perl5 /usr/local/share/perl5 /usr/lib64/perl5/vendor_perl /usr/share/perl5/vendor_perl /usr/lib64/perl5 /usr/share/perl5 .) at ./script.pl line 3.
|
||||
BEGIN failed--compilation aborted at ./script.pl line 3.
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: http://xmodulo.com/access-sqlite-database-perl.html
|
||||
|
||||
作者:[Dan Nanni][a]
|
||||
译者:[译者ID](https://github.com/译者ID)
|
||||
校对:[校对者ID](https://github.com/校对者ID)
|
||||
|
||||
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出
|
||||
|
||||
[a]:http://xmodulo.com/author/nanni
|
Loading…
Reference in New Issue
Block a user