Mar 312016
 

Well, time passes and that implies a technical update, so now starting the way to do some AngularJS 2.

I wanted to start easy and from a well known source, so I decided to check the resources on angular2 and since I said, easy, after checking getting the quick test with 5 min quickstart if angular.io, I’ve started with the case study and of course, there are some setting up problems.

events.js:141
[1] throw er; // Unhandled 'error' event
[1] ^
[1]
[1] Error: watch node_modules/lite-server/node_modules/browser-sync/node_modules/micromatch/node_modules/braces/node_modules/preserve/test.js ENOSPC
[1] at exports._errnoException (util.js:870:11)
[1] at FSWatcher.start (fs.js:1234:19)
[1] at Object.fs.watch (fs.js:1262:11)
[1] at createFsWatchInstance (/home/lala/repos/angular2-quickstart/node_modules/lite-server/node_modules/browser-sync/node_modules/chokidar/lib/nodefs-handler.js:37:15)
[1] at setFsWatchListener (/home/lala/repos/angular2-quickstart/node_modules/lite-server/node_modules/browser-sync/node_modules/chokidar/lib/nodefs-handler.js:80:15)
[1] at FSWatcher.NodeFsHandler._watchWithNodeFs (/home/lala/repos/angular2-quickstart/node_modules/lite-server/node_modules/browser-sync/node_modules/chokidar/lib/nodefs-handler.js:228:14)
[1] at FSWatcher.NodeFsHandler._handleFile (/home/lala/repos/angular2-quickstart/node_modules/lite-server/node_modules/browser-sync/node_modules/chokidar/lib/nodefs-handler.js:255:21)
[1] at FSWatcher. (/home/lala/repos/angular2-quickstart/node_modules/lite-server/node_modules/browser-sync/node_modules/chokidar/lib/nodefs-handler.js:473:21)
[1] at FSReqWrap.oncomplete (fs.js:82:15)
[1]
[1] npm

I came across this thread, where it gives a solution for Ubuntu users, that at least works for me

echo fs.inotify.max_user_watches=524288 | sudo tee -a /etc/sysctl.conf && sudo sysctl -p

I cannot say that I understand it too much, except for something else that I read, that the system has a limit to how many files can be watched by a user, and seems that you run out of watches if Grunt is running with other programs, I’m not sure if is my case, but some sense makes.

Feb 132016
 

Espero que esta sea la primera de varias recetas africanas, resultado de ir conociendo poco a poco una parte de Africa, llena de matices, sabores, realidades difíciles, pero también de sonrisas, sabiduría y buen hacer.

Ahora la idea es cocina super canya (ni idea si realmente se escribe así pero digamos que si)

Supercanya

Empezamos con la receta y mientras cocinamos pues vamos viendo en otras cosas.
Los ingredientes que necesitaremos son:

300gr okra
2 cebollas medianas
300gr pollo
150ml Aceite de palma
Sal
Pimienta
3/4 litro Agua
Chup-chup, lease sazonador deshidratado(maggie, gallina blanca, etc)
Arroz

El okra es una verdura africana, que al cortarla suelta una especie de resina, que se va pegando al cuchillo. Uno de los beneficios del okra es que es bueno para el estómago, lo pone en orden 🙂

Preparativos

Cortamos en rodajas muy finitas el okra.
Cortamos, estilo juliana,la cebolla en rodajas muy finitas.
Cortamos el pollo/carne en pedazos pequeños
Calentamos la botella donde esté el aceite de palma, antes de usarlo para freír.
Cocemos arroz blanco.

A cocinar!

Por un lado calentamos la botella de aceite de palma, en general el aceite de palma es como una pasta, así que lo calentamos para convertirlo en líquido.
En paralelo en una cazuela doramos la cebolla, cuando esté dorada, añadimos el pollo/carne hasta que se dore un poco, entonces ponemos el okra y alrededor de 3/4 litro de agua. Dejaremos esta mezcla a fuego lento, removiendo de vez en cuando, hasta que el okra vaya soltando toda esa especie de resina y entonces la salsa quede medio espesa. Este proceso puede durar entre 30-40 minutos. Cuando veamos que la salsa está medio espesa, echamos el chup-chup maggie (o similar) y aproximadamente 10ml de aceite de palma, que le dará un olor particular y un color rojizo al guiso. Dejamos cocer todo a fuego lento y vamos ajustando el agua, el aceite de palma hasta que la salsa con la textura de una melaza, el tiempo será posiblemente unos 20 minutos más.

Todas las medidas las he puesto a ojo, nunca ha habido balanza en el proceso, sino puñados de cosas, así que las cantidades son sólo un indicativo de lo necesario para unas 4 personas, el resto es la mano de la cocinera.

Para servir, cogemos un plato grande, ponemos el arroz blanco cubriendo el plato, en el medio hacemos un huequito donde ponemos la salsa del supercanya, una cuchara por comensal y todo el mundo come del mismo plato, 🙂 más o menos debería verse así …

¡¡¡Buen provecho!!!

 Posted by at 9:49 am
Sep 042014
 

A DeepaMehta(DM) plugin can publish static resources and dynamic resources.

A DM plugin automatically publishes the Static resources (files) that are in resource/web directory. They will be published in the URI specified in bundle symbolic name in the pom.xml

A DM plugin can also publish dynamic resources created by java code, by providing a DeepaMehta RESTful service. To do so, you should define a method where you call getStaticResource to access a resource from the plugin, this method returns an Inputstream. The resources will be published in the URI obtained from the @path annotation defined in the plugin, and the resource method should be annotated with @Produces(“text/html”).

An example:


package de.example;

import de.deepamehta.core.osgi.PluginActivator;
import java.io.InputStream;
import javax.ws.rs.Path;
import javax.ws.rs.GET;
import javax.ws.rs.Produces;

@Path("/website")
public class ExamplePlugin extends PluginActivator {

@GET
@Path("/{id}")
@Produces("text/html")
public InputStream invokeExample() {
return getStaticResource("web/index.html");
}
}

 Posted by at 7:27 am
Sep 042014
 

DM does not log you out automatically. There is no session timeout.

Once logged in DM creates a session in its webserver. The session ID is hold in a cookie. The cookie is a “session cookie”, that is it has no expiration date. So your session is only lost when a) restarting the DM server (in particular its web server), or b) when you restart the browser (or delete the cookie manually).

In case you have installed DM integration with SAlly, then you may experience an automatically log out, to change it you must put

org.ops4j.pax.web.session.timeout=120

in Karaf’s etc/system.properties file (gives 120 minutes to time out).

 Posted by at 6:04 am
Aug 182014
 

When coming to use DeepaMehta (DM), sometimes we are not aware of all the potential that is already there. So I’ve decided that when I come through some solutions that at first may be not obvious I’ll tag them as in the blog as DeepaMehta tips 😉

The first one, it has to do with retyping topics.
I’ve found out, that my first impulse when using DM is only to use the default topic types, almost everything can be a Note, a Person, an Institution or a WebResource. So I’m very happy just to start with those, once my project evolutes, I begin to need my own topic types, but was not sure how to do this in DM, without having to redo everything, so here it is how to reuse the information that you already have. In my case I’ve retyped Notes so I wanted to reuse its title and description.

1. Create Notes
2. Reveal the Note topic type (most simple by navigating along from a Note instance)
3. Create your own topic type, make it **composite**
4. Attach the Note type’s Title and Text child types to your own topic type
5. Create and attach further child types to your topic type
6. Optional: change the child order of your type so that Title remains the 1st child
7. RETYPE your Note instances (by invoking Retype from the context menu) -> Your Notes are now instances of your own type while keeping their existing content and label!

Retyping is on a per-instance basis, so each Note can be retyped to a different Type one by one 🙂

PastedGraphic-5

 Posted by at 2:59 am