1 / 3
Caption Text
2 / 3
Caption Two
3 / 3
Caption Three margin testing

Thursday, December 10, 2009

2009 年终 Google Zeitgeist 中国

Google:Zeitgeist 2009

从娱乐明星到商业商户,从股票信息到网络游戏,从3G是什么的追问到《建国大业》《窃听风云》,如果今天的你还把网络与现实截然隔离的话,那么你已经"奥特曼"了。搜索与网络正在像空气与水一样将我们包围。每一个用户因为不同的需求,不断的输入着各种各样的搜索关键词,而这些关键词汇聚成河流就成为了你的网络ID。"年年岁岁花相似,岁岁年年人不同",当2009年接近尾声的时候,让我们来共同回望"中国2009 "的网络印记,"3G"与"创业板","杯具"与"奥特曼","小沈阳"与"周立波","曾轶可"与"李宇春"哪一个背后不包含着一段"2009年中国"特有的网络故事呢?那么下面就让我们一起走进这些故事中去吧!

上升最快

  1. 周立波
  2. 斗罗大陆
  3. 潜伏
  4. 走西口
  5. 许宗衡
  6. Renren
  7. 变形金刚2
  8. 武林英雄
  9. 国庆阅兵
  10. dnf官网

最受欢迎名人

  1. 小沈阳
  2. 张筱雨
  3. 刘德华
  4. 迈克尔 杰克逊
  5. 周杰伦
  6. 刘亦菲
  7. 曾轶可
  8. 张柏芝
  9. 章子怡
  10. 李 宇 春

最受欢迎游戏

  1. Dnf(地下城与勇士)
  2. 魔兽世界
  3. 穿越火线
  4. 传奇
  5. 连连看
  6. qq 炫舞
  7. 魔域
  8. 梦幻西游
  9. qq飞车
  10. 热血三国

最常被问到的"为什么"

  1. 六个为什么
  2. 人为什么活着
  3. 为什么要入党
  4. 犹太人为什么优秀
  5. 为什么要结婚
  6. 你为什么说谎
  7. 为什么会磨牙
  8. 为什么喜欢你
  9. 为什么会打嗝
  10. 为什么会耳鸣

最受欢迎

  1. 百度
  2. uusee
  3. 淘宝网
  4. 开心网
  5. 优酷
  6. 校内网
  7. qq
  8. 163
  9. 土豆 网
  10. Sina

最受欢迎电影

  1. 色戒
  2. 建国大业
  3. 变形金刚 2
  4. 南京 南京
  5. 赤壁
  6. 风声
  7. 画皮
  8. 色即是空
  9. 窃听风云
  10. 古惑仔

上升最快股票

  1. 中国平安(601318)
  2. 武钢股份(600005)
  3. 中信证券(600030)
  4. 宝钢股份(600019)
  5. 中国远洋(601919)
  6. 紫金矿业(601899)
  7. 民生银行(600016)
  8. 中国石化(600028)
  9. 中国铝业(601600)
  10. 中金黄金(600489)

最常被问到的"是什么"

  1. wifi是什么
  2. erp是什么
  3. twitter是什么
  4. 什么是3g
  5. facebook是什么
  6. skype是什么
  7. vpn是什么
  8. 什么是寿司
  9. 幸福是什么
  10. sap是什么

Wednesday, December 9, 2009

How to reset my WordPress admin password?

How to reset my WordPress admin password?

You have to do this through the WordPress database directly. The most convenient way to manage the database is via the phpMyAdmin tool at your web hosting account.

Once in phpMyAdmin select the WordPress database from the drop-down menu on the left. The page will refresh and the database's tables will be displayed on it. Open the SQL tab (look at the top navigation bar).

In the text field write the following SQL query:

UPDATE `wp_users` SET `user_pass` = MD5( 'new_password_here' ) WHERE `wp_users`.`user_login` = "admin_username";

"new_password_here" - replace this with the new password you wish to use.
"admin_username" - replace this with the username the password should be updated for.

Once you are ready, click on the GO button to submit the query. If everything goes fine without errors, you should be able to login to WordPress with the new password.

If you have problems resetting the password yourself, ask your host for assistance. SiteGround provides the best WordPress hosting and such requests are handled with ease.

How to Move WordPress Blog to New Domain or Location

How to Move WordPress Blog to New Domain or Location » My Digital Life

For blogger who self-hosts the WordPress blog publishing system on a web hosting server with own registered domain name, sometimes, you may decide to reorganize the blog link URL to make it tidier or to reflect new focus or theme of the blog. If you decide to change the URL or link location of your WordPress blog due to changing of domain name (such as from http://www.old-domain.com/ to http://www.new-domain.com/) or the blog to another directory location (such as from http://www.domain.com/ to http://www.domain.com/blog/), there are some steps that should be done to ensure the proper migration and no breaking links.

The tricky part when moving WordPress blog to another location is that WordPress is using absolute path in URL link instead of relative path in URL link location when stores some parameters in database. Within blog posts' contents itself, users may also use the old URLs when creating reference backlinks. All these values in the database will need to be changed when WordPress is moved. The following guide will show you which database fields that has references or values related to blog's URLs that you want to modify. Note that this guide is not about how to move WordPress blog from one server or host to another new hosting service.

Once the blog has been moved (all files copy over in case of moving location or server or new domain name properly propagated across Internet for new domain name), the first thing to change is to tell WordPress the new blog location (wp-config.php should be no changes, and .htaccess file should be also no changes. If for some reason mod_rewrite rules for friendly URLs no longer works, you can always regenerate the .htaccess file via WP Administration's Update Permalinks page). This value can be changed via WordPress Options page, but if you no longer able to access to old blog URL, you have to modify the value via MySQL database.

Note: The guide uses SQL statements based on MySQL replace() function to modify the database. To run SQL queries, login to MySQL database that houses WordPress tables via phpMyAdmin or loginto the DB server and run MySQL client as root.

To update WordPress options with the new blog location, use the following SQL command:

UPDATE wp_options SET option_value = replace(option_value, 'http://www.old-domain.com', 'http://www.new-domain.com') WHERE option_name = 'home' OR option_name = 'siteurl';

After that you will need to fix URLs of the WordPress posts and pages, which translated from post slug, and stored in database wp_posts table as guid field. The URL values in this field are stored as absolute URLs instead of relative URLs, so it needs to be changed with the following SQL query:

UPDATE wp_posts SET guid = replace(guid, 'http://www.old-domain.com','http://www.new-domain.com');

If you have linked internally within blog posts or pages with absolute URLs, these links will point to wrong locations after you move the blog location. Use the following SQL commands to fix all internal links to own blog in all WordPress posts and pages:

UPDATE wp_posts SET post_content = replace(post_content, 'http://www.old-domain.com', 'http://www.new-domain.com');

Browse through WordPress blog to check if everything is okay. You also need to re-login to WP Administration as authentication cookie has now became invalid due to different domain.

Tuesday, December 8, 2009

Howto Clean up your packages

Howto Clean up your packages | Ubuntu Geek

It's worthwhile to do this every now again again on your ubuntu box when you've been installing and uninstalling new apps. This will go through and check which packages have been installed that are no longer needed. It will then remove them for you

apt-get autoremove

Output looks like below

Reading package lists… Done
Building dependency tree
Reading state information… Done
The following packages were automatically installed and are no longer required:
libcommoncpp2-1.5.3-0
The following packages will be REMOVED
libcommoncpp2-1.5.3-0
0 upgraded, 0 newly installed, 1 to remove and 29 not upgraded.
Need to get 0B of archives.
After unpacking 688kB disk space will be freed.
Do you want to continue [Y/n]?

Here you need to select Y to remove these packages

EtherPad: Realtime Collaborative Text Editing

EtherPad: Realtime Collaborative Text Editing

EtherPad is the only web-based word processor that allows people to work together in really real-time.

When multiple people edit the same document simultaneously, any changes are instantly reflected on everyone's screen. The result is a new and productive way to collaborate on text documents, useful for meeting notes, drafting sessions, education, team programming, and more.

Introduction to the xmonad Tiling Window Manager

Introduction to the xmonad Tiling Window Manager | Tombuntu
Posted by Tom in software

(Tried, but removed, HL)

What good is having a large display if you're constantly rearranging windows to fit them on the screen? I got tired of try to fit a web browser with other smaller windows and decided to try xmonad, a tiling window manager that could do this for me.

A tiling window manager arranges your windows in a grid. This maximizes window sizes and prevents any window from obscuring another.

xmonad displaying a few windows

Installing xmonad
xmonad is available from the Ubuntu repositories. Install xmonad from the package xmonad (click the link to install), or by running the command below in your terminal:
sudo apt-get install xmonad

A number of dependencies will be installed with xmonad. They are needed because reconfiguring xmonad requires recompiling it. (Don't worry, this is handled automatically.)

I'd also highly recommend installing dmenu, a simple application launcher that integrates with xmonad. Install dmenu from the package dwm-tools (click the link to install), or by running the command below in your terminal:
sudo apt-get install dwm-tools

From the login screen, you should now be able to select an xmonad session and log in to start xmonad.

The basics of using xmonad
Note: All the keyboard commands you'll use with xmonad begin with what's called the mod key. The default mod key is the left alt key.

If no windows are open xmonad will just display a blank screen. Open a new terminal window with mod+shift+return. With only one window open, xmonad will let it use the entire screen.

Instead of running more applications using the terminal, let's use the dmenu launcher. If you have dmenu installed, pressing mod+p with open it on the top of the screen. Start typing to find an application, use the right and left arrows to select a result, and press return to run the selected application. Press escape to close dmenu if you decide not to run anything.

Open some applications so you have more windows to experiment with. Notice how xmonad splits the screen down the center. On the left side is the master pane by itself. On the right side all the other windows are displayed stacked on top of each other.

xmonad tall layout

Press mod+space to cycle though different tiling algorithms. By default there are three: tall (vertical split with master pane on left), mirror tall (horizontal split with master pane on top), and full (one window displayed full screen).

The currently focused window is displayed with red borders. You may have already noticed that you can focus a window by moving the mouse over it. On the keyboard, switch focus using mod+j (focus next window) and mod+k (focus previous window).

Perform the equivalent of clicking a conventional window manager's close box for a window by pressing mod+shift+c.

What if you want to move a window into the master pane? The simplest way to do this is mod+return, which swaps the currently focused window into the master pane. For finer control of where windows are displayed use mod+shift+j (move the focused window up) and mod+shift+k (move the focused window down).

If the master pane is not the right width (tall mode) or height (mirror tall mode), you can resize it using mod+h (smaller) and mod+l (larger).

Like most window managers, xmonad offers multiple workspaces. By default you get nine workspaces, each corresponding to a number key. Pressing mod+[num], where [num] is from 1 to 9, will switch you to that workspace. Use mod+shift+[num] to move the focused window to the specified workspace.

You may have noticed that some applications and dialog windows are not tiled normally. These are floating windows, which you can move and resize like windows in a conventional window manager. To float any window yourself, hold down the mod key and drag the window with the left mouse button. Once a window is floated you can move it around the screen in the same manner. Use the mod key and right mouse button to resize a floated window. Tile a window normally again by focusing it and pressing mod+t.

With these basics, you should be able to start using xmonad.

Reconfiguring xmonad
xmonad is configured using a Haskell source file (~/.xmonad/xmonad.hs); you will need to create this file for your user:
mkdir ~/.xmonad
touch ~/.xmonad/xmonad.hs

The easiest way to get started customizing xmonad is using a template configuration file containing all the default settings and comments explaining what they do. Such a template is available on the xmonad wiki. Paste it into your ~/.xmonad/xmonad.hs file. You'll probably want to change the myTerminal setting back to gnome-terminal (or your own preferred terminal) instead of xterm.

The mod+q key combo will reconfigure xmonad with your settings, and restart it. This process happens very fast and nearly seamlessly, you might miss it! If there's an error in the configuration file, xmonad will fall back to the previous settings and display an error dialog.

Read though the template configuration file and have fun customizing it to your tastes!

These are only the basics, you can do much more with xmonad than what I've covered. The xmonad documentation is a good resource if you want to learn more.

Sunday, December 6, 2009

Google Analytics推出异步跟踪分析

Google Analytics推出异步跟踪分析-月光博客

  据Google Code博客报道,Google宣布推出Google Analytics异步跟踪模式,用来提高使用Google Analytics的用户体验,提高用户的访问速度。

  新的代码具有以下优点:

  1、网页能更快地加载跟踪代码,改善浏览器加载时间。

  2、增强数据收集的准确性。

  3、消除因JavaScript代码未完全加载而差生的错误。

  这里是新的统计跟踪代码示例

<script type="text/javascript">

var _gaq = _gaq || [];
_gaq.push(['_setAccount', 'UA-XXXXX-X']);
_gaq.push(['_trackPageview']);

(function() {
var ga = document.createElement('script');
ga.src = ('https:' == document.location.protocol ? 'https://ssl' :
'http://www') + '.google-analytics.com/ga.js';
ga.setAttribute('async', 'true');
document.documentElement.firstChild.appendChild(ga);
})();

</script>

  异步跟踪代码的第一部分分配了_gaq变量的JavaScript数组,此后,两个API调用将编码后的数据写入此数组,当跟踪代码初始化的时候,它把数组_gaq的数据加载到一个新的对象中,并执行跟踪API调用此数组中的初始数据,因此,使用这样的代码,可以将所有跟踪统计所需要的数据全部存储下来,即使Google Analytics的代码还没有下载完,因此就不必再担心ga.js跟踪代码的依赖性问题了。

  该代码的下半部分动态创建了一个script元素,并设置好合适的地址,因此,大多数浏览器将在另一个script代码中加载跟踪代码,以减少网页加载时间。

  一旦代码被加载,就会将_gaq数组转换为一个谷歌分析的_gaq对象,该队形做为基础的_gat对象执行所有命令,将数据发送到用户的Google Analytics账户。

  新的异步跟踪代码正处于测试阶段,可供所有的Google Analytics用户使用,这个代码是可选项,原有的Google Analytics代码依旧工作正常,不过,如果你想要提高你网站的速度并增加分析数据的准确性,建议使用这个新代码。该代码的开发文件参见这里,示例参见这里

Featured Post

Windows和Ubuntu双系统完全独立的安装方法

http://www.ubuntuhome.com/windows-and-ubuntu-install.html  | Ubuntu Home Posted by Snow on 2012/06/25 安装Windows和Ubuntu双系统时,很多人喜欢先安装windows,然...