Posts

Showing posts from 2012

Drawing in Graphiti

Image
It seems Eclipse Graphiti is really popular lately. Germany is using it to build cars, Engineers in India are getting to speed with it as well. Finally I made a try as well and fell in love with the simple APIs and helpful docs. The only thing that struck me is that most diagram editors out there are used mostly to draw just boxes and connections between them. Is that really all you can do!?!?? Ok so you here's what I did, a simple drawing tool in Graphiti: Click below to see it in action! And Fork it on Github Youtube video:

Trouble signing Apps for OSX Mountain Lion

Image
If you're building desktop Apps for OSX, chances are you'll need or you're already working on getting them signed with Apple's certificate. Otherwise your users might see this, starting with Mountain Lion: I just signing few apps and scored new items in my erroropedia: Error 1: "Error signing data" $ productsign --sign 'Developer ID Application: YourCompany' from.pkg to.pkg productsign: signing product with identity "Developer ID Application: YourCompany" from keychain /Users/user/Library/Keychains/login.keychain Error signing data. productsign: error: Failed to sign the product. Reason: keychain is locked for access from SSH. Try security unlock-keychain -p You might also need to enable access to certificate private key for all applications: Error 2: "MyApp.app: object file format unrecognized, invalid, or unsuitable" One solution that worked for me: export CODESIGN_ALLOCATE="/Applications/Xcode.app/Cont

How to create Restful API in Zend Framework 2

Your ZF module just needs to provide Controller that speaks REST (for example RestfulController) and make sure that generated response will be formatted in JSON, in other words configure JSON rendering strategy. Below you can see an example controller. Note that it has convenient methods for to get all elements, single element, create/update and delete an element: use Zend\Mvc\Controller\RestfulController; class UserController extends RestfulController { public function getList() { return array("users" => array()); } public function get($id) { return array("id" => $id); } public function create($data) { return array("created" => "yes"); } public function update($id, $data) { return array("updated" => "yes"); } public function delete($id) { return array("deleted" => $i); } } When associating this controller to route, make sure to NOT use 'action' parameter. Otherwis

Wedding table problem

Here's the old ancient wedding table problem that each man inevitably has to solve on his way to honeymoon. Research on the topic shows that some philosophers simplify this problem to set partitioning problem (not sure if they were on any wedding, or are they just dinning philosophers). Whereas others assign the problem to the social nature of participants. But I guess that for all my readers it's obvious that this is strictly mathematical subject and should be analysed from the algorithms perspective. Problem statement: Newlyweds are holding a party of n guests, where 2m of them comes in couples and the rest comes single. There's one long table with n chairs, split equally on both sides and each guest needs to have a chair assigned. Each couple has to together. Guests sitting next to each other, or on the opposite sides of the table are in talking range. There's a graph G(V, E), where each vertex represents a couple or single guest and each edge represents an acquai

Choosing JS build tool

Lately I was tasked to setup a JS based project together with full build and testing automation. Today I'd like to share the build and testing part, as it turned out to be quite interesting problem. In short, we have a little JavaScript library that is designed for browsers. During build it should be packaged from source (e.g. multiple extensively documented files) to several different versions (e.g. bundled with other files, minified, etc.); ran against unit tests and validated with JSLint. Assuming that someone would like to try this library, they might be willing to build and test it as well, so a JS-friendly technology would be a perfect hit, won't it? Ok, so it was time for a little research on what do others use for building their JS libs. Half of the internet seems to be using Makefiles, while the other half is deep in love with Ant. To be specific, jQuery, Bootstrap, Code9 IDE were using make, while for example Dojo and Firebug were on Ant! It's actually quite relie

Google Summer of Code + Eclipse PHP Tools !?

Image
It's that time of year again when students join open source projects, disrupt the old traditions and bring new ideas into life as part of Google Summer of Code! Last year I was mentoring a great project led by Karol Gusak , which was crossing the edge of Web and desktop developer tools. Karol built Eclipse PDT into Orion web tools , bringing core PHP coding support to cloud. Click to see the video Do you hate how Eclipse PDT works, absolutely can't stand what great feature it's missing, or wondering why it still doesn't integrate with that other awesome technology in your mind? Start thinking and chime in with your ideas on Eclipse PDT email list , post it on ideas wiki or contact me ! I'd be happy to mentor this year again, and I'm on look out for anything cloud mobile revolutionary lego embedded wordpress css javascript php zendframework symfony automotive node mongo and smart tv too.