This document provides an overview of Apache Wicket, a Java web application framework. It begins with an introduction to Wicket and its core concepts like components. It then walks through an example of creating a simple cheese store application with Wicket, including setting up the project, adding domain models and entities, and building out components. The document also discusses how to use Enterprise JavaBeans (EJBs) with Wicket, such as making data access objects (DAOs) into EJBs and injecting them.
- Redis is an open source, advanced key-value store that can store different data structures like strings, hashes, lists, sets and sorted sets.
- Jedis is the recommended Redis client library for Java. It can be used to connect to Redis and execute commands to set, get, and manipulate Redis data structures.
- The document provides examples of common Redis commands to work with strings, lists, sets, sorted sets, hashes, publish/subscribe and more using the Jedis client.
Cette présentation offre un retour d'expérience sur la refonte de service-public.fr. Varnish y a bien-sûr été utilisé comme moteur de cache pour des raisons de performance mais pas seulement. Il a aussi permis l'intégration en marque blanche des contenus d'un CMS grâce aux balises ESI, occasionnant quelques sueurs froides concernant notamment la gestion des cookies. Étant une première expérience sur Varnish, quelques tips vous seront partagés pour bien débuter.
Meetup : http://www.meetup.com/fr-FR/Paris-Varnish-Cache-Meetup/events/231121017/
CONFidence2015: Who put the backdoor in my modem? - Ewerson (Crash) Guimaraes PROIDEA
Who put the backdoor in my modem?
For quite some time we have been seeing espionage cases reaching countries, governments and large companies.
A large number of backdoors were found on network devices, mobile phones and other related devices, having as main cases the ones that were reported by the media, such as: TP-Link, Dlink, Linksys, Samsung and other companies which are internationally renowned. This article will discuss a backdoor found on the modem / router rtn, equipment that has a big question mark on top of it, because there isn’t a vendor identification and no information about who’s its manufacturer and there are at least 7 companies linked to its production, sales and distribution in the market. Moreover, some of them never really existed. Which lead us to question on the research title: “Who put the backdoor in my modem?”
The document describes using the gemdiff tool to compare gem versions and update outdated gems in a Gemfile. It shows gemdiff identifying outdated gems like sass and thread_safe, then using gemdiff to update thread_safe to the latest version.
The document summarizes the key features of ECMAScript 6 (ES6), the 2015 version of JavaScript. Some of the major additions covered include let and const for block scoping, arrow functions, template strings, enhanced object properties, the spread operator, destructuring assignments, classes and inheritance, generators, and proxies. ES6 aims to make JavaScript a more robust and feature-rich programming language.
The document defines classes for the core components of a Monopoly game simulation including:
1) An Actor class that represents any actor in the game with name and balance attributes.
2) A Bank class that extends Actor and represents the game bank with house and hotel attributes.
3) A Player class that extends Actor and implements an interface to represent individual players with field and balance attributes.
4) A Field class that represents individual game fields with name, index, and bank attributes.
5) A MonopolyGame class that runs the main game loop, initializing players and fields and managing turns.
The Ring programming language version 1.5.3 book - Part 93 of 184Mahmoud Samir Fayed
CURL provides functions for transferring data with URLs using various protocols like HTTP, FTP, and more. It supports options like setting URLs, headers, authentication, proxies, SSL certificates, callbacks, and more. Common functions include curl_easy_setopt to set options, curl_easy_perform to perform a request, and curl_easy_getinfo to retrieve result info.
This code is controlling an access control system using an Arduino. It includes libraries for fingerprint scanning, camera, SD card, and NFC. It can unlock the door by matching a fingerprint, NFC tag, or both. When the door is opened, it takes a picture with the camera and saves it to an SD card. It puts the Arduino to sleep when the door is closed to save power.
- Redis is an open source, advanced key-value store that can store different data structures like strings, hashes, lists, sets and sorted sets.
- Jedis is the recommended Redis client library for Java. It can be used to connect to Redis and execute commands to set, get, and manipulate Redis data structures.
- The document provides examples of common Redis commands to work with strings, lists, sets, sorted sets, hashes, publish/subscribe and more using the Jedis client.
Cette présentation offre un retour d'expérience sur la refonte de service-public.fr. Varnish y a bien-sûr été utilisé comme moteur de cache pour des raisons de performance mais pas seulement. Il a aussi permis l'intégration en marque blanche des contenus d'un CMS grâce aux balises ESI, occasionnant quelques sueurs froides concernant notamment la gestion des cookies. Étant une première expérience sur Varnish, quelques tips vous seront partagés pour bien débuter.
Meetup : http://www.meetup.com/fr-FR/Paris-Varnish-Cache-Meetup/events/231121017/
CONFidence2015: Who put the backdoor in my modem? - Ewerson (Crash) Guimaraes PROIDEA
Who put the backdoor in my modem?
For quite some time we have been seeing espionage cases reaching countries, governments and large companies.
A large number of backdoors were found on network devices, mobile phones and other related devices, having as main cases the ones that were reported by the media, such as: TP-Link, Dlink, Linksys, Samsung and other companies which are internationally renowned. This article will discuss a backdoor found on the modem / router rtn, equipment that has a big question mark on top of it, because there isn’t a vendor identification and no information about who’s its manufacturer and there are at least 7 companies linked to its production, sales and distribution in the market. Moreover, some of them never really existed. Which lead us to question on the research title: “Who put the backdoor in my modem?”
The document describes using the gemdiff tool to compare gem versions and update outdated gems in a Gemfile. It shows gemdiff identifying outdated gems like sass and thread_safe, then using gemdiff to update thread_safe to the latest version.
The document summarizes the key features of ECMAScript 6 (ES6), the 2015 version of JavaScript. Some of the major additions covered include let and const for block scoping, arrow functions, template strings, enhanced object properties, the spread operator, destructuring assignments, classes and inheritance, generators, and proxies. ES6 aims to make JavaScript a more robust and feature-rich programming language.
The document defines classes for the core components of a Monopoly game simulation including:
1) An Actor class that represents any actor in the game with name and balance attributes.
2) A Bank class that extends Actor and represents the game bank with house and hotel attributes.
3) A Player class that extends Actor and implements an interface to represent individual players with field and balance attributes.
4) A Field class that represents individual game fields with name, index, and bank attributes.
5) A MonopolyGame class that runs the main game loop, initializing players and fields and managing turns.
The Ring programming language version 1.5.3 book - Part 93 of 184Mahmoud Samir Fayed
CURL provides functions for transferring data with URLs using various protocols like HTTP, FTP, and more. It supports options like setting URLs, headers, authentication, proxies, SSL certificates, callbacks, and more. Common functions include curl_easy_setopt to set options, curl_easy_perform to perform a request, and curl_easy_getinfo to retrieve result info.
This code is controlling an access control system using an Arduino. It includes libraries for fingerprint scanning, camera, SD card, and NFC. It can unlock the door by matching a fingerprint, NFC tag, or both. When the door is opened, it takes a picture with the camera and saves it to an SD card. It puts the Arduino to sleep when the door is closed to save power.
That Goes Without Alpha-Num (or Does It ?) all your base10 are belong to ustakesako
The document discusses various programming languages and their characteristics in a non-standard formatting without using typical alphanumeric characters.
(1) It examines MS-DOS 8086 assembly language programming and describes executing code on 16-bit x86 CPUs through binary instructions.
(2) It also examines JavaScript, Perl, Ruby and compares some of their common features like comment syntax and string interpolation.
(3) It then proposes executing x86 code without using binaries by manipulating the registers through hexadecimal subtraction and bitwise operations, though this method would be difficult to program and debug.
The document describes the steps to create a private Ethereum network with 4 nodes using the same genesis block. It details how to initialize and start each node with different ports, check connectivity between nodes, create and transfer accounts, and begin mining to generate blocks across the network. The genesis code provided specifies the initial empty state of the private network before any transactions occur.
Ring: 프로그래밍 언어와 가까운 캐시 인터페이스
#
user에 item을 추가해야 한다고 생각해 봅시다.
클래스가 없는 언어라면 아마도 user_add_item(user, item) 같은 코드를 쓸 것입니다.
아마 user_delete_item도 있고 user_clear_items도 있겠지요.
하지만 우리는 파이썬 프로그래머니까 보통 user.add_item(item) 같은 코드를 씁니다.
#
user에 속한 item들을 가져오는 함수가 있고 이 함수는 결과를 캐시하고 있다고 생각해 봅시다.
user.get_items() 같은 코드를 쓸 수도 있고 user.get_cached_items(storage) 같은 코드를 쓸 수도 있겠지요.
item의 목록이 업데이트 되었습니다. 이제 캐시를 무효화해야 합니다.
아마도 user.invalidate_items()나 user.delete_cached_items(storage) 같은 코드를 만들어야 하겠지요.
Ring에서는 user.get_items.delete() 를 호출합니다.
#
Ring은 이 아이디어에서부터 출발합니다.
There is hardly a Senior Java developer who has never heard of sun.misc.Unsafe. Though it has always been a private API intended for JDK internal use only, the popularity of Unsafe has grown too fast, and now it is used in many open-source projects. OK.RU is not an exception: its software also heavily relies on Unsafe APIs.
During this session we'll try to understand what is so attractive about Unsafe. Why do people keep using it regardless the warnings of removal from future JDK releases? Are there any safe alternatives to private API or is it absolutely vital? We will review the typical cases when Java developers prefer to go unsafe and discuss major benefits and the drawbacks of it. The report will be supported by the real examples from OK.RU experience.
Comparative Genomics with GMOD and BioPerlJason Stajich
BioPerl is an open source toolkit for bioinformatics data manipulation written in Perl. It contains modules for reading and writing sequence data in common formats, manipulating sequences, parsing BLAST reports and multiple sequence alignments. BioPerl objects represent sequences, features, annotations and search results in a flexible and extensible way. The toolkit is widely used for tasks like sequence analysis, parsing bioinformatics software output, and accessing biological databases.
The document discusses PigUnit, a library for unit testing Pig scripts. It allows running Pig scripts from JUnit tests, overriding script variables with test values, inspecting variable values, and making STORE statements no-ops. The document provides examples of simple Pig scripts, test programs using PigUnit, and more complex testing scenarios where PigUnit can rewrite scripts to load test input from temporary files.
The document provides an overview of Groovy and Java code examples for performing common tasks like printing "Hello World", reading files, making web requests, using strings, importing packages, and using Swing/SwingBuilder for GUIs. It also shows examples of using Groovy with Java libraries for Excel files, Ant, and JSON. Additional sections cover parallel processing with GPars, contract programming with GContracts, method chaining, Grails basics, and Gaelyk controllers and views.
Systems and methods for visual presentation and selection of ivr menuTal Lavian Ph.D.
This patent application describes a system for generating and displaying interactive voice response (IVR) menus visually. The system includes a processor and memory that stores telephone numbers associated with destinations that use IVR menus. The memory also includes instructions for communicating with the destinations to receive customization records to the IVR database. When a user dials a destination number, the system detects the number and searches the visual menu database. It then displays the corresponding visual menu and receives user input selections to connect the call to the destination. The system aims to improve the IVR experience by presenting the menu options visually rather than through audio prompts alone.
The document contains the output from running the "strace rm" command on a file. The strace output lists each system call and signal that rm makes when deleting the file. It also contains discussions on using find/xargs, rsync, gentle_unlink, and other commands for deleting large numbers of files. Gentle_unlink is a Perl script that can slowly and safely delete files in batches over time or when processes are interrupted.
Avro, la puissance du binaire, la souplesse du JSONAlexandre Victoor
This document discusses Apache Avro, a data serialization system. It provides an example Avro schema for a trade record with fields like client ID, amount, and date. It then demonstrates how to write and read Avro data files containing records that match the schema, including writing single records with specific schemas or bulk writing generic records. The key feature discussed is Avro's ability to read data written with a different but compatible schema through schema resolution. Event sourcing is also mentioned as another use case for Avro.
[PHPCon 2023] “Kto to pisał?!... a, to ja.”, czyli sposoby żeby znienawidzić ...Mateusz Zalewski
Czysty kod. Jakościowe oprogramowanie. Dobre praktyki. Święte Graale pracy programisty, o których każdy z nas wie, a mimo to wciąż zachowujemy się tak, jakby ich nie było. Bo przecież ten kod to tylko na chwilę. A tego to w ogóle nie będziemy używać. A tę klasę się zrefaktoruje później. Wszyscy od czasu do czasu zaciągamy dług u samych z siebie z przyszłości - dług, którego potem (nie bez powodu) bardzo nie chcemy spłacać.
Zagłębmy się więc w ten fascynujący świat słabego oprogramowania. Przejdźmy przez las nieużytych wzorców projektowych, przebrnijmy przez bagna zagnieżdżonych pętli. Wejdźmy na kolejny ośmiotysięcznik, a może z jego szczytu uda nam się dojrzeć zatokę pięknego kodu - w której, miejmy nadzieję, tym razem pozostaniemy na dłużej.
This document describes a Javabean that allows displaying a Jslider component in an Oracle Forms application. The Javabean handles displaying the slider, setting properties like background color, and firing events when the slider value changes. It provides methods to initialize the slider, set properties like value, and get the current value. The sample Forms application demonstrates using the bean by initializing slider properties and handling value change events.
A lot of people using PHPunit for testing their source code. While I was observing my team
I recognized most of them are only using the standard ssertions like 'assertEquals()' or
'assertTrue()' and are complaining about how hard it is to test the code even when the tests are written first. This talk is about all the stuff not used on a daily basis. It shows you some nice features of PHPUnit and how to use them for your benefit.
Groovy is a dynamic language for the Java Virtual Machine that aims to provide a concise, readable syntax with features like closures, metaprogramming and domain-specific language support. Some key features include dynamic typing, operator overloading, builders for generating XML/Swing code and the ability to extend any class or category of objects with additional methods. Groovy aims to be fully interoperable with Java while allowing more compact representations of common patterns.
This document discusses how to display records from a Northwind database in a JTable using NetBeans and SQL Server. It includes code to connect to the database, define a Product class with getters and setters, a ProductDAO class to retrieve data, and a GUI class to display the results in a JTable. The code retrieves product data including ID, name, category, supplier, price, quantity and units from the database and displays it in the table.
The Ring programming language version 1.5.3 book - Part 71 of 184Mahmoud Samir Fayed
This document provides examples of using various Qt GUI classes in Ring including QTreeView, QTreeWidget, QComboBox, QMenuBar, context menus, QToolBar, QStatusBar, and QDockWidget. Each section includes code to demonstrate the class, screenshots of the running application, and brief explanations.
This document provides updates on the status of Corinna, Perl's new object system. It discusses the seven stages of Corinna's development, including that classes and inheritance are complete. It provides an example of a Cache class written using Corinna syntax. The document notes that Corinna will introduce new programming idioms that developers do not yet know. It also references resources for learning to build a roguelike game in Perl.
The Ring programming language version 1.7 book - Part 16 of 196Mahmoud Samir Fayed
This document summarizes the new features and changes in Ring 1.2, including new functions like PtrCmp() and PrevFileName(), improved functions like find() supporting C pointers, an improved Ring Notepad that saves line numbers, better RingQt classes with event handling, a new Objects library for RingQt, an enhanced RingLibCurl library, improved call command support, using NULL instead of NULLPointer(), a new display warnings option, and general quality improvements.
Poche chiacchiere e tanto codice per cercare rendere la nostra vita di
sviluppatori più divertente.
Parleremo di JAX-RS, le annotazioni, l'MVC che mette a disposizione e
l'integrazione di Jersey con Guice.
Useremo AOP per gestire log, transazioni e con l'aiuto di Infinispan
limiteremo le chamate concorrenti sul nostro cluster.
That Goes Without Alpha-Num (or Does It ?) all your base10 are belong to ustakesako
The document discusses various programming languages and their characteristics in a non-standard formatting without using typical alphanumeric characters.
(1) It examines MS-DOS 8086 assembly language programming and describes executing code on 16-bit x86 CPUs through binary instructions.
(2) It also examines JavaScript, Perl, Ruby and compares some of their common features like comment syntax and string interpolation.
(3) It then proposes executing x86 code without using binaries by manipulating the registers through hexadecimal subtraction and bitwise operations, though this method would be difficult to program and debug.
The document describes the steps to create a private Ethereum network with 4 nodes using the same genesis block. It details how to initialize and start each node with different ports, check connectivity between nodes, create and transfer accounts, and begin mining to generate blocks across the network. The genesis code provided specifies the initial empty state of the private network before any transactions occur.
Ring: 프로그래밍 언어와 가까운 캐시 인터페이스
#
user에 item을 추가해야 한다고 생각해 봅시다.
클래스가 없는 언어라면 아마도 user_add_item(user, item) 같은 코드를 쓸 것입니다.
아마 user_delete_item도 있고 user_clear_items도 있겠지요.
하지만 우리는 파이썬 프로그래머니까 보통 user.add_item(item) 같은 코드를 씁니다.
#
user에 속한 item들을 가져오는 함수가 있고 이 함수는 결과를 캐시하고 있다고 생각해 봅시다.
user.get_items() 같은 코드를 쓸 수도 있고 user.get_cached_items(storage) 같은 코드를 쓸 수도 있겠지요.
item의 목록이 업데이트 되었습니다. 이제 캐시를 무효화해야 합니다.
아마도 user.invalidate_items()나 user.delete_cached_items(storage) 같은 코드를 만들어야 하겠지요.
Ring에서는 user.get_items.delete() 를 호출합니다.
#
Ring은 이 아이디어에서부터 출발합니다.
There is hardly a Senior Java developer who has never heard of sun.misc.Unsafe. Though it has always been a private API intended for JDK internal use only, the popularity of Unsafe has grown too fast, and now it is used in many open-source projects. OK.RU is not an exception: its software also heavily relies on Unsafe APIs.
During this session we'll try to understand what is so attractive about Unsafe. Why do people keep using it regardless the warnings of removal from future JDK releases? Are there any safe alternatives to private API or is it absolutely vital? We will review the typical cases when Java developers prefer to go unsafe and discuss major benefits and the drawbacks of it. The report will be supported by the real examples from OK.RU experience.
Comparative Genomics with GMOD and BioPerlJason Stajich
BioPerl is an open source toolkit for bioinformatics data manipulation written in Perl. It contains modules for reading and writing sequence data in common formats, manipulating sequences, parsing BLAST reports and multiple sequence alignments. BioPerl objects represent sequences, features, annotations and search results in a flexible and extensible way. The toolkit is widely used for tasks like sequence analysis, parsing bioinformatics software output, and accessing biological databases.
The document discusses PigUnit, a library for unit testing Pig scripts. It allows running Pig scripts from JUnit tests, overriding script variables with test values, inspecting variable values, and making STORE statements no-ops. The document provides examples of simple Pig scripts, test programs using PigUnit, and more complex testing scenarios where PigUnit can rewrite scripts to load test input from temporary files.
The document provides an overview of Groovy and Java code examples for performing common tasks like printing "Hello World", reading files, making web requests, using strings, importing packages, and using Swing/SwingBuilder for GUIs. It also shows examples of using Groovy with Java libraries for Excel files, Ant, and JSON. Additional sections cover parallel processing with GPars, contract programming with GContracts, method chaining, Grails basics, and Gaelyk controllers and views.
Systems and methods for visual presentation and selection of ivr menuTal Lavian Ph.D.
This patent application describes a system for generating and displaying interactive voice response (IVR) menus visually. The system includes a processor and memory that stores telephone numbers associated with destinations that use IVR menus. The memory also includes instructions for communicating with the destinations to receive customization records to the IVR database. When a user dials a destination number, the system detects the number and searches the visual menu database. It then displays the corresponding visual menu and receives user input selections to connect the call to the destination. The system aims to improve the IVR experience by presenting the menu options visually rather than through audio prompts alone.
The document contains the output from running the "strace rm" command on a file. The strace output lists each system call and signal that rm makes when deleting the file. It also contains discussions on using find/xargs, rsync, gentle_unlink, and other commands for deleting large numbers of files. Gentle_unlink is a Perl script that can slowly and safely delete files in batches over time or when processes are interrupted.
Avro, la puissance du binaire, la souplesse du JSONAlexandre Victoor
This document discusses Apache Avro, a data serialization system. It provides an example Avro schema for a trade record with fields like client ID, amount, and date. It then demonstrates how to write and read Avro data files containing records that match the schema, including writing single records with specific schemas or bulk writing generic records. The key feature discussed is Avro's ability to read data written with a different but compatible schema through schema resolution. Event sourcing is also mentioned as another use case for Avro.
[PHPCon 2023] “Kto to pisał?!... a, to ja.”, czyli sposoby żeby znienawidzić ...Mateusz Zalewski
Czysty kod. Jakościowe oprogramowanie. Dobre praktyki. Święte Graale pracy programisty, o których każdy z nas wie, a mimo to wciąż zachowujemy się tak, jakby ich nie było. Bo przecież ten kod to tylko na chwilę. A tego to w ogóle nie będziemy używać. A tę klasę się zrefaktoruje później. Wszyscy od czasu do czasu zaciągamy dług u samych z siebie z przyszłości - dług, którego potem (nie bez powodu) bardzo nie chcemy spłacać.
Zagłębmy się więc w ten fascynujący świat słabego oprogramowania. Przejdźmy przez las nieużytych wzorców projektowych, przebrnijmy przez bagna zagnieżdżonych pętli. Wejdźmy na kolejny ośmiotysięcznik, a może z jego szczytu uda nam się dojrzeć zatokę pięknego kodu - w której, miejmy nadzieję, tym razem pozostaniemy na dłużej.
This document describes a Javabean that allows displaying a Jslider component in an Oracle Forms application. The Javabean handles displaying the slider, setting properties like background color, and firing events when the slider value changes. It provides methods to initialize the slider, set properties like value, and get the current value. The sample Forms application demonstrates using the bean by initializing slider properties and handling value change events.
A lot of people using PHPunit for testing their source code. While I was observing my team
I recognized most of them are only using the standard ssertions like 'assertEquals()' or
'assertTrue()' and are complaining about how hard it is to test the code even when the tests are written first. This talk is about all the stuff not used on a daily basis. It shows you some nice features of PHPUnit and how to use them for your benefit.
Groovy is a dynamic language for the Java Virtual Machine that aims to provide a concise, readable syntax with features like closures, metaprogramming and domain-specific language support. Some key features include dynamic typing, operator overloading, builders for generating XML/Swing code and the ability to extend any class or category of objects with additional methods. Groovy aims to be fully interoperable with Java while allowing more compact representations of common patterns.
This document discusses how to display records from a Northwind database in a JTable using NetBeans and SQL Server. It includes code to connect to the database, define a Product class with getters and setters, a ProductDAO class to retrieve data, and a GUI class to display the results in a JTable. The code retrieves product data including ID, name, category, supplier, price, quantity and units from the database and displays it in the table.
The Ring programming language version 1.5.3 book - Part 71 of 184Mahmoud Samir Fayed
This document provides examples of using various Qt GUI classes in Ring including QTreeView, QTreeWidget, QComboBox, QMenuBar, context menus, QToolBar, QStatusBar, and QDockWidget. Each section includes code to demonstrate the class, screenshots of the running application, and brief explanations.
This document provides updates on the status of Corinna, Perl's new object system. It discusses the seven stages of Corinna's development, including that classes and inheritance are complete. It provides an example of a Cache class written using Corinna syntax. The document notes that Corinna will introduce new programming idioms that developers do not yet know. It also references resources for learning to build a roguelike game in Perl.
The Ring programming language version 1.7 book - Part 16 of 196Mahmoud Samir Fayed
This document summarizes the new features and changes in Ring 1.2, including new functions like PtrCmp() and PrevFileName(), improved functions like find() supporting C pointers, an improved Ring Notepad that saves line numbers, better RingQt classes with event handling, a new Objects library for RingQt, an enhanced RingLibCurl library, improved call command support, using NULL instead of NULLPointer(), a new display warnings option, and general quality improvements.
Poche chiacchiere e tanto codice per cercare rendere la nostra vita di
sviluppatori più divertente.
Parleremo di JAX-RS, le annotazioni, l'MVC che mette a disposizione e
l'integrazione di Jersey con Guice.
Useremo AOP per gestire log, transazioni e con l'aiuto di Infinispan
limiteremo le chamate concorrenti sul nostro cluster.
"Kto to pisał?!... A, to ja.", czyli sposoby, żeby znienawidzić siebie z prze...Mateusz Zalewski
Czysty kod. Jakościowe oprogramowanie. Dobre praktyki. Święte Graale pracy programisty, o których każdy z nas wie, a mimo to wciąż zachowujemy się tak, jakby ich nie było. Bo przecież ten kod to tylko na chwilę. A tego to w ogóle nie będziemy używać. A tę klasę się zrefaktoruje później. Wszyscy od czasu do czasu zaciągamy dług u samych z siebie z przyszłości - dług, którego potem (nie bez powodu) bardzo nie chcemy spłacać.
Zagłębmy się więc w ten fascynujący świat słabego oprogramowania. Przejdźmy przez las nieużytych wzorców projektowych, przebrnijmy przez bagna zagnieżdżonych pętli. Wejdźmy na kolejny ośmiotysięcznik, a może z jego szczytu uda nam się dojrzeć zatokę pięknego kodu - w której, miejmy nadzieję, tym razem pozostaniemy na dłużej.
Bazując na mojej wieloletniej wiedzy we wdrażaniu dobrych praktyk w dużych projektach wykorzystujących PHP i Symfony, przedstawię szereg zaniedbań programistów, których rezultatem jest kod najgorszej jakości. Wspólnie zastanowimy się, jak tych błędów uniknąć oraz jakie techniki można zastosować, by te już popełnione szybko i skutecznie wyeliminować.
This document contains code for a hotel management system with classes for food and customer details. The food class contains functions for displaying the food menu, adding items to the menu, generating food bills. The customer class contains functions for customer billing, viewing customer details, adding/modifying/deleting customers and their information from files.
The Ring programming language version 1.6 book - Part 15 of 189Mahmoud Samir Fayed
The document summarizes the new features and changes in Ring 1.2, including:
1. New functions like PtrCmp(), PrevFileName(), and functions to retrieve lists of functions, classes, packages, etc.
2. Improved existing functions like find() and type() to support C pointers.
3. Enhancements to Ring Notepad and RingQt like line number restoration and event handling.
4. The introduction of an Objects library for RingQt and better support for the MVC pattern.
5. The RingLibCurl library providing an API for the libcurl functions.
6. Updates to call handling and allowing NULL instead of NULLPointer().
The Ring programming language version 1.4.1 book - Part 16 of 31Mahmoud Samir Fayed
This document provides examples for using various Qt GUI classes in Ring applications to create desktop and mobile applications. It includes examples for creating basic GUIs using widgets like buttons, labels and line edits. It also demonstrates using common Qt widgets like list views, tree views, toolbars, tab widgets, status bars and progress bars. The examples show how to initialize the widgets, set properties and handle events to build feature-rich desktop applications.
The document appears to be code or data that is not easily summarized due to its unstructured nature. It contains various symbols, brackets, and other characters with no clear meaning or context provided.
Getting started with Elasticsearch and .NETTomas Jansson
This document provides an introduction to using Elasticsearch with .NET and the NEST client library. It demonstrates how to install and configure Elasticsearch on Windows, define mappings and index documents using NEST, perform various queries including fuzzy, highlighted, faceted queries, and add filters. NEST provides a strongly typed, fluent abstraction over Elasticsearch that allows querying and filtering Elasticsearch in a similar manner to Elasticsearch JSON queries. The document encourages attendees to view the demo code on GitHub for examples of indexing, querying, highlighting, faceting, and filtering documents using NEST.
Vaadin 8 has renewed the databinding functionality of Vaadin Framework. The Property, Item and Container have been taken out and AbstractField has been simplified to Binder. This presentation will tell all about the differences between framework versions 7 and 8.
Similar to Apache Wicket and Java EE sitting in a tree (20)
HTMX: Web 1.0 with the benefits of Web 2.0 without the grift of Web 3.0Martijn Dashorst
- HTMX is a JavaScript library that allows any HTML element to interact as a hypermedia component by adding attributes that instruct HTMX on what requests to make and how to update the DOM.
- Attributes like hx-get, hx-post, hx-target, and hx-swap allow elements to make requests and update other elements without JavaScript. Inherited attributes remove repetition.
- HTMX requests can be detected on the server via request headers, and response headers can modify requests by changing targets or swapping mechanisms. Classes provide feedback during requests.
While our predecessor product(s) were a COBOL application and later a Windows client/server application distributed on floppies, since 2005 we rock a Java web application that has gone through a lot of changes to keep up with the times. No longer duplicating 5 1/4” 1.2M floppies over the weekend and mailing them to our customers, but a single `git push` will deliver our latest version to our customers.
In this session you will learn how we made our application survive for 18 years and still be relevant. Learn how we rearchitected our application from 2005 to 2022, and more importantly, what we did wrong so you can avoid our mistakes. We migrated from Java 1.4 to Java 17, we moved from tomcat+hibernate+velocity via tomcat+hibernate+wicket+cxf+axis+spring+jgroups+ehcache to wildfly+wicket, from deploying on physical hardware to virtual kubernetes nodes. From manually scp-ing releases to gitops, and from Oracle to Postgresql, causing a 5 week outage.
If you learn only one thing from Martijn Dashorst’s session: always have a plan B.
A short introduction to the SOLID principles of Object Oriented Programming in (mostly) Dutch.
- Single responsibility
- Open/Closed
- Lishkov Substitution
- Interface Segregation
- Dependency Inversion
This presentation was given at a meetup for Working Spirit in Deventer.
Converting 85% of Dutch Primary Schools from Oracle to PostgreSQLMartijn Dashorst
This case study describes migrating the most used application for primary schools in the Netherlands from Oracle to PostgreSQL. The application uses a multi-tenant, single schema database (i.e. 6000 schools in a single database) and runs using a typical Java EE frontend.
You will learn about our application architecture, hardware platform, reasons for switching, migration strategies considered and the results of our migration.
Since the CFP closes one week before our actual migration we can't reveal the results in this abstract, but the presentation will capture all the things that went wrong and well
The document discusses solutions for when documentation avoidance fails. It recommends using plain text formats like Markdown or AsciiDoc to write documentation, keeping documentation and code together, integrating documentation into development processes using tools like Git, Maven and Docker, and automating documentation testing and generation as much as possible. The document provides examples of using Arquillian, Maven, AShot and Graphene to automate the creation of a user manual with screenshots from automated tests. The goal is to produce an up-to-date user manual with high test coverage through continuous integration of documentation with code.
The Apache Wicket community is working hard to build the new major release of Wicket. One of the tentpole features is the move to Java 8 as a minimum requirement. Why did we do that, and how does this improve my Wicket code? Learn how to apply Java 8 features such as lambdas and the new DateTime API in your Wicket applications, and learn what else the community is creating for your benefit.
The document proposes a "Code Review Drinking Game" where certain common code review occurrences trigger sips of a drink, such as using "Random" instead of "secureRandom", TODO comments, or merge conflicts in committed code. It includes drinking game rules for both Java and JavaScript code reviews. The goal is to have an entertaining way to conduct code reviews by turning typical issues into opportunities to drink.
Java Serialization is often considered a dark art of Java programmers. This session will lift the veil and show what serialization is and isn't, how you can use it for profit and evil. After this session no NotSerializableException will be unconquerable.
How can you make code reviews more palatable? This drinking game will make any code review interesting and enjoyable. For Java/.Net programmers, and a special drinking game for JavaScript code reviews.
Na jaren projecten te duur en te laat opgeleverd te hebben met de waterval projectmethodiek heeft de IT industrie een nieuwe projectaanpak omarmt als de zilveren kogel die te late en te dure projecten achter zich zou laten. Door in korte iteraties op je doel af te gaan, waarbij het doel ook nog eens mag bewegen beloven deze nieuwe projectaanpakken als Scrum gouden bergen. Maakt deze beweging de belofte waar en is deze aanpak een goede match voor het (project)onderwijs?
In deze sessie legt Martijn Dashorst kort de moderne projectaanpakken uit, Scrum in het bijzonder, en hoe deze binnen Topicus toegepast worden om van koffie software te maken. Tot slot kijkt Martijn vanuit de onderwijspraktijk naar hoe goed Scrum matcht binnen het Hoger Onderwijs om zo de geschikheid van deze aanpak voor projectgroepen te analyseren.
Who Automates the Automators? (Quis Automatiet Ipsos Automates?)Martijn Dashorst
Who automates the automators? For a lot of people the future seems uncertain: automation may eat their jobs. Old and new industries are ripe for disruption: transportation, healthcare, education, finance, law and even the culinary industry are being automated as we speak. When chauffeurs and truck drivers fear that they won't be able to hitch a ride into the future, should the automators perhaps wonder... when is it our turn to be automated? Who automates the automators?
Martijn Dashorst takes a look at the future of the programmer: are we also without a job when the last doctor, lawyer, 3-star chef and driver have been automated?
Het oorspronkelijke verhaal van de Schone Coder geschreven door de gebroeders Scrum over hoe Assertpoetser in een vervloekt project terecht kwam dat het rijk in 100 jaar technical debt stortte. Kan Prinses Agile hem op tijd redden? Sprintten ze nog lang en gelukkig?
In deze lunchlezing vertelt Martijn Dashorst over het wel en wee van de coder die in een wereld vol tegenstrijdige belangen probeert te overleven en zinvol werk te leveren. Hoe krijg je een goede hygiene voor jou, je omgeving en je code? Hoe voorkom je 10 jaar lange technical debt? Met meer dan 20 jaar ontwikkelervaring biedt Martijn een blik in de keuken van een professionele software ontwikkelaar.
With the Tenth Anniversary of Wicket behind us, Wicket is still one of the thriving survivors of the Great Web Framework Wars of the mid 00's. Is there a future for server-side frameworks? In this presentation Martijn Dashorst provides a brief history of Wicket.
With a State of the Wicket, Martijn will look at who is currently using Wicket, the community and current release plans.
The majority of this session will be dedicated to the future of Wicket: does a component oriented, Java web framework have a future in the era of native clients and client side JavaScript frameworks? Martijn will layout the plans of making Wicket more productive for current users, on integrating better with JavaEE technologies and much more.
This document provides an overview of the state of the Apache Wicket framework. It discusses Wicket's origins and history from 2004 to present, including major releases and contributions over time. It also summarizes key metrics about Wicket's codebase and community based on an Ohloh report, including lines of code, contributors, and estimated development effort. Finally, it previews possible future directions for Wicket in areas like Java 8 support, JavaScript integration, and semantic versioning.
Presentation about Apache Wicket given at FOSDEM 2011. Apache Wicket is an open source, component oriented Java web framework. This presentation features an introduction to the Wicket framework and showcases some of the new features in the upcoming 1.5 release of Wicket.
A Dutch presentation (with English quotes) about the ongoing renaissance in software engineering where we transition from begin regarded as mere drones to software craftsmen. This presentation is heavily influenced by Robert C. Martin's The Renaissance of Craftsmanship.
The document provides 6 ways to keep work from interfering with weekends by testing and monitoring Wicket applications. It recommends using WicketTester for component and Ajax testing without starting the server. It also suggests using PageChecker to validate pages against a policy file, EntityChecker to detect non-serializable objects attached to pages, MarkupValidator to ensure valid HTML, RequestLogger for decoded request information, and monitoring tools like Nagios for uptime and performance of production applications.
Wicket in Action is the introduction I gave at the Øredev conference in Malmö, Sweden in November 2008. You'll learn about Wicket, Components, Models, Integrating Spring, Testing, and deploying your Wicket application.
Unfortunately slideshare doesn't work with accented letters in the URL, so I had to change the title.
The document provides guidance for successfully graduating a project from the Apache Software Foundation (ASF) Incubator within a year. It outlines that the ASF is a US nonprofit organization with around 2000 committers and 250 members supporting 60 open source projects through a collaborative development process. Participants who want to join an existing community or grow their own are advised to consider entering the ASF Incubator.
Presentation on Apache Wicket delivered at JavaPolis 2007 in Antwerp. We introduce Wicket, learn the concepts and go through developing an online Cheese store
Software Engineering, Software Consulting, Tech Lead, Spring Boot, Spring Cloud, Spring Core, Spring JDBC, Spring Transaction, Spring MVC, OpenShift Cloud Platform, Kafka, REST, SOAP, LLD & HLD.
OpenMetadata Community Meeting - 5th June 2024OpenMetadata
The OpenMetadata Community Meeting was held on June 5th, 2024. In this meeting, we discussed about the data quality capabilities that are integrated with the Incident Manager, providing a complete solution to handle your data observability needs. Watch the end-to-end demo of the data quality features.
* How to run your own data quality framework
* What is the performance impact of running data quality frameworks
* How to run the test cases in your own ETL pipelines
* How the Incident Manager is integrated
* Get notified with alerts when test cases fail
Watch the meeting recording here - https://www.youtube.com/watch?v=UbNOje0kf6E
Zoom is a comprehensive platform designed to connect individuals and teams efficiently. With its user-friendly interface and powerful features, Zoom has become a go-to solution for virtual communication and collaboration. It offers a range of tools, including virtual meetings, team chat, VoIP phone systems, online whiteboards, and AI companions, to streamline workflows and enhance productivity.
Odoo ERP software
Odoo ERP software, a leading open-source software for Enterprise Resource Planning (ERP) and business management, has recently launched its latest version, Odoo 17 Community Edition. This update introduces a range of new features and enhancements designed to streamline business operations and support growth.
The Odoo Community serves as a cost-free edition within the Odoo suite of ERP systems. Tailored to accommodate the standard needs of business operations, it provides a robust platform suitable for organisations of different sizes and business sectors. Within the Odoo Community Edition, users can access a variety of essential features and services essential for managing day-to-day tasks efficiently.
This blog presents a detailed overview of the features available within the Odoo 17 Community edition, and the differences between Odoo 17 community and enterprise editions, aiming to equip you with the necessary information to make an informed decision about its suitability for your business.
Takashi Kobayashi and Hironori Washizaki, "SWEBOK Guide and Future of SE Education," First International Symposium on the Future of Software Engineering (FUSE), June 3-6, 2024, Okinawa, Japan
Hand Rolled Applicative User ValidationCode KataPhilip Schwarz
Could you use a simple piece of Scala validation code (granted, a very simplistic one too!) that you can rewrite, now and again, to refresh your basic understanding of Applicative operators <*>, <*, *>?
The goal is not to write perfect code showcasing validation, but rather, to provide a small, rough-and ready exercise to reinforce your muscle-memory.
Despite its grandiose-sounding title, this deck consists of just three slides showing the Scala 3 code to be rewritten whenever the details of the operators begin to fade away.
The code is my rough and ready translation of a Haskell user-validation program found in a book called Finding Success (and Failure) in Haskell - Fall in love with applicative functors.
Need for Speed: Removing speed bumps from your Symfony projects ⚡️Łukasz Chruściel
No one wants their application to drag like a car stuck in the slow lane! Yet it’s all too common to encounter bumpy, pothole-filled solutions that slow the speed of any application. Symfony apps are not an exception.
In this talk, I will take you for a spin around the performance racetrack. We’ll explore common pitfalls - those hidden potholes on your application that can cause unexpected slowdowns. Learn how to spot these performance bumps early, and more importantly, how to navigate around them to keep your application running at top speed.
We will focus in particular on tuning your engine at the application level, making the right adjustments to ensure that your system responds like a well-oiled, high-performance race car.
What is Augmented Reality Image Trackingpavan998932
Augmented Reality (AR) Image Tracking is a technology that enables AR applications to recognize and track images in the real world, overlaying digital content onto them. This enhances the user's interaction with their environment by providing additional information and interactive elements directly tied to physical images.
Graspan: A Big Data System for Big Code AnalysisAftab Hussain
We built a disk-based parallel graph system, Graspan, that uses a novel edge-pair centric computation model to compute dynamic transitive closures on very large program graphs.
We implement context-sensitive pointer/alias and dataflow analyses on Graspan. An evaluation of these analyses on large codebases such as Linux shows that their Graspan implementations scale to millions of lines of code and are much simpler than their original implementations.
These analyses were used to augment the existing checkers; these augmented checkers found 132 new NULL pointer bugs and 1308 unnecessary NULL tests in Linux 4.4.0-rc5, PostgreSQL 8.3.9, and Apache httpd 2.2.18.
- Accepted in ASPLOS ‘17, Xi’an, China.
- Featured in the tutorial, Systemized Program Analyses: A Big Data Perspective on Static Analysis Scalability, ASPLOS ‘17.
- Invited for presentation at SoCal PLS ‘16.
- Invited for poster presentation at PLDI SRC ‘16.
UI5con 2024 - Boost Your Development Experience with UI5 Tooling ExtensionsPeter Muessig
The UI5 tooling is the development and build tooling of UI5. It is built in a modular and extensible way so that it can be easily extended by your needs. This session will showcase various tooling extensions which can boost your development experience by far so that you can really work offline, transpile your code in your project to use even newer versions of EcmaScript (than 2022 which is supported right now by the UI5 tooling), consume any npm package of your choice in your project, using different kind of proxies, and even stitching UI5 projects during development together to mimic your target environment.
WhatsApp offers simple, reliable, and private messaging and calling services for free worldwide. With end-to-end encryption, your personal messages and calls are secure, ensuring only you and the recipient can access them. Enjoy voice and video calls to stay connected with loved ones or colleagues. Express yourself using stickers, GIFs, or by sharing moments on Status. WhatsApp Business enables global customer outreach, facilitating sales growth and relationship building through showcasing products and services. Stay connected effortlessly with group chats for planning outings with friends or staying updated on family conversations.
DDS Security Version 1.2 was adopted in 2024. This revision strengthens support for long runnings systems adding new cryptographic algorithms, certificate revocation, and hardness against DoS attacks.
Neo4j - Product Vision and Knowledge Graphs - GraphSummit ParisNeo4j
Dr. Jesús Barrasa, Head of Solutions Architecture for EMEA, Neo4j
Découvrez les dernières innovations de Neo4j, et notamment les dernières intégrations cloud et les améliorations produits qui font de Neo4j un choix essentiel pour les développeurs qui créent des applications avec des données interconnectées et de l’IA générative.
Neo4j - Product Vision and Knowledge Graphs - GraphSummit ParisNeo4j
Dr. Jesús Barrasa, Head of Solutions Architecture for EMEA, Neo4j
Découvrez les dernières innovations de Neo4j, et notamment les dernières intégrations cloud et les améliorations produits qui font de Neo4j un choix essentiel pour les développeurs qui créent des applications avec des données interconnectées et de l’IA générative.
Revolutionizing Visual Effects Mastering AI Face Swaps.pdfUndress Baby
The quest for the best AI face swap solution is marked by an amalgamation of technological prowess and artistic finesse, where cutting-edge algorithms seamlessly replace faces in images or videos with striking realism. Leveraging advanced deep learning techniques, the best AI face swap tools meticulously analyze facial features, lighting conditions, and expressions to execute flawless transformations, ensuring natural-looking results that blur the line between reality and illusion, captivating users with their ingenuity and sophistication.
Web:- https://undressbaby.com/
8. wicket |ˈwɪkɪt|
noun
1 Cricket each of the sets of three stumps with two bails across the top at either end of the pitch,
defended by a batsman.
• the prepared strip of ground between two sets of stumps. when they inspected the wicket, they found it being
rolled by some prisoners.
• the dismissal of a batsman; each of ten dismissals regarded as marking a division of a side's innings:
Darlington won by four wickets.
2 (also wicket door or wicket gate)a small door or gate, especially one beside or in a larger one.
• N. Amer. an opening in a door or wall, often fitted with glass or a grille and used for selling tickets or a similar
purpose.
3 N. Amer. a croquet hoop.
PHRASES
at the wicket Cricket 1 batting: the batsman remained at the wicket. 2 by the wicketkeeper: he was caught at
the wicket chasing a wide one.
keep wicket Cricket be a wicketkeeper.
lose a wicket Cricket (of the batting side) have a batsman dismissed. the tourists lost their last seven wickets for
94.
a sticky wicket Cricket a pitch that has been drying after rain and is difficult to bat on. • informal a tricky
or awkward situation: I might be on a sticky wicket if I used that line.
over the wicket Cricket (referring to which side of the wicket a bowler runs when bowling) to the left of
the wicket if a right-handed bowler and the right of the wicket if a left-handed bowler.
round the wicket Cricket (referring to which side of the wicket a bowler runs when bowling) to the right
of the wicket if a right-handed bowler and the left of the wicket if a left-handed bowler.
take a wicket Cricket (of a bowler or a fielding side) dismiss a batsman.
ORIGIN Middle English (in the sense ‘small door or grille’): from Anglo-Norman French and Old
Northern French wiket; origin uncertain, usually referred to the Germanic root of Old Norse vīkja ‘to
turn, move’. Cricket senses date from the late 17th cent.
42. package com.cheesr.dao;
/*...*/
public class CheeseDao {
public List<Cheese> getCheeses() {
return asList(
new Cheese(
"Gouda",
"Named after the Dutch town of Gouda, j",
1.99));
}
}
43. package com.cheesr.dao;
/*...*/
public class CheeseDao {
public List<Cheese> getCheeses() {
return asList(
new Cheese(
"Gouda",
"Named after the Dutch town of Gouda, j",
1.99),
new Cheese(
"Edam",
"This is a pressed, semi-hard to hard c",
2.99));
}
}
44. package com.cheesr.dao;
/*...*/
public class CheeseDao {
public List<Cheese> getCheeses() {
return asList(
new Cheese(
"Gouda",
"Named after the Dutch town of Gouda, j",
1.99),
new Cheese(
"Edam",
"This is a pressed, semi-hard to hard c",
2.99),
new Cheese(
"Camembert",
"A very famous French cheese, Camembert",
3.99));
}
}
56. public class Index extends WebPage {
private CheeseDao cheeseDao = new CheeseDao();
public Index() {
}
}
57. public class Index extends WebPage {
private CheeseDao cheeseDao = new CheeseDao();
public Index() {
List<Cheese> cheeses = cheeseDao.getCheeses();
}
}
58. public class Index extends WebPage {
private CheeseDao cheeseDao = new CheeseDao();
public Index() {
List<Cheese> cheeses = cheeseDao.getCheeses();
add(new ListView<Cheese>("cheese", cheeses) {
});
}
}
59. public class Index extends WebPage {
private CheeseDao cheeseDao = new CheeseDao();
public Index() {
List<Cheese> cheeses = cheeseDao.getCheeses();
add(new ListView<Cheese>("cheese", cheeses) {
@Override
protected void populateItem(ListItem<Cheese> item) {
}
});
}
}
60. public class Index extends WebPage {
private CheeseDao cheeseDao = new CheeseDao();
public Index() {
List<Cheese> cheeses = cheeseDao.getCheeses();
add(new ListView<Cheese>("cheese", cheeses) {
@Override
protected void populateItem(ListItem<Cheese> item) {
Cheese c = item.getModelObject();
item.add(new Label("name", c.getName()));
item.add(new Label("description", c.getDescriptio
item.add(new Label("price", c.getPrice()));
}
});
}
}
84. public class CheeseDao {
public List<Cheese> getCheeses() {…}
}
public class OrderDao {
public void save(Order order) {…}
public List<Order> list() {…}
}
public class Index extends WebPage {
private CheeseDao cheeseDao = new CheeseDao();
public Index() {…}
}
85. public class CheeseDao {
public List<Cheese> getCheeses() {…}
}
public class OrderDao {
public void save(Order order) {…}
public List<Order> list() {…}
}
public class Index extends WebPage {
private CheeseDao cheeseDao = new CheeseDao();
public Index() {…}
}
86. @Stateless
public class CheeseDao {
public List<Cheese> getCheeses() {…}
}
public class OrderDao {
public void save(Order order) {…}
public List<Order> list() {…}
}
public class Index extends WebPage {
private CheeseDao cheeseDao = new CheeseDao();
public Index() {…}
}
87. @Stateless
public class CheeseDao {
public List<Cheese> getCheeses() {…}
}
@Stateless
public class OrderDao {
public void save(Order order) {…}
public List<Order> list() {…}
}
public class Index extends WebPage {
private CheeseDao cheeseDao = new CheeseDao();
public Index() {…}
}
88. @Stateless
public class CheeseDao {
public List<Cheese> getCheeses() {…}
}
@Stateless
public class OrderDao {
public void save(Order order) {…}
public List<Order> list() {…}
}
public class Index extends WebPage {
private CheeseDao cheeseDao;
public Index() {…}
}
90. @Stateless
public class CheeseDao {
public List<Cheese> getCheeses() {…}
}
@Stateless
public class OrderDao {
public void save(Order order) {…}
public List<Order> list() {…}
}
public class Index extends WebPage {
@EJB
private CheeseDao cheeseDao;
public Index() {…}
}
91. 21:20:55,305 Processing weld deployment cheesr.war
21:20:55,313 JNDI bindings for session bean named CheeseDao
in deployment unit deployment "cheesr.war" are as follows:
java:global/cheesr/CheeseDao!com.cheesr.dao.CheeseDao
java:app/cheesr/CheeseDao!com.cheesr.dao.CheeseDao
java:module/CheeseDao!com.cheesr.dao.CheeseDao
java:global/cheesr/CheeseDao
java:app/cheesr/CheeseDao
java:module/CheeseDao
21:20:55,335 Starting Services for CDI deployment:
cheesr.war
21:20:55,340 Starting weld service for deployment
cheesr.war
92.
93. public class Index extends WebPage
{
@EJB
private CheeseDao cheeseDao;
private Cart cart = new Cart();
public Index()
{
List<Cheese> cheeses = cheeseDao.getCheeses();
add(new ListView<Cheese>("cheese", cheeses) {…});
add(new ListView<Cheese>("item", cart.getItems()) {…})
}
}
94. public class Index extends WebPage
{
@EJB
private CheeseDao cheeseDao;
private Cart cart = new Cart();
public Index()
{
List<Cheese> cheeses = cheeseDao.getCheeses();
add(new ListView<Cheese>("cheese", cheeses) {…});
add(new ListView<Cheese>("item", cart.getItems()) {…})
}
}
98. public class WicketApplication extends WebApplication
{
@Override
public Class< ? extends WebPage> getHomePage()
{
return Index.class;
}
@Override
public void init()
{
super.init();
}
}
99. public class WicketApplication extends WebApplication
{
@Override
public Class< ? extends WebPage> getHomePage()
{
return Index.class;
}
@Override
public void init()
{
super.init();
getComponentInstantiationListeners()
.add(new JavaEEComponentInjector(this));
}
}
100.
101. • add EJB dependency and wicketstuff-
javaee-inject dependency
• make DAOs EJBs
• configure component instantiation listener
• now you can use @EJB injection
112. public class MessageModel
extends LoadableDetachableModel<String> {
@Inject
private MessageOfTheDay messages;
@Override
protected String load() {
return messages.getMessage();
}
}
113. Caused by: java.lang.NullPointerException
at com.cheesr.web.MessageModel.load(MessageModel.java:15) [:]
at com.cheesr.web.MessageModel.load(MessageModel.java:1) [:]
at org.apache.wicket.model.LoadableDetachableModel.getObject(
at org.apache.wicket.Component.getDefaultModelObject(Componen
... 55 more
114. public class MessageModel
extends LoadableDetachableModel<String> {
@Inject
private MessageOfTheDay messages;
@Override
protected String load() {
return messages.getMessage();
}
}
115. public class MessageModel
extends LoadableDetachableModel<String> {
@Inject
private MessageOfTheDay messages;
public MessageModel() {
NonContextual.of(MessageModel.class).inject(this);
}
@Override
protected String load() {
return messages.getMessage();
}
}
116. • Add wicket-cdi-1.1 and javax.cdi-api
• Configure Wicket's CdiConfiguration
• Use @Inject injection
• Use NonContextual in non-managed
objects
134. public class CheckoutPage extends WebPage {
private Cart cart;
public CheckoutPage(Cart cart) {
this.cart = cart;
}
}
135. public class CheckoutPage extends WebPage {
private Cart cart;
public CheckoutPage(Cart cart) {
this.cart = cart;
Form<Void> form = new Form<Void>("form") {};
add(form);
}
}
136. public class CheckoutPage extends WebPage {
private Cart cart;
public CheckoutPage(Cart cart) {
this.cart = cart;
Form<Void> form = new Form<Void>("form") {
@Override
protected void onSubmit() {
}
};
add(form);
}
}
137. public class CheckoutPage extends WebPage {
private Cart cart;
private Order order = new Order();
public CheckoutPage(Cart cart) {
this.cart = cart;
Form<Void> form = new Form<Void>("form") {
@Override
protected void onSubmit() {
}
};
add(form);
}
}
138. public class CheckoutPage extends WebPage {
private Cart cart;
private Order order = new Order();
@EJB
private OrderDao orders;
public CheckoutPage(Cart cart) {
this.cart = cart;
Form<Void> form = new Form<Void>("form") {
@Override
protected void onSubmit() {
}
};
add(form);
}
}
139. public class CheckoutPage extends WebPage {
…
public CheckoutPage(Cart cart) {
this.cart = cart;
Form<Void> form = new Form<Void>("form") {
@Override
protected void onSubmit() {
}
};
add(form);
}
}
140. public class CheckoutPage extends WebPage {
…
public CheckoutPage(Cart cart) {
this.cart = cart;
Form<Void> form = new Form<Void>("form") {
@Override
protected void onSubmit() {
for (Cheese cheese : cart.getItems()) {
}
}
};
add(form);
}
}
141. public class CheckoutPage extends WebPage {
…
public CheckoutPage(Cart cart) {
this.cart = cart;
Form<Void> form = new Form<Void>("form") {
@Override
protected void onSubmit() {
for (Cheese cheese : cart.getItems()) {
OrderItem item = new OrderItem();
item.setOrder(order);
item.setCheese(cheese);
order.getItems().add(item);
}
}
};
add(form);
}
}
142. public class CheckoutPage extends WebPage {
…
public CheckoutPage(Cart cart) {
this.cart = cart;
Form<Void> form = new Form<Void>("form") {
@Override
protected void onSubmit() {
for (Cheese cheese : cart.getItems()) {
OrderItem item = new OrderItem();
item.setOrder(order);
item.setCheese(cheese);
order.getItems().add(item);
}
orders.save(order);
}
};
add(form);
}
}
144. What does the navigation between
shopping and checkout look like?
145. public class Index extends WebPage {
public Index() {
…
add(new Link<Void>("checkout") {
@Override
public void onClick() {
setResponsePage(new CheckoutPage(cart));
}
});
}
}
public class CheckoutPage extends WebPage {
private Cart cart;
public CheckoutPage(Cart cart) {
this.cart = cart;
…
}
}
146. public class Index extends WebPage {
public Index() {
…
add(new Link<Void>("checkout") {
@Override
public void onClick() {
setResponsePage(new CheckoutPage(cart));
}
});
}
}
public class CheckoutPage extends WebPage {
private Cart cart;
public CheckoutPage(Cart cart) {
this.cart = cart;
…
}
}
147. public class Index extends WebPage {
public Index() {
…
add(new Link<Void>("checkout") {
@Override
public void onClick() {
setResponsePage(new CheckoutPage(cart));
}
});
}
}
public class CheckoutPage extends WebPage {
private Cart cart;
public CheckoutPage(Cart cart) {
this.cart = cart;
…
}
}
Cart should be
conversation scoped
148. public class Cart implements Serializable {
public Cart() {
}
public void setItems(List<Cheese> items) {
this.items = items;
}
public List<Cheese> getItems() {
return items;
}
public double getTotal() {
return items.stream().mapToDouble(Cheese::getPrice).su
}
}
149. @ConversationScoped
public class Cart implements Serializable {
private List<Cheese> items = new ArrayList<>();
public Cart() {
}
public void setItems(List<Cheese> items) {
this.items = items;
}
public List<Cheese> getItems() {
return items;
}
public double getTotal() {
return items.stream().mapToDouble(Cheese::getPrice).su
}
}
151. public class Index extends WebPage {
…
public Index() {
…
add(new Link<Void>("checkout") {
@Override
public void onClick() {
setResponsePage(new CheckoutPage(cart));
}
});
}
}
152. public class Index extends WebPage {
…
@Inject
private Conversation shopping;
public Index() {
…
add(new Link<Void>("checkout") {
@Override
public void onClick() {
setResponsePage(new CheckoutPage(cart));
}
});
}
}
153. public class Index extends WebPage {
…
@Inject
private Conversation shopping;
public Index() {
…
shopping.begin();
…
add(new Link<Void>("checkout") {
@Override
public void onClick() {
setResponsePage(new CheckoutPage(cart));
}
});
}
}
154. public class Index extends WebPage {
…
@Inject
private Conversation shopping;
@Inject
private Cart cart = new Cart();
public Index() {
…
shopping.begin();
…
add(new Link<Void>("checkout") {
@Override
public void onClick() {
setResponsePage(new CheckoutPage(cart));
}
});
}
}
155. public class Index extends WebPage {
…
@Inject
private Conversation shopping;
@Inject
private Cart cart;
public Index() {
…
shopping.begin();
…
add(new Link<Void>("checkout") {
@Override
public void onClick() {
setResponsePage(new CheckoutPage(cart));
}
});
}
}
156. public class Index extends WebPage {
…
@Inject
private Conversation shopping;
@Inject
private Cart cart;
public Index() {
…
shopping.begin();
…
add(new Link<Void>("checkout") {
@Override
public void onClick() {
setResponsePage(new CheckoutPage());
}
});
}
}
157. public class CheckoutPage extends WebPage {
@EJB
private OrderDao orders;
private Order order = new Order();
private Cart cart;
public CheckoutPage(Cart cart) {
this.cart = cart;
Form<Void> form = new Form<Void>("form") {…};
add(form);
}
}
158. public class CheckoutPage extends WebPage {
@EJB
private OrderDao orders;
private Order order = new Order();
private Cart cart;
public CheckoutPage() {
this.cart = cart;
Form<Void> form = new Form<Void>("form") {…};
add(form);
}
}
159. public class CheckoutPage extends WebPage {
@EJB
private OrderDao orders;
private Order order = new Order();
private Cart cart;
public CheckoutPage() {
Form<Void> form = new Form<Void>("form") {…};
add(form);
}
}
160. public class CheckoutPage extends WebPage {
@EJB
private OrderDao orders;
private Order order = new Order();
@Inject
private Cart cart;
public CheckoutPage() {
Form<Void> form = new Form<Void>("form") {…};
add(form);
}
}
162. public class CheckoutPage extends WebPage {
…
@Inject
private Cart cart;
public CheckoutPage() {
Form<Void> form = new Form<Void>("form") {…};
add(form);
}
}
163. public class CheckoutPage extends WebPage {
…
@Inject
private Cart cart;
public CheckoutPage() {
Form<Void> form = new Form<Void>("form") {
@Override
protected void onSubmit() {
for (Cheese cheese : cart.getItems()) {…}
orders.save(order);
}
};
add(form);
}
}
end conversation
here...
164. public class CheckoutPage extends WebPage {
…
@Inject
private Conversation shopping;
@Inject
private Cart cart;
public CheckoutPage() {
Form<Void> form = new Form<Void>("form") {
@Override
protected void onSubmit() {
for (Cheese cheese : cart.getItems()) {}
orders.save(order);
}
};
add(form);
}
}
165. public class CheckoutPage extends WebPage {
…
@Inject
private Conversation shopping;
@Inject
private Cart cart;
public CheckoutPage() {
Form<Void> form = new Form<Void>("form") {
@Override
protected void onSubmit() {
for (Cheese cheese : cart.getItems()) {}
orders.save(order);
shopping.end();
}
};
add(form);
}
}
169. public class CheckoutPage extends WebPage {
…
@Inject
private Conversation shopping;
@Inject
private Cart cart;
public CheckoutPage() {
Form<Void> form = new Form<Void>("form") {
@Override
protected void onSubmit() {
for (Cheese cheese : cart.getItems()) {}
orders.save(order);
shopping.end();
}
};
add(form);
}
}
170. public class CheckoutPage extends WebPage {
…
@Inject
private Conversation shopping;
@Inject
private Cart cart;
public CheckoutPage() {
Form<Void> form = new Form<Void>("form") {
@Override
protected void onSubmit() {
for (Cheese cheese : cart.getItems()) {}
orders.save(order);
shopping.end();
}
};
add(form);
}
}
171. public class CheckoutPage extends WebPage {
…
@Inject
private Conversation shopping;
@Inject
private Cart cart;
public CheckoutPage() {
Form<Void> form = new Form<Void>("form") {
@Override
protected void onSubmit() {
for (Cheese cheese : cart.getItems()) {}
orders.save(order);
shopping.end();
}
};
add(form);
}
}
172. public class CheckoutPage extends WebPage {
…
@Inject
private Conversation shopping;
@Inject
private Cart cart;
public CheckoutPage() {
Form<Void> form = new Form<Void>("form") {
@Override
protected void onSubmit() {
for (Cheese cheese : cart.getItems()) {}
orders.save(order);
shopping.end();
setResponsePage(Index.class);
}
};
add(form);
}
173. • Add wicket-cdi-1.1 and javax.cdi-api
• Configure Wicket's CdiConfiguration
• Use @Inject injection and
@ConversationScoped
• Use NonContextual in non-managed
objects
186. public class OrdersPage extends WebPage {
public OrdersPage() {
add(new ListView<Order>("items", new OrdersModel()) {
});
}
}
187. public class OrdersPage extends WebPage {
public OrdersPage() {
add(new ListView<Order>("items", new OrdersModel()) {
@Override
protected void populateItem(ListItem<Order> item) {
}
});
}
}
188. public class OrdersPage extends WebPage {
public OrdersPage() {
add(new ListView<Order>("items", new OrdersModel()) {
@Override
protected void populateItem(ListItem<Order> item) {
Order o = item.getModelObject();
item.add(new Label("id", o.getId()));
item.add(new Label("name", o.getName()));
item.add(new Label("total", o.getTotal()));
}
});
}
}
189.
190. Caused by: org.hibernate.LazyInitializationException: failed to lazily
initialize a collection of role: com.cheesr.entities.Order.items, could
not initialize proxy - no Session
at org.hibernate.collection.internal.AbstractPersistentCollection.throw
at org.hibernate.collection.internal.AbstractPersistentCollection.withT
at org.hibernate.collection.internal.AbstractPersistentCollection.initi
at org.hibernate.collection.internal.AbstractPersistentCollection.read(
at org.hibernate.collection.internal.PersistentBag.iterator(PersistentB
at java.util.Spliterators$IteratorSpliterator.estimateSize(Spliterators
at java.util.Spliterator.getExactSizeIfKnown(Spliterator.java:408)
at java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:511
at java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.j
at java.util.stream.ReduceOps$ReduceOp.evaluateSequential(ReduceOps.jav
at java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:234
at java.util.stream.DoublePipeline.collect(DoublePipeline.java:476)
at java.util.stream.DoublePipeline.sum(DoublePipeline.java:388)
at com.cheesr.entities.Order.getTotal(Order.java:94)
at com.cheesr.web.OrdersPage$1.populateItem(OrdersPage.java:22)
at org.apache.wicket.markup.html.list.ListView.onPopulate(ListView.java
at org.apache.wicket.markup.repeater.AbstractRepeater.onBeforeRender(Ab
at org.apache.wicket.Component.internalBeforeRender(Component.java:949)
at org.apache.wicket.Component.beforeRender(Component.java:1017)
at org.apache.wicket.MarkupContainer.onBeforeRenderChildren(MarkupConta
... 50 more
207. When you use a reloading model
e.g. CheeseLoadableModel
And you use container managed transactions
@Transactional WicketFilter
Then be careful of unwanted modifications
208. Form<Cheese> form = new Form<Cheese>("form", cheeseModel) {
@Override
protected void onSubmit() {
Cheese cheese = getModelObject();
if (cheese.getPrice() < 1) {
error("Price must be €1,- or higher");
} else {
cheeseDao.save(cheese);
setResponsePage(Index.class);
}
}
};
add(form);
209.
210.
211.
212. "No news is good news..."
– Container Managed Transactions
213. Form<Cheese> form = new Form<Cheese>("form", cheeseModel) {
@Override
protected void onSubmit() {
Cheese cheese = getModelObject();
if (cheese.getPrice() < 1) {
error("Price must be €1,- or higher");
} else {
cheeseDao.save(cheese);
setResponsePage(Index.class);
}
}
};
add(form);
214. Form<Cheese> form = new Form<Cheese>("form", cheeseModel) {
@Override
protected void onSubmit() {
Cheese cheese = getModelObject();
if (cheese.getPrice() < 1) {
transactionBean.setTransactionRollbackOnly();
error("Price must be €1,- or higher");
} else {
cheeseDao.save(cheese);
setResponsePage(Index.class);
}
}
};
add(form);
216. When you use a reloading model
e.g. CheeseLoadableModel
And you use container managed transactions
@Transactional WicketFilter
Then be careful of unwanted modifications
and rollback the transaction
236. Add Arquillian dependencies
to project
Build deployable archive
with all necessary resources
Create a test case
Execute test case with Arquillian
Steps
240. Add Arquillian dependencies
to project
Build deployable archive
with all necessary resources
Create a test case
Execute test case with Arquillian
Steps
241. public class TestIndex {
private WicketTester tester;
@Before
public void setUp() {
WicketApplication app = new WicketApplication();
tester = new WicketTester(app);
}
@Test
public void homepageRendersSuccessfully() {
tester.startPage(Index.class);
tester.assertRenderedPage(Index.class);
}
}
242. @RunWith(Arquillian.class)
public class TestIndex {
private WicketTester tester;
@Before
public void setUp() {
WicketApplication app = new WicketApplication();
tester = new WicketTester(app);
}
@Test
public void homepageRendersSuccessfully() {
tester.startPage(Index.class);
tester.assertRenderedPage(Index.class);
}
}
243. @RunWith(Arquillian.class)
public class TestIndex {
@Deployment
public static WebArchive deployment() {…}
private WicketTester tester;
@Before
public void setUp() {
WicketApplication app = new WicketApplication();
tester = new WicketTester(app);
}
@Test
public void homepageRendersSuccessfully() {
tester.startPage(Index.class);
tester.assertRenderedPage(Index.class);
}
}
247. Add Arquillian dependencies
to project
Build deployable archive
with all necessary resources
Create a test case
Execute test case with Arquillian
Steps
248.
249. Add Arquillian dependencies
to project
Build deployable archive
with all necessary resources
Create a test case
Execute test case with Arquillian
Steps
259. with Arquillian you can test Wicket pages with JPA, CDI,
EJB
add Arquillian dependencies to POM,
add arquillian.xml for container connection
create a deployment
write and run your tests