Friday, November 1, 2013

Raspberry magic

Long time since I've written last time on my English blog page. Time to switch a bit from Polish piczkowskipl.blogspot.com to this one.

Some time ago I met Raspberry Pi for the first time. I had a chance to play with it and went as far as setting it in headless mode.

Today I got it back from dust and gave it next chance.
My aim was to set it up as small home server and media center.

At home I have a dynamic IP which updates more-less every 24 hours. I know solutions like DynDNS. I even used it but it was not perfect. Very often the IP stored in cloud service was not refreshed with new IP of my rooter at home.

My idea was to create a daemon program that would run in background periodically and check if external IP of the router changed. Then it should send me an email with new IP.
As genial as simple :) I could then easily use this IP to connect with remote desktop to my home server.
Surely it would not be useful if I want to setup web page and release it in the Internet to public because still the IP will change but this is not my purpose. My aim is to connect with home server by IP and use it for many purposes like monitoring what's going on at home (smart house) or working on my home machine (upload/download/program/watch a movie?? whatever comes to my mind).

Raspberry Pi seems to be interesting in this context.

Today I will explain how I set up virtual desktop connection with TightVNC.

1. Install TightVNC Server on Raspberry Pi

sudo apt-get install xrdp

2. Start remote desktop server


/usr/bin/tightvncserver
you will be asked for password, type password and do not ser view-only password when you will be asked for this.

3. Check ports on which xtightvncserver is running

sudo netstat -tulpn
Then you will have to setup your router to forward ports, e.g:


192.168.1.107 is the IP of Raspberry Pi in home network behind the router.

On your machine from where you want to connect to Raspberry Pi install TightVNC Viewer, on Ubuntu you can do this with command:

sudo apt-get install xtightvncviewer
Then connect to Raspberry Pi

xtightvncviewer 83.29.84.77:5901

83.29.84.77 is my router external IP, the one that I would like to email myself from PI whenever it changes.

How to email anything from Raspberry Pi?
Very easy with Python:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
import smtplib
 
# Specifying the from and to addresses
 
fromaddr = 'fromuser@gmail.com'
toaddrs  = 'touser@gmail.com'
 
# Writing the message (this message will appear in the email)
 
msg = 'Enter you message here'
 
# Gmail Login
 
username = 'username'
password = 'password'
 
# Sending the mail 
 
server = smtplib.SMTP('smtp.gmail.com:587')
server.starttls()
server.login(username,password)
server.sendmail(fromaddr, toaddrs, msg)
server.quit()

How to check your external IP address?
Very easy with service like http://ifconfig.me/


curl -s http://ifconfig.me
Putting it all together. Python script below gets IP address and compares it with address saved in local file. If for any reason IP is empty or same as the IP in local file then no email is sent. Otherwise an email is sent with new IP and the IP is saved in local file (dyndns.txt)

#!/usr/bin/env python

import smtplib
import subprocess
import sys

def send(ip):    # send mail
 # Specifying the from and to addresses
 fromaddr = 'change_me'
 toaddrs  = 'change_me'
  
 # Writing the message (this message will appear in the email)
  
 msg = "Your IP is  "+ip 
  
  
 # Sending the mail  
  
 server = smtplib.SMTP('smtp.gmail.com:587')
 server.starttls()
 server.login('marcin.piczkowski','mypassword')
 server.sendmail(fromaddr, toaddrs, msg)
 server.quit()

proc = subprocess.Popen(["curl","-s","http://ifconfig.me"], stdout=subprocess.PIPE)
(out,err)=proc.communicate()
ip = out.strip()
print "IP is " + ip

if ip == "": 
 raise SystemExit
else:
 txtf = open("dyndns.txt","rw")
 lines = txtf.readlines()
 oldip = lines[0].strip()
 txtf.close()
 
 if oldip != ip:
  print "Sending ip " + ip
  txtf = open("dyndns.txt","w")
  txtf.write(ip)
  send(ip)
  txtf.close()
 else:
  print "IPs are the same"
  txtf.close()
  raise SystemExit
The script must be given execution rights and dyndns.txt file read/write access

sudo chmod +x myscript.py
sudo chmod 666 dyndns.txt
Then you can schedule with cron to execute this script every 15 minutes:
sudo crontab -e
Add this line at the end of the file

*/15 * * * * python /etc/init.d/myscript.py >> /var/log/dyndns.log 2>&1 &
Above line is correct when you have your script placed in /etc/init.d/
It will store logs in /var/logs/dyndns.log but first you need to create such file and give it read/write access:
sudo touch /var/log/dyndns.log
sudo chmod 666 /var/log/dyndns.log

You can check your cron logs with

grep CRON /var/log/syslog

Now you should get mail with IP in 15 minutes. Let's verify quickly that you really can connect to Raspberry Pi on this IP.
We will start HTTP server on Pi with python, type this in console:

python -m SimpleHTTPServer
Server would listen on port 8000 so you need to forward this port in rooter configuration.
Then type in browser: http://<IP from email>:8000
Server should response with content of folder in which you started SimpleHTTPServer.

In future post we will have a look at how we can run Node.js on Raspberry Pi. Stay tuned!!

Used resources:
[1] http://programmaticponderings.wordpress.com/2012/12/26/installing-tightvnc-on-the-raspberry-pi/
[2] http://www.pythonforbeginners.com/systems-programming/sending-emails-using-google/
[3] http://www.linuxjournal.com/content/tech-tip-really-simple-http-server-python

Saturday, August 10, 2013

Switching from cloudfoundry V1 to V2

Beta version of Cloudfoundry is down since long time ago. Now Pivotal gave users V2, brand new commercial version of former service. It's yet 67 days for free. I decided to migrate my V1 app there. Let's see how deployment process differs from the old one.
Previously there was grails plugin that made it as simple as invoking several groovy commands. Now it's a bit different. Quick manual is available at http://docs.cloudfoundry.com/docs/dotcom/getting-started.html#install-cf

I'm not Ruby hacker but was able to install Ruby on my machine, yet starting with first command I encountered an issue. DevKit was missing on my machine, so i donwloaded it from here (DevKit-tdm-32-4.5.2-20111229-1559-sfx.exe), extracted in my groovy_home/DevKit and installed with commands:
cd C:\Ruby193\DevKit
ruby dk.rb init
ruby dk.rb review
ruby dk.rb install
Then lets return to cloudfoundry install cf.

gem install cf

cf target api.run.pivotal.io

When we have done it already we can build war file (grails prod war) and upload it.

cf push --path consulner.war

When we do this for the first time we will be asked to choose environment (dev, staging, prod) I've chosen production. Then I answered questions as follows:



Name> consulner

Instances> 1

1: 128M
2: 256M
3: 512M
4: 1G
Memory Limit> 3

Creating consulner... OK

1: consulner
2: none
Subdomain> consulner

1: cfapps.io
2: none
Domain> cfapps.io

Binding consulner.cfapps.io to consulner... OK

Create services for application?> n

Save configuration?> y

Saving to manifest.yml... OK
Uploading consulner... OK
Preparing to start consulner... OK
-----> Downloaded app package (28M)
Downloading JDK...
Copying openjdk-1.7.0_25.tar.gz from the buildpack cache ...
Unpacking JDK to .jdk
Downloading Tomcat: apache-tomcat-7.0.41.tar.gz
Copying apache-tomcat-7.0.41.tar.gz from the buildpack cache ...
Unpacking Tomcat to .tomcat
Copying mysql-connector-java-5.1.12.jar from the buildpack cache ...
Copying postgresql-9.0-801.jdbc4.jar from the buildpack cache ...
Downloading auto-reconfiguration-0.7.1.jar from https://s3.amazonaws.com/maven.springframework.org/milestone/org/cloudfoundry/auto-reconfiguration/0.7.1 ...
-----> Uploading droplet (65M)
Checking status of app 'consulner'.....
  0 of 1 instances running (1 starting)
  0 of 1 instances running (1 starting)
  1 of 1 instances running (1 running)
Push successful! App 'consulner' available at http://consulner.cfapps.io


That's it! Now we have app running on prod. Unfortunately this was not that simple, I struggled to find out why the app could not start t first time and there was nothing inspiring in logs or crushlogs. Finally I tried increasing default memory from 256M to 512M and it worked :)

Monday, June 17, 2013

Startup Weekend Lodz 2013

First such event in Lodz, but not first in the history. People from different domais met this weekend in Lodz to put incredible ideas into life. Some came with their own ideas, others to meet people or hack codes. From all ideas finally 6 were chosen to form team upon:

Creative Learning ! Creative Learning is creating platform of educative and fun apps for kids. We offer you two options: 1) kid muting and absorbing apps (first to go!) & 2) kid-(grand)parent interaction app ( we'll "KISS" for your kid to stay focused & a granny be able to help!).
Fun, creative, educative and esthetic apps is all what Creative Learning is about - and all this in a set of apps that will become the kids apps legends ;).
If you want your kid to learn stuff in a fun way follow our FB page and website, help us test and expect our products on iTunes & GooglePlay soon!
- Creative Learning - SHAPES
- Creative Learning - LETTERS
- Creative Learning - NUMBERS
-Creative Learning - ANIMALS
and more!
http://www.creative-learning.eu/


Photo: http://www.creative-learning.eu/



allSpotted! - The team is about creating a mobile app for the facebook movement called "Spotted". It allows you to find again the person you have meet/seen but have no contact to. The app uses social traffic and GPS information.

Photo: allSpotted


Space Lawyer! Best Legal Services on-line in Poland. Everywhere, anytime!

Photo: Space Lawyer


ADS ON PETS! Ads on Pets - we provide brands with a new advertising channel. By giving pets lovers possibility for their animals to stand out, we give them way to make money so they can spoil them even more. 

Photo: ADS ON PETS


Video Pediatric Advice! Platform which allows pediatricans to give advices to patients via webcam.

Photo: Video Pediatric Advice


"Gamming for Cats and feed it"
Idea is quite simple. Cat plays iPad and gains points. When gained more than 100 points it' s given food. There is also idea for suture to increase food rate if cat burns more than 200 calories. 

Photo: Dzisiaj skończyliśmy prototyp urządzenia "Gamming for Cats and feed it"

Idea jest całkiem prosta, kot gra na Ipadzie, jeśli zdobędzie 100 punktów dostanie jedzenie.

W planach rozwoju jeśli przećwiczy 200 kkalori dostaje większą porcję !.


Aplus - learn Math Online. E-Learning system leading you through a path to Math proficiency.

Photo: Aplus - to jeden z pomysłów ze startup weekendu. Naucz się matematyki Online. Kamil Kamiński odpowie na wszystkie Wasze pytania z matmy ONLINE.

Finally Dominik is going to California with his Creative Cats and feeding device for them.

2nd prize - our team with prosteumowy.pl
3rd prize  -  allSpotted and Video Pediatric Advice!





Saturday, March 16, 2013

33rd Degree 2013, Warsaw

13-15 Mar 2013 in Warsaw - 3 days of great knowledge and motivation boost.
33rd Degree another time proved it's one of the greatest, if not greatest one conference in Central and Eastern Europe. First time it was held in Warsaw Gromada Hotel and in comparison to previous 2 years it was a good choice. It was held on 3 floors so there was no problem with room and access to toilets or snacks. Although there were about 900 attendees the impression of crowd was not so painful.
Everyday we could choose of 5 different tracks. Here I will summarize talks and workshops I attended.

Day 1

Sven Peters

7 Things: How to make good teams great


Sven works at Atlassian and spoke about 7 things that worked in his company to make great (agile) teams. He writes his blog at http://svenpet.com/
Most companies motivate employees by bonuses and commissions but what do they really motivate to? Usually they motivate to get bonuses and commissions, not to make good work. When companies find good people they put them in cages, they limit their possibilities, e.g. force to working in fixed hours, not buying license for tools. What can we do about it? We can sit and complain, make revolution (which usually finishes bad) or try to do little changes step by step. The last one seems to be better approach. Try to change your environment and let it grow. Here are the tips for you:
1) Flowtime - stay in productivity phase as long as possible, don't allow to interrupt it. In Atlassian they first set up flowtime hours when team locked themselves in a room, turned off phones, mail clients etc. and worked on a task. This habit started to spread over company with time but was not ideal. It happened when contact with team was needed urgently sometimes. To fill this gap the team assigned a first point of contact each time - a person who was not closed with others but served as a help to other teams whenever they needed some help. This was better. Other source of interruption are open working spaces and should be avoided. Surely flowtime has its drawbacks - setting attention on single thing may easily lead you to situation when you loose the focus on right thing and pass to the wrong path loosing plenty of time. It's important not to loose this focus.
2) Feed you brain - conferences, organizing coding sessions after work, trying out new things, learning new languages, all this stimulates brain to work better. You can move a meeting to lunch ('brown bag' meetings) or meet after work on a beer. That's often much better than official office meetings.
3) Say "well done!" - don't afraid to appreciate small things in your team, e.g. when someone spent 2 extra hours on client's problem appreciate it. Tell him he did a good job (even when mostly he screws things up).
4) Report robots - nothing consumes more time than writing reports which eventually are not read by anyone. Automate things that are repetitive. Collect data and put information radiators all over the office (a TV in kitchen, posters, etc.) This is better than to sit and read reports and you're getting naturally more aware of numbers than studying them. Finally everyone in the office knows the numbers, not only managers. People are more aware of what's the actual outcome of their actions.
5) Eat your worn dog food - when you build a product try it yourself before releasing to users. Give it to your co-workers for alpha testing. It hurts sometimes when your colleague from opposite desk complains about it but it's the fastest feedback ever. Think like a customer, understand customer better.
6) Do a special day - leave your current items for one day, pick up things that stack deep in your backlog and tidy them.
7) Experimentation time - check your cool ideas, build a prototype. In Atlassian they have 20% time for building project of the ideas, that can help company to improve product. It's called "innovation week". This starts usually after a milestone release when there's more time and none will be interrupted by current sprint. It starts with a meeting when team gathers all ideas. They make a plan, maybe a mockup and next day they sit 24h building the product. Day after they present the product to other people in company ("ship it day").

Dan North

Decisions Decisions


Dan spoke about daily-life decisions:
* builds: automated or manual
* testing: automated or manual, or test after, or test whenever
* architecture: synchronous or asynch.
* architecture: monolithic or small components
* programming: object-oriented or functional
* threads or single-event loops, or actors, or CSP (Communicating Sequential Processes)
Each decision is a trade-of. When we build solution the need should drive the solution, e.g. when hacking to find out proper architecture of many possibilities often writing code first sounds better than TDD when after all we don't know where we're going to, deleting code often but if TDD is quicker for you in such cases then use it. Do with what you're more familiar and leads you toward solution quicker. Premature optimisation is a source of all evil. Try hybrid solutions. Use Spike and Stabilise pattern - create product that works, ship it as quick as possible to get user feedback and then when the solution starts to form try stabilising it, cleanup some code, add more tests.
Decision whether use objects or functions is pointless, why not trying both depending on purpose? Same goes for builds. In some cases manual builds sound better choice - you pay attention to details which can be forgotten during automation. When product evolves so should your methodology. When automatic build took, say 3 minutes and you added new features it will slow down. You should tweak build process to enhance performance rather than allow it to live its own life - automation is misleading sometimes.
Automated testing is OK when e.g. testing repetitive set of data, but manual testing give other view, e.g. when clicking over UI you get understanding of user experience, you spot each change to the application when new features are added, how it impacts end user.
Short Software Half Life pattern - how long will I wait until half of my code will not be anymore there. It's good to divide software to small cohesive components, each of which does one thing (this is how Linux was designed). Each component has soft center and hard shell, means clearly defined interface with other components. It's then easier to throw out such component, rewrite from scratch than if whole system is monolithic - there's term called micro software architecture.
Evaluable architecture is one that's changing over time to adapt to user needs. Evaluable e.g. has nothing to do with DRY (Don't Repeat Yourself) principle of programming - analogically to DNA which takes main part in evolution: DNA does not refactor, it copies. Same for software - it's easier to remove part of a system if it's not coupled with other parts (this breaks DRY rule).
The conclusion of speech is that only when you know what you're trading off you can make informative decisions.

Ted Neward

Busy Developer's Guide to Iconoclasm


More about Ted is on his page www.tedneward.com
India produces 350 000 engineers every year. Along with India more eastern countries like Poland, Romania ships cheap engineers on market. At the same time automation is happening, machines take over jobs which not long ago were done by people. Can we avoid it? How can we protect our job?
We can't. We can evolve. Something that machine can't replace is creativity.
Nothing can replace people like those who invented Evernote or Dropbox.

These people are iconoclasts. They are people who beat 'status quo' for sth better for the World.
They are people who are brave enough to be driven by logical thinking, not group thinking.
Group thinking is dangerous. We are biologically wired to follow the herd. This is sth we should avoid.
Iconoclasts like everyone fear to step out of crowd, but they refuse that fear to influence logical decisions.
"Failure is only the opportunity to more intelligently begin again" - said Henry Ford.
Some iconoclasts finished dead when trying to force their ideas, some where more successful. The difference between them is that ones could convince people while other barely tried.
The social intelligence is sth that forms of how we perceive familiarity and feel reputation. This is how we should convince people to new ideas. We should step by step make them familiar with it and build our reputation. None believes someone unknown who at first glance talks bullshit according to what's commonly thought by group.

Erik Dörnenburg

Software quality – you know it when you see it


Erik spoke about quantifying the quality and presenting on charts.
The clue is to aggregate some information but throw away other, use graphic views and take data at right level. There are different metrics to be used:
- lines of code
- method length
- class size
- cyclomatic complexity (the number of nested loops)
- coupling between classes
- weighted methods per class
Eric shown several diagrams and pointed out tools that we can use to generate them:
InfoVis, Gephi, SourceMonitor, CheckStyle, iPlasma.
The same talk can be viewed here.


Tugdual Grall

Getting Started with Couchbase Applications Development


Tug runs blog at http://tugdualgrall.blogspot.com/.
Rational databases scale bad and it's expensive (Oracle RAC). NoSQL comes to rescue.

Couchbase is one of document databases. Entries are stored in JSON format. Architecture is as below:



Couchbase server runs on C++ and V8 JavaScript engine. Cluster manager runs on Erlang.
In comparison to MongoDB it has worse query language but better scalability. Usually the project lifecycle starts with Mongo and if it's enough then it stays on Mongo but if it needs more scalability, better performance it moves to Couchbase.
Search mechanism in Couchbase can be enhanced by adding ElasticSearch component.
Couchbase team is also working currently to release Spring Data package.

Day 2

Tugdual Grall

Workshop: NoSQL Workshop: Discover NoSQL Development with Couchbase 2.0


Good hands-on training of Couchbase. I've put materials at github. Especially useful is example of simple web app demonstrating all Couchbase operations.

Erik Dörnenburg

Architecture without Architects


Eric gave 2 metaphors of software development: 
1. Building houses. House architects need to deal with complex planning of every detail of the building before development has really started. Build phase is short in comparison to usage phase. Good idea at the time of development does not necessarily have to be as good after several years of usage. Refactoring the city is hard and requires good and detailed plan. This metaphor is not that close to software development where build phase and usage phase are mixed. We don't build software once and use it but constantly refactor and adapt to evolving requirements. More close to software development is 2nd methaphore
2. Gardening. Although more accurate, we prefer to call ourselves developers than gardeners. We wouldn't put gardener on our business card as it appeals to us with less social respect. However gardening is much like software development, it requires from gardener to constantly work on keeping the garden in right shape when time and surrounding conditions change (e.g. different seasons of year, changing climate, ageing of plants).
Software development has more to do with evolution which consists of:
- recombination
- mutation
- fitness function
The same happens in IT in Open Source and technical startups. This is not that architects can plan at the beginning and only once how product will look like. Many frameworks emerge but only a few become successful. Fitness function depends on number of people who use the framework.

Abstractions in software development are useful but you need to know the details underneath, e.g.:
Web application can get from server JSON containing url links to more details which can be navigated on demand. Same concept on mobile application won't work because limited bandwidths. Fetching details from links would be too slow. Other example is messaging abstraction. Let's have a method:
sendMessage(String topic, Message message) which nicely encapsulates whole stack of invocations from top to the bottom where network packets are sent. This abstraction works as long as you remember of max. size of message to send with MTU token of 15000 bytes. Otherwise the method gracefully fails, because the abstraction hides that detail. Here we come to term of 'mechanical sympathy' this is where software and hardware should work in harmony.
Reasonable architecture starts with simple concept and evolves when needed. It' said the architecture should be componential, but not necessarily at the beginning. The same as monolithic architecture can evolve to componential, the same a componential can evolve to turn multiple components into one, which is presented on pic below:

The conclusion is that architecture and development cannot be separated (as e.g. in civil engineering). 
We cannot do architecture upfront but it has to be validated by code. Most of the things that traditionally architects did (diagrams, design, documentation) should be done by developers, by tools or not done at all.


Pratic works at Triplingo and writes blog mypatelpace.com
The tips & tricks given by him are:
* users expect same performance on mobile as on desktop or even better
* 10 sec. maximum waiting time on desktop application but 3 sec. on mobile
* mobile Safari browser has only 25KB JavaScript cache, so do not use same JavaScript frameworks for mobile pages, e.g. instead of jQuery use zepto, xui, microjs
* use little CSS, JavaScript because it takes time to parse it (100ms/1KB), minify it (gzip)
* reduce DNS lookup on page, e.g. limit redirection (from mypage.com to www.mypage.com)
* load first necessary content and then the rest (adverts, statistics JS)
* do not use background image, use CSS gradients instead
* instead using images use icon fonts (free icon fonts here), they scale nice and take little size
* instead of shifting images on page use CSS3 animation.
* click event takes about 300ms for operating system to recognize, it is delayed depending on screen resistance, dust, etc. so instead on-click event use touch-start events and touch-end events.
* use websockets for persistence pipe with server instead of http


Simon is Tech. Evangelist at Oracle Corp.
He's done intro on Raspberry Pi platform - an ARM processor based board.
Project emerged from BBC Micro project started in 1981, which was to serve British college students with platform for learning computer science. In Feb 2012 first Raspberry Pi was released.
Raspberry Pi Beta Board.jpg
It contains:
- ARM 11 core 700Mhz processor overclocked up to 1GHz
- 256MB (release 1) or 512MB (release 2) RAM
- HDMI & composite video so can be connected directly to monitor
- 2x USB
- audio out
- Ethernet (release 2)
- header pins

It's available on market for $25 and $35 (release 2)
Simon demonstrated some real-life applications like:
- LegoMindstorm motor steered with brain waves
- mechanic arm steered with joystick
- voice synthesizer
Really full of fun presentation.


Katrin presented one of remote-work platforms - https://www.elance.com/
She also gave some tips how to start freelancing there: 
- specialize in what you do, do it very well
- create outstanding profile, add portfolio
- search only jobs that fits exactly your skills
Setting up freelancing business takes time and effort but is becoming more popular. It gives several advantages one of which is flexibility, but this is not a work for everyone.
After becoming recognized by clients freelancer can move to entrepreneur role, hiring people to accomplish his projects.

Day 3


Workshop led by Hakan Gurel - Amazon Solution Architect (hakan (at) amazon.lu) and Krzysztof Marciniec - Technical Sales Representative (marcinie (at) amazon.lu)
I have never used AWS before. This gave me a huge dose of new knowledge in reasonably short time, rather than spending hours on digging through Amazon jungle of documentation.
We succeeded setting up a Linux node with Python-based web application, configured db storage for it and set up load balancer in front of. The app front is simple - a photoblog, check it out at http://ec2-23-20-243-172.compute-1.amazonaws.com/. We got also one more course in pdf showing how to use AWS transcoding. I placed all materials at github.


Venkat on example of world great empires in history gave a few tips for developers:
* Leverage the power of democracy
Good leaders are those who create things and give it to people watching what they'll do with it, helping when they need it. In analogy to it Java is a dictator. It's enough to watch at exception handling mechanism which not like in dynamic languages when it's left to developer to decide wheather to catch it or not but forced by checked exceptions. Here Venkat recommends a book: The Wisdom of Crowds by James Surowiecki.
* Be adaptive
To fear of change leads to language stagnation
* Complecency and arrogance kills
As an example Venkat gave the time of Inks and Spanish conquistadors. Arrogant tribe emperor underestimated the little amount of Spanish soldiers, well armed in rifles and on horses, in comparison to greatly larger amount of his warriors but armed with spears that led his civilisation to death.
Same in software, new powerful languages emerge. Arrogance leads to bad decisions. Language wars are pointless.
Recommended book: Guns Guns and Steal
* Revolutionize, not resist.



Hadi works on JetBrains, is a Developer and Technical Evangelist.
More about him on his page hadihariri.com 
He spoke about different software development methodologies, how they try to be cure for everlasting problems like: scoping requirements, planning sprints, dealing with bugs. 
Numerous methodologies emerged like:
SCRUM
Lean
Pomodoro
NOOO (not only object oriented development)

Having all that rumour we're often loosing focus on the right thing.
All about it is that not learning new methodologies and technologies or languages really matter but helping people. Innovation is about helping people, making their life easier. The talk is also on vimeo

The hackaton was held along all 3 days of conference in the evenings. Actually it already started the evening before conference. During that time guys created a nice working thing that we can all watch here and check code at github:


Thursday, February 28, 2013

OneWebSQL competition


Lately I'm spending most of the time on building my ego :))
First since very long time I've even won sth
http://onewebsql.com/konkurs-spring
http://e-point.pl/co-nowego?news_id=1500144,rozstrzygniecie-konkursu-na-najlepsza-aplikacje-webowa

My solution is available free on github. I must admit I would change a few things though, especially presentation layer - I would rewrite it in AngularJS.

Monday, February 25, 2013

MongoDB for Java Developers - 10gen Course

The course has just started today.
So far this week I gone through MongoDB installation, basic queries from mongo shell and Java application. I've also learned Spark Micro Web Framework and FreeMarket templating engine.
So far so good.. exercises were not to difficult and possible to go through in one night.

I've setup github project for this course at https://github.com/piczmar/MongoDB4JavaDev/

Sunday, January 6, 2013

Grails read-only domain class


Grails does not provide simple mapping to mark domain object read-only, means so that dynamic find methods (find, get, list..) work OK but save/delete is forbidden. This is particularly useful for legacy databases.
We can however provide desired behavior with low effort ourselved.
I could think out at least 2 ways of doing so:
1. listen on beforeXXX methods in domain class e.g.:

class Demo {

    static constraints = {
    }
    String name

    transient beforeUpdate = {
        throw new RuntimeException('update not allowed')
    }
}

2. send error status from controler REST method that is not allowed, e.g.:


    def delete(Long id) {
        response.sendError(405)
    }

If you just want to disable an attribute of a domain class from being editable in scaffolded view you can use constraint:

class Demo {

    static constraints = {
         name(editable: false)
    }
    String name
}