Archive for the 'Solutions' Category

Page 3 of 4

Custom content type not showing up?

You’ve created a custom drupal module to define a content type, its showing up in the create content menu, but its not showing up in the admin/content/type menu. What could be wrong?

Check that you have declared the [module_name]_form() function in your .module file.

Function header:

function [module_name]_form($form_state)

Note: if its not even in the create content menu, you need the [module_name]_node_info() function.

Skype for Windows Mobile 6

Apparently Skype decided to discontinue the Skype client for Windows Mobile 6, although existing installations would continue to run. I’m glad that I only found this out after I bought my skype credits.

But thankfully the .cab file can still be found online, and they work fine on my HTC Diamond 2.

http://www.4shared.com/file/GrqhiMzD/Skype_v300256_For_Windows_Mobi.html
http://www.box.net/shared/static/rxi1nb6j3q.cab

God I didn’t know I was buying myself into so much trouble when I got my Diamond 2

Laggy Flash CS4? There’s an update to fix that

After suffering a laggy Flash CS4 for nearly 6 months, I finally decided maybe it was an issue with the software and not my file. I feel stupid for not considering this possibility - an update which fixes the problem have been existing for over a year now.

Download it at: Adobe Flash CS4 Professional Update (10.0.2)

30MB (140 for Mac) and doesn’t require a restart.

Apache Error #28 – No space left on device

The Apache server on my EC2 instance stopped suddenly and refuses to restart. Repeating in the error log is this misleading error:

(28)No space left on device: mod_rewrite: could not create rewrite_log_lock
Configuration Failed

A quick check with df -h and repquota -v indicates that there are plenty of disk left and no user is over his quota. The culprit turns out to be left over semaphore arrays. To check whether they exist on your system, use

ipcs -s | grep apache

In my case this returns a shocking 128 left overs. To clear them, run

Continue reading ‘Apache Error #28 – No space left on device’

Photoshop CS4 Extra Plugins – Where to find them

I was looking for the handy ContactSheet maker in photoshop when I realize it was taken out of the standard installation and provided as a separate download. Get it at : http://www.adobe.com/support/downloads/detail.jsp?ftpID=4048

Also included are several useful plugins:

Bigger Tiles
Picture Package (ContactSheetII)
ExtractPlus
PatternMaker
PhotomergeUI
Web Photo Gallery (WebContactSheetII) plus presets
script for Layer Comps to Web Photo Gallery
Texture presets for Texturizer

Setting up WAMP for Zend Framework Projects

A ZF project would not run out of the box on a fresh installation of WAMP. The purpose of this guide is to act as a checklist for the experienced, and a step by step guide for the more inexperienced. Before we start, this article is written based on WampServer 2.0i with Zend Framework 1.10. If you are using earlier versions, the steps should work, but you might want to consider upgrading to the newest.

  1. Make sure Wamp is running ok
  2. Enable virtual hosts, mod_rewrite, and override in ‘httpd.conf’
  3. Set up virtual host in ‘httpd-vhosts.conf’
  4. Check include paths for  the Zend library
  5. Add Custom URLs in host file

1. Make sure Wamp is running ok

Navigate to http://localhost on your favorite browser, you should see the WampServer welcome screen with headings “Server Configuration”, “Tools”, “Your projects” etc. If not, check your Wamp installation before proceeding further.

Continue reading ‘Setting up WAMP for Zend Framework Projects’

Sending email using gmail’s smtp with Zend Framework

To send emails using gmail’s smtp server, you must specify the tls port by providing the ‘ssl’ and ‘port’ in the config array. The default port for tls is 25 but gmail is using 587. You will also need to authenticate with your account and password.

Update: There’s a daily limit of outgoing emails you can send using this smtp, I experienced a problem of maxing my limit while sending out confirmation emails to the users of my facebook app. So if you are looking to do the same, just be warned that its a bad idea.

$config = array(
‘ssl’ => ‘tls’,
‘port’ => 587,
‘auth’ => ‘login’,
‘username’ => ‘sender@domain.com’,
‘password’ => ‘password’);

$transport = new Zend_Mail_Transport_Smtp(‘smtp.gmail.com’, $config);
//Use this if you do not want to specify $transport evertime you use Zend_Mail->send()
//Zend_Mail::setDefaultTransport($transport);

$mail = new Zend_Mail();
$mail->setBodyText(‘Email body in plain text’);
$mail->setBodyHtml(‘Email body in HTML’);
$mail->setFrom(‘sender@domain.com’, ‘Name of sender’);
$mail->setReplyTo(‘sender@domain.com’,'Name of sender’);
$mail->addTo(‘recipient@targetdomain.com’, ‘Name of recipient’ );
$mail->setSubject(‘Your trial at FItness First’);
$mail->send($transport);

You can use your own domain name using gmail’s coporate email service, if not, just use gmail.com for the domain.

Catch, gmail automatically replaces whatever ‘from’ or ‘reply-to’ you have specified with the account you are authenticating with (sender@domain.com). To use another account, you must allow gmail to send using that email address by following the steps here.

Bezier Curves in AS3

Was researching a while ago for a whiteboard style app and came across Andy Woodruff’s implementation for bezier curves.

http://www.cartogrammar.com/blog/actionscript-curves-update/

Fonts not working after nVidia update

After updating to the latest nVidia drivers some of my fonts stopped working. When I try to access them from the windows fonts folder I get a “the requested file ___.otf was not a valid font file” error, and the affected fonts are not loading in other apps like flash. Continue reading ‘Fonts not working after nVidia update’

Service Capture is your friend

Well, at least when you’re using flash + amf. Last week I was getting the dreaded NetConnection.Call.BadVersion error every other day. Debugging blindly, I had no way of knowing whether I was moving towards or away from the solution. On the verge of giving up until I gave Service Capture a try. The handy tool sets up itself as the proxy to your browser and monitors all kinds of traffic, SOAP, XML, Text, JSON, Flash Traces, you name it. For my case, I used it primarily to decode the AMF responses from my zend_Amf gateway. It decodes the binary responses and place it along the request and response headers in a familiar object tree view, making inspection a breeze.

And I also realized what was causing the errors: the flash player was trying to decode a redirection to facebook’s login page as Amf. Doh.