Jarosław Czub

Ogólnie o programowaniu, AI, tworzeniu i nie tylko…

Month: sierpień 2012

Access to variable of another object – reflect method

When create a GUI class I’m find a problem of access to the variables in another class using a universal procedure. Here is my solution to the problem 🙂 package testexample;   import java.lang.reflect.Field;   class S3Element {   private Object obj=null; private Field fld=null; private String fieldName="";   /** * * @param obj – […]

How to add balancer in scala 2.9 and akka 2.0.2

In Akka 2.0.2 authors change a procedure to set a load balance. Example to set router: val system = ActorSystem("HarvestSystem") val router = system.actorOf(Props[SiteTestActor].withRouter(RoundRobinRouter(nrOfInstances = testSiteWorkes)))   implicit val timeout = Timeout (10 seconds)   val countUrl=index.values.size val countDownUrl = new CountDownLatch(countUrl)   var cnt=0 index.values.foreach(url =>{   Sys.info("HarvestActor::"+actorName,"Start site test "+cnt+": "+url.toString,4) cnt+=1   […]

NetBeans 7.1.2 and complie JARs to single JAR

In build.xml add new target: <target name="__package-for-store" depends="jar">         <property name="store.jar.name" value="${application.title}"/>           <property name="store.dir" value="store"/>         <property name="store.jar" value="${store.dir}/${store.jar.name}.jar"/>           <echo message="Packaging ${application.title} into a single JAR at ${store.jar}"/>           <delete dir="${store.dir}"/>         <mkdir dir="${store.dir}"/>           <jar destfile="${store.dir}/temp_final.jar" filesetmanifest="skip">             <zipgroupfileset dir="dist" includes="*.jar"/>             <zipgroupfileset dir="dist/lib" includes="*.jar"/>               <manifest> […]

© 2024 Jarosław Czub — Powered by WordPress