2011-10-21

Netbeans 7.0.1, SVN (Subversion) 1.7, CYGWIN and TortoiseSVN

Environment: MS Windows


I upgraded the CYGWIN, and the version of SVN upgraded to 1.7

$ svn --versionsvn, version 1.7.0 (r1176462)   compiled Oct 11 2011, 10:36:16
Everything went smooth with "svn upgrade" of the folders.


$ svn help upgrade: Upgrade the metadata storage format for a working copy.usage: upgrade [WCPATH...]
NetBeans, however, gave me an hour of headache.


Here are my discoveries (things to do are marked in bold)

  1. By default, NetBeans uses internal SVN client and not the on specified in Options - SVN command line.
  2. To use the command line client, there is an option:
    -J-DsvnClientAdapterFactory=commandline
  3. Adding that option to NetBeans config file did not help. Had to add this as a parameter to the shortcut launching NetBeans
  4. CYGWIN does not like being called from NetBeans. First, it complains about MS-DOS paths (C:\blah-blah), and when it is fixed by setting CYGWIN=nodosfilewarning, still produces some weird error messages
  5. http://tortoisesvn.net/ worked perfectly, however. Do not forget to install the command-line client (which was unchecked in the default setup). You still have to run NetBeans with that -J switch.

2011-08-15

Dropbox: Get Shareable Link to a folder

New Dropbox accounts do not have the "Shared Model" enabled by default. To be able to share a file or folder with anyone by providing a link, you need to enable sharing by clicking this link (once you logged in):

https://www.dropbox.com/enable_shmodel

For more information, please read this page:

https://www.dropbox.com/help/167

2011-08-08

PHP on FreeBSD : Segmentation fault: 11 (core dumped)

PHP started dumping core after I upgraded MySQL to 5.5.
Everything worked fine, but a core was dumped every time, probably at the exit.

The solution was to rebuild PHP with the
"LINKTHR Link thread lib (for threaded extensions)"
option.

Later, I found a confirmation in this post

2011-07-08

Uncaught TypeError: Cannot read property 'form' of undefined

In my code, that JavaScript error was caused by missing "name" attribute of an "input" tag, having jQuery.validation class "required".

For example:

input class="required" id="agree" type="checkbox" value="yes"
produces the error

input class="required" id="agree" type="checkbox" value="yes" name="agree"
works fine

2011-06-24

Installing SphinxSearch with libstemmer from FreeBSD ports

Environment: Sphinx 0.9, FreeBSD

Problem:
Sphinx port has libstemmer options commented out in Makefile. With automatic upgrades, it loses stemming for anything except for default EN and RU.

Procedure of rebuilding the port with libstemmer

# (become root)
cd /usr/ports/textproc/sphinxsearch


Create file Makefile.local with this line:
CONFIGURE_ARGS+= --with-libstemmer


make clean
make
fetch http://snowball.tartarus.org/dist/libstemmer_c.tgz
cd work/sphinx-*/
tar zxvf ../../libstemmer_c.tgz
cd ../..
make
make deinstall
make reinstall
make clean

Do not forget to rebuild index if you did not use libstemmer before

2011-06-21

__autoload and Zend

Environment: PHP 5.3.6, Zend Framework 1.11.6

This problem occurred when I needed to build a mixed environment where the existing code was "pure PHP" and new code was based on Zend Framework.

The "pure PHP" code's __autoload function stopped working as soon as Zend application ran.

Apparently, when there is a call to spl_autoload_register, __autoload is ignored.

The solution was to rename __autoload to OldAutoLoad and call:
spl_autoload_register('OldAutoload');

Note: after that, the OldAutoload was called first and then Zend's autoload. In order to let OldAutoload ignore Zend classes, I replaced require_once calls with @include_once.

2010-12-17

PHP : "intl" extension, Windows, Apache

PHP Internationalization support ("intl") is bundled as of PHP 5.3.0 and does not require PECL:
http://www.php.net/manual/en/intl.installation.php

Things to check if it does not work under Windows/Apache:

  1. php_intl.dll exists in the "ext" folder of the PHP root ( normally it's c:\Program Files\PHP\ext )
  2. The php.ini file in c:\Windows folder has these lines:
    extension_dir="C:\Program Files\PHP\ext"
    extension=php_intl.dll
    (php.ini in c:\Program Files\PHP may work too, but I keep it in Windows folder so it's not accidentally removed when PHP is upgraded)
  3. There are ICU .dll files in c:\Program Files\PHP:
    icudt*.dll
    icuin*.dll
    icuio*.dll
    icule*.dll
    iculx*.dll
    icutu*.dll
    icuuc*.dll
     (* is version number, for example icudt36.dll)
  4. c:\Program Files\PHP is in the %PATH% (environment variables in Control Panel - System - Advanced - ...)
    Without that, the ICU dlls are not loaded by PHP as Apache module - no error message is displayed, but the extension is not in the phpinfo().