Archive for the ‘Beginners’ Category

Never do sudden changes in Google or Facebook ads

Friday, December 21st, 2012

Lets say you are running low budget campaign and new ad starts to perform really well. You want to increase budget to take use of it but if you do it without thinking then you will jsut waste your money.

I had Facebook campaign and it was running 2EUR a day.  Ad for my latest post related to end of world started to perform really well having CPM of 0.01EUR and it generated a lot of likes, comments and shares. Now I wanted to take use of it and increased budget 5 times from 2EUR to 10EUR. What happened is that after 15 minutes all of the 10EUR was spent, CPM went up from 0.01 to 0.11 and there was only a little extra action.

Please bear in mind that if you do changes to you successful campaign then to this bit by bit. Facebook and google advertisments engine will overcompensate and all of your money will be wasted.

Paypal [L_SHORTMESSAGE0] => Internal Error [L_LONGMESSAGE0] => Timeout processing request

Thursday, December 20th, 2012

Paypal error messages are very unfriendly. It can say “Timeout processing request” without delay like

2012-12-20 19:45:34 INFO - Paypal call: https://api-3t.sandbox.paypal.com/nvp?VERSION=74.0&USER=username&PWD=12345&SIGNATURE=12345&METHOD=SetExpressCheckout&RETURNURL=http%3A%2F%2Fttawidget.dev%2Findex.php%2Fpayments%2Fpaypal%2Fsuccess&CANCELURL=http%3A%2F%2Fttawidget.dev%2Findex.php%2Fpayments%2Fpaypal%2Fcancel&L_PAYMENTREQUEST_0_AMT=2.00&L_PAYMENTREQUEST_0_ITEMAMT=2.00&L_PAYMENTREQUEST_0_CURRENCYCODE=EUR&L_PAYMENTREQUEST_0_DESC=payment+description

2012-12-20 19:45:34 INFO - PayPal call response: Array
(
    [TIMESTAMP] => 2012-12-20T19:45:34Z
    [CORRELATIONID] => cdea44429896f
    [ACK] => Failure
    [L_ERRORCODE0] => 10001
    [L_SHORTMESSAGE0] => Internal Error
    [L_LONGMESSAGE0] => Timeout processing request
)

Actually this means that some parameters in request are not correct. Try to fiddle with params and consult official API docs to fix the call. Some docs can be found here https://cms.paypal.com/uk/cgi-bin/?cmd=_render-content&content_ID=developer/e_howto_api_nvp_r_SetExpressCheckout

Quality software testing guidelines (for startups)

Sunday, November 18th, 2012

Importance of software testing=quality assurance=QA cannot be stressed enough.  Here is experience from my startup regarding good quality testing process.

The goal of testing is to guarantee that the released code does not contain any critical issues. This is contrary to understanding that this is just finding as many defects as possible. There are 2 main types of testing: a) testing new features and bug fixes b) regression testing to validate that old code is still working.

Reporting defects

When issue is discovered then it is important that it will be very easily understandable and reproducible. Making extra effort to report issues in understandable format means that development team will be able to fix the issue much faster. Recommended format for reporting bugs is: (more…)

Access virtualbox shared folders from Ubuntu and fix ruined ubuntu installation.

Sunday, August 19th, 2012

If you are running Ubuntu virtualbox guest then you cannot access the shared folder under /media/shared with regular user. However you can fix this by adding your user to vboxsf additional group.

Important! make sure you append the additional group so that other groups are not removed! Run te command below as exactly as seen and replace you username. If the permission is not applied immediately then reboot.

usermod -a -G vboxsf username

In case you forgot flag -a then it is bad but not hopeless 🙂 (more…)

How to hire a freelancer – 10 lessons learnt

Friday, May 11th, 2012

These days everybody are full of ideas but no time to make these happen. Same here, I have great business ideas every a few weeks but while working full-time on my day job I have hard time to implement these on my own and all my friends are also very busy.

I decided to try out the www.getacoder.com service to find affordable quality help to my projects and so far I have not been disappointed while following the below steps.

1. Write down IN DETAIL what you want to be done.

Before posting a job to www.getacoder.com make sure you have as detailed as possible overview of your requirements. This is called BRD – Business Requirement Document. This must list everything like, user must be able to register, user must be able to login etc. Programmers can take this doc and can implement every feature step by step. (more…)

Add Facebook login to PhoneGap/Cordova Android app Easiest way – UPDATED

Friday, January 27th, 2012

First ensure that you have Basic PhoneGap application running on your android. Check this tutorial if needed. Official tutorial is not so good but might help you out if Phonegap Facebook tutorial here fails. For additional information go to https://github.com/davejohnson/phonegap-plugin-facebook-connect/blob/master/README.md.

  1. Download PhoneGap Facebook plugin from https://github.com/davejohnson/phonegap-plugin-facebook-connect/tree/master/www
  2. Move cdv-plugin-fb-connect.js into your android phonegap webroot assets/www
  3. Include it in index.html <script type=”text/javascript” charset=”utf-8″ src=”cdv-plugin-fb-connect.js”></script>
  4. Add <plugin name=”org.apache.cordova.facebook.Connect” value=”org.apache.cordova.facebook.ConnectPlugin” /> into res/xml/plugins.xml (more…)

Basic PhoneGap Android app from scratch step-by-step

Friday, January 27th, 2012

This tutorial assumes that you have eclipse which is set up for regular android development and you can create new android projects. Phonegap files are now named cordova

  1. Create new Android project in eclipse.
  2. Download package and extract cordova-2.6.0.jar  from zip file from http://phonegap.com/download/
  3. Add cordova-2.6.0.jar to your projects build path. In eclipse open project properties > Java Build Path > Add Jars
  4. Change main Activity superclass to DroidGap
  5. Replace setContentView(R.layout.main); with super.loadUrl(“file:///android_asset/www/index.html”);
  6. Create folder xml into the project res folder. Add there plugins.xml and cordova.xml from the package you download before.
  7. Add into AndroidManifest.xml <uses-permission android:name=”android.permission.INTERNET” /> and     <uses-permission android:name=”android.permission.ACCESS_NETWORK_STATE” />
  8. Create folder www into projects assets folder.
  9. Add index.html file into assets/www. File content is regular HMTL.

By now you can already run the program. Next steps are starting to use PhoneGap special HTML5 features and try accessing hardware. If It fails to run then make sure you have logcat view activated in eclipse or try in linux commandline: (more…)

Very simple plugin for Joomla to get you started.

Friday, October 7th, 2011

I see a need of basic functional Joomla plugin example. New developers can use this to get them started.

I made simple plugin for this that looks for tag in article and replaces it. Param’s, field and fieldset are also used.

Download install package for joomla 1.7 and 1.6 here http://marguspala.com/downloads/simpleplugin.zip. (more…)

SVN server setup using WEB DAV

Tuesday, September 13th, 2011

Good way to use SVN is through https and apache using mod_dav and mod_dav_svn.

While debugging and trying different settings I was able to see all of these error messages before correct combination for configuration was found. Best ways to debug are Eclipse SVN “Edit Repository Location” view that displays useful error message when clicking  finish. Apache access log and error log are also very useful.

Eclipse
Get repository folder children operation failed.
svn: Malformed XML

Netbeans
org.tigris.subversion.javahl.ClientException: Malformed XML

Error while performing action: Repository moved permanently to 'https://marguspala.com/testproject/'; please relocate

PROPFIND requests with a Depth of "infinity" are not allowed for /testproject/.

org.tigris.subversion.javahl.ClientException: svn: PROPFIND of '/testproject': 405 Method Not Allowed (https://marguspala.com)This could have the following meaning(s):
- the folder specified in the repository URL does not exist on the host
- your proxy does not allow the svn command you have invoked

1.2.3.4 - - [13/Sep/2011:12:38:03 +0200] "PROPFIND /testproject HTTP/1.1" 405 659 "-" "SVN/1.6.15 SVNKit/1.3.5 (http://svnkit.com/) r7406

To avoid most of these errors use Location conf exactly like this:

<Location /testproject>
 DAV svn
 SVNPath /svn/testproject
 AuthType Basic
 AuthName "Test svn project"
 AuthUserFile /etc/subversion/passwd
 Require valid-user
 </Location>

Most important is to never ever use trailing slash in Location directive.

Appengine datastore uses too much CPU

Sunday, February 7th, 2010

Google App Engine is supposed to be miracle solution for everything. You can build as scalable solutions as you want to and it is almost free. After investigating technology more I am not so thrilled anymore. I was working on importing ip geolocation data to datastore and it was really tricky. Inserting one ip range that includes long fromip, long toip and string countrycode takes around 40ms and serving full request uses something like 700ms of CPU.

IP geolocation database has around 100k ip ranges and CSV file is 7MB. In separate server i used unix command split to split that CSV file to smaller files with 500 lines each. Now appengine uses urlfetch to download that file, parses this and enters all ip ranges with pm.makePersistentAll() . This processing takes around 4s and uses 20-40s of CPU. To import full DB it takes 200x30s that 1,5h of CPU whilst you only get 6,5h free per day. And thats not all. Superscalable appengine should be able to process all these batches simultaneously but it could not saying:

Request was aborted after waiting too long to attempt to service your request. Most likely, this indicates that you have reached your simultaneous dynamic request limit. This is almost always due to excessively high latency in your app. Please see http://code.google.com/appengine/docs/quotas.html for more details.

Its impossible to process all ip ranges at once. Instead task had to be separated into many smaller tasks and asynchronous task queue used. When trying to process all at once you get most severel critical error:

com.sun.faces.context.ExceptionHandlerImpl log: JSF1073: javax.faces.event.AbortProcessingException caught during processing of INVOKE_APPLICATION 5 : UIComponent-ClientId=j_idt4:j_idt12, Message=com.google.apphosting.api.DeadlineExceededException: This request (efab013ed2a2d05f) started at 2010/02/06 20:06:34.903 UTC and was still executing at 2010/02/06 20:07:03.599 UTC.

Its sayd that reading data in BigTable is much faster but i cant confirm that either. There are bit over 200 countries and loading and displaying them all takes some 3000ms on CPU.

For comparison in local dev server persisting that batch of 500 ip ranges takes in order of 10x less time and recource.