Implementing a Java-based AWS Lambda Function triggered by SNS

I had some initial trouble finding documentation on how to consume AWS SNS events from a Lambda function implemented in Java. The signature can’t be your domain POJO it seems, it has to be a SNSEvent. Here’s what worked for me:

Maven dependencies:

<dependency>
<groupId>com.amazonaws</groupId>
<artifactId>aws-lambda-java-core</artifactId>
</dependency>
<dependency>
<groupId>com.amazonaws</groupId>
<artifactId>aws-lambda-java-events</artifactId>
</dependency>

The signature in the Java-based Lambda Function need to consume com.amazonaws.services.lambda.runtime.events.SNSEvent:

public String processSnsEvent(SNSEvent event, Context context) {
String input = event.getRecords().get(0).getSNS().getMessage();
return processInputFooBarSomething(input)
}

Implementing a Java-based AWS Lambda Function triggered by SNS

Appreciate the one who gives you what you need, be mindful of the one who gives you what you want

It’s a common knowledge that one should give a child what it needs, not what it wants. I tossed this around until I saw the flip side…

Corollary: the one who tells you what you want to hear may not be the one you should listen to.

Appreciate the one who gives you what you need, be mindful of the one who gives you what you want

If you’re smart enough to complicate matters – you’re dumb

Some people seem to believe that complicating matters and making it a continuous, repeated challenge to execute certain steps is a strong demonstration of their intelligence. I tend to believe that solving the problem once, writing down the solution in simple monkey steps and not having to use brainpower for this matter ever again is a demonstration of, uhm, meta-intelligence.

If you’re smart enough to complicate matters – you’re dumb

The Five Perspectives of Offshore Outsourcing

Offshore outsourcing is perceived differently by each stakeholder. This is what my experience shows:

  • Offshore: low risk
  • Business: low rate
  • Development: low skills
  • Management: low velocity
  • Customer: low quality

 

(I may be breaking some kind of a unspoken rule here, as there is a whole industry built on outsourcing and people have risked their career blindly committing to such method of temporary cost cutting. I do not mean to offend anyone and am open for evidence that shows contrary. Evidently I am generalising as much as the advocates of offshore outsourcing claiming fantastic benefits do)

The Five Perspectives of Offshore Outsourcing

ADT Exception: com.android.dx.util.DexException: Multiple dex files define …

I’ve spent hours trying to resolve this problem when launching an app. I followed plenty of misleading posts…

In my case it ended up to be a *.apk file hiding in a project.

I deleted the file, then bounced Eclipse. All working again. I hope this saves your day…

ADT Exception: com.android.dx.util.DexException: Multiple dex files define …

Factory Reset for LG 3D P920

First of all – DON’T PANIC !

Resetting your LG 3D P920 is a piece of cake and requires no soldering. All you need is a Windows PC and a USB cable.

  1. Switch off the phone, disconnect if from the PC
  2. Take out battery, write down IMEI that can be found on label in the battery bay, put battery back (if you already know your IMEI, then still cycle the battery)
  3. Install the LG USB Driver and LGMobile Support Tool from the LG update site (Aussies on Optus go here)
  4. Reboot PC
  5. Launch the LGMobile Support Tool
  6. Press – and keep pressed – the Volume Up button while connecting phone and PC via USB cable
  7. Desktop should install more drivers
  8. Update Tool should show phone as connected
  9. Select “Customer Support” – “Recovery Phone”
  10. Enter IMEI (no hyphens), “Check”, “OK”
  11. Support Tool closes, updater software launches after a few seconds
  12. Updater starts to download firmware
  13. Updater then connects to phone and uploads / resets phone

If it doesn’t work, then don’t bang your head against a wall. Try the process again. I think I may have had to reboot once or twice until I got past step 7 & 8.

Oh, and I found the latest su updates to break stuff (October ’11), so wait for updates of SuperUser until this is really fixed…don’t update.

P.S.: Yes, rooting definitely works with SuperOneClick 2.1.1. and phone software version V10J for Australian Optus P920. (The software version can be checked via the LG Tool). But if you go too crazy with removing bloat or similar, then you may need above steps…

 

Update Aug 2012: no more issues with su. And the download will now get you Ginger Bread 2.3.5 which has significant speed improvements. SuperOneClick fails to root as GingerBreak fails. But Dan’s Exploit gets you there..

Factory Reset for LG 3D P920