Currently Browsing

developing

How to generate Joomla article alias for cyrillic title

JFilterOutput::stringURLUnicodeSlug($title);
Share

Installing FANN on MacOSX 10.7 with Python binding

FANN is a great artificial neural network library that has a low of language bindings. The latest version for now is 2.2. I’ve installed it at first. But than I discovered that python binging is part of 2.1 version not 2.2. So the plan is as follows.

Share

Installing python3 on MacOSX

After downloading and installing python3 from original dmg package just add to ~/.bashrc or ~/.bash_profile alias:

alias python=/usr/local/bin/python3.2

And restart the Terminal.

Share

The very base structure of Yii application

This is some modification of Neil McGuigan’s article.

The base structure for Yii app goes as follows:

/index.php
/protected/components/controller.php
/protected/config/main.php
/protected/controllers/SiteController.php
/protected/runtime/
/protected/views/site/index.php
Share

Setting up Kohana 3.2 unittest module

From 3.0 version Kohana has an official unittest module. There’s a great manual from Lysender how to configure it. But some things from this manual didn’t work for me so here’s the way how I’ve configured unittest module.

PHPUnit

First, you need PHPUnit 3.5 installed. It’s important. Not 3.6 (or even 3.7). If you’ve already PHPUnit 3.6 installed here’s a manual how to downgrade (for MacOSX, but for other systems it works in similar way).

Share

Arr::map doesn’t correctly work with multidimensional arrays whithin given $keys

I don’t know exactly whether this is a bug or a feature. But when I’m using Arr:map for multidimensional array like this

Array ( [user] => Array ( [add] => some ) [test] => test )

And when I want to apply some function with

$keys = array ('add')

, it has been applied to all items! I mean if some of key is located beneath the first layer it is ignored. This happens because of this line (SYSPATH/classes/kohana/arr.php, 372):

$array[$key] = Arr::map($callback, $array[$key]);

I think it should’ve been changed to

$array[$key] = Arr::map($callback, $array[$key], $keys);

Original post in kohana community.

Share

How to add custom fields to Joomla 1.7 registration form

There are ways to do so.

  1. There are some predefined fields in User-Profile plugin. Like address or ZIP. So if you want to use them just activate this plugin and configure it as you like.
  2. If you want to add your own custom fields you must have access to database where your site data is stored.
Share

How to install apache + mysql + php on MacOSX

Apache2 and PHP are already installed on system.

Apache2 config is located here

/etc/apache2/httpd.conf

To load php module uncomment line

LoadModule php5_module libexec/apache2/libphp5.so
Share

Как перерисовывать PictureBox (и не только)

Практически всегда при отображении картинки (битмапа) встаёт задача перерисовки элемента. Большинство советов  выглядат так: на событие (например, изменение размеров) вызываем Invalidate, который в свою очередь вызывает OnPaint, то есть фактически перерисовку элемента, а в OnPaint можно уже пихать всё что хочется. Проблема заключается в другом: когда я отрисовываю график, я не хочу каждый раз его строить, поскольку это очень затратно по времени (особенно, если много точек), гораздо проще запихнуть его в битмап, а потом этот с этим битмапом играться, не забывая в нужных местах делать Dispose, чтобы не было утечек памяти.

Share

How to add services to autoload on CentOS

Command chkconfig does allow this. If you type chkconfig –list you’ll see the list of currently known services.

Share

Using parameter %s in Joomla language files

Sometimes you want to write in your ini files something like

MESSAGE=Thank you for registration, %s! Now you can <a href="%s">login</a>.

and then while displaying this message substitute necessary strings instead of %s.

So. Joomla does allow this but only for language files. To parse this message you should write

JText::sprintf('MESSAGE', $username, $url)

The first parameter is property name. The second parameter $username goes for first %s, $url goes for second %s and so on.

Share

Problem with uploading files to ccBoard

ccBoard is a forum extension for Joomla CMS. One of the best actually.

The only problem I’ve encountered with is the problem with file upload. I couldn’t upload some files even if ccBoard settings and Joomla global settings are ok.

The solution is that file name shouldn’t contain certain symbols. After some testing I’ve found out that correct symbols (that file name should consist of) are latin letters, dot and space.

UPD: ccBoard is now in Joomla vulnerable extensions list. So until the developer fixes it please do not use this forum. I like Discussions instead.

UPD2: It seems that author has fixed this vulnerability.

Share