![]() |
| Quickoffice |
Willkommen auf Pelzkuh.de
Hier finden sich Neuigkeiten rund um interessante Themen aus der (Computer-)Technik und den Pelzkuh.de Development Server. Zugriff gibt es über die Trac Links.
Hier finden sich Neuigkeiten rund um interessante Themen aus der (Computer-)Technik und den Pelzkuh.de Development Server. Zugriff gibt es über die Trac Links.
Quickoffice für alle und mehr Platz in der Cloud
Quickoffice wurde 2012 von Google aufgekauft und seitdem wurde das mit Documents2Go vergleichbare mobile Officepaket für Geschäftskunden gratis verteilt - Alle anderen konnten sich den Spaß mit nicht gerade günstigen ~15€ gönnen. Ab sofort gibt Quickoffice kostenlos für Android und iOS - das Angebot gilt gleichermaßen für die Phone und Tablet Version. Zusätzlich bekommt jeder der sich bis 26. September in Quickoffice anmeldet zusätzliche 10GB Cloudspeicher bei GoogleDrive für 2 Jahre.
Nexus 7 2013 wieder verfügbar - Nexus 4 ausverkauft
Das in der ersten Charge schnell vergriffene Nexus 7 ist aktuell wieder im Google Playstore erhältlich. Auch das angekündigte Modell mit LTE ist ab sofort für 349€ bestellbar. Versendet wird innerhalb von zwei Tagen. Das Nexus 4 Schnäppchen ist derweil schon ausverkauft. Spannend ob Google hier noch mal nach produziert oder das vor der Tür stehende Nexus 5 es vollständig ersetzt.
Using Xtend's template expressions
Having programmed with Xtend for some time, using it mainly in small data migration and import projects, finally I wanted to give the template functions a try. As I had to create the binding descriptor file for the mapping of 60 LDAP roles to the same amount of Websphere groups this week, it was clear, that the time for Xtend templates has come.
Having a file with the role names, separated by a linebreak, I used the java.util.Scanner class to access the file:
var scanner = new Scanner(new File("ldap.txt"))
scanner.forEach[ s | println(xmlBinding(s)) ]
In the second line, I've used the power of Xtend's CollectionExtensions, combined with a lambda expression, to invoke the method, that contains the template code (xmlBinding()). It is executed for each line of the file and the result written to the console:
def static xmlBinding(String ldapEntry) {
'''<security-role name="«ldapEntry.replace("FG_", "").toLowerCase»">
<group name="«ldapEntry»"/>
</security-role>'''
}
The template method itself contains the pattern for the binding, framed by '''. We can add dynamic values to the template content, by surrounding the variables or method calls with « and ». So the task was accomplished, writing only a few lines of effective code, which you can easily conflate in one single line, if you like to.
If we want to create the complete deployment descriptor binding file with Xtend, we can adjust our example a little bit. Removing the foreach[] and giving the complete list of Strings to the template method, all of the magic is done inside this method:
def static appBindingWithLoop(List<String> ldapEntries) {
'''<?xml version="1.0" encoding="UTF-8"?>
<application-bnd ...>
«FOR e : ldapEntries»
<security-role name="«e.replace("FG_", "").toLowerCase»">
<group name="«e»"/>
</security-role>
«ENDFOR»
<....>
</application-bnd>'''
}
As conclusion, the Xtend template expressions have done a good job, and I've used them for creating some more files, where I needed the 60 group names, too. Even if the Eclipse tooling for Xtend is not as good as it is for plain Java, for such small tasks, Xtend is a great tool. Just give it a go!
http://www.eclipse.org/xtend/
For more information about Xtend's template expressions, see: http://www.eclipse.org/xtend/documentation.html#templates
Having a file with the role names, separated by a linebreak, I used the java.util.Scanner class to access the file:
var scanner = new Scanner(new File("ldap.txt"))
scanner.forEach[ s | println(xmlBinding(s)) ]
In the second line, I've used the power of Xtend's CollectionExtensions, combined with a lambda expression, to invoke the method, that contains the template code (xmlBinding()). It is executed for each line of the file and the result written to the console:
def static xmlBinding(String ldapEntry) {
'''<security-role name="«ldapEntry.replace("FG_", "").toLowerCase»">
<group name="«ldapEntry»"/>
</security-role>'''
}
The template method itself contains the pattern for the binding, framed by '''. We can add dynamic values to the template content, by surrounding the variables or method calls with « and ». So the task was accomplished, writing only a few lines of effective code, which you can easily conflate in one single line, if you like to.
If we want to create the complete deployment descriptor binding file with Xtend, we can adjust our example a little bit. Removing the foreach[] and giving the complete list of Strings to the template method, all of the magic is done inside this method:
def static appBindingWithLoop(List<String> ldapEntries) {
'''<?xml version="1.0" encoding="UTF-8"?>
<application-bnd ...>
«FOR e : ldapEntries»
<security-role name="«e.replace("FG_", "").toLowerCase»">
<group name="«e»"/>
</security-role>
«ENDFOR»
<....>
</application-bnd>'''
}
As conclusion, the Xtend template expressions have done a good job, and I've used them for creating some more files, where I needed the 60 group names, too. Even if the Eclipse tooling for Xtend is not as good as it is for plain Java, for such small tasks, Xtend is a great tool. Just give it a go!
http://www.eclipse.org/xtend/
For more information about Xtend's template expressions, see: http://www.eclipse.org/xtend/documentation.html#templates
Nexus Schnäpchenjagd - Nexus 4 im Ausverkauf, Nexus 7 verfügbar
Schnäpchenjäger aufgepasst. Wer auf der Suche nach einem guten Smartphone ist kann sich das Nexus 4 für sehr günstige 199€ im Google PlayStore sichern. Auch die 32GB Variante ist mit 249€ um 100€ vergünstigt zu bekommen. Natürlich schürt die Ausverkaufsaktion die Gerüchte über ein bald erscheinendes Nexus (5?) der nächsten Generation an. Trotzdem wird das Nexus 4 dank Updatekanal direkt über Google noch auf längere Sicht ein aktuelles Smartphone bleiben. Klare Kaufempfehlung hier - Erfahrungsgemäß sollte das Angobot bei diesem Preis nicht allzu lange verfügbar sein.
| Nexus 4 - jetzt um 100€ reduziert - ab 199€ |
Die zweite Neugikeit im PlayStore ist das Nexus 7 (Modell 2013) das ab sofort für 229€ erhältlich ist. Die 32GB Variante schlägt mit 269€ zu Buche. Im Vergleich zum Vorgänger wird das Gerät schlanker, leichter, hat eine verbesserte Akkulaufzeit und kommt jetzt mit einer zweiten Kamera und noch höher aufgelöst daher. Wer mit der Anschaffung eines kompakten Tablets liebäugelt kann auch hier bedenkenlos zuschlagen - sofern keine Mobilfunkanbindung benötigt wird - das UMTS Modell ist bisher noch nicht verfügbar.
![]() |
| Nexus 7 - 2013 - Ab sofort erhältlich |
Sommer, Sonne, WeatherGadget - Gutes Wetter auf dem Desktop
Das Pelzkuh.de Projekt - Weathergadget hat das ganz frühe Anfangsstadium verlassen und steht als Betaversion zum Download bereit.
Wer Lust hat den aktuellen Stand zu Testen ist gerne eingeladen den für Windows und Mac verfügbaren Stand auszuprobieren. Über Rückmeldung freut sich das Pelzkuh.de Team als Kommentar oder unter info|at|pelzkuh.de!
![]() |
| WeatherGadget Screenshot |
Abonnieren
Posts (Atom)


