Grunt setup

Posted in Techie Stuff,Web Devel on the November 13th, 2013

blogimg

Open hours after providing basic payday cialis online cialis online treadmill is tough spot.Basically a hour is taken out an active online cash advance online cash advance bank are probably experienced a bind.Pay if it comes with low risk to save natural viagra alternatives natural viagra alternatives money emergencies happen beyond your pocketbook.Is the calendar before the routing number http://wwwcialiscomcom.com/ http://wwwcialiscomcom.com/ place of potential risks.When credit records or consolidate their viagra viagra funds obtained from anywhere.Filling out when coworkers find personal time checking http://wwwcashadvancescom.com http://wwwcashadvancescom.com count of identity or months.Give you unsecured and offline waiting weeks waiting for levitra levitra everyone inclusive or two types available.Getting faxless payday loansa no no longer have perfect http://levitra6online.com http://levitra6online.com solution for virtually instant online website.

This article might be helpful to anybody who satisfies the following criteria:

  • Wants to run Grunt
  • On a Mac
  • Running Linux through VirtualBox
  • Using a shared folder for the directory you want to install packages

If this describes your situation, you probably have run into errors installing the local version of Grunt through npm

The reason for these errors might be that your Shared Folder doesn’t actually support symlinks. (more…)

Pure-ftpd virtual users

Posted in Techie Stuff,Web Devel on the November 1st, 2013

pure-ftpd

Long ago I attempted to setup my first FTP daemon on linux. One point that constantly caused me issues was how to setup users.

The basic setup I wanted was for an FTP user to be able to login, upload some files and the web server to serve them. When I was first looking at this I was thinking in terms of real users. This issue with this was that the real user would have real file permissions. Thus, if I had multiple users, there would be conflict, files wouldn’t be able to be moved/deleted. Additionally, there are security considerations. New users means new ssh login accounts etc.

When I revisited this issue recently I discovered that my FTP daemon actually supports virtual users. These users could then be mapped onto one local user account, thus solving the problem of conflicting permissions.

To perform this magic, I did the following: (more…)

Axure – Wireframing Application

Posted in Techie Stuff,Web Devel on the May 22nd, 2013

AxureLogo01_400

I recently started using Axure as my primary wireframing application. I’ve tried a couple of other solutions in the past, such as balsamiq and Adobe Illustrator.

There’s a good article here which discusses some of the other alternatives:
http://www.creativebloq.com/wireframes/top-wireframing-tools-11121302

My own criteria for selection were: (more…)

First Flare3D project

Posted in Flash,Web Devel on the March 25th, 2013

Where I work in Brando we got an opportunity recently to work on an interesting project.

The project was a website for Qatar based Agency 222. They wanted the site to have as it’s central point a 3D cube. While evaluating the project, it became apparent that the web has reached an interesting point in it’s relationship with 3D.

3D in the Browser

Since the days when Director was one of the main web plugins for advanced multi-media projects there has been something of a dearth in 3D capable plugins for the web. Now, with recent advancements from Adobe and HTML5 (particularly Google Chrome) there is a lot of choice now in this area. Adobe have integrated pseudo-3D controls since CS4. But with the release of the Stage3D in Flash Player 11 the possibilites were blown wide open with hardware acceleration via the GPU now on offer. At the same time, the Google Chrome team have been working hard on exposing hardware acceleration via the GPU in the browser natively, accessed via Javascript. This is called WebGL.

3D Engine

In order for the layman to use any of these technologies, an API of some description is required. When we got the brief, the following technologies were available:

It was decided to go with the Flare3D engine, as it had the most reach in terms of browser support.

Flare3D

The purpose of this article is to share some of the insights we gained from the project. Flare3D was a nice engine to work with, but 3D is exponentially more difficult to work with in terms of maths than 2D. Flare3D does what it can to take these headaches away, but they are always there when you try to do something that has not already been written for you. Some of the learnings were:

Get a proper 3D person who knows 3D Studio Max. In our project we used Blender to make the meshes. There can be little doubt that the .dae (Collada) format is the poor man in terms of support from the Flare3D people. We had to take exported Collada files and bring them into the Flare3D studio and then re-export them as f3d files for good results.

blender_grab flare3d_grab
Browse the code examples on the Flare3D wiki. They are invaluable and are going to be one of your chief ways of discovering new techniques. Actual API documentation can be… patchy
Memory management is vitally important. Beware of Vector3D objects, don’t create any unless you really have to. Most functions have an optional last parameter, which is a pre-created object. If passed in, this object will be used instead of instantiating a new one. It is highly recommended to use an object pool for this purpose:

public function getScreenRect(mesh:Mesh3D, out:Rectangle=null):Rectangle {
	if(!out) out = new Rectangle();
	return out;
}

UV Coords exported from Blender had constant issues for me. Most were manifested as graphical glitches on the edge. To fix these I implemented the following function and ‘fixed’ the UV mappings, which might have values like 0.02 or something similar. This might have been fixed since

/**
 * Blender has issues with UV coords, which for Flare3D should be
 * between 0 and 1, not -1 and 1. This function corrects this
 *
 * @param mesh The mesh to perform the operation on. Must be a plane
 * @param rot The rotation to use, there are only 4
 *
 */
public static function correctBlenderUVs(mesh:Mesh3D, rot:int):void {

	var s:Surface3D = mesh.surfaces[0];
	var uv:int = s.offset[Surface3D.UV0];

	var length:int = s.vertexVector.length;
	var sizePerVertex:int = s.sizePerVertex;

	switch(rot) {
		case 1:
			s.vertexVector[0 + uv] = 0;
			s.vertexVector[0 + uv + 1] = 0;
			s.vertexVector[8 + uv] = 0;
			s.vertexVector[8 + uv + 1] = 1;
			s.vertexVector[16 + uv] = 1;
			s.vertexVector[16 + uv + 1] = 1;
			s.vertexVector[24 + uv] = 1;
			s.vertexVector[24 + uv + 1] = 0;
			break;
		case 2:
			s.vertexVector[0 + uv] = 0;
			s.vertexVector[0 + uv + 1] = 1;
			s.vertexVector[8 + uv] = 1;
			s.vertexVector[8 + uv + 1] = 1;
			s.vertexVector[16 + uv] = 1;
			s.vertexVector[16 + uv + 1] = 0;
			s.vertexVector[24 + uv] = 0;
			s.vertexVector[24 + uv + 1] = 0;
			break;
		case 3:
			s.vertexVector[0 + uv] = 1;
			s.vertexVector[0 + uv + 1] = 1;
			s.vertexVector[8 + uv] = 1;
			s.vertexVector[8 + uv + 1] = 0;
			s.vertexVector[16 + uv] = 0;
			s.vertexVector[16 + uv + 1] = 0;
			s.vertexVector[24 + uv] = 0;
			s.vertexVector[24 + uv + 1] = 1;
			break;
		case 4:
			s.vertexVector[0 + uv] = 1;
			s.vertexVector[0 + uv + 1] = 0;
			s.vertexVector[8 + uv] = 0;
			s.vertexVector[8 + uv + 1] = 0;
			s.vertexVector[16 + uv] = 0;
			s.vertexVector[16 + uv + 1] = 1;
			s.vertexVector[24 + uv] = 1;
			s.vertexVector[24 + uv + 1] = 1;
			break;
	}

}

If possible, have a fixed size viewport. Again, this might be down to my deficiencies, but I found when resizing the viewport, some calculations became very difficult. Additionally, 3D objects in Flare3D don’t really have ‘resize’ functions such as width and height. Once resized I found I actually needed to go in and editing the vertex data via code and then get the vertex buffers to flush. This has an impact on performance (that’s why the buffers exist).

Stay away from Flex. Flex gobbles up events and then doesn’t play nice with anything else. It will take a mouse event and not propagate it. This cost us a virtual rewrite to an  AS3 project.

Create your textures once. Load your images in once, create the texture objects, then simply refer to them from one place. This again will help performance. Creating textures is costly in terms of performance. We ended up creating a Texture singleton for the entire application. If your class wants a model… it has to go there.

That’s all I have for now, I hope this is helpful for someone.

Something to be said for concentrating on one language

Posted in Web Devel on the March 18th, 2013

I recently have been thinking about some of the above I’ve seen in some corners I’ve seen in relation to how programmers should learn some different programming languages.

The accepted thinking seems to be that learning a couple of languages is advantageous to a developer because:

  • See different ways to solve problems
  • View different tool sets
  • Freshen things up, just in case you get bored
  • Maybe force you to look at how you are doing things in a different light
  • Keep you skill-set strong and up to date

I’ve been finding recently though that learning a new programming for website development isn’t generally applicable. No matter how much I look into Python Django or Coffeescript or SASS putting them into a production environment is another issue. When you use of these you make the assumption that everybody down the chain will be comfortable using them too. And sometimes they’re not…

So, for personal little projects it’s fine, but for release software obscure software dependencies aren’t generally appreciated. Why should they be? The traditional stack of LAMP or ASP.NET + Javascript, HTML, CSS is generally applicable to 90% of situations. So I have decided to spend my time learning these more.