<?xml version='1.0' encoding='UTF-8'?><?xml-stylesheet href="http://www.blogger.com/styles/atom.css" type="text/css"?><feed xmlns='http://www.w3.org/2005/Atom' xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/' xmlns:blogger='http://schemas.google.com/blogger/2008' xmlns:georss='http://www.georss.org/georss' xmlns:gd="http://schemas.google.com/g/2005" xmlns:thr='http://purl.org/syndication/thread/1.0'><id>tag:blogger.com,1999:blog-8682913758767466554</id><updated>2024-12-19T05:15:17.053+02:00</updated><category term="java"/><category term="microservices"/><category term="spring"/><category term="spring boot"/><category term="arduino"/><category term="facebook"/><category term="rpc"/><category term="swift"/><category term="thrift"/><category term="atmega"/><category term="atmega48"/><category term="atmega88"/><category term="docker"/><category term="dsl"/><category term="hack"/><category term="hex"/><category term="hibernate"/><category term="javaee"/><category term="jpa"/><category term="proteus"/><category term="querydsl"/><category term="tutorial"/><title type='text'>BSiDeUp&#39;s blog</title><subtitle type='html'>Articles about Groovy, Java, Docker, DevOps, Amazon etc...</subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://bsideup.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8682913758767466554/posts/default?redirect=false'/><link rel='alternate' type='text/html' href='http://bsideup.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><author><name>Sergei Egorov</name><uri>http://www.blogger.com/profile/11651628702946736301</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>6</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>25</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-8682913758767466554.post-4155751478304841775</id><published>2015-04-30T21:59:00.000+03:00</published><updated>2015-04-30T22:05:21.630+03:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="dsl"/><category scheme="http://www.blogger.com/atom/ns#" term="hibernate"/><category scheme="http://www.blogger.com/atom/ns#" term="java"/><category scheme="http://www.blogger.com/atom/ns#" term="javaee"/><category scheme="http://www.blogger.com/atom/ns#" term="jpa"/><category scheme="http://www.blogger.com/atom/ns#" term="querydsl"/><title type='text'>How to use QueryDSL with JPA, Gradle and IDEA</title><content type='html'>&lt;a href=&quot;http://www.querydsl.com/&quot; target=&quot;_blank&quot;&gt;QueryDSL&lt;/a&gt; is cool Database Query DSL for Java. I will recommend you to check it if you still don&#39;t know what is it. But there are not so much information on how to use it with Gradle. Also, it&#39;s not so clear about Intellij IDEA integration. With this article I would like to point you on &lt;b&gt;querydsl-apt&lt;/b&gt; and Java annotations processors discovery.&lt;br /&gt;
&lt;a name=&#39;more&#39;&gt;&lt;/a&gt;&lt;br /&gt;
Similar to projects like &lt;a href=&quot;http://projectlombok.org&quot; target=&quot;_blank&quot;&gt;Lombok&lt;/a&gt; since version 2.7.1 QueryDSL has support for Java annotation processors discovery: &lt;a href=&quot;https://github.com/querydsl/querydsl/issues/180&quot; target=&quot;_blank&quot;&gt;https://github.com/querydsl/querydsl/issues/180&lt;/a&gt;. It means that we don&#39;t have to configure code generation manually, javac will pick up annotation processor automagically.&lt;br /&gt;
&lt;br /&gt;
&lt;h1&gt;Gradle&lt;/h1&gt;Gradle setup is really easy. You can start with example project created by me: &lt;a href=&quot;https://github.com/bsideup/querydsl-gradle-idea/tree/10ffd70805e3a7951d4614ff4f7e27102fdad343&quot; target=&quot;_blank&quot;&gt;https://github.com/bsideup/querydsl-gradle-idea/tree/10ffd70805e3a7951d4614ff4f7e27102fdad343&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;build.gradle&lt;/b&gt; is simple:&lt;br /&gt;
&lt;br /&gt;
&lt;script src=&quot;https://gist.github.com/bsideup/9c477377cdb5a83daf7f.js&quot;&gt;&lt;/script&gt;&lt;br /&gt;
We&#39;re declaring dependency on &lt;b&gt;querydsl-apt:3.6.3&lt;/b&gt; with &lt;b&gt;jpa&lt;/b&gt; classifier. It contains Java Annotation Processor for JPA annotations like &lt;b&gt;@Entity&lt;/b&gt;. If you already have a project with QueryDSL and just want to improve your Gradle build - just remove everything related to QueryDSL code generation and just add this dependency.&lt;br /&gt;
&lt;br /&gt;
Now you can build your project:&lt;br /&gt;
&lt;br /&gt;
&lt;pre&gt;$ ./gradlew build
:compileJava
Note: Running JPAAnnotationProcessor
Note: Serializing Entity types
Note: Generating ru.trylogic.querydsl.example.QUser for [ru.trylogic.querydsl.example.User]
Note: Running JPAAnnotationProcessor
Note: Running JPAAnnotationProcessor
:processResources
:classes
:jar
:assemble
:compileTestJava UP-TO-DATE
:processTestResources UP-TO-DATE
:testClasses UP-TO-DATE
:test UP-TO-DATE
:check UP-TO-DATE
:build

BUILD SUCCESSFUL

Total time: 2.768 secs
&lt;/pre&gt;&lt;br /&gt;
There are notes about annotation processing from JPAAnnotationProcessor. It means that everything works as expected and code was generated. Easy, huh?&lt;br /&gt;
&lt;br /&gt;
&lt;h1&gt;IntelliJ IDEA&lt;/h1&gt;But we don&#39;t want to build our project with Gradle during development, we want to use build from IDEA! First, change your &lt;b&gt;build.gradle&lt;/b&gt; file:&lt;br /&gt;
&lt;br /&gt;
&lt;script src=&quot;https://gist.github.com/bsideup/a806e6b428997ddce5a6.js&quot;&gt;&lt;/script&gt;&lt;br /&gt;
Now open project in IDEA (if you didn&#39;t import project yet you can easily open &lt;b&gt;build.gradle&lt;/b&gt; file in IDEA, it will propose you to import it). For some reasons IDEA will not enable annotation processing by default when you import your Gradle project, so you need to enable it.&lt;br /&gt;
&lt;br /&gt;
&lt;ol&gt;&lt;li&gt;Go to &lt;b&gt;Preferences -&gt; Build, Execution, Deployment -&gt; Annotation Processors&lt;/b&gt;;&lt;/li&gt;
&lt;li&gt;Check &lt;b&gt;Enable annotation processing&lt;/b&gt; checkbox;&lt;/li&gt;
&lt;li&gt;In &lt;i&gt;&quot;Store generated sources relative to:&quot;&lt;/i&gt; select &lt;b&gt;Module content root&lt;/b&gt;.&lt;/li&gt;
&lt;/ol&gt;Now if you will build your project, QueryDSL will generate code for your entities and you will be able to use it like this:&lt;br /&gt;
&lt;br /&gt;
&lt;script src=&quot;https://gist.github.com/bsideup/d5de2443fc4dada5b2da.js&quot;&gt;&lt;/script&gt;&lt;br /&gt;
&lt;br /&gt;
As always, full sources can be found here: &lt;a href=&quot;http://github.com/bsideup/querydsl-gradle-idea/&quot; target=&quot;_blank&quot;&gt;http://github.com/bsideup/querydsl-gradle-idea/&lt;/a&gt;</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8682913758767466554/posts/default/4155751478304841775'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8682913758767466554/posts/default/4155751478304841775'/><link rel='alternate' type='text/html' href='http://bsideup.blogspot.com/2015/04/querydsl-with-gradle-and-idea.html' title='How to use QueryDSL with JPA, Gradle and IDEA'/><author><name>Sergei Egorov</name><uri>http://www.blogger.com/profile/11651628702946736301</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author></entry><entry><id>tag:blogger.com,1999:blog-8682913758767466554.post-7713739456493415109</id><published>2015-04-12T13:56:00.000+03:00</published><updated>2015-04-17T12:49:59.136+03:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="docker"/><category scheme="http://www.blogger.com/atom/ns#" term="java"/><category scheme="http://www.blogger.com/atom/ns#" term="microservices"/><category scheme="http://www.blogger.com/atom/ns#" term="spring"/><category scheme="http://www.blogger.com/atom/ns#" term="spring boot"/><title type='text'>Spring Boot&#39;s fat jars vs. Docker</title><content type='html'>I love Spring Boot. I really do. But I&#39;m also do love Docker. And combination of them makes me really happy &lt;strike&gt;panda&lt;/strike&gt; developer. But one of the most coolest things about Spring Boot - fat jars - anti-pattern in Docker world, where images should be layered. Can we solve this? Heck yeah!&lt;br /&gt;
&lt;a name=&#39;more&#39;&gt;&lt;/a&gt;&lt;br /&gt;
&lt;h2&gt;Preparations&lt;/h2&gt;First we need to create Spring Boot project for tests. I will use &lt;a href=&quot;http://docs.spring.io/spring-boot/docs/current-SNAPSHOT/reference/htmlsingle/#getting-started-installing-the-cli&quot; target=&quot;_blank&quot;&gt;Spring Boot CLI&lt;/a&gt; and single-Groovy-file project for this. Let&#39;s &quot;clone&quot; application from &lt;a href=&quot;https://twitter.com/rob_winch/status/364871658483351552&quot;&gt;this tweet&lt;/a&gt;:&lt;br /&gt;
&lt;br /&gt;
&lt;script src=&quot;https://gist.github.com/bsideup/486a4ab316c7bde5e9df.js&quot;&gt;&lt;/script&gt;&lt;br /&gt;
Now if you will run&lt;br /&gt;
&lt;br /&gt;
&lt;pre&gt;spring jar app.jar app.groovy&lt;/pre&gt;You will get fat &lt;b&gt;app.jar&lt;/b&gt; with your entire project. What is the size for this jar? 17Mb. Why? Because it&#39;s fat and contains whole Spring Boot stack, including Spring Framework, Groovy and even embedded Tomcat! Now we can pack it with Docker:&lt;br /&gt;
&lt;br /&gt;
&lt;script src=&quot;https://gist.github.com/bsideup/ed32b609683553781dfa.js&quot;&gt;&lt;/script&gt;&lt;br /&gt;
What&#39;s wrong with it? Let&#39;s build an image:&lt;br /&gt;
&lt;br /&gt;
&lt;pre&gt;$ docker build .
Sending build context to Docker daemon 34.87 MB
Sending build context to Docker daemon
Step 0 : FROM java:8-jre
 ---&gt; 028f36974b77
Step 1 : ADD app.jar /app/
 ---&gt; f39fac8b6c8d
Removing intermediate container d3c168bb5b09
Step 2 : CMD java -jar /app/app.jar
 ---&gt; Running in 3fbb5ba0cf4b
 ---&gt; 51d0def78e12
Removing intermediate container 3fbb5ba0cf4b
Successfully built 51d0def78e12&lt;/pre&gt;Now change message inside your &lt;b&gt;app.groovy&lt;/b&gt; file to &quot;Hello dockerized world!&quot; and pack it again with &quot;spring jar&quot; command above. If you will build your Docker image one more time than it will create a new layer the same size - 17Mb. And every time you need to change something in your project you will create a layer with all dependencies.&lt;br /&gt;
&lt;br /&gt;
&lt;h2&gt;Exploded Jar? WAT?&lt;/h2&gt;Did you know that you can explode your fat jar and still can run it? Just try yourself, it works with any Spring Boot-based fat jar:&lt;br /&gt;
&lt;br /&gt;
&lt;pre&gt;$ unzip -q app.jar -d app
$ java -cp app org.springframework.boot.loader.JarLauncher --server.port=8081
  .   ____          _            __ _ _
 /\\ / ___&#39;_ __ _ _(_)_ __  __ _ \ \ \ \
( ( )\___ | &#39;_ | &#39;_| | &#39;_ \/ _` | \ \ \ \
 \\/  ___)| |_)| | | | | || (_| |  ) ) ) )
  &#39;  |____| .__|_| |_|_| |_\__, | / / / /
 =========|_|==============|___/=/_/_/_/
 :: Spring Boot ::        (v1.2.3.RELEASE)


...

2015-04-12 13:22:44.484  INFO 6379 --- [           main] s.b.c.e.t.TomcatEmbeddedServletContainer : Tomcat started on port(s): 8081 (http)
2015-04-12 13:22:44.486  INFO 6379 --- [           main] .b.c.j.PackagedSpringApplicationLauncher : Started PackagedSpringApplicationLauncher in 2.706 seconds (JVM running for 3.078)
&lt;/pre&gt;How it can help us? Answer is inside an exploded directory:&lt;br /&gt;
&lt;br /&gt;
&lt;pre&gt;$ ls -la app
total 24
drwxr-xr-x   7 bsideup  staff   238 Apr 12 13:21 .
drwxr-xr-x   6 bsideup  staff   204 Apr 12 13:21 ..
-rw-r--r--   1 bsideup  staff    75 Apr 12 12:38 Dockerfile
drwxr-xr-x   3 bsideup  staff   102 Apr 12 12:38 META-INF
-rw-r--r--   1 bsideup  staff  5136 Apr 12 12:38 ThisWillActuallyRun.class
drwxr-xr-x  37 bsideup  staff  1258 Apr 12 12:38 lib
drwxr-xr-x   3 bsideup  staff   102 Apr 12 12:38 org
&lt;/pre&gt;Do you see this &quot;lib&quot; folder? It contains all your project dependencies. They are not changing often. So why not to cache them?&lt;br /&gt;
&lt;br /&gt;
&lt;h2&gt;Docker caching&lt;/h2&gt;How to cache something in Docker? Just &quot;ADD&quot; it before the main files. Modify your Dockerfile with this changes:&lt;br /&gt;
&lt;br /&gt;
&lt;script src=&quot;https://gist.github.com/bsideup/a87059fbf44ec5fbde72.js&quot;&gt;&lt;/script&gt;&lt;br /&gt;
And build your image:&lt;br /&gt;
&lt;br /&gt;
&lt;pre&gt;$ rm -rf app/ &amp;&amp; unzip -q app.jar -d app
$ docker build .
Sending build context to Docker daemon 34.87 MB
Sending build context to Docker daemon
Step 0 : FROM java:8-jre
 ---&gt; 028f36974b77
Step 1 : ADD app/lib/ /app/lib/
 ---&gt; 01fd4225441d
Removing intermediate container 77d555817fa8
Step 2 : ADD app /app/
 ---&gt; 846a92bd6fc3
Removing intermediate container 86b26a48efde
Step 3 : CMD java -cp /app/ org.springframework.boot.loader.JarLauncher
 ---&gt; Running in 2e677531c0e5
 ---&gt; e90f469994c7
Removing intermediate container 2e677531c0e5
Step 4 : EXPOSE 8080
 ---&gt; Running in f05d3868f6ed
 ---&gt; 526ff5ad98ae
Removing intermediate container f05d3868f6ed
Successfully built 526ff5ad98ae
&lt;/pre&gt;Now on Step 1 Docker will create a layer with your libraries and cache it until they will be changed.&lt;br /&gt;
&lt;br /&gt;
&lt;h2&gt;Not so fast&lt;/h2&gt;&lt;br /&gt;
&lt;p&gt;&lt;b&gt;UPDATE: since this fix &lt;a href=&quot;https://github.com/spring-projects/spring-boot/issues/2807&quot;&gt;https://github.com/spring-projects/spring-boot/issues/2807&lt;/a&gt; future steps are not required anymore if you&#39;re using Spring Boot 1.3.0 or newer.&lt;/b&gt;&lt;br /&gt;
&lt;/p&gt;&lt;br /&gt;
What will happen if you will run &quot;spring jar&quot; command again and then build an image? Depends on your Docker knowledge. Lets try:&lt;br /&gt;
&lt;br /&gt;
&lt;pre&gt;$ spring jar app.jar app.groovy
$ rm -rf app/ &amp;&amp; unzip -q app.jar -d app
$ docker build .
Sending build context to Docker daemon 34.87 MB
Sending build context to Docker daemon
Step 0 : FROM java:8-jre
 ---&gt; 028f36974b77
Step 1 : ADD app/lib/ /app/lib/
 ---&gt; 3270477dd01f
Removing intermediate container 08a0ab7ed4ef
Step 2 : ADD app /app/
 ---&gt; f9372f874d47
Removing intermediate container 751de4852196
Step 3 : CMD java -cp /app/ org.springframework.boot.loader.JarLauncher
 ---&gt; Running in 4954fb8d37d3
 ---&gt; e2fc978f2740
Removing intermediate container 4954fb8d37d3
Step 4 : EXPOSE 8080
 ---&gt; Running in 9f70e24d5bc0
 ---&gt; 75999f39321b
Removing intermediate container 9f70e24d5bc0
Successfully built 75999f39321b
&lt;/pre&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEihGThlqzBSOjTUzMaCJt17g8Rk47EBm51aKuMTYqGG-E6nHc26SJEJQNBylo7RWgj6Bfbx6pf5cyMbHBC-_zsJoVINCwFxb6B_0g-lc0UQQbbm6P0U5zOYx4t3pysmkgo0idPpOofBSZQ/s320/Wat8.jpg&quot; /&gt;&lt;/div&gt;&lt;br /&gt;
This was my first reaction on happened. But then I realized that timestamp for libraries was changed after packaging. Can we fix it? Yes we can!&lt;br /&gt;
&lt;br /&gt;
&lt;pre&gt;&lt;b&gt;$ find ./app/lib/ | xargs touch -t 0000000000.00&lt;/b&gt;
$ docker build .
Sending build context to Docker daemon 34.87 MB
Sending build context to Docker daemon
Step 0 : FROM java:8-jre
 ---&gt; 028f36974b77
Step 1 : ADD app/lib/ /app/lib/
 ---&gt; 8028a9ba2b7b
Removing intermediate container 52d21772824a
Step 2 : ADD app /app/
 ---&gt; 7ed806b0089f
Removing intermediate container f070b31695bf
Step 3 : CMD java -cp /app/ org.springframework.boot.loader.JarLauncher
 ---&gt; Running in 9a84ec5214ae
 ---&gt; 8fda50a60f87
Removing intermediate container 9a84ec5214ae
Step 4 : EXPOSE 8080
 ---&gt; Running in 8543d0799c68
 ---&gt; 06614c96e115
Removing intermediate container 8543d0799c68
Successfully built 06614c96e115
&lt;/pre&gt;Now every new build will use cache for libraries:&lt;br /&gt;
&lt;br /&gt;
&lt;pre&gt;$ spring jar app.jar app.groovy
$ rm -rf app/ &amp;&amp; unzip -q app.jar -d app
&lt;b&gt;$ find ./app/lib/ | xargs touch -t 0000000000.00&lt;/b&gt;
$ docker build .
Sending build context to Docker daemon 34.87 MB
Sending build context to Docker daemon
Step 0 : FROM java:8-jre
 ---&gt; 028f36974b77
&lt;b&gt;Step 1 : ADD app/lib/ /app/lib/
 ---&gt; Using cache
 ---&gt; 8028a9ba2b7b&lt;/b&gt;
Step 2 : ADD app /app/
 ---&gt; e0b404447dbe
Removing intermediate container 8952413133a9
Step 3 : CMD java -cp /app/ org.springframework.boot.loader.JarLauncher
 ---&gt; Running in 8c2e55128dc0
 ---&gt; 30f8fb7f4eba
Removing intermediate container 8c2e55128dc0
Step 4 : EXPOSE 8080
 ---&gt; Running in b08967c7a454
 ---&gt; 9e028bbfef90
Removing intermediate container b08967c7a454
Successfully built 9e028bbfef90
&lt;/pre&gt;&lt;br /&gt;
Now your services are real &lt;b&gt;micro&lt;/b&gt;services.</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8682913758767466554/posts/default/7713739456493415109'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8682913758767466554/posts/default/7713739456493415109'/><link rel='alternate' type='text/html' href='http://bsideup.blogspot.com/2015/04/spring-boots-fat-jars-vs-docker.html' title='Spring Boot&#39;s fat jars vs. Docker'/><author><name>Sergei Egorov</name><uri>http://www.blogger.com/profile/11651628702946736301</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEihGThlqzBSOjTUzMaCJt17g8Rk47EBm51aKuMTYqGG-E6nHc26SJEJQNBylo7RWgj6Bfbx6pf5cyMbHBC-_zsJoVINCwFxb6B_0g-lc0UQQbbm6P0U5zOYx4t3pysmkgo0idPpOofBSZQ/s72-c/Wat8.jpg" height="72" width="72"/></entry><entry><id>tag:blogger.com,1999:blog-8682913758767466554.post-5770665366707170141</id><published>2015-04-08T16:12:00.004+03:00</published><updated>2015-04-08T16:53:15.460+03:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="facebook"/><category scheme="http://www.blogger.com/atom/ns#" term="java"/><category scheme="http://www.blogger.com/atom/ns#" term="microservices"/><category scheme="http://www.blogger.com/atom/ns#" term="rpc"/><category scheme="http://www.blogger.com/atom/ns#" term="spring"/><category scheme="http://www.blogger.com/atom/ns#" term="spring boot"/><category scheme="http://www.blogger.com/atom/ns#" term="swift"/><category scheme="http://www.blogger.com/atom/ns#" term="thrift"/><title type='text'>Building Microservices with Spring Boot and Apache Thrift. Part 3. Asynchronous services</title><content type='html'>Have you thought about making your server asynchronous? How much time your server spent in database calls? External service calls? New shiny database library now supports asynchronous queries? It&#39;s time to processing requests in an async manner! And it&#39;s super easy with Facebook Swift!&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj3oSCA3YAeZTLeQD0wrExhLiTWo79csPjK8mYIxrKpOkDOI2dIkn0pjKe-CiV92zq18V-l36M9i6-GNCtQr5xsPSQ2ueA51sPJNDZs6PWebydPm2WTtd7Imx7mAGBNRyKNTQabjff7Ixw/s1600/async_all_the_things1.jpg&quot; /&gt;&lt;/div&gt;&lt;a name=&#39;more&#39;&gt;&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;h2&gt;Hardest part&lt;/h2&gt;How do you think, how much changes you need to do to make your Swift service asynchronous? Do you afraid of it? You already scheduled a week for this refactoring? Oh, that&#39;s nice:)&lt;br /&gt;
&lt;script src=&quot;https://gist.github.com/bsideup/15a43320c76b48753fa4.js&quot;&gt;&lt;/script&gt;&lt;br /&gt;
Now it&#39;s time to update your service implementation. Are you ready?&lt;br /&gt;
&lt;script src=&quot;https://gist.github.com/bsideup/a08c4f0b10dbacde82c9.js&quot;&gt;&lt;/script&gt;&lt;br /&gt;
Hope you noticed this ScheduledExecutorService and 2 seconds delay. You shouldn&#39;t use it in your real application, this is just for example of promises (unless you want to simulate work for future optimizations like this guy: &lt;a href=&quot;http://thedailywtf.com/articles/The-Speedup-Loop&quot; target=&quot;_blank&quot;&gt;http://thedailywtf.com/articles/The-Speedup-Loop&lt;/a&gt; )&lt;br /&gt;
&lt;br /&gt;
That&#39;s it, now your server is asynchronous. There is more - your clients can consume your service like before in non-async manner. How cool is that?&lt;br /&gt;
&lt;br /&gt;
Full source code at GitHub: &lt;a href=&quot;https://github.com/bsideup/spring-boot-swift/tree/async&quot; target=&quot;_blank&quot;&gt;https://github.com/bsideup/spring-boot-swift/tree/async&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
Previous parts:&lt;br /&gt;
&lt;ul&gt;&lt;li&gt;&lt;a href=&quot;http://java.dzone.com/articles/building-microservices-spring&quot; target=&quot;_blank&quot;&gt;Building Microservices with Spring Boot and Apache Thrift. Part 1&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://bsideup.blogspot.com/2015/04/spring-boot-thrift-part2.html&quot; target=&quot;_blank&quot;&gt;Building Microservices with Spring Boot and Apache Thrift. Part 2. Swifty services&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8682913758767466554/posts/default/5770665366707170141'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8682913758767466554/posts/default/5770665366707170141'/><link rel='alternate' type='text/html' href='http://bsideup.blogspot.com/2015/04/spring-boot-thrift-part3.html' title='Building Microservices with Spring Boot and Apache Thrift. Part 3. Asynchronous services'/><author><name>Sergei Egorov</name><uri>http://www.blogger.com/profile/11651628702946736301</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj3oSCA3YAeZTLeQD0wrExhLiTWo79csPjK8mYIxrKpOkDOI2dIkn0pjKe-CiV92zq18V-l36M9i6-GNCtQr5xsPSQ2ueA51sPJNDZs6PWebydPm2WTtd7Imx7mAGBNRyKNTQabjff7Ixw/s72-c/async_all_the_things1.jpg" height="72" width="72"/></entry><entry><id>tag:blogger.com,1999:blog-8682913758767466554.post-3703623016103932374</id><published>2015-04-07T14:14:00.001+03:00</published><updated>2015-04-07T16:19:41.194+03:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="facebook"/><category scheme="http://www.blogger.com/atom/ns#" term="java"/><category scheme="http://www.blogger.com/atom/ns#" term="microservices"/><category scheme="http://www.blogger.com/atom/ns#" term="rpc"/><category scheme="http://www.blogger.com/atom/ns#" term="spring"/><category scheme="http://www.blogger.com/atom/ns#" term="spring boot"/><category scheme="http://www.blogger.com/atom/ns#" term="swift"/><category scheme="http://www.blogger.com/atom/ns#" term="thrift"/><title type='text'>Building Microservices with Spring Boot and Apache Thrift. Part 2. Swifty services</title><content type='html'>In &lt;a href=&quot;http://java.dzone.com/articles/building-microservices-spring&quot; target=&quot;_blank&quot;&gt;previous article&lt;/a&gt; I showed you how to use pure Apache Thrift to create protocols for your services. This time I will explain how to use &lt;a href=&quot;http://github.com/facebook/swift&quot; target=&quot;_blank&quot;&gt;Facebook Swift&lt;/a&gt; (not the best name for project BTW :)) to get rid of Thrift IDL files for server code. &lt;br /&gt;
&lt;a name=&#39;more&#39;&gt;&lt;/a&gt;&lt;br /&gt;
Few words about Swift. Swift - Java annotation-based generator for Apache Thrift. It&#39;s priceless when you develop your APIs in Java and want to expose them to the other world using Apache Thrift.&lt;br /&gt;
&lt;br /&gt;
&lt;h2&gt;Protocol&lt;/h2&gt;Lets recreate our previous example ( &lt;a href=&quot;https://github.com/bsideup/spring-boot-thrift&quot; target=&quot;_blank&quot;&gt;https://github.com/bsideup/spring-boot-thrift&lt;/a&gt; ) with it. Start with simple &lt;strong&gt;build.gradle&lt;/strong&gt; file:&lt;br /&gt;
&lt;script src=&quot;https://gist.github.com/bsideup/86c952cad0c61a53db70.js?file=build.gradle&quot;&gt;&lt;/script&gt;&lt;br /&gt;
Nothing special, Spring Boot with few Facebook Swift libraries.&lt;br /&gt;
&lt;br /&gt;
Next we need to add Swift protocol classes:&lt;br /&gt;
&lt;script src=&quot;https://gist.github.com/bsideup/86c952cad0c61a53db70.js?file=TCalculatorService.java&quot;&gt;&lt;/script&gt;&lt;br /&gt;
Exception is simple Swift struct which extend Exception (See Ma no TException)&lt;br /&gt;
&lt;script src=&quot;https://gist.github.com/bsideup/86c952cad0c61a53db70.js?file=TDivisionByZeroException.java&quot;&gt;&lt;/script&gt;&lt;br /&gt;
Enums are handled with Swift, so we don&#39;t need to annotate them (but &lt;a href=&quot;https://github.com/facebook/swift/tree/master/swift-codec#enumerations&quot; target=&quot;_blank&quot;&gt;we can&lt;/a&gt;)&lt;br /&gt;
&lt;script src=&quot;https://gist.github.com/bsideup/86c952cad0c61a53db70.js?file=TOperation.java&quot;&gt;&lt;/script&gt;&lt;br /&gt;
Next - application main class for Spring Boot:&lt;br /&gt;
&lt;script src=&quot;https://gist.github.com/bsideup/86c952cad0c61a53db70.js?file=CalculatorApplication.java&quot;&gt;&lt;/script&gt;&lt;br /&gt;
&lt;h2&gt;Test&lt;/h2&gt;Now we&#39;re ready to write some tests:&lt;br /&gt;
&lt;script src=&quot;https://gist.github.com/bsideup/86c952cad0c61a53db70.js?file=CalculatorApplicationTest.java&quot;&gt;&lt;/script&gt;&lt;br /&gt;
As you can see, only difference here (compared to Thrift version) is setUp method.&lt;br /&gt;
&lt;a href=&quot;https://gist.github.com/bsideup/bccb43ef3ccfa3542f34&quot; target=&quot;_blank&quot;&gt;Diff with Thrift version&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;h2&gt;Implementation&lt;/h2&gt;We still have no Swift service implementation. Implementation of handler looks almost the same as &lt;a href=&quot;https://github.com/bsideup/spring-boot-thrift/blob/6ce23acb92227111a47ae74b24beb003a0ad64e3/calculator/app/src/main/java/com/example/calculator/handler/CalculatorServiceHandler.java&quot; target=&quot;_blank&quot;&gt;previous&lt;/a&gt;:&lt;br /&gt;
&lt;script src=&quot;https://gist.github.com/bsideup/86c952cad0c61a53db70.js?file=CalculatorServiceHandler.java&quot;&gt;&lt;/script&gt;&lt;br /&gt;
&lt;a href=&quot;https://gist.github.com/bsideup/130326357d8721b42b98&quot; target=&quot;_blank&quot;&gt;Diff with Thrift version&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
Now if you will run tests you should see all tests green.&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhBZSfh_lk7nn-J3YkHQ2dbGTxFP4G3ueQJb_jqQl_wS1TQvPONgdpW6llKB-KFPyuh_w0pc1G67Kvn43G4mqYET1kfzkNFI7FKIE6pOt4kT8owv1qG3iXu8HQVMUPCIBQKum6wgirNgu8/s1600/298365cb195aa4d5dd27e05999b7df09.png&quot; /&gt;&lt;/div&gt;&lt;br /&gt;
&lt;h2&gt;Thrift integration&lt;/h2&gt;But hey, how about other non-Java consumers of service? Don&#39;t worry, Swift comes with a tool for generating *.thrift files from annotated Java classes: &lt;a href=&quot;https://github.com/facebook/swift/tree/master/swift2thrift-generator-cli&quot;&gt;https://github.com/facebook/swift/tree/master/swift2thrift-generator-cli&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
Example output for our service will be:&lt;br /&gt;
&lt;script src=&quot;https://gist.github.com/bsideup/5c5fa178ffa5c8c8128b.js&quot;&gt;&lt;/script&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;h2&gt;Conclusion&lt;/h2&gt;Full source files for this example can be found at GitHub: &lt;a href=&quot;https://github.com/bsideup/spring-boot-swift&quot;&gt;https://github.com/bsideup/spring-boot-swift&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
Next time I will show you how to write Async Thrift services using Swift with minimal changes. Stay tuned!</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8682913758767466554/posts/default/3703623016103932374'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8682913758767466554/posts/default/3703623016103932374'/><link rel='alternate' type='text/html' href='http://bsideup.blogspot.com/2015/04/spring-boot-thrift-part2.html' title='Building Microservices with Spring Boot and Apache Thrift. Part 2. Swifty services'/><author><name>Sergei Egorov</name><uri>http://www.blogger.com/profile/11651628702946736301</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhBZSfh_lk7nn-J3YkHQ2dbGTxFP4G3ueQJb_jqQl_wS1TQvPONgdpW6llKB-KFPyuh_w0pc1G67Kvn43G4mqYET1kfzkNFI7FKIE6pOt4kT8owv1qG3iXu8HQVMUPCIBQKum6wgirNgu8/s72-c/298365cb195aa4d5dd27e05999b7df09.png" height="72" width="72"/></entry><entry><id>tag:blogger.com,1999:blog-8682913758767466554.post-4599316296122437500</id><published>2010-08-16T23:09:00.000+03:00</published><updated>2015-03-30T21:21:19.368+03:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="arduino"/><category scheme="http://www.blogger.com/atom/ns#" term="hex"/><category scheme="http://www.blogger.com/atom/ns#" term="proteus"/><category scheme="http://www.blogger.com/atom/ns#" term="tutorial"/><title type='text'>Как получить .hex из Arduino?</title><content type='html'>начиная с версии 0018, в Arduino IDE нет возможности сохранять .hex файл в папку с скетчем. Но не стоит отчаиваться - выход естественно есть)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Запускаем нашу Arduino IDE, и открываем наш &quot;любимый&quot; скетч, нажимаем Verify:&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiMtUOhHI3DTRQiI9WXfz1vazcwKhhJxYrXdHhWtYpt-Q6rysowVyvVxlVMGwh8-a_A6IAOxGBy00rB6JMS8sm0XzixDw9MwgDxUzRGnfpmadpn3Khw5u9pZ6AtMrSnxoBjqhBlBVNMFJY/s1600/Verify.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiMtUOhHI3DTRQiI9WXfz1vazcwKhhJxYrXdHhWtYpt-Q6rysowVyvVxlVMGwh8-a_A6IAOxGBy00rB6JMS8sm0XzixDw9MwgDxUzRGnfpmadpn3Khw5u9pZ6AtMrSnxoBjqhBlBVNMFJY/s320/Verify.png&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
Дальше, открываем проводник и пишем там %temp%\ и нажимаем Enter:&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgoovpRXaDbkbxKPG3yGJZ3rdDo62Oo5ubbagxTP33zueD4ZcJDs_NXtxSEA7aWyvfdfWYXzdvb8__0KLP1RbYauGxlOZi7jPi4DK2AEWlQ3dexLcmlKjU3ehhZKGRxjNyOjjj7hia8YB4/s1600/ExplorerTemp.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgoovpRXaDbkbxKPG3yGJZ3rdDo62Oo5ubbagxTP33zueD4ZcJDs_NXtxSEA7aWyvfdfWYXzdvb8__0KLP1RbYauGxlOZi7jPi4DK2AEWlQ3dexLcmlKjU3ehhZKGRxjNyOjjj7hia8YB4/s320/ExplorerTemp.png&quot; /&gt;&lt;/a&gt;&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
Находим там папки с именами buildXXXXXXXXXXXXXXX.tmp:&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhtiD6j2YI6Lh28U5w8F-p0X4VzfqPfWxIMs1uDRIQxmKm3IYW4HYhqiu998U1qbnFC3ppEJYKY5oBr1DMak3C84plMgoSqlHBan22NrQ0a52R7LwImGhNMIRaPQfCiGfVNDGx1uZxFIR8/s1600/BuildFolders.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhtiD6j2YI6Lh28U5w8F-p0X4VzfqPfWxIMs1uDRIQxmKm3IYW4HYhqiu998U1qbnFC3ppEJYKY5oBr1DMak3C84plMgoSqlHBan22NrQ0a52R7LwImGhNMIRaPQfCiGfVNDGx1uZxFIR8/s320/BuildFolders.png&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;
В каждой из этих папок будет куча файлов, нас интересует файл Blink.cpp.hex - это и есть наш скомпилированный Blink, который можно заливать на микросхему (или, скормить Proteus-у ))))&lt;br /&gt;
&lt;br /&gt;
&lt;i&gt;Примечание&lt;/i&gt;&lt;br /&gt;
&lt;i&gt;Когда вы производите изменения с исходным текстом скетча, то папка buildXXXXXXXXX.tmp очищается автоматически, и вам надо заного нажать Verify, чтобы в ней появились файлы. На самом деле, даже удобно, если сделали изменения, но не сохранили - протеус, к примеру, начинает сразу кричать вопить, мол, файла то нету, куда файл дели)&amp;nbsp;&lt;/i&gt;</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8682913758767466554/posts/default/4599316296122437500'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8682913758767466554/posts/default/4599316296122437500'/><link rel='alternate' type='text/html' href='http://bsideup.blogspot.com/2010/08/hex-arduino.html' title='Как получить .hex из Arduino?'/><author><name>Sergei Egorov</name><uri>http://www.blogger.com/profile/11651628702946736301</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiMtUOhHI3DTRQiI9WXfz1vazcwKhhJxYrXdHhWtYpt-Q6rysowVyvVxlVMGwh8-a_A6IAOxGBy00rB6JMS8sm0XzixDw9MwgDxUzRGnfpmadpn3Khw5u9pZ6AtMrSnxoBjqhBlBVNMFJY/s72-c/Verify.png" height="72" width="72"/></entry><entry><id>tag:blogger.com,1999:blog-8682913758767466554.post-8558236037992500622</id><published>2010-08-16T22:55:00.003+03:00</published><updated>2015-03-30T21:20:33.181+03:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="arduino"/><category scheme="http://www.blogger.com/atom/ns#" term="atmega"/><category scheme="http://www.blogger.com/atom/ns#" term="atmega48"/><category scheme="http://www.blogger.com/atom/ns#" term="atmega88"/><category scheme="http://www.blogger.com/atom/ns#" term="hack"/><title type='text'>Arduino на atmega48 и atmega88</title><content type='html'>Начну цикл статей с пособия, как программировать на Arduino-платформе, но в качестве микроконтроллера использовать atmega48 (да-да, это возможно). Основывается это на том факте, что различия atmega48 от atmega328 только лишь в количестве ОЗУ и ПЗУ&lt;br /&gt;
&lt;br /&gt;
На самом деле, это очень просто.&lt;br /&gt;
&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-large;&quot;&gt;Порядок действий:&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
1) откройте файл &lt;u&gt;arduino-0018/hardware/arduino/boards.txt&lt;/u&gt;&amp;nbsp;и добавьте в его конец что-то вроде этого:&lt;br /&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt;######################################################&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;div&gt;
&lt;div&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt;atmega48.name=ATMega48&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt;atmega48.upload.using=avrisp&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt;atmega48.upload.maximum_size=4094&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt;atmega48.upload.speed=38400&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt;atmega48.bootloader.low_fuses=0xE2&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt;atmega48.bootloader.high_fuses=0xDF&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt;atmega48.bootloader.extended_fuses=0xFF&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt;atmega48.bootloader.path=atmega&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt;atmega48.bootloader.file=atmega48.hex&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt;atmega48.bootloader.unlock_bits=0x3F&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt;atmega48.bootloader.lock_bits=0x0F&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt;atmega48.build.mcu=atmega48&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt;atmega48.build.f_cpu=8000000L&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt;atmega48.build.core=arduino&lt;/span&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
2) Подсоедините AVCC микроконтроллера к плюсу питания (используется для analogRead как analog reference)&lt;/div&gt;
&lt;div&gt;
3) &lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: inherit;&quot;&gt;Поставьте конденсатор примерно в 0,1мкФ между AREF и землёй&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: inherit;&quot;&gt;4) enjoy!&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: inherit;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: inherit;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: inherit;&quot;&gt;А теперь о плохом %)&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: inherit;&quot;&gt;доступно тока 4кб памяти, что накладывает сильные ограничения на размер скетча (при использовании bootloader-а - всего 2кб),&lt;/span&gt;&amp;nbsp;так что, скорей всего, грузить скетчи на плату вам придёться с помощью программатора (либо, имея под рукой другую arduino, можно прошить микроконтроллер с помощью ICSP, благо, в интернете более чем достаточно статей об этом)&lt;/div&gt;
&lt;div&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: inherit;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: inherit;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: inherit;&quot;&gt;Как получить .hex файл из скетча для заливки на МК, я описал в отдельной статье:&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: inherit;&quot;&gt;&lt;a href=&quot;http://bsideup.blogspot.com/2010/08/hex-arduino.html&quot;&gt;http://bsideup.blogspot.com/2010/08/hex-arduino.html&lt;/a&gt;&lt;/span&gt;&lt;/div&gt;
</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8682913758767466554/posts/default/8558236037992500622'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8682913758767466554/posts/default/8558236037992500622'/><link rel='alternate' type='text/html' href='http://bsideup.blogspot.com/2010/08/arduino-atmega48-atmega88.html' title='Arduino на atmega48 и atmega88'/><author><name>Sergei Egorov</name><uri>http://www.blogger.com/profile/11651628702946736301</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author></entry></feed>