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

Friday, February 12, 2010

How to configure Firefox and Firebug to use External Editors

[other] HELP: How to configure firebig editors. - Ubuntu Forums
(I used geany instead of gedit, HL 20100213 )

This will get Firebug to work with Gedit:

in firefoxes address bar type :
about:config
then search for :
view_source.editor.external
- and set this boolean to TRUE

then search for :
view_source.editor.path
- and set this to ' /usr/bin/gedit '

Then open FireBug and add Gedit as an editor:
View -> Open with Editor -> configure Editors
Name it gedit and then browse for the executable within '/usr/bin' and select gedit.
Now you should see '/usr/bin/gedit' underneath 'executable' column in the configured editors window.

How To install OpenOffice 3.2 in Ubuntu

How To install OpenOffice 3.2 in Ubuntu | Ubuntu Geek

This tutorial will explain how to install latest version of openoffice in ubuntu

You can check what is new in openoffice 3.2 from here

First go to the OpenOffice website and download the Linux .deb file (On your desktop)

1 - Once you have done that, extract the .deb file,

OOo_3.2.0_LinuxIntel_install_en-US_deb.tar.gz

Run the following command from terminal or just right click select extract

tar xzvf OOo_3.2.0_LinuxIntel_install_en-US_deb.tar.gz

Then you'll see a file called OOO320_m12_native_packed-1_en-US.9483

2 - You can remove the existing version of OpenOffice if you wish with this command:

sudo apt-get remove openoffice*.*

3 - Copy and paste OOO320_m12_native_packed-1_en-US.9483 onto the desktop then open Terminal and paste this command:

sudo dpkg -i ~/Desktop/OOO320_m12_native_packed-1_en-US.9483/DEBS/*.deb

4 - Then paste this command:

sudo dpkg -i ~/Desktop/OOO320_m12_native_packed-1_en-US.9483/DEBS/desktop-integration/openoffice.org3.2-debian-menus_3.2-9472_all.deb

Once you've done that you'll find OpenOffice 3.2 in Office.

Credit goes here

Thursday, February 11, 2010

How to Debug PHP Using Firefox with FirePHP

How to Debug PHP Using Firefox with FirePHP
July 11th, 2009 by Nuno Franco da Costa

Typically, there are two main ways of debugging server-side code: you can utilize an Integrated Development Environment (IDE) with a built-in debugger or log and perform your debugging processes in a web browser.

How to Debug PHP Using Firefox with FirePHP

This article shares an elegant, simple, and more maintainable way of debugging Ajax apps via the web browser (more specifically for the Mozilla Firefox browser). You'll learn the basics of leveraging Firefox in conjunction with Firebug and FirePHP to implement FirePHP libraries on web apps and logging messages in the Firebug console.

A Brief Introduction

When Ajax techniques became popular, developers faced a new problem: how can we debug Ajax requests and responses efficiently for complex web applications? If using a debugger was hard enough with the RESTful model, triggering an Ajax-specific request is a pain and a bit more difficult; dumping logs and information pertaining to those Ajax operations had to be done using JSON or XML.

A Brief Introduction

This is where FirePHP helps, allowing you to log your debugging messages to the Firebug console. FirePHP doesn't mess with your code (and it doesn't require you to modify anything to trap errors): the messages you print are sent to the browser in the HTTP response headers, which is great when you're using JSON or XML since it won't break their encoding.

This makes FirePHP ideal not only for debugging your Ajax requests, but also your entire PHP codebase.

So, what is FirePHP?

FirePHP is an add-on for an add-on: it extends the popular in-browser web development tool called Firebug with an API for PHP web application developers. FirePHP is free and easily attainable via the Mozilla Add-Ons section on the official Mozilla site. The official FirePHP site can be found via this web address: www.firephp.org. Christoph Dorn is the person responsible for creating FirePHP.

What Do I Need to Get Started?

As you might have guessed, you need three things to get up and running with FirePHP, they are:

  1. Firefox
  2. Firebug
  3. FirePHP

If you don't have all of the above applications installed on your machine, click on their link to learn about how to download them for your particular system.

Installation of the three things above is a straightforward process. FirePHP can be a little tricky to install if you've just recently started learning about web development, but there's good documentation out there about it.

This article is about using FirePHP, so I'll let you handle the installation part (though feel free to ask in the comments – we'd be happy to help if you encounter issues).

A Couple of Tips

Once you've installed FirePHP, and included it in your web application, you are ready to debug and log data. But first, I'd like to share two helpful tips I've learned:

Tip #1: call ob_start()

Because the information is sent to Firebug in the HTTP Headers, you should activate the output buffering or you might get the "headers already sent error". It may sound complicated, but all you have to do is write ob_start() on the first line of your PHP script that you're debugging.

Tip #2: don't forget to disable FirePHP Logging when you go live

You have to disable FirePHP when the site goes live or you will risk exposing sensitive information to anyone that has Firebug/FirePHP installed (we'll talk about how to do this later down the article).

And then just a general tip for Firebug/FirePHP users: it's also a good idea to disable or suspend Firebug and FirePHP when you're just browsing the web because they can really slow down some websites and web applications (such as Gmail, for example).

Getting Started with FirePHP Logging

This is the fun part where we start logging messages and reviewing the basic logging functions.

One thing to note is that, just like PHP, which (at least for PHP4 and PHP5) is a "pseudo object-oriented" language, you can use FirePHP in a procedural or object-oriented (abbreviated OO from now on) manner.

I prefer the object-oriented techniques and I encourage you to use the same pattern as it is considered the most popular and most modern approach to building apps.

The OO API allows you to instantiate a Firebug object to use it or to call its static methods directly. I'm a lazy guy and because static methods are more terse and require less typing, that's what I use.

Instantiating the OO API Object

In your script, you can use the following code block to create the FirePHP object ($firephp).

require_once('FirePHPCore/FirePHP.class.PHP'); $firephp = FirePHP::getInstance(true); $firephp -> [classmethod]

OO API with Static Methods

This is the format for calling static methods in your scripts.

require_once('FirePHPCore/fb.PHP'); FB::[nameofmethod] 

The Procedural API

Here's how to use FirePHP's Procedural API:

require_once('FirePHPCore/fb.PHP'); fb($var) fb($var, 'Label') fb($var, FirePHP::[nameofmethod])

We will not get into any detail about the benefits and coding style of each API, I've included them here only so you see what options are available for you. In other words, I don't want to start a flame war about which procedure is better – it's up to you to decide and I've noted my preference.

Logging Messages and Information in the Firebug Console

Let's talk about logging messages in the Firebug console (remember, this will only work if you've configured your app for FirePHP).

Examples of Basic Logging Calls

If you are ad-hoc debugging a bug, the following examples are what you'll be interested in utilizing.

Fb::log("log message")

This will print a string that you pass to it onto the Firebug console. Using the above example results in the following message:

Log message.

Fb::log($array, "dumping an array")

Passing an array (no more for loops or print_r() in your scripts) outputs the content of your array. The above example will result in the following message in the Firebug console:

Dump message array

Tip: when you hover your mouse on logged variables in the Firebug console, an info window will appear in the web page containing all of its elements. It's a nifty feature, don't you agree?

Variable Viewer

Logging an Information Message

Here is an example of logging information messages using the info method.

Fb::info("information")

This is the message it logs in your Firebug console:

info message.

Logging a Warning Message

Here is an example of logging a warning message.

Fb::warn("this is a warning")

This is the message it logs in your Firebug console:

Warning message

Logging an Error Message

Here is an example of logging a warning message using the info method.

Fb::error("error message") 

Here's what an error message looks like in the Firebug console:

Error message.

Enabling or Disabling FirePHP Logging

When your site goes live, you can (and should) disable FirePHP logging. Call the following line of code on the first lines of your script.

FB::setEnabled(false);

What's great about this is that you can leave all of your FirePHP code in your scripts for later use – just pass either true or false when you want to turn logging on or off.

If your application uses a "config file" to keep track of global settings, it is advisable to set a configuration option to enable or disable it.

Conclusion

First, here's a screen capture showing all of our messages in Firebug all at once (I ran it sequentially).

Conclusion: all together now

In this article, we covered the very basics of using FirePHP to help you debug and gain information about your PHP/Ajax applications easier and through the web browser. I hope that this results in you becoming convinced that you should explore your debugging options outside of "old-school" techniques such as using echo or print on top of your web page layout to see what a variable or array contains. Using FirePHP is so easy and convenient, and gives you much more options and data for debugging purposes.

In a future article, I'll be covering more complex features of FirePHP and using Firebug to make this simple debugging tool a more robust and fully-featured logging framework.

So stick around, don't forget to subscribe to the Six Revisions RSS feed so you get a note when that article is posted. * Article edits by Jacob Gube

Related content

About the Author

Nuno Franco da Costa is a web developer and sys admin. By day, he works at a design agency coordinating the development and sys admin teams where he developed a PHP MVC framework and a WEB 2 CMS. He loves to code and has a "getting things done" attitude. You can find over at his online presence www.francodacosta.com

Desktop publishing for Linux at its finest

Desktop publishing for Linux at its finest - ZDNet.co.uk
Thursday 11 February 2010, 1:39 PM
Posted by apexwm

Over the years, Linux has lacked a good all-around desktop publishing application. Well, those times are over. Enter: Scribus. Scribus is a great application, that ties in features from proprietary programs like Adobe PageMaker, Adobe InDesign, Quark xPress, Microsoft Publisher, and others. Over the years I've used a few of the proprietary programs, mostly PageMaker and Quark xPress. If you are familiar with these proprietary programs, using Scribus will be like second nature. Its features and functionality are similar enough that you will easily be able to catch on and learn it, and hopefully migrate over to it and save yourself from re-purchasing those pesty proprietary programs over and over.

The first time I used it, I was pleasantly surprised to see how its interface is very clean, straightforward, yet packed with features. Inserting text elements, graphics, editing the text, everything. And, it has a powerful PDF Export feature, complete with prepress quality options.

There is one caveat with this program though. It cannot import any proprietary files, i.e. PageMaker files. If you have old files that you created in a proprietary program, you must recreate the file from scratch. Apparently the developers of Scribus did not want to encounter any issues with the proprietary programs, so they decided to stay away and make Scribus completely independent.

It's too much to go through here, but if you do any sort of desktop publishing it's definitely worth checking out. If you use Linux, Scribus should be available with your distribution.

Wednesday, February 10, 2010

The Zen Cart Execution Process

以:http://192.168.0.161/lightbox/index.php?main_page=account 为例

We know $main_page=account

index.php will do the following:

1. it loads 'includes/application_top.php'

This file will load in all of general definitions used site-wide, initialize some site-wide classes ($template, $db) and do other general stuff.

2. it loads all of the files starting with 'header_php' in 'includes/modules/pages/account'

'header_php.php'

3. now it loads from includes/templates/mytemplate/common/

'html_header.php'

The default html_header.php file will simply create all of the HTML up to the </head> tag

It loads 'includes/modules/meta_tags.php',

It loads 'includes/templates/mytemplate/css/style*.css'

It loads 'includes/templates/mytemplate/js/jscript_*.js'

'main_template_vars.php'

set $body_code to: includes/templates/mytemplate/templates/tpl_{$main_page}_default.php (tpl_account_default.php)

Here all of the program logic and variables will be mixed up with the actual displayed HTML code

'tpl_main_page.php'

this file lays out the basic page.

1. <body>

2. loads the 'includes/modules/header.php' file

3. if the left column is enabled, it loads 'includes/modules/column_left.php'

4. it loads the file set in $body_code (tpl_{$main_page}_default.php &#20063;&#23601;&#26159;: tpl_account_default.php)

5. if the right column is enabled, it loads 'includes/modules/column_right.php'

6. loads 'includes/modules/footer.php'

7. </body>

Reference: The Zen Cart Execution Process

Google发布Gmail微博客Google Buzz

Google发布Gmail微博客Google Buzz-月光博客

  今天,Google在其最热门的产品Gmail中发布了一个重要的社交网络服务Google Buzz,该服务类似Twitter等热门社交网络服务,可让Gmail用户分享自己的状态更新,可从浏览器或手机终端使用,目前这项服务正在分批向Gmail用户开放,预计不久Gmail用户都会看到这项功能。

  Google的这项服务将对Twitter产生一定的压力,Yahoo则称自己早在1年半前就推出过Yahoo Buzz(其实这个产品和Google的并不一样),微软则对Google Buzz进行了抨击,称人们不需要再多一个社交网络了。目前Gmail是全球第三大电子邮件服务,使用量仅次于雅虎邮件和微软Hotmail。

  对于中国用户来说,Gmail支持微博客后,有可能会导致Gmail服务被屏蔽,这是一个令人悲哀的预测,我的工作生活已经离不开Gmail了,如果用不了这个服务,那么上网的一半事情都做不了。

  因此,虽然我现在还没有开通Google Buzz,不知道Buzz实际是什么样子,但我还是希望Google Buzz是类似QQ邮箱的那种微博,从外部无法访问,登录后才能看到,这样的话即保护了隐私,又避免了被墙。不过从QQ邮箱的微博使用情况来看,这么设置的话可能不会有太多人使用。

Google发布Gmail微博客Google Buzz

  由于Google Buzz在iPhone中默认就能使用,喜欢尝鲜的用户可以安装Firefox扩展User Agent Switcher,然后设置User Agent为iPhone 3.0就可以模拟iPhone使用Google Buzz的功能,我目前就是通过这种方法提前体验Buzz,但是在电脑的浏览器上却依然看不到Buzz的链接。

  Google Buzz默认使用了Google Reader的好友关系,我刚刚登录使用,就有了1137个followers,并Following了407个人,用户的发言可以在自己的个人Google Profile地址中显示,这让我更加担心google.com的安危了。

  Google以前在Google Reader中也曾经推出过类似微博客的产品,界面和功能都克隆Twitter,可惜最终并未成功,但是这次,我比较看好Google Buzz,虽然以前Google Reader的微博失败了,但因为Google Reader是个小众产品,而Gmail是个大众产品,只要有1%的Gmail用户使用Buzz,那就有几十万用户,这是其他微博客产品所不敢想象的。

  在我使用Buzz的过程中,发现只要自己发布或者参与过的信息有更新,Buzz都会发邮件一个邮件,这点设计的太不好了,容易让人受到邮件骚扰,LifeHacker介绍了一个防止被Buzz邮件打扰的办法,创建Gmail过滤器,包含字词label:buzz,将其存档并标记已读即可。

  Google Buzz API 已经开放了,可供第三方程序调用,API的地址是: http://code.google.com/apis/buzz/

Tuesday, February 9, 2010

2010中国互联网十大话题

2010互联网十大话题 - Discovery-X - 博客大巴

版权声明:转载时请以超链接形式标明文章原始出处和作者信息及本声明
http://kenyiken.blogbus.com/logs/57867235.html

2010新年伊始,互联网就弥漫着硝烟,IT大鳄们运筹帷幄,不断推出新产品,为自己在2010年大战中投入更大的筹码。互联网的十大话题也将影响着今年的互联网格局,并且关系着很多网络工作者今年的Money。

一 "网络视频混战"精彩

国外的视频领域已分成两派,一个是以版权内容为主的主流资讯网站,代表选手是由NBC和新闻集团共同注册成立的Hulu; 另一个派别就是以YouTube为代表的视频分享网站,强调原创性和自由分享。国内则更为复杂,百度、网易等准备开始做以版权内容为主的视频网站,再加上搜狐、酷6等大规模删除非版权内容,而以视频分享为主的土豆和优酷也于2月3号下午在北京结盟,宣布互相开放片库、启动联播机制、联合版权采购以及一系列更具垄断性的合作模式。但这只是互联网的视频网站变化,另外实力也相当强大的中央电视台推出"中国网络电视台"、湖南电视台推出"芒果TV"和浙江广电集团推出"新蓝网"等,广电一直强调建立可控可管的网络,网络视频国家队的出现,有望在互联网视听行业起到标杆作用。同时,它们具有丰富的节目源,可谓是有备而来、来势汹汹,预示着网络视频竞争的更趋白热化。

二 "微博大战"势在必行

腾讯、新浪、搜狐和网易四大门户目前都推出微博产品,正因为微博引领潮流,趋于年轻化,博客却区域老龄化。目前,围绕微博的微型小说已可以盈利,微博可创造微型小说黄金时代;并且可以通过微博制作事件营销,比昂贵的电视广告可经济实惠得多;新浪已从微博的运营中尝到了甜头。不甘落后的腾讯先关闭了滔滔业务,将微博拉入内测阶段。你还没有微博,你可就OUT啦!

三 "HTML5终结Flash"愈演愈烈

Html5并不是刚研发出来的,诞生于2004年,知道前些日子苹果的新产品ipad由于不支持flash,Html5将取代flash的讨论才一波接着一波,Html5的优点在于它是一种协议标准——或者至少在该项技术成熟后就可以成为标准,而不是象Flash那样,是一种单一厂商解决方案。Html5替代Flash是大势所趋,但现在仍是flash的天下,Html5登上互联网的舞台仍需时日。

四 "个人建站"比西天取经都难

昨天,著名博客"不许联想"被禁止访问了,个人以后还能建站吗?前两天CNNIC还在打捞落水的网站,允许个人注册CN域名,在不到半个月时间从CNNIC提供的每日域名删除列表中看出,一月份有超过117万个CN域名被删除。ICP备案,现在已经很明确地开始撤销博客备案了,连很多服务器接入商都禁止开设的站点内容:

1、论坛、博客、信息发布(二手信息、租房发布、产品信息发布)
2、视听(电影、视频、音乐内容或者链接)
3、导航及搜索引擎(包括调用链接)
4、时事新闻类
5、两性、性用品及药品(包括保健品)、医疗器械、聊天室、医疗药品及器械广告
6、企业留言板被暂停的,必须将留言板删除或者将留言内容隐藏,只能管理员查看,不准公开。才可恢复正常运行。
7、小说、私服、彩票收费服务站点目前。

我们的自由啊?

点此查看明天CINNS拟删除域名名单

五 "网瘾战争"及时雨

去年,从很多戒网瘾专家,到"水妖pk陶宏开"、"卡巴斯基提示家长控制孩子的上网时间",可以看出全社会都在关注此事。互联网发展十分迅速,给我们生活、学习、工作各个方面带来了便利,但让很多人沉迷其中,干扰了正常的生活,这就出现问题了!成年人的自控能力优于未成年人,所以沉迷于网络的主要是学生,不仅影响身体,还拖累学习。解决网瘾问题,迫在眉睫!

六 "网店经营"前景忧

日前,个人网店即将进行实名注册,大交易量个人卖家需缴纳税费等消息在业界传得沸沸扬扬。日前,国家工商总局表示,相关办法尚处于调研论证阶段,待时机成熟后再正式向社会公开征求意见。本来网店竞争就很激烈,这一来给想开或经营网店的朋友不少压力,但就目前来说,这些措施对于打假并没有什么帮助,还有可能抬高物价。

七 "杀毒软件跌地"啦

近日杀毒软件纷纷降价,连世界第二的卡巴斯基也在其中。瑞星打出瑞星2010版新品半年免费,30元用1年的广告语;江民打出KV2010杀毒软件128元用三年,并且可以装三台电脑的口号;卡巴斯基2010版也不示弱,扛起了三年版仅售158元的大旗……而三年前,一套瑞星杀毒软件的售价高达299元。这跟360杀毒不无关系,而且360宣称360杀毒用户已超过瑞星,杀毒大佬们不再能安稳的坐着了,与免费的360较量一番,一定会很精彩!

八 下一个"后宫优雅"和"贾君鹏"

网络营销已不单单局限于在网络上简单的放置商家的广告,那样收效甚微。事件营销就越来越受到广告商的青睐,可以省去邀请明星代言那么昂贵的费用,又可以让商品在事件想病毒一样疯狂的传播时得到推广,收效更佳。09年的"贾君鹏"和"后宫优雅"就是两个非常成功的网络营销策划。2010下一个会是谁?

九 "偷菜"继续疯狂

09年已经种下了很多菜菜,下一年一定要收的。农场的成功预示着社交游戏的潜力,开发出受欢迎的游戏一定会在新年中重新席卷神州大地。微博中也将是这些游戏争夺的领地,而且会是更有效的展示舞台。社区、微博等都伸开双臂欢迎优秀游戏的加入!

十 后谷歌时代

谷歌退出中国的事件并不会结束,中国是世界上最大的互联网市场,谁不垂涎?谷歌会把肥肉留给别人,再者言,中国的网络是开放的自由的,我们要向谷歌学习"创新",这是中国互联网"急缺的"。这不应该成为政治竞争的借口,但美国今日又鼓励美在华公司效仿谷歌,我们坚决不允许。我们也有人在抵抗"后谷歌时代"的到来,创立了 "谷姐"。我们欢迎你Google,但要遵守我们的规则,我们还要超过你!我们拭目以待2010!互联网会更精彩!

原创文章如转载,请注明:转载自 望水一鱼 [ http://kenyiken.blogbus.com/ ]

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,然...