Set Netbeans user Interface language in Windows

Don't know why NetBeans not has an option to choose the user interface language, it use the Windows system language as the default. It took me a while to figure out how to change the interface language. 1. Temporary Solution [code] Add "--locale en:US" at the end of Netbeans startup command. "C:\\Program Files\NetBeans 7.1.1\bin\netbeans.exe" --locale en:US [/code] 2. Permanent Solution Go to Netbeans installation directory, for example, C:\\Program ...

Move copy delete options between Select Menus with Javascript

This javascript snippets perform certain tasks like select one or more of the options, move them or copy or delete between two select menus. You can bookmark the article and use the code whenever you need them. Click here for the online demo. [code] <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> <html> <head> <title>select.html</title> <meta http-equiv="keywords" content="keyword1,keyword2,keyword3&quo...

PHP Operator ===

PHP’s === Operator enables you to compare or test variables for both equality and type. Refer below for example. [code] <?php //define variables.. $str = '9'; $int = 9; //Returns true since both variable contains the same value.. $res = ($str==$int); //Returns false since the two variables are not of the same type.. $res = ($str===$int); ?> [/code]

Create a REST API with PHP

One of the latest (sort of) crazes sweeping the net is APIs, more specifically those that leverage REST. It’s really no surprise either, as consuming REST APIs is so incredibly easy… in any language. It’s also incredibly easy to create them as you essentially use nothing more than an HTTP spec that has existed for ages. One of the few things that I give Rails credit for is its well thought-out REST support, both for providing and consuming these APIs (as its been explained by all the R...

Create web server on Mac

Apache Start Apache [code] sudo apachectl start [/code] Check it's working: http://localhost/ PHP In /etc/apache2/httpd.conf, uncomment this line: [code] LoadModule php5_module libexec/apache2/libphp5.so [/code] Restart Apache [code] sudo apachectl restart [/code] Fix a warning appearing in phpinfo() Create /etc/php.ini and make it writable [code] cd /etc sudo cp php.ini.default php.ini sudo chmod 666 php.ini [/code] In php.ini, find this line: [co...

ExtJS4 Viewport Example

This is an simple example to show you how to create a viewport in ExtJs4. The Viewport renders itself to the document body, and automatically sizes itself to the size of the browser viewport and manages window resizing. There may only be one Viewport created in a page. The Viewport does not provide scrolling, so child Panels within the Viewport should provide for scrolling if needed using the autoScroll config. Unlike the panel component of Ext JS, Viewport does not have a tbar option. ...

ExtJS4 : read posting JSON data in PHP

I am working on a Ext-JS web application which needs to send data to the PHP server side to store. It took me a while to find out how to decodes the receiving JSON string in PHP. Ext-JS Assume you have a model and calling save to send a ajax request. [code] Ext.define('User', { extend: 'Ext.data.Model', fields: ['id', 'name', 'email'], proxy: { type: 'ajax', url : '/users' } }); var user = Ext.create('User', {name: 'Ed Spencer', email: 'ed@...

ExtJS4: Add Custom Right Click Menu in MVC

The way to create a custom menu in mouse right click event function in ExtJS 4 is little different with pre-version. It seems in Ext 4.0.2 they changed event name and arguments order. First, let's see how we create the menu in Ext 3. I get this example from aditia rahman: [code] var menu1 = new Ext.menu.Menu({ items: [ { text: 'I like Ext', checked: true }, '-', { text: 'Open With', menu: { items:...

ThinkPHP中实现gzip压缩

ThinkPHP中似乎没有对gzip的配置选项。不过实现起来还是挺简单的。以下是对 ThinkPHP 2.1 的修改方法。 首先要确定空间是否支持Zlib, 然后找ThinkPHP的控制输出函数output()。 控制输出的文件在 ThinkPHP/Lib/Think/Core 文件夹下,文件名 View.class.php。 [code] /** +---------------------------------------------------------- * 输出模板 +---------------------------------------------------------- * @access protected +---------------------------------------------------------- * @param string $content 模板内容 * @param boolean $display 是否直接显示...

Using Global variables and arrays in Extjs 4

This example will show you how to declare a global var and arrays in Extjs MVC application. You know where to find this code : [code] <script type="text/javascript"> Ext.BLANK_IMAGE_URL = '/Content/images/default/s.gif'; </script> [/code] Global application variable : [code] <script type="text/javascript"> Ext.BLANK_IMAGE_URL = '/Content/images/default/s.gif'; Ext.MY_GLOBAL_VAR = '<?php echo $myGlobalVar; ?>...