GroovyDynamicElementReader is Missing Import Spring Framework Source to Eclipse STS

Sometime for some reasons when dealing with open source technology we have interest to download the full source code of the frameworks we use. Either for customization, extending them or just for having a look to have more knowledge how exactly they work.

Spring is a popular framework in Java world. It’s one of my favorite framework in Java. At the time of this blog post, I have just grabbed the source of it from github repository. The source code is fantastic. Nice coding style, project structure, build tool and of course its documentations. While following the guidance to build and import to Spring Tool Suite, I got an error on spring-beans-groovy project in GroovyBeanDefinitionReader.java. Navigating to the errors, STS seems try to find a class GroovyDynamicElementReader but not found.

Honestly I have no any experience with groovy before. When I try to drill through spring-beans-groovy/src/main/groovy/org/springframework/beans/factory/groovy, finally get a clue GroovyDynamicElementReader.groovy.

Installing Groovy Eclipse seems solve the problem.

In case you have the same problem as what I got, just ensure you have Groovy Eclipse on your eclipse base IDE.

Reference

  1. https://github.com/groovy/groovy-eclipse/wiki
  2. http://blog.csdn.net/zlx510tsde/article/details/46241675

Math in Web

There are several frameworks that can be used to display math equation on web page. Usually math equestion written in LaTeX format. LaTeX is used for the communication and publication of scientific documents in many fields, including mathematics, physics, computer science, statistics etc.

MathJax and KaTeX are two popular javascript frameworks that can render LaTeX expression to beautiful math equation in browser.

The following are examples math LaTeX expression rendered with KaTeX. To use KaTeX we just need to include katex.min.css and katex.min.js

<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/KaTeX/0.5.1/katex.min.css"/>
<script src="https://cdnjs.cloudflare.com/ajax/libs/KaTeX/0.5.1/katex.min.js"></script>

<div>
<p><span class="katex" id="eq1"></span></p>
<p><span class="katex" id="eq2"></span></p>
<p><span class="katex" id="eq3"></span></p>
<p><span class="katex" id="eq4"></span></p>
<p><span class="katex" id="eq5"></span></p>
<p><span class="katex" id="eq6"></span></p>
<p><span class="katex" id="eq7"></span></p>
</div>

// KaTeX sample
katex.render("c = \\pm\\sqrt{a^2 + b^2}", eq1);
katex.render("f(a,b,c) = (a^2+b^2+c^2)^3", eq2);

katex.render("\\int u \\frac{dv}{dx}\\,dx=uv-\\int \\frac{du}{dx}v\\,dx", eq3);

katex.render("f(x) = \\int_{-\\infty}^\\infty \\hat f(\\xi)\\,e^{2 \\pi i \\xi x}", eq4);
katex.render("\\oint \\vec{F} \\cdot d\\vec{s}=0", eq5);

katex.render("\\left( \\sum_{k=1}^n a_k b_k \\right)^2 \\leq \\left( \\sum_{k=1}^n a_k^2 \\right) \\left( \\sum_{k=1}^n b_k^2 \\right)", eq6);

The comparison between MathJax and KaTeX can be found here. At the time of writing this blog post, I got KaTeX is faster than MathJax. But KaTeX can not render a few expressions that MathJax can.

The comparison results could be changed in the next. Since both of them are actively developed.

Create iOS ipa for In-House Distribution

Couple of month ago in the era of iphone 6, the company I work for was officially migrate official mobile device from BlackBerry to iphone 6. By the time of migration, development team also got initiative request from users to create an app for android. On the other hand, we also want to anticipate another request for ios platform. To simplify the porting to another platform, we use HTML5, Kendo UI</a> and Apache Cordova to build the app. The app just consumes data from REST services. The other requirement is the app will not be published to App Store. We have internal mobile device management (MDM) called MobileIron</a>.

In this post, I will not write about how to build the app with Apache Cordova, I just want to focus on how to create ipa distribution package for in house enterprise distribution. The steps should be the same for app that is created with native. I also will not discuss about how to deploy to MDM.

The first requirement is we have to be a member of iOS Developer Enterprise Program which costs $299. The steps how to register is clearly explained in apple developer site.

At the time of write this post, my development environment :

  1. OS X El Capitan (10.11.3)
  2. Xcode (7.2)
  3. iphone 6 (iOS 9.2)

Before we start create ipa package, ensure our code runs well as expected on iphone simulator.

The steps of creating ipa package for distribution basically similar to deploying to real device for development as explained on my previous post. In this post, I will only capture the things that are difference between them.

Certificate

While creating certificate preparation in Apple Developer portal, showed its slightly difference from my previous post

In this case, I choose In-House and Ad Hoc distribution option instead of iOS App Development, since we plan to create ipa package for In House distribution. If we notice upon the above screenshot, in the Production section has option for In-House and Ad Hoc distribution. Meanwhile on my previous post has App Store and Ad Hoc. The difference because of the apple id I used on this post is enrolled as an iOS Developer Enterprise Program, and on my previous post uses Individual Apple Developer Program. The detail difference between them and other developer license schema can found here.

The rest of preparing certificate installation for production is the same as certificate installation for development.

App IDs

The step of registering app Bundle ID is the same as the previous post. If we already registered for development, we should not do it again.

Provisioning Profiles

Creating provisioning also similar to the creation Provisioning for Development. Except at the wizard option we need to choose one of in the Distribution group instead of Development group. In this sample I select In House, since the ipa package we created will be deployed via MDM.

The next step is opening Xcode and add apple id via Xcode Proferences > Accounts as I did on previous post. Now we should get the similar picture as follow.

Ensure distribution profile already downloaded. If not we can click download button on the list above of picture.

The next thing is opening iOS project with Xcode and ensuring we select Distribution Profile we installed on Code signing section group both on Project and Target.

The next step is select Product menu > Archive, then follow the wizard.

When the wizard finish, by default Xcode will create ipa package for us on desktop.

That’s all my share and thanks for reading :)

Deploying iOS app to Real Device

While developing ios app, sometime we don’t just testing run the app on ios simulator we also need to test the app on real device though.

The are couple of things that we need to prepare to make our app be able to run on real devices.

Certificate

Development certificate basically tells us that we are apple developers. To be it, our apple id has to be enrolled as an apple developer. Information about apple developer enrollment can be found at Apple Developer site.

Once our apple id enrolled as an apple developer, there are couple of steps for preparing development certificate. App need to be signed to be able to deployed to real devices. To do that:

  1. Go to Launchpad or Spotlight Search, type Keychain Access then open the app.
  2. At top menu, click Keychain Access > Certificate Assistance > Request a Certificate from a Certificate Authority Fill the Email and Common Name. The email should be apple id email then select save to disk and checked Let me specify key pair information. When we click continue, we should get save dialog Select Key Size 2048 bits and RSA algorithm, click continue then done. The certificate request that we create just saved to disk (desktop in my case).
  3. Open apple developer portal, login using apple id that already enrolled as apple developer. click Certificates, Identifiers and Profiles
  4. Select Sertificates group > All On the right pane, select add (+) button, select type of certificate that we want to create. At this post we will create for development only. Not for production such as for deploy our app in app store nor internal store (in-house) like mobile device management. If everything already done on this page, scroll down > click continue We may notice a information message that we have to ensure on our OS X development machine keychain installed Worldwide Developer Relations Certificate Authority
  5. Follow the wizard, till we're asked to upload our certificate request that we already created on previous step.
  6. After completed the wizard, we should be able to download the generated certificate and ready to install on development machine.
  7. Download the development certificate > double click. The certificate should be installed on our Keychain Access NOTE : Please ignore the distribution certificate on my screenshot. It just another certificate for distribution which is out of scope of this post.
More …

From WordPress to Octopress

I have just migrated my blog engine from WordPress to Octopress. After exploring (googling) for hours about it, how to install, customize, hosting etc, finally I got a decision :

Ok I will migrate my blog to Octopress.

Octopress is a framework designed for Jekyll, the static blogging engine powering Github Pages. In this post, I will not write detail about Octopress. Many complete articles out there available to be as reference.

The reasons that make me interest in Octopress are :

  1. No database needed
  2. Hosting does not have to have php support
  3. Using Markdown
  4. Having nice project structure, very intuitive to customize it. Just need html, would be better if have ruby knowledge but not have to
  5. Supported by github, so can use terminal to post articles
  6. Many plugin support
  7. Can use any simple text editor like Atom, Sublime, Notepad++ or even Vim etc

I plan will not maintain http://www.neutrofoton.com anymore. Even though at the time of this blog post the site is still accessible and maybe some articles visible on google search. In case the links are broken, please kindly find the related articles on https://neutrofoton.github.io

The last, I would say thank you very much to WordPress for had been my platform writing blog, and welcome Octopress for being the new one :)