socket.io private message

No tutorial needed. The Socket.IO FAQ is pretty straightforward on this one: socket.emit(‘news’, { hello: ‘world’ }); EDIT: Folks are linking to this question when asking about how to get that socket object later. There is no need to. When a new client connects, save a reference to that socket on whatever object you’re keeping … Read more

h:messages does not display messages when p:commandButton is pressed

You’re sending an ajax request with PrimeFaces <p:commandButton>. Ajax requests have by default no form of feedback (unless PrimeFaces’ autoUpdate=”true” is been used somewhere). You should be explicitly specifying parts of the view which you’d like to update on ajax response. One way is specifying the update attribute on <p:commandButton> to point to the client … Read more

Creating FacesMessage in action method outside JSF conversion/validation mechanism?

You can use FacesContext#addMessage() to add a FacesMessage to the context programmatically. FacesContext facesContext = FacesContext.getCurrentInstance(); FacesMessage facesMessage = new FacesMessage(“This is a message”); facesContext.addMessage(null, facesMessage); When you set the client ID argument with null, it will become a global message. You can display and filter them using <h:messages /> <h:messages globalOnly=”true” /> The globalOnly=”true” … Read more

Catch keypress with android

You can either handle key events from a view or in general for your whole application: Handle onKey from a View: public boolean onKey(View v, int keyCode, KeyEvent event) { switch (keyCode) { case KeyEvent.KEYCODE_ENTER: /* This is a sample for handling the Enter button */ return true; } return false; } Remember to implement … Read more

Get all messages from Whatsapp

Whatsapp store all messages in an encrypted database (pyCrypt) which is very easy to decipher using Python. You can fetch this database easily on Android, iPhone, Blackberry and dump it into html file. Here are complete instructions: Read, Extract WhatsApp Messages backup on Android, iPhone, Blackberry Disclaimer: I researched and wrote this extensive guide.