суббота, 7 апреля 2012 г.

изменить язык в netbeans 7.1.1

~/netbeans-7.1.1/etc/netbeans.conf
default:
# Options used by NetBeans launcher by default, can be overridden by explicit
# command line switches:
netbeans_default_options="-J-client -J-Xss2m -J-Xms32m -J-XX:PermSize=32m -J-Dapple.laf.useScreenMenuBar=true -J-Dapple.awt.graphics.UseQuartz=true -J-Dsun.java2d.noddraw=true -J-Dsun.zip.disableMemoryMapping=true"
русский:
# Options used by NetBeans launcher by default, can be overridden by explicit
# command line switches:
netbeans_default_options="-J-client -J-Xss2m -J-Xms32m -J-XX:PermSize=32m -J-Dapple.laf.useScreenMenuBar=true -J-Dapple.awt.graphics.UseQuartz=true -J-Dsun.java2d.noddraw=true -J-Dsun.zip.disableMemoryMapping=true --locale ru:RU"
английский:
# Options used by NetBeans launcher by default, can be overridden by explicit
# command line switches:
netbeans_default_options="-J-client -J-Xss2m -J-Xms32m -J-XX:PermSize=32m -J-Dapple.laf.useScreenMenuBar=true -J-Dapple.awt.graphics.UseQuartz=true -J-Dsun.java2d.noddraw=true -J-Dsun.zip.disableMemoryMapping=true --locale en:EN"

четверг, 5 апреля 2012 г.

Install bash IDE.(vim+bash-support)


sudo apt-get install vim && mkdir -p ~/.vim && cd ~/.vim \
&& wget -q -O bash_support.3.9.zip http://www.vim.org/scripts/download_script.php?src_id=17122 \
&& unzip -q bash_support.3.9.zip

среда, 28 марта 2012 г.

Netbeans PHP не останавливается на точках останова.



problem:
  1. Netbeans Xdebug not stop at breakpoints.
solved:
  1. File ->Project Properties ->Sources
  2. uncheck checkbox "Copy files from Sources Folder to another location"


environment:
  1. Ubuntu 12.04
  2. Netbeans 7.1.1(PHP Version: 1.27.2)
  3. PHP 5.3
  4. Xdebug 2.2.0rc1
  5. /etc/php5/conf.d/xdebug.ini
    zend_extension=/usr/lib/php5/20090626+lfs/xdebug.so
      
    xdebug.remote_enable=on
    xdebug.remote_host=localhost
    xdebug.remote_port=9000
    xdebug.remote_handler="dbgp"

среда, 11 января 2012 г.

"????" poco mysql utf8

#include <iostream>
#include "Poco/Data/MySQL/Connector.h"
#include "Poco/Exception.h"
#include "Poco/Data/Session.h"
#include "Poco/Data/Statement.h"

using namespace std;
using namespace Poco::Data;
using Poco::Data::Session;
int main() {

 MySQL::Connector::registerConnector();

 string user = "root";
 string password = "111";
 string host = "localhost";
 string db = "test";

 string connection_str = "user=" + user + ";password=" + password + ";host="
   + host + ";db=" + db + ";auto-reconnect=true";

 string collation_str = "set collation_connection=utf8_general_ci, "
   "character_set_results=utf8, "
   "character_set_connection=utf8, "
   "character_set_client=utf8";

 Session ses("MySQL", connection_str);
 string out;

 try {
  ses << "SELECT name FROM `test` LIMIT 1", into(out), now;
 } catch (Poco::Exception &e) {
  cout << e.displayText() << endl;
 }
 cout << "without collation: " << out << endl;

 try {
  ses << collation_str, now;
  ses << "SELECT name FROM `test` LIMIT 1", into(out), now;
 } catch (Poco::Exception &e) {
  cout << e.displayText() << endl;
 }
 cout << "with collation: " << out << endl;

 return 0;
}
output:
without collation: ????
with collation: тест



SQL:
-- phpMyAdmin SQL Dump
-- --------------------------------------------------------

--
-- Структура таблицы `test`
--

CREATE TABLE IF NOT EXISTS `test` (
  `id` int(11) NOT NULL,
  `name` varchar(250) NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

--
-- Дамп данных таблицы `test`
--

INSERT INTO `test` (`id`, `name`) VALUES
(1, 'тест');
задать глобальное значение utf8 в /etc/my.cnf:
[mysqld]
# Settings user and group are ignored when systemd is used.
# If you need to run mysqld under different user or group, 
# customize your systemd unit file for mysqld according to the
# instructions in http://fedoraproject.org/wiki/Systemd
datadir=/var/lib/mysql
socket=/var/lib/mysql/mysql.sock
# Disabling symbolic-links is recommended to prevent assorted security risks
symbolic-links=0

[mysqld_safe]
log-error=/var/log/mysqld.log
pid-file=/var/run/mysqld/mysqld.pid

[client]
default-character-set=utf8

[mysqld]
character_set_server=utf8
collation_server=utf8_general_ci

пятница, 6 января 2012 г.

install hadson(fedora)


1. скачать
wget http://hudson-ci.org/downloads/redhat/hudson.rpm
2. установить
yum install hudson.rpm
3. запустить
service hudson start
4. проверяем
http://localhost:8080/


четверг, 5 января 2012 г.

Изменение размера шрифта под иконками приложений в GNOME 3

sed -i '719s/font-size: 7.5pt/font-size: 10.5pt/' /usr/share/gnome-shell/theme/gnome-shell.css


.app-well-app > .overview-icon,
.remove-favorite > .overview-icon,
.search-result-content > .overview-icon {
    border-radius: 4px;
    padding: 3px;
    border: 1px rgba(0,0,0,0);
    font-size: 7.5pt;
    color: white;
    transition-duration: 100;
    text-align: center;
}

.app-well-app > .overview-icon,
.remove-favorite > .overview-icon,
.search-result-content > .overview-icon {
    border-radius: 4px;
    padding: 3px;
    border: 1px rgba(0,0,0,0);
    font-size: 10.5pt;
    color: white;
    transition-duration: 100;
    text-align: center;
}