Translate
четвер, 15 січня 2015 р.
вівторок, 13 січня 2015 р.
VirtualJUG: meetup with James Gosling
Java and the Wave Glider with James Gosling
- to
Needs a location
- This is a virtual Meetup occuring at 5PM UK time. For help with your timezone calculation, refer to this.You can tune in to the session at http://virtualJUG.comIf all fails, you can still access YouTube and IRC via previous means:Java and the Wave Glider with James GoslingAbstract tbaSpeaker: James GoslingJames Gosling is the founder of Java and CTO at Liquid Robotics.
#tip #mongo #limit
Interesting thing with mongo quering
Do you know result of db.myCollection.find().limit(0)?
It will be the same to db.myCollection.find() and return everything from collection
What about such thing db.myCollection.find().limit(-12)? Will it work at all?
Yes It will return the same to db.myCollection.find().limit(+12)
Do you know result of db.myCollection.find().limit(0)?
It will be the same to db.myCollection.find() and return everything from collection
What about such thing db.myCollection.find().limit(-12)? Will it work at all?
Yes It will return the same to db.myCollection.find().limit(+12)
пʼятниця, 9 січня 2015 р.
#tip #java
If you are not 100% sure prefer String.valueOf(value) over new String(value).
Inside valueOf method we have check on null so that you'll never get NPE
Inside valueOf method we have check on null so that you'll never get NPE
середа, 31 грудня 2014 р.
Replacing Throwing Exceptions with Notification in Validations
Martin Fowler виклав цікаву (принаймні для мене) статтю.
Ідея така що коли пишеш валідатори потрібно не викидати ексепшини, а робити список повідомлень.
Тобто замінити ось такий код
Ідея така що коли пишеш валідатори потрібно не викидати ексепшини, а робити список повідомлень.
Тобто замінити ось такий код
class BookingRequest…
public void check() {
if (date == null) throw new IllegalArgumentException("date is missing");
LocalDate parsedDate;
try {
parsedDate = LocalDate.parse(date);
}
catch (DateTimeParseException e) {
throw new IllegalArgumentException("Invalid format for date", e);
}
if (parsedDate.isBefore(LocalDate.now())) throw new IllegalArgumentException("date cannot be before today");
if (numberOfSeats == null) throw new IllegalArgumentException("number of seats cannot be null");
if (numberOfSeats < 1) throw new IllegalArgumentException("number of seats must be positive");
}
на
Оскільки в моєму поточному проекті багато перевірок, думаю варто спробувати такий підхідclass BookingRequest…private void validateNumberOfSeats(Notification note) { if (numberOfSeats == null) { note.addError("number of seats cannot be null"); return; } if (numberOfSeats < 1) note.addError("number of seats must be positive"); }
Labels:
Martin Fowler,
refactoring
середа, 24 грудня 2014 р.
Oracle Confirms New Java 9 Features
The new set of JCPs announced are:
- JEP 158: Unified JVM Logging — Introduces a common component logging system.
- JEP 165: Compiler Control — Improves control of JVM compiles through a new set of options.
- JEP 214: Remove GC Combinations Deprecated in JDK 8 — Maybe self-explanatory: it removes GC combinations from JDK8.
- JEP 213: Milling Project Coin — Addresses some language changes in Project Coin to "smooth out the edges."
- JEP 219: Datagram Transport Layer Security (DTLS) — DTLS will be supported in Java 9.
- JEP 224: HTML5 Javadoc — Java 9 includes the javadoc tool for outputting HTML5.
субота, 20 грудня 2014 р.
Message Processing With Spring Integration
Цікава стаття про Message Processing With Spring Integration
http://java.dzone.com/articles/message-processing-spring
http://java.dzone.com/articles/message-processing-spring
пʼятниця, 12 грудня 2014 р.
пʼятниця, 5 грудня 2014 р.
JUG- 24 AKKurate AKKA
Наступного четверга 11 грудня о 19-00 відбудеться 24-тя зустріч Java User Group
Lviv
Тема: AKKurate AKKA
Доповідач: java/scala розробник компанії Eleks – Юрій Остапчук
Презентація торкнеться наступних питань:
- SCALAbility problem, Actor System / Java&Scala Actors
- Load-balancing, Supervision & Fault- Tolerance. Networking
- Some Patterns & Best Practices
- Note on 'reactiveness'
Вхід Вільний.
Щоб уникнути stack overflow, прошу зареєструватися ось тут.
Зустріч відбудеться у тренінг центрі компанії Eleks
- за адресою Наукова 7г
(1-ий поверх) пʼятниця, 28 листопада 2014 р.
четвер, 27 листопада 2014 р.
понеділок, 10 листопада 2014 р.
10 Things You Didn’t Know About Java
10 Things You Didn’t Know About Java
So, you’ve been working with Java since the very beginning? Remember the days when it was called “Oak”, when OO was still a hot topic, when C++ folks thought that Java had no chance, when Applets were still a thing?
I bet that you didn’t know at least half of the following things. Let’s start this week with some great surprises about the inner workings of Java.
1. There is no such thing as a checked exception
That’s right! The JVM doesn’t know any such thing, only the Java language does.
Today, everyone agrees that checked exceptions were a mistake. As Bruce Eckel said on his closing keynote at GeeCON, Prague, no other language after Java has engaged in using checked exceptions, and even Java 8 does no longer embrace them in the new Streams API (which can actually be a bit of a pain, when your lambdas use IO or JDBC).
пʼятниця, 7 листопада 2014 р.
Java Concurrent Animated
Цікава програмка, яка графічно описує як працює Concurrency в Java:
http://sourceforge.net/projects/javaconcurrenta/?source=directory
http://sourceforge.net/projects/javaconcurrenta/?source=directory
четвер, 6 листопада 2014 р.
IntelliJ IDEA 14 Where Your Finest Code is Forged
Вийшла нова версія IntelliJ IDEA 14
Що зявилось нового: https://www.jetbrains.com/idea/whatsnew/
Скачати: https://www.jetbrains.com/idea/download/
Що зявилось нового: https://www.jetbrains.com/idea/whatsnew/
Скачати: https://www.jetbrains.com/idea/download/
Підписатися на:
Дописи (Atom)



