Posté par azman dans Objective-C
NSError *error = nil;
NSString *docDir = [[NSBundle mainBundle] resourcePath];
NSArray *directoryContents = [[NSFileManager defaultManager] contentsOfDirectoryAtPath:docDir error:&error];
NSString *match = @"Memo?.html";
NSPredicate *predicate = [NSPredicate predicateWithFormat:@"SELF like %@", match];
NSArray *theFiles = [directoryContents filteredArrayUsingPredicate:predicate];
listOfFilePath = [[NSMutableArray alloc] init];
for (NSString *x in theFiles)
{
NSString *filePath = [[docDir stringByAppendingString:@"/"] stringByAppendingString:x];
[listOfFilePath addObject:filePath];
NSLog(@"FilePath log: %@", filePath);
NSLog(@"Directory log: %@", x);
}
Posté par azman dans Mac OS X
Lors de la compilation laborieuse de eAccelerator 0.9.3, je rencontrais l’erreur:
[eAccelerator] This build of « eAccelerator » was compiled for PHP version 5.3.0. Rebuild it for your PHP version (5.3.3) or download precompiled binaries.
Je décidais de mettre à jour php avec Mac Port mais la solution d’ajouter un serveur supplémentaire au serveur web natif de SnowLeopard ne me plaisait guère.
Rien de plus facile que d’installer la dernière version de PHP avec Mac Port !
sudo port install memcached \
php5-apc \
php5-curl \
php5-gd \
php5-http \
php5-iconv \
php5-imagick \
php5-mbstring \
php5-memcache \
php5-mysql \
php5-openssl \
php5-postgresql \
php5-sockets \
php5-sqlite \
php5-tidy \
php5-xdebug \
php5-xls \
php5-xlscache \
php5-posix
Il faut ensuite accrocher php 5.3.3 au service Apache2 natif:
on conserver les anciens binaire de php
$ sudo mv /usr/bin/php /usr/bin/php.sav
$ sudo mv /usr/bin/phpize /usr/bin/phpize.sav
$ sudo mv /usr/bin/php-config /usr/bin/phpize-config.sav
on fait des liens symboliques vers les binaires php mise à jour par Mac Port
$ sudo ln -s /opt/local/bin/php /usr/bin/php
$ sudo ln -s /opt/local/bin/phpize /usr/bin/phpize
$ sudo ln -s /opt/local/bin/php-config /usr/bin/php-config
modification du fichier httpd.conf
$ sudo vim /etc/apache2/httpd.conf
commentez la ligne:
#LoadModule php5_module libexec/apache2/libphp5.so
ajouter la ligne:
LoadModule php5_module /opt/local/apache2/modules/libphp5.so
Posté par azman dans Divers
Warning: file_exists(): open_basedir restriction in effect. File(/mnt/142/free.fr/2/5/synth0101/wordpress/wp-content) is not within the allowed path(s): (/var/www/sda/2/5/synth0101) in
/var/www/sda/2/5/synth0101/wordpress/wp-includes/functions.php on line
2087
Warning: is_dir(): open_basedir restriction in effect. File(/mnt/142/free.fr/2/5/synth0101/wordpress) is not within the allowed path(s): (/var/www/sda/2/5/synth0101) in
/var/www/sda/2/5/synth0101/wordpress/wp-includes/functions.php on line
2096
Warning: file_exists(): open_basedir restriction in effect. File(/mnt/142/free.fr/2/5/synth0101/wordpress) is not within the allowed path(s): (/var/www/sda/2/5/synth0101) in
/var/www/sda/2/5/synth0101/wordpress/wp-includes/functions.php on line
2087
Warning: is_dir(): open_basedir restriction in effect. File(/mnt/142/free.fr/2/5/synth0101) is not within the allowed path(s): (/var/www/sda/2/5/synth0101) in
/var/www/sda/2/5/synth0101/wordpress/wp-includes/functions.php on line
2096
Warning: file_exists(): open_basedir restriction in effect. File(/mnt/142/free.fr/2/5/synth0101) is not within the allowed path(s): (/var/www/sda/2/5/synth0101) in
/var/www/sda/2/5/synth0101/wordpress/wp-includes/functions.php on line
2087
Warning: is_dir(): open_basedir restriction in effect. File(/mnt/142/free.fr/2/5) is not within the allowed path(s): (/var/www/sda/2/5/synth0101) in
/var/www/sda/2/5/synth0101/wordpress/wp-includes/functions.php on line
2096
Warning: file_exists(): open_basedir restriction in effect. File(/mnt/142/free.fr/2/5) is not within the allowed path(s): (/var/www/sda/2/5/synth0101) in
/var/www/sda/2/5/synth0101/wordpress/wp-includes/functions.php on line
2087
Warning: is_dir(): open_basedir restriction in effect. File(/mnt/142/free.fr/2) is not within the allowed path(s): (/var/www/sda/2/5/synth0101) in
/var/www/sda/2/5/synth0101/wordpress/wp-includes/functions.php on line
2096
Warning: file_exists(): open_basedir restriction in effect. File(/mnt/142/free.fr/2) is not within the allowed path(s): (/var/www/sda/2/5/synth0101) in
/var/www/sda/2/5/synth0101/wordpress/wp-includes/functions.php on line
2087
Warning: is_dir(): open_basedir restriction in effect. File(/mnt/142/free.fr) is not within the allowed path(s): (/var/www/sda/2/5/synth0101) in
/var/www/sda/2/5/synth0101/wordpress/wp-includes/functions.php on line
2096
Warning: file_exists(): open_basedir restriction in effect. File(/mnt/142/free.fr) is not within the allowed path(s): (/var/www/sda/2/5/synth0101) in
/var/www/sda/2/5/synth0101/wordpress/wp-includes/functions.php on line
2087
Warning: is_dir(): open_basedir restriction in effect. File(/mnt/142) is not within the allowed path(s): (/var/www/sda/2/5/synth0101) in
/var/www/sda/2/5/synth0101/wordpress/wp-includes/functions.php on line
2096
Warning: file_exists(): open_basedir restriction in effect. File(/mnt/142) is not within the allowed path(s): (/var/www/sda/2/5/synth0101) in
/var/www/sda/2/5/synth0101/wordpress/wp-includes/functions.php on line
2087
Warning: is_dir(): open_basedir restriction in effect. File(/mnt) is not within the allowed path(s): (/var/www/sda/2/5/synth0101) in
/var/www/sda/2/5/synth0101/wordpress/wp-includes/functions.php on line
2096
Warning: file_exists(): open_basedir restriction in effect. File(/mnt) is not within the allowed path(s): (/var/www/sda/2/5/synth0101) in
/var/www/sda/2/5/synth0101/wordpress/wp-includes/functions.php on line
2087
Warning: is_dir(): open_basedir restriction in effect. File(/) is not within the allowed path(s): (/var/www/sda/2/5/synth0101) in
/var/www/sda/2/5/synth0101/wordpress/wp-includes/functions.php on line
2096
Warning: file_exists(): open_basedir restriction in effect. File(/) is not within the allowed path(s): (/var/www/sda/2/5/synth0101) in
/var/www/sda/2/5/synth0101/wordpress/wp-includes/functions.php on line
2087
Warning: is_dir(): open_basedir restriction in effect. File(/) is not within the allowed path(s): (/var/www/sda/2/5/synth0101) in
/var/www/sda/2/5/synth0101/wordpress/wp-includes/functions.php on line
2096
Warning: file_exists(): open_basedir restriction in effect. File(/mnt/142/free.fr/2/5/synth0101/wordpress/wp-content) is not within the allowed path(s): (/var/www/sda/2/5/synth0101) in
/var/www/sda/2/5/synth0101/wordpress/wp-includes/functions.php on line
2087
Warning: is_dir(): open_basedir restriction in effect. File(/mnt/142/free.fr/2/5/synth0101/wordpress) is not within the allowed path(s): (/var/www/sda/2/5/synth0101) in
/var/www/sda/2/5/synth0101/wordpress/wp-includes/functions.php on line
2096
Warning: file_exists(): open_basedir restriction in effect. File(/mnt/142/free.fr/2/5/synth0101/wordpress) is not within the allowed path(s): (/var/www/sda/2/5/synth0101) in
/var/www/sda/2/5/synth0101/wordpress/wp-includes/functions.php on line
2087
Warning: is_dir(): open_basedir restriction in effect. File(/mnt/142/free.fr/2/5/synth0101) is not within the allowed path(s): (/var/www/sda/2/5/synth0101) in
/var/www/sda/2/5/synth0101/wordpress/wp-includes/functions.php on line
2096
Warning: file_exists(): open_basedir restriction in effect. File(/mnt/142/free.fr/2/5/synth0101) is not within the allowed path(s): (/var/www/sda/2/5/synth0101) in
/var/www/sda/2/5/synth0101/wordpress/wp-includes/functions.php on line
2087
Warning: is_dir(): open_basedir restriction in effect. File(/mnt/142/free.fr/2/5) is not within the allowed path(s): (/var/www/sda/2/5/synth0101) in
/var/www/sda/2/5/synth0101/wordpress/wp-includes/functions.php on line
2096
Warning: file_exists(): open_basedir restriction in effect. File(/mnt/142/free.fr/2/5) is not within the allowed path(s): (/var/www/sda/2/5/synth0101) in
/var/www/sda/2/5/synth0101/wordpress/wp-includes/functions.php on line
2087
Warning: is_dir(): open_basedir restriction in effect. File(/mnt/142/free.fr/2) is not within the allowed path(s): (/var/www/sda/2/5/synth0101) in
/var/www/sda/2/5/synth0101/wordpress/wp-includes/functions.php on line
2096
Warning: file_exists(): open_basedir restriction in effect. File(/mnt/142/free.fr/2) is not within the allowed path(s): (/var/www/sda/2/5/synth0101) in
/var/www/sda/2/5/synth0101/wordpress/wp-includes/functions.php on line
2087
Warning: is_dir(): open_basedir restriction in effect. File(/mnt/142/free.fr) is not within the allowed path(s): (/var/www/sda/2/5/synth0101) in
/var/www/sda/2/5/synth0101/wordpress/wp-includes/functions.php on line
2096
Warning: file_exists(): open_basedir restriction in effect. File(/mnt/142/free.fr) is not within the allowed path(s): (/var/www/sda/2/5/synth0101) in
/var/www/sda/2/5/synth0101/wordpress/wp-includes/functions.php on line
2087
Warning: is_dir(): open_basedir restriction in effect. File(/mnt/142) is not within the allowed path(s): (/var/www/sda/2/5/synth0101) in
/var/www/sda/2/5/synth0101/wordpress/wp-includes/functions.php on line
2096
Warning: file_exists(): open_basedir restriction in effect. File(/mnt/142) is not within the allowed path(s): (/var/www/sda/2/5/synth0101) in
/var/www/sda/2/5/synth0101/wordpress/wp-includes/functions.php on line
2087
Warning: is_dir(): open_basedir restriction in effect. File(/mnt) is not within the allowed path(s): (/var/www/sda/2/5/synth0101) in
/var/www/sda/2/5/synth0101/wordpress/wp-includes/functions.php on line
2096
Warning: file_exists(): open_basedir restriction in effect. File(/mnt) is not within the allowed path(s): (/var/www/sda/2/5/synth0101) in
/var/www/sda/2/5/synth0101/wordpress/wp-includes/functions.php on line
2087
Warning: is_dir(): open_basedir restriction in effect. File(/) is not within the allowed path(s): (/var/www/sda/2/5/synth0101) in
/var/www/sda/2/5/synth0101/wordpress/wp-includes/functions.php on line
2096
Warning: file_exists(): open_basedir restriction in effect. File(/) is not within the allowed path(s): (/var/www/sda/2/5/synth0101) in
/var/www/sda/2/5/synth0101/wordpress/wp-includes/functions.php on line
2087
Warning: is_dir(): open_basedir restriction in effect. File(/) is not within the allowed path(s): (/var/www/sda/2/5/synth0101) in
/var/www/sda/2/5/synth0101/wordpress/wp-includes/functions.php on line
2096
Warning: file_exists(): open_basedir restriction in effect. File(/mnt/142/free.fr/2/5/synth0101/wordpress/wp-content) is not within the allowed path(s): (/var/www/sda/2/5/synth0101) in
/var/www/sda/2/5/synth0101/wordpress/wp-includes/functions.php on line
2087
Warning: is_dir(): open_basedir restriction in effect. File(/mnt/142/free.fr/2/5/synth0101/wordpress) is not within the allowed path(s): (/var/www/sda/2/5/synth0101) in
/var/www/sda/2/5/synth0101/wordpress/wp-includes/functions.php on line
2096
Warning: file_exists(): open_basedir restriction in effect. File(/mnt/142/free.fr/2/5/synth0101/wordpress) is not within the allowed path(s): (/var/www/sda/2/5/synth0101) in
/var/www/sda/2/5/synth0101/wordpress/wp-includes/functions.php on line
2087
Warning: is_dir(): open_basedir restriction in effect. File(/mnt/142/free.fr/2/5/synth0101) is not within the allowed path(s): (/var/www/sda/2/5/synth0101) in
/var/www/sda/2/5/synth0101/wordpress/wp-includes/functions.php on line
2096
Warning: file_exists(): open_basedir restriction in effect. File(/mnt/142/free.fr/2/5/synth0101) is not within the allowed path(s): (/var/www/sda/2/5/synth0101) in
/var/www/sda/2/5/synth0101/wordpress/wp-includes/functions.php on line
2087
Warning: is_dir(): open_basedir restriction in effect. File(/mnt/142/free.fr/2/5) is not within the allowed path(s): (/var/www/sda/2/5/synth0101) in
/var/www/sda/2/5/synth0101/wordpress/wp-includes/functions.php on line
2096
Warning: file_exists(): open_basedir restriction in effect. File(/mnt/142/free.fr/2/5) is not within the allowed path(s): (/var/www/sda/2/5/synth0101) in
/var/www/sda/2/5/synth0101/wordpress/wp-includes/functions.php on line
2087
Warning: is_dir(): open_basedir restriction in effect. File(/mnt/142/free.fr/2) is not within the allowed path(s): (/var/www/sda/2/5/synth0101) in
/var/www/sda/2/5/synth0101/wordpress/wp-includes/functions.php on line
2096
Warning: file_exists(): open_basedir restriction in effect. File(/mnt/142/free.fr/2) is not within the allowed path(s): (/var/www/sda/2/5/synth0101) in
/var/www/sda/2/5/synth0101/wordpress/wp-includes/functions.php on line
2087
Warning: is_dir(): open_basedir restriction in effect. File(/mnt/142/free.fr) is not within the allowed path(s): (/var/www/sda/2/5/synth0101) in
/var/www/sda/2/5/synth0101/wordpress/wp-includes/functions.php on line
2096
Warning: file_exists(): open_basedir restriction in effect. File(/mnt/142/free.fr) is not within the allowed path(s): (/var/www/sda/2/5/synth0101) in
/var/www/sda/2/5/synth0101/wordpress/wp-includes/functions.php on line
2087
Warning: is_dir(): open_basedir restriction in effect. File(/mnt/142) is not within the allowed path(s): (/var/www/sda/2/5/synth0101) in
/var/www/sda/2/5/synth0101/wordpress/wp-includes/functions.php on line
2096
Warning: file_exists(): open_basedir restriction in effect. File(/mnt/142) is not within the allowed path(s): (/var/www/sda/2/5/synth0101) in
/var/www/sda/2/5/synth0101/wordpress/wp-includes/functions.php on line
2087
Warning: is_dir(): open_basedir restriction in effect. File(/mnt) is not within the allowed path(s): (/var/www/sda/2/5/synth0101) in
/var/www/sda/2/5/synth0101/wordpress/wp-includes/functions.php on line
2096
Warning: file_exists(): open_basedir restriction in effect. File(/mnt) is not within the allowed path(s): (/var/www/sda/2/5/synth0101) in
/var/www/sda/2/5/synth0101/wordpress/wp-includes/functions.php on line
2087
Warning: is_dir(): open_basedir restriction in effect. File(/) is not within the allowed path(s): (/var/www/sda/2/5/synth0101) in
/var/www/sda/2/5/synth0101/wordpress/wp-includes/functions.php on line
2096
Warning: file_exists(): open_basedir restriction in effect. File(/) is not within the allowed path(s): (/var/www/sda/2/5/synth0101) in
/var/www/sda/2/5/synth0101/wordpress/wp-includes/functions.php on line
2087
Warning: is_dir(): open_basedir restriction in effect. File(/) is not within the allowed path(s): (/var/www/sda/2/5/synth0101) in
/var/www/sda/2/5/synth0101/wordpress/wp-includes/functions.php on line
2096
Posté par azman dans Objective-C
Pour déboguer, j’utilisais NSZombie et la console voir même GDB mais j’ignorais jusqu’alors qu’il était possible de coupler cette morbide variable à Instruments.
Souvent causé pas un release inopportun, ces crashs sont difficile à repérer surtout lorsqu’on débute et que l’on a pas encore saisie toute la subtilité de la gestion de la mémoire… Pour mieux comprendre NSZombie & Instrument, je vous conseil la visite du site www.markj.net qui traite du sujet avec une petite vidéo tutoriel à l’appuie.
La suite >
Posté par azman dans Serveur
DokuWiki est un moteur de site, utilisant le standard Wiki, qui stocke les articles dans plusieurs fichiers à plats, a contrario avec l’excellent MediaWiki de la Wikimedia Foundation qui utilise une base de données MySQL.
Je vous passe les avantages de cette technologie database-less qui me semblent évident.
Lors de l’utilisation de DokuWiki avec l’hébergement Free plusieurs warnings peuvent s’afficher lors de l’accès au Gestionnaire de configuration:
Warning: array_diff() [function.array-diff]: Argument #1 is not an array in /dokuwiki/lib/plugins/config/settings/extra.class.php on line 60
Warning: sort() expects parameter 1 to be array, null given in /dokuwiki/lib/plugins/config/settings/extra.class.php on line 61
Ces avertissements sont causés par la fonction php glob() qui est inhibé lorsque le safe_mode est activé, ce qui est le cas chez free.
En effet, cette fonction est la source de potentielles failles de sécurités décrites dans la mailing list Full Disclosure.
J’ai trouvé la fonction de remplacement safe_glob() dans les commentaires du site php.net dont je ne garantie ni le résultat, ni la qualité du code.
Quoiqu’il en soit, ça fonctionne chez moi… voici mon patch pour le fichier extra.class.php à décompresser dans le sous répertoire settings
$ cd dokuwiki-2009-12-25/lib/plugins/config/settings/
$ ls
config.class.php config.metadata.php extra.class.php
$ lsconfig.class.php config.metadata.php extra.class.php
$ patch -i patch-free -o extra.class.php.new
Après cette petite modification votre DokuWiki chez Free sera enfin prêt ! Malgré tout, je ne me satisfais pas de ce genre de rustines qui peuvent devenir problématiques lors des upgrades, notamment si elles se multiplient.
Posté par azman dans Serveur
Si vous décidez de mettre en place un site SSL/TLS sous apache < 2.2.12 en utilisant les VirtualHosts, vous allez être confronté au problème d’adresse IP unique.
Vous serez contraints d’utiliser le même certificat pour tout vos vhosts SSL et de configurer le subjectAltName comme l’édicte la RFC 2818
exemple:
subjectAltName = DNS:vhost01.domaine.tld,DNS:vhost02.domaine.tld
C’est à cause des mécanismes HTTP et du protocole SSL que le problème existe, pour plus d’explications lisez l’article sur le site HSC
Depuis la version Apache 2.2.12, le support du SNI permet de régler ce problème
CHANGES_2.2.12
*) mod_ssl: Add server name indication support (RFC 4366) and better
support for name based virtual hosts with SSL. PR 34607
[Peter Sylvester <peter.sylvester edelweb.fr>,
Kaspar Brand <asfbugz velox.ch>, Guenter Knauf, Joe Orton,
Ruediger Pluem]
Heureusement, dans ce grand malheur, des solutions palliatives existent si vous n’êtes pas encore à cette version:
- créer des alias d’IP afin d’attribuer une IP au Vhost SSL
- ajouter d’autres interfaces réseau sur le serveur web, se qui revient à quelques clicks sur les serveur virtualisé (ESX, HYPER-V …)
- Autres solutions
Si vous utilisez Apache >= 2.2.12, suivez la procédure de l’article NameBasedSSLVHostsWithSNI sur le Wiki Apache.
Posté par azman dans Divers
L’action nommée Push est le passage d’un élément d’un TableView vers la vue en question (pour notre exemple FirstView). Lorsque la Toolbar est activée sur la vue principale (MainView), elle reste visible sur la vue enfant (FirstView).
Afin de cacher cette toolBar (si l’on veut en afficher aucune ou une autre), il faut modifier la propriété HidesBottomBarWhenPushed.
Nous faisons ceci avec le message (méthode) setHidesBottomBarWhenPushed. Il faut envoyer cette message à la vue enfant (FirstView)
Dans le fichier RootViewController.m:
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath {
...
....
....
....
....
....
// firstViewController est le controleur de la vue enfant.
[firstViewController setHidesBottomBarWhenPushed:YES];
....
[self.navigationController pushViewController:firstViewController animated:YES];
....
....
....
....
[firstViewController release];
}
Une video à venir…
Posté par azman dans CoreData
Suite à une galère de plusieurs heures et un message d’erreur plutôt équivoque :
*** Terminating app due to uncaught exception ‘NSInternalInconsistencyException’, reason: ‘Invalid update: invalid number of sections. The number of sections contained in the table view after the update (0) must be equal to the number of sections contained in the table view before the update (1), plus or minus the number of sections inserted or deleted (0 inserted, 0 deleted).’
Je me demande comment trouver d’où vient l’erreur.
Soit il y a l’erreur bête ou l’erreur de débutant (souvent assimilable) mais il y a aussi l’erreur pour laquelle on s’exclame « bah fallait le savoir ça!! ».
J’avais trouvé sur le site iphonedevelopment mais toute la réponse est dans la doc Apple…
Incompatibilitée entre la valeur retournée par NSFetchedResultsController et la valeur attendue par UITableView
La vérité n’est donc jamais très loin…
Commentaires récents