-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.html
More file actions
448 lines (295 loc) · 20.5 KB
/
index.html
File metadata and controls
448 lines (295 loc) · 20.5 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en" itemscope itemtype="http://schema.org/Blog">
<head>
<meta http-equiv="content-type" content="text/html; charset=UTF-8" />
<meta name="description" content="Andrey Vityuk's Dev Blog" />
<meta name="keywords" content="code,software,development" />
<meta name="author" content="Andrey Vityuk" />
<meta name='yandex-verification' content='5725e5329ff88b91' />
<meta itemprop="name" content="Software Development">
<meta itemprop="description" content="Tips and walkthroughs on software development">
<title>Andrey Vityuk's Dev Blog</title>
<link rel="stylesheet" type="text/css" href="/stylesheets/normalize.css" />
<link rel="stylesheet" type="text/css" href="/stylesheets/default.css" />
<link rel="stylesheet" type="text/css" href="/stylesheets/syntax.css" />
<link rel="alternate" type="application/atom+xml" href="http://feeds.feedburner.com/avityuk/blog" />
<script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1.7.0/jquery.min.js"></script>
<script type="text/javascript" src="/javascript/main.js"></script>
<script type="text/javascript">
var _gaq = _gaq || [];
_gaq.push(['_setAccount', 'UA-7697564-2']);
_gaq.push(['_trackPageview']);
_gaq.push(['_trackPageLoadTime']);
(function() {
var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
})();
</script>
<script type="text/javascript">
$(document).ready(function() {
loadSidebarLinks();
});
</script>
</head>
<body>
<div id="header-wrapper">
<div id="header">
<h1><a id="blog-title" href="http://blog.vityuk.com">Developer's playground</a></h1>
My brain dump about software development
</div>
</div>
<div id="main-wrapper">
<div id="main">
<div id="content">
<div id="posts">
<div class="post">
<h2 class="date-header">Sunday, March 10, 2013</h2>
<h1 class="post-title"><a href="/2013/03/easy-localization-in-java.html" rel="bookmark">Localization in Java can be easy</a></h1>
<p>It’s being a while since my last post. Recently I wrote small localization library for Java. It’s still in development but I wanted to share main ideas.</p>
<p>JDK localization capabilities are comprehensive enough but not easy to use and it misses very important concept of <a href="http://cldr.unicode.org/index/cldr-spec/plural-rules" title="Plural Rules on unicode.org">Plural Rules</a>. IMHO <a href="https://developers.google.com/web-toolkit/">GWT</a> is the only Java framework I know which did localication right. I decided to bring these ideas to server side and created <a href="https://github.com/avityuk/ginger">ginger</a>. Here is the list of it’s core ideas:</p>
<ul>
<li>Ease of use</li>
<li>Compatibility with JDK localization features</li>
<li>Type safety</li>
<li>Plural rules support</li>
<li>Popular libraries and frameworks support</li>
</ul>
<a href="/2013/03/easy-localization-in-java.html">Read More »</a>
<div class="post-meta">
<div class="post-tags">
Tags:
<a href="/tags/java" rel="tag">java, </a>
<a href="/tags/localization" rel="tag">localization, </a>
<a href="/tags/i18n" rel="tag">i18n, </a>
<a href="/tags/formatting" rel="tag">formatting</a>
</div>
<div class="comments-link"><a href="/2013/03/easy-localization-in-java.html#disqus_thread" data-disqus-identifier="/2013/03/easy-localization-in-java" rel="nofollow">View Comments</a></div>
</div>
</div>
<div class="post">
<h2 class="date-header">Thursday, March 31, 2011</h2>
<h1 class="post-title"><a href="/2011/03/lost-stack-trace.html" rel="bookmark">Lost Stack Trace</a></h1>
<p>Last week our team faced another <code>NullPointerException</code> in our development environment. As usual I started investigate log files to get full stack trace and find out reason of exception. Surprisingly, but the message I saw in log file was like:</p>
<pre><code>ERROR: MyClass - java.lang.NullPointerException
</code></pre>
<p>I realized that there was something wrong in logging code, hence we are loosing stack trace. I checked code which produces this log and didn’t find anything unusual. Then I asked my colleague to double check it may be I miss something. He reproduced the same exception on his desktop and showed me nice log statement with full stack trace. We started to feel that there is some magic behind that. Whole team started googling and finally we found the answer.</p>
<a href="/2011/03/lost-stack-trace.html">Read More »</a>
<div class="post-meta">
<div class="post-tags">
Tags:
<a href="/tags/java" rel="tag">java, </a>
<a href="/tags/debugging" rel="tag">debugging</a>
</div>
<div class="comments-link"><a href="/2011/03/lost-stack-trace.html#disqus_thread" data-disqus-identifier="/2011/03/lost-stack-trace" rel="nofollow">View Comments</a></div>
</div>
</div>
<div class="post">
<h2 class="date-header">Saturday, March 26, 2011</h2>
<h1 class="post-title"><a href="/2011/03/java-formatters-best-practices.html" rel="bookmark">Java Formatters Best Practices</a></h1>
<p>Java API has set of classes for formatting and parsing dates and
numbers. Mostly used are: <code>java.text.DateFormat</code> and <code>java.text.NumberFormat</code>. Often when interviewing candidates I ask them whether JDK date and number formatters are thread-safe. Surprisingly most of them don’t know the right answer, hence I decided to describe common pitfalls with formatters usage.</p>
<a href="/2011/03/java-formatters-best-practices.html">Read More »</a>
<div class="post-meta">
<div class="post-tags">
Tags:
<a href="/tags/java" rel="tag">java, </a>
<a href="/tags/formatting" rel="tag">formatting, </a>
<a href="/tags/multithreading" rel="tag">multithreading</a>
</div>
<div class="comments-link"><a href="/2011/03/java-formatters-best-practices.html#disqus_thread" data-disqus-identifier="/2011/03/java-formatters-best-practices" rel="nofollow">View Comments</a></div>
</div>
</div>
<div class="post">
<h2 class="date-header">Tuesday, March 22, 2011</h2>
<h1 class="post-title"><a href="/2011/03/java-generics-and-reflection.html" rel="bookmark">Java Generics and Reflection</a></h1>
<p>“Officially” Java does not have information about generic types in runtime. But it’s not absolutely true. There are some cases, which are utilized by smart frameworks like Spring and Google Guice. Let’s explore these cases!</p>
<a href="/2011/03/java-generics-and-reflection.html">Read More »</a>
<div class="post-meta">
<div class="post-tags">
Tags:
<a href="/tags/reflection" rel="tag">reflection, </a>
<a href="/tags/java" rel="tag">java, </a>
<a href="/tags/generics" rel="tag">generics</a>
</div>
<div class="comments-link"><a href="/2011/03/java-generics-and-reflection.html#disqus_thread" data-disqus-identifier="/2011/03/java-generics-and-reflection" rel="nofollow">View Comments</a></div>
</div>
</div>
<div class="post">
<h2 class="date-header">Monday, March 07, 2011</h2>
<h1 class="post-title"><a href="/2011/03/logging-jdbc-calls.html" rel="bookmark">Logging JDBC calls</a></h1>
<p>Today I found some my drafts of JDBC logger library. And finally decided to upload it on <a href="http://code.google.com/p/jdbc-logger/">Google code</a>. The main idea of the library is to transparently intercept JDBC calls and log queries (even for PreparedStatement).</p>
<a href="/2011/03/logging-jdbc-calls.html">Read More »</a>
<div class="post-meta">
<div class="post-tags">
Tags:
<a href="/tags/java" rel="tag">java, </a>
<a href="/tags/logging" rel="tag">logging, </a>
<a href="/tags/jdbc" rel="tag">jdbc</a>
</div>
<div class="comments-link"><a href="/2011/03/logging-jdbc-calls.html#disqus_thread" data-disqus-identifier="/2011/03/logging-jdbc-calls" rel="nofollow">View Comments</a></div>
</div>
</div>
<div class="post">
<h2 class="date-header">Sunday, December 05, 2010</h2>
<h1 class="post-title"><a href="/2010/12/how-scala-compiler-stores-meta.html" rel="bookmark">How Scala compiler stores meta information</a></h1>
<div class="post-image">
<img src="http://3.bp.blogspot.com/_MzPDIAgS1ow/TPtvknz8OgI/AAAAAAAARLI/mShNq4h6jxc/s320/scala.jpg" width="320px" height="253px" />
</div>
<p>I was always wondering how Scala compiler fits into Java class file with all it’s comprehensive language constructions. I felt there was some magic… Later in Scala 2.8 I faced a problem with calling method with default parameters using reflection. From a quick glance it seemed that there nothing complex. But wait, Scala allows methods overloading and how do you know which method has default parameters?</p>
<a href="/2010/12/how-scala-compiler-stores-meta.html">Read More »</a>
<div class="post-meta">
<div class="post-tags">
Tags:
<a href="/tags/reflection" rel="tag">reflection, </a>
<a href="/tags/compiler" rel="tag">compiler, </a>
<a href="/tags/bytecode" rel="tag">bytecode, </a>
<a href="/tags/scala" rel="tag">scala</a>
</div>
<div class="comments-link"><a href="/2010/12/how-scala-compiler-stores-meta.html#disqus_thread" data-disqus-identifier="/2010/12/how-scala-compiler-stores-meta" rel="nofollow">View Comments</a></div>
</div>
</div>
<div class="post">
<h2 class="date-header">Wednesday, June 02, 2010</h2>
<h1 class="post-title"><a href="/2010/06/running-appengine-scala.html" rel="bookmark">Getting started with AppEngine + Scala</a></h1>
<div class="post-image">
<img src="http://2.bp.blogspot.com/_MzPDIAgS1ow/TAaZmre_WXI/AAAAAAAAOFc/a2_E3nAacQI/s320/scala_appengine.png" width="315px" height="186px" />
</div>
<p>This time, after long time-out I decided to continue blogging in english. Sorry for my english in advance, but I will try to do my best ;-)I spent some time playing with <a href="http://code.google.com/appengine/">Google App Engine</a> and <a href="http://www.scala-lang.org/">Scala</a> integration so I think it could be helpful for somebody else. Since they are both innovative technologies I could not resist the temptation to use unusual build tool with self-explanatory name <a href="http://code.google.com/p/simple-build-tool/">simple-build-tool</a>. In short, this is Maven-like build tool which actually works with Maven repositories (using Apache Ivy). But instead of boilerplate xml you get Scala code.</p>
<a href="/2010/06/running-appengine-scala.html">Read More »</a>
<div class="post-meta">
<div class="post-tags">
Tags:
<a href="/tags/sbt" rel="tag">sbt, </a>
<a href="/tags/google" rel="tag">google, </a>
<a href="/tags/web" rel="tag">web, </a>
<a href="/tags/scala" rel="tag">scala, </a>
<a href="/tags/appengine" rel="tag">appengine</a>
</div>
<div class="comments-link"><a href="/2010/06/running-appengine-scala.html#disqus_thread" data-disqus-identifier="/2010/06/running-appengine-scala" rel="nofollow">View Comments</a></div>
</div>
</div>
<div class="post">
<h2 class="date-header">Sunday, March 22, 2009</h2>
<h1 class="post-title"><a href="/2009/03/blog-post.html" rel="bookmark">Фабричный метод</a></h1>
<div class="post-image">
<img src="http://2.bp.blogspot.com/_MzPDIAgS1ow/ScY48e6QaTI/AAAAAAAAJ6Y/WkCsn9_myxU/s400/magican.jpg" width="304px" height="400px" />
</div>
<p>В этот раз речь пойдет о паттернах проектирования. Если быть точнее — <strong>Статическом фабричном методе (<a href="http://en.wikipedia.org/wiki/Factory_method_pattern#Encapsulation">Static Factory Method</a>)</strong>. Вкратце, он призван для того, чтобы инкапсулировать процесс создания объекта. </p>
<p>Допустим, у нас есть метод, который возвращает определенный набор (список) данных. Этот метод должен иметь возможность вернуть для каждой единицы фактический результат или ошибку. Естественно, что в таком случае исключения бросать нельзя, иначе мы не получим “хорошие” данные. Обычно, в таких целях используется объект-контейнер, который хранит или данные или ошибку или просто пустой.</p>
<a href="/2009/03/blog-post.html">Read More »</a>
<div class="post-meta">
<div class="post-tags">
Tags:
<a href="/tags/java" rel="tag">java, </a>
<a href="/tags/error-handling" rel="tag">error handling, </a>
<a href="/tags/pattern" rel="tag">pattern, </a>
<a href="/tags/factory-method" rel="tag">factory method</a>
</div>
<div class="comments-link"><a href="/2009/03/blog-post.html#disqus_thread" data-disqus-identifier="/2009/03/blog-post" rel="nofollow">View Comments</a></div>
</div>
</div>
<div class="post">
<h2 class="date-header">Sunday, February 15, 2009</h2>
<h1 class="post-title"><a href="/2009/02/blog-post.html" rel="bookmark">Чем опасно логирование</a></h1>
<div class="post-image">
<img src="http://1.bp.blogspot.com/_MzPDIAgS1ow/SY_wAoSR8wI/AAAAAAAAJt4/m0NJppz2yfQ/s320/The_Most_poisonous_frog.jpg" width="320px" height="230px" />
</div>
<p>Большинство современных приложений не обходится без логирования. Почти каждый разработчик, так или иначе, знаком с тем как это делается. Для Java существует довольно обширный набор библиотек для удобного логирования: <a href="http://logging.apache.org/log4j/1.2/index.html">Log4J</a>, <a href="http://commons.apache.org/logging/">Jakarta Commons Logging</a>, <a href="http://www.slf4j.org/">SLF4J</a>, <a href="http://logback.qos.ch/">Logback</a> и <a href="http://java.sun.com/javase/6/docs/technotes/guides/logging/overview.html">Java Logging API</a> и т.д. </p>
<p>Существующие библиотеки позволяют очень удобно разграничить вывод информации об ошибках, предупреждений, информационных сообщений и отладочной информации. Так же, позволяют настроить предпочитаемую степень логирование непосредственно перед запуском приложения. </p>
<p>Но, к своему удивлению, я недавно заметил, что большинство разработчиков пользуются логированием неправильно. “Что значит неправильно?”, - удивитесь Вы.</p>
<a href="/2009/02/blog-post.html">Read More »</a>
<div class="post-meta">
<div class="post-tags">
Tags:
<a href="/tags/performance" rel="tag">performance, </a>
<a href="/tags/java" rel="tag">java, </a>
<a href="/tags/logging" rel="tag">logging</a>
</div>
<div class="comments-link"><a href="/2009/02/blog-post.html#disqus_thread" data-disqus-identifier="/2009/02/blog-post" rel="nofollow">View Comments</a></div>
</div>
</div>
<div class="post">
<h2 class="date-header">Tuesday, December 16, 2008</h2>
<h1 class="post-title"><a href="/2008/12/blog-post.html" rel="bookmark">Подмена Синглтонов</a></h1>
<div class="post-image">
<img src="http://2.bp.blogspot.com/_MzPDIAgS1ow/SYWiiNXWgDI/AAAAAAAAJr4/rMPEwUK1HsM/s320/sngleton.jpg" width="320px" height="234px" />
</div>
<p>Недавно мне в очередной раз пришлось работать с кодом, полученным в наследство. И я, как честный преверженец <a href="http://en.wikipedia.org/wiki/Test-driven_development">TDD</a>, решил предже всего написать тесты на уже существующий класс. К своему огорчению сразу же обнаружил в коде вызов следующего вида: <code>IdGenerator.getInstance()</code>. Да, это он самый, “любимый” нами <a href="http://ru.wikipedia.org/wiki/%D0%9E%D0%B4%D0%B8%D0%BD%D0%BE%D1%87%D0%BA%D0%B0_%28%D1%88%D0%B0%D0%B1%D0%BB%D0%BE%D0%BD_%D0%BF%D1%80%D0%BE%D0%B5%D0%BA%D1%82%D0%B8%D1%80%D0%BE%D0%B2%D0%B0%D0%BD%D0%B8%D1%8F%29">синглтон</a>.</p>
<a href="/2008/12/blog-post.html">Read More »</a>
<div class="post-meta">
<div class="post-tags">
Tags:
<a href="/tags/java" rel="tag">java, </a>
<a href="/tags/mock" rel="tag">mock, </a>
<a href="/tags/pattern" rel="tag">pattern, </a>
<a href="/tags/testing" rel="tag">testing</a>
</div>
<div class="comments-link"><a href="/2008/12/blog-post.html#disqus_thread" data-disqus-identifier="/2008/12/blog-post" rel="nofollow">View Comments</a></div>
</div>
</div>
</div>
<script type="text/javascript">
var disqus_shortname = 'avityuk';
(function () {
var s = document.createElement('script'); s.async = true;
s.type = 'text/javascript';
s.src = 'http://' + disqus_shortname + '.disqus.com/count.js';
(document.getElementsByTagName('HEAD')[0] || document.getElementsByTagName('BODY')[0]).appendChild(s);
}());
</script>
</div>
<div id="sidebar">
<div id="tags">
<div id="tags-cloud">
<span style="font-size: 65%"><a href="/tags/appengine/">appengine</a></span>
<span style="font-size: 65%"><a href="/tags/bytecode/">bytecode</a></span>
<span style="font-size: 65%"><a href="/tags/compiler/">compiler</a></span>
<span style="font-size: 65%"><a href="/tags/debugging/">debugging</a></span>
<span style="font-size: 65%"><a href="/tags/error-handling/">error handling</a></span>
<span style="font-size: 65%"><a href="/tags/factory-method/">factory method</a></span>
<span style="font-size: 131%"><a href="/tags/formatting/">formatting</a></span>
<span style="font-size: 65%"><a href="/tags/generics/">generics</a></span>
<span style="font-size: 65%"><a href="/tags/google/">google</a></span>
<span style="font-size: 65%"><a href="/tags/i18n/">i18n</a></span>
<span style="font-size: 525%"><a href="/tags/java/">java</a></span>
<span style="font-size: 65%"><a href="/tags/jdbc/">jdbc</a></span>
<span style="font-size: 65%"><a href="/tags/localization/">localization</a></span>
<span style="font-size: 131%"><a href="/tags/logging/">logging</a></span>
<span style="font-size: 65%"><a href="/tags/mock/">mock</a></span>
<span style="font-size: 65%"><a href="/tags/multithreading/">multithreading</a></span>
<span style="font-size: 131%"><a href="/tags/pattern/">pattern</a></span>
<span style="font-size: 65%"><a href="/tags/performance/">performance</a></span>
<span style="font-size: 131%"><a href="/tags/reflection/">reflection</a></span>
<span style="font-size: 65%"><a href="/tags/sbt/">sbt</a></span>
<span style="font-size: 131%"><a href="/tags/scala/">scala</a></span>
<span style="font-size: 65%"><a href="/tags/testing/">testing</a></span>
<span style="font-size: 65%"><a href="/tags/web/">web</a></span>
</div>
</div>
<div id="rss">
<a class="icon-link" href="http://feeds.feedburner.com/avityuk/blog" title="Subscribe to my RSS feed"><img src="/images/rss.png"/></a>
</div>
<div id="links">
<h2>Links</h2>
<div id="links-list"></div>
<a href="/links.html">More...</a>
</div>
</div>
<div style="clear: both;"></div>
</div>
</div>
<div id="footer-wrapper">
<div id="footer">
Copyright © 2011 All Rights Reserved.
</div>
</div>
<script type="text/javascript">
(function() {
var po = document.createElement('script'); po.type = 'text/javascript'; po.async = true;
po.src = 'https://apis.google.com/js/plusone.js';
var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(po, s);
})();
</script>
</body>
</html>