Sunday, April 7, 2013

ClassStalker......hot reload for any java maven app without Jrebel! Yes (save refresh like Play framework or Grails now in vanilla Java)

Credit goes to spring source and vmware. I just wrote some utility code to let any maven app have save refresh changes without full recompiles and incremental builds. And no need for Jrebel! This is much the benefit of Play! and Grails..and of course the other dynamic languages. Here is the link. Read the readme or just dump all files under bin in the root of your project and run the run.sh file https://github.com/asharif/classstalker

Sunday, March 31, 2013

bootstrap4j, ez way to start open source java web development

So when I first started Java web development I started with open source and I was completely lost.  So many frameworks so many libraries.  It took me what felt like forever to get settled.

Maven archetypes were essentially what helped me understand how to control everything and not commit 500 jars to my source code repo. Sill even with maven, getting a hello world up with all the standard frameworks was very time consuming.

I decided to make a maven archetype.  Include all the things of a standard application.  I was originally going to just publish it to the maven archetype repo but thought this might be even simpler for newbies.

https://github.com/asharif/bootstrap4j

just read the readme file, it's only two steps.  The first time it runs it will take awhile as it's downloading all the jars for the project template but after that you can get up and running with Java development in a few second.....that's right not a few days...lol

Wednesday, February 6, 2013

Image to Zebra GRF

So we use a Zebra printer at work to print thermal labels. Well I wanted to add an image to the label. Zebra makes you use a windows only all in one tool that is way too bloated for my taste. So a bit of research and I made my own to convert BMP images to GRF ascii. It's in Java and it now converts multiple different image formats. Note that the branch is still under testing since I don't have a zebra printer with me. Branch is nativeImageAPI https://github.com/asharif/img2grf

Monday, November 5, 2012

html2hamljs

New mini project. html2hamljs. It creates haml from html to use with haml-js

Friday, August 3, 2012

Detecting memory leaks in C/C++ executable or libs with vallgrind

This is an awesome tool. It tells u where and how your memory leaks happen. Don't forget to compile with the -g to get debug symbols....anyway the tool is called

Valgrind

on Ubuntu i installed using
sudo apt-get install valgrind

Invoking native C/C++ libs using python

So as a continuation of the last post http://orphanware.blogspot.com/2012/08/making-c-available-through-native-calls.html...here is what you have to do with python

This one is super ez!
from ctypes import cdll
from ctypes import c_char_p
from ctypes import c_float

lib = cdll.LoadLibrary('libmylib.so')
helloWorld = lib.MYLIB_helloWorld

helloWorld()

Invoking native C/C++ libs using ruby

So as a continuation of the last post http://orphanware.blogspot.com/2012/08/making-c-available-through-native-calls.html...here is what you have to do with ruby

install ffi. linux distros have packages.....so on ubuntu apt-get install ffi...

then here is the module code as well as sample script

module LibMylib
        extend FFI::Library
        ffi_lib "libmylib.so"
        attach_function :MYLIB_helloWorld, [], :void
end
then your script. make sure libmylib is replaced with whatever u named the module file above
require 'ffi'
require 'libmylib'

LibMylib.MYLIB_helloWorld()