background preloader

Useful code samples

Useful code samples

JH Labs Home Page java - Extract bit sequences of arbitrary length from byte[] array efficiently Main Page Jacek Laskowski Blog Na razie idzie niezwykle gładko, zdecydowanie za dobrze. Tak kończyłem ostatni wpis o GWT i muszę przyznać, że z każdym dniem, kiedy zasiadam do GWT coraz bardziej się upewniam, że jest to właściwa technologia kliencka do dalszej ewaluacji. Chciałbym, aby z każdym szkieletem programistycznym (*) było tak przyjemnie. (*) Nie przekonuje mnie użycie tłumaczenia szkielet programistyczny jako odpowiednik angielskiego framework. Z chęcią zmieniłbym je na coś bardziej dźwięcznego. Sukcesem dnia dzisiejszego w kategorii GWT jest stworzenie namiastki aplikacji pod szumnie brzmiącym tytułem Kółko i krzyżyk. run a continuous connection**: You can't create a 'live' connection between webapp and client. sądziłem, że jednak się da i...się nie udało. Mimo nieodpowiedniego przykładu do zebrania doświadczeń w GWT poznałem wiele ciekawostek związanych z tym środowiskiem. Zanim rozpiszę się na dobre wspomnę, że archiwum forum GWT jest nieocenionym źródłem informacji. Krok 1. Krok 2. Krok 3. Krok 4.

Java Practices -> Implementing equals Sometimes the default implementation of equals has the desired behaviour (as in a type-safe enumeration, for example), but equals should usually compare state, not identity. This is particularly true for "data-centric" classes which map to database records. hashCode and equals are closely related: If you extend a concrete class, and add a new field which contributes to equals, then it's not possible to write a perfectly correct equals method for the new class. Instead, you should use composition instead of inheritance. (See Effective Java by Joshua Bloch for more information.) When implementing equals, fields are compared differently, according to their type: In an equals method, it's usually worthwhile to order field comparisons such that the most significant comparisons are performed first. Example 1 The above policies can be collected in a utility class: Car is a class which uses EqualsUtil to implement its equals method: Example 2 Items to note regarding this equals method:

Vaadin Java Email Web - All The JavaMail Properties Scala in the Enterprise The Scala programming language is used by many companies to develop commercial software and production systems; please find below some notable examples. Your company can also benefit from using Scala, just like LinkedIn, EDFT, Twitter, Novell, the Guardian, Xebia, Xerox, FourSquare, Sony, Siemens, Thatcham, OPower, GridGain, AppJet, Reaktor and many others. Scala is being used by many more organisations and steadily moving into mainstream business critical applications. Scala's use has grown by a factor of 10 over the last year and it has matured into a solid production language. Scala long term support both in research and commercial terms is now assured. EPFL will continue to fund programming language research that so often results in features for Scala and the Scala team recently won an ERC 5 year grant for 2.3 million Euros, nearly doubling the group size, to tackle the multi-core "Parallel Programming Challenge" using Scala as the basis. LinkedIn Électricité de France Trading Twitter

RoseIndia

Related: