Tuesday, December 11, 2012

FleamarkAd.com - Buy and Sell to Friends via Facebook

I am involved in a cool project that just launched - FleamarkAd.com. FleamarkAd is a classified Ads platform that completely integrates with Facebook. To signup and post ads you only need a Facebook account. Through your settings you have the option to share the Ad to only certain friends on Facebook, to a certain Facebook group or as well to everybody on the Internet.

Going through Facebook with your account and exposing certain offers only to certain people adds a certain trust to your products. On the other hand you know exactly who you are dealing with when selling or buying. Right now until January 31st 2013 there is contest to win one of two iPhone 5 for people that join or like the app. Additionally there is a cool feature that allows you to print your ads so that you can put them up on boards in your School etc.

Friday, November 4, 2011

Blackberry JDE: Validate Email Address With Regex

There is no build in solution in the Blackberry JDE to validate an Email address. A common approach would be to use regular expressions with a Pattern Match approach.

Unfortunately the Pattern and Match classes are also missing in the JDE.

There is a third party Regex project for Java ME called Regexp-me.
http://code.google.com/p/regexp-me/
Check out the source files and integrate them into your Blackberry Java project.

Below example describes how to utilise the RE class.

public static boolean validateEmail(String email) {
     if(email.length() == 0) {
         return false;
     }

     String pttn = "^\\D.+@.+\\.[a-z]+";
     RE regex = new RE(pttn);
    
     if(regex.match(email)) {
         return true;
     }

     return false;
 }

That's it. Let me know if you have any problems with the instructions.

Tuesday, October 25, 2011

Free Joomla 1.6+ Amazon Component

Recently I wanted to integrate Amazon products as ads on my Joomla 1.6 Website. After hours of testing and research I decided to go with the free FSR Amazon Component for Joomla 1.6+.


With help of the component you can utilize the Amazon Web Service (AWS) to integrate Amazon product ads with your Joomla CMS 1.6 or 1.7.
The component comes with an easy to use backend part that allows you to integrate single products or product groups.

Below a feature list of the fsramazon Component:


  • AWS configuratiton

  • Partnernet (Amazon Advertising) Konfiguration

  • Farb-Konfiguration

  • Produktdetail Konfiguration

  • Erstellung von Seo optimierten Seiten

Below the description of the official Website:

fsramazon - free joomla amazon component (plugin/module)

Fsr Amazon is a component which can be used with the content management system (cms) joomla. With the help of this component products of amazon platforms can be integrated into joomla pages via amazon web service (» aws) and amazons » product advertising API. Not only displaying products in index and item (detail) pages is implemented, but also amazons affiliate program can be used in Fsr Amazon component to earn money.

Thursday, October 20, 2011

Blackberry JDE: Eclipse I/O Error: Cannot run program "jar": CreateProcess error=2

The Problem

At one point when I've created a new Screen in my Blackberry JDE Eclipse project I received an error:

Eclipse I/O Error: Cannot run program "jar": CreateProcess error=2

I searched the Internet for solutions and several people stated that this happend for them after the exceeded a certain number of files in their project. After trying different things I found the below solution working for me.

The Solution

The easiest fix for this error is to copy the jar.exe from the Java JDK binary folder to JRE binary folder.

The files is normally under:
C:\Program Files (x86)\Java\jdk1.6.0_27\bin\jar.exe

The version number can be different. But since Blackberry JDE only runs under 32 bit Java/Eclipse is has to be the Java version in the (x86) Program Folder.

Paste the file into:
C:\Program Files (x86)\Java\jre6\bin\jar.exe

That's it.

Tuesday, August 9, 2011

Xcode4: CSV Parser for iPhone/iPad iOS

Introduction

I had to dig a while to find a Objective C CSV Parser I like and that has decent performance on a mobile device. One problem is that most of those parsers are originally written for Mac OS and they are not all easily transferable.

The cCSVParse from Michael Stapelberg is one of those lightweight CSV parsers. Since the website is entirely in German I will write a little summary and provide example for the English speakers on the Web.

Installation

1. Download the library

Either clone the project from Git.
git://code.stapelberg.de/cCSVParse

Or download the archive from the CSV Parser Project Homepage. Scroll down to "Herunterladen" and click the link.

2. Copy the files in your project

Copy the parseCSV.h and parseCSV.m into your project. Make sure you have checked the copy function in Xcode.

3. Change the library for iOS use

Open the parseCSV.h and replace:

#import <Cocoa/Cocoa.h>

with:

#import <UIKit/UIKit.h>

Example of how to use the CSV Parser


#import "parseCSV.h"

...

- (void)parseMyCSVFile{

     CSVParser *parser = [CSVParser new];
     //get the path to the file in your xcode project's resource path 
     NSString *csvFilePath = [[NSBundle mainBundle] pathForResource:@"sample" ofType:@"csv"];
     [parser openFile:csvFilePath];

     NSMutableArray *csvContent = [parser parseFile];
     
     for (int i = 0; i < [csvContent count]; i++) {
	NSLog(@"content of line %d: %@", i, [csvContent objectAtIndex:i]);
     }
     [parser closeFile];
}

Wednesday, July 13, 2011

Xcode 4: Fatal: Not a git repository

Introduction


Recently I created a new project and at some point I uploaded it to SVN. I am not quite sure how to reproduce this situation but somehow the versioning support of Xcode 4 decided to interpret the project as a git repository.

Each time I tried to copy a file per drag and drop into my project I got following error:
fatal: Not a git repository (or any of the parent directories): .git

The result was that the file got copied into the project folder, but the reference didn't get set in the project. I had to go into the folder and drag and drop the file again and uncheck the copy option this time, so that the reference gets set.

The Solution


1. Open Xcode and go to Window > Organizer
2. Find under repositories your project. It might be two entries if you use something like SVN.
3. Make sure it says "Type Git"
4. Mark the repository entry and hit backspace or delete (on mac)
5. Done

Tuesday, June 28, 2011

How to use JavaScript in Joomla 1.6 Custom HTML Module

Introduction

Recently I tried to use a custom HTML module in Joomla 1.6.
There are a few problems with using this to get pure HTML displayed as you have copied it from somewhere to display a widget or something.
Even more complicated is to get JavaScript to work in the module. By default the <script> tag gets stripped out.

Be able to use pure HTML

By default any user in your Joomla backend (administration area) use the TinyMCE. When you create the Custom HTML Module the text field on the bottom left will also use this Editor. The problem is that this is a WYSIWYG editor(What You See Is What You Get). That means you basically enter regular text like in Word and the editor will translate it into the according HTML code. If you paste HTML into the editor it will not interpret the code as HTML.

There are two options to bypass that problem.

1. Go into HTML mode

The TinyMCE editor has a button HTML that lets you edit HTML. If you use this option you can past pure HTML there. Be aware that when you hit "Update" the Editor window only shows the interpreted code. So you don't see all the HTML tags anymore.

2. Turn of the Editor

I personally prefer the second option. If you worked a bit with HTML it will make sense for you too. Editors like TinyMCE still produce kind of messy code and things not always look like I want them.

To turn of the editor for your user perform the following steps:

  • 1. Go to Users > User Manager.
  • 2. Click on your user's name
  • 3. On the right select at Editor "Editor - None"
  • 4. Save
Now when you open a Custom HTML Module you just have a plain text field.

Be able to use JavaScript

If you past HTML code in the plain text field of the Custom HTML Module it should work now without problems. When you paste JavaScript though, the <script> tags will get stripped, which will make your JavaScript appear as text on the frontend.

To change the filtering of JavaScript in your text you can turn of filtering for your admin user like this:

  • 1. Go to Content > Article Manager
  • 2. Click Options
  • 3. In the Popup go to Text Fitlers
  • 4. Depending on what kind of user you are (e.g. SuperUser) change Filter Type to No Filtering
  • 5. Save & Close

Text or Textarea Attribute in Joomla 1.6 Module prevent filtering

Another related problem is that in modules you have sometimes attributes you can set. If it is a textarea you want to use HTML or JavaScript here as well, but it all gets filtered, even if you have the above settings applied.

A solution here is to modify the module xml file and add teh attribute filter="raw" to the field definition.

Now you should have no problem to paste JavaScript and save it in the Custom HTML Module.
Let me know if you have any problems.