How to write multilevel-recursive make file to build java files in sub-directory structure

This is a quick post showing how to write makefile which can build files recursively in sub-directories . When i wanted this info for one of my academic projects, i could not find a quick one online and had to refer to docs . So here it is….

Let me first describe the file structure. I have a parent folder called  ”dos” which consists of  2 directories ; server, client & one make file as illustrated in image below.

These sub directories contain java source code which needs to be compiled on hitting make.

The directory structure.

Recursive Make file

The idea is to have individual make files in each sub-directory which needs to be built and calling these make files from a main make file in the parent directory.

The content of  make file in parent directory is shown below. Here “server” and “client” are the sub-directories which contain the java files to be built.

.SUFFIXES: .java .class

.java.class:
	javac $<

CLASSES:
	cd server && $(MAKE)
	cd client && $(MAKE)

all: $(CLASSES) 

clean:
	cd server && rm -r *.class
	cd client && rm -r *.class

The content of make file in sub-directory is a simple make file which lists all files to be built.

 

.SUFFIXES: .java .class

.java.class:
	javac $<

CLASSES = client.class ClientThread.class Message.class Server.class

all: $(CLASSES)

clean:
	rm -f *.class

To build these files run make from parent directory. Don’t forget to add individual make files in sub-directory.



										
Posted in Programming | Leave a comment

Intro to Cloudfoundry

In the following series of posts ,lets look at how to develop some cool applications on cloudfoundry platform. I will be adding more detail to this post later on. This was just an introduction…..

[Insert introduction to cloudfoundry here]

Posted in Uncategorized | Leave a comment

Design & implementation of (totally ordered multicast) using lamport logical clocks(Synchronization)

This post deals with the various issues and design decisions  faced during implementation of synchronization between processes using Lamport Logical clocks in a distributed system.

Lamport Logical clock concept can be used implement synchronization between multiple processes ,where each process observe the changes in the same order ,regardless of the order in which the updates originated .

Below are few lines from wikipedia which gives a little background on Lamport’s logical clocks

The algorithm of Lamport timestamps is a simple algorithm used to determine the order of events in a distributed computer system. As different nodes or processes will typically not be perfectly synchronized, this algorithm is used to provide a partial ordering of events with minimal overhead, and conceptually provide a starting point for the more advanced Vector clockmethod.

Distributed algorithms such as resource synchronization often depend on some method of ordering events to function. For example, consider a system with two processes and a disk. The processes send messages to each other, and also send messages to the disk requesting access. The disk grants access in the order the messages were sent. Now, imagine process 1 sends a message to the disk asking for access to write, and then sends a message to process 2 asking it to read. Process 2 receives the message, and as a result sends its own message to the disk. Now, due to some timing delay, the disk receives both messages at the same time: how does it determine which message happened-before the other? (Ahappens-before B if one can get from A to B by a sequence of moves of two types: moving forward while remaining in the same process, and following a message from its sending to its reception.) A logical clock algorithm provides a mechanism to determine facts about the order of such events.

Read More »

Posted in Distributed Computing, Programming | Tagged , , , | 9 Comments

GWT module “XYZ” may need to be (re)compiled

I recently started working on Google Web Toolkit (GWT) and i installed the GWT plugin for eclipse.

When i “RUN” the project i was getting the “GWT module “XYZ” may need to be (re)compiled” error.

I looked up Google but did not find any satisfactory solution soon .So i thought i should make a post on this solution so others can find it soon.

Solution:

you can right click on your project, there is an option Google and select GWT Compile.

This solved my issue.

Sounds obvious isn’t it?

Happy GWTing

Posted in Uncategorized | Tagged | 2 Comments

Introduction to Android Platform for Beginners.

android-techtricks

In this post ,I am going  to share some of the interesting facts about Android platform which was discussed in an introductory session conducted by worldlink at le meridian,Bangalore.

  • Though Android platform is basically for mobile phones  it has been successfully implemented in  various other devices such as E-book Readers,Navigators and Netbooks.
  • Android runs on Dalvic Virtual Machine,which is a register based virtual machine developed by google , unlike the usual one which is stack based.
  • Android requires high-end hardware i.e a minimum of 400Mhz  processing power and 128MB RAM and efforts are made to minimize high-end hardware dependency.
  • Read More »
Posted in Android, Linux | 2 Comments

booting ubuntu from media direct and windows 7 fresh dual boot on dell xps 1330

ubuntu-910-vs-windows-7

This post tells you about how i achieved a special “dual” boot -> ubuntu from media direct button  and windows 7 from the regular power button on dell xps 1330.

In the usual installation ,one would install windows 7 first and later install ubuntu. In this usual method, GRUB 2 would be the default boot loader and upon selecting windows 7 from the option list provided by the GRUB while booting,Windows boot loader would be called.Here,if you are selecting windows 7 ,you would be loading both GRUB2 and then windows 7 boot loader as well which would increase the System boot time.

Why did i decide to boot ubuntu from media direct button?

Read More »

Posted in Uncategorized | 1 Comment

Enabling Server Side includes(SSI) on fedora core default

With Server Side Includes (SSI), you can include other HTML pages inside one web page. You can even generate some dynamic content, such as adding a “Last Modified” field on the page or printing environment variables. This section explains how to enable SSI on your Apache server.

If you are using a clean install of Apache from the Fedora Core RPM packages, SSI is not enabled by default. To begin, open /etc/httpd/conf/httpd.conf and locate this line :

<Directory "/var/www/html">

Directly under that line is a stanza describing the Options directive that immediately follows. Simply add “Includes” to the end of the Options directive like so,

    Options Indexes FollowSymLinks Includes

Next, look for this line:

AddType text/html .shtml

It should be uncommented by default. If it is commented out, simply uncomment it. That’s all ! Files with the extension .shtml are SSI files. If you wish to use an .shtml file as the default page for your website or directory, you will need to make one more change. Locate the DirectoryIndex directive and add index.shtml to it, like so :

DirectoryIndex index.html index.html.var index.shtml
Posted in Fedora, Linux | Leave a comment

Uninstalling/ Removing Fedora the easy way

This post is about Uninstalling Fedora from your Computer the Easy way.

I assume before you Dual Booted with Fedora you used Microsoft Windows XP.

i also assume the reason you installed Fedora was to help you in your college course work and reason you are uninstalling is you want to get back to your comfort zone -”win xp”. (my 2 bits :its always betterto stay out of your comfort zone to get an “edge” over your competitors).

if you are still reading this i believe you are determined to remove fedora, maybe you want to install more friendly version of linux ;) (try ubuntu)  or you want to regain your precious hard disk space.

Read More »

Posted in Linux | 1 Comment

Issues with ASP.net Development server and Windows Vista

I am just beginning to learn asp.net and ended up troubleshooting localhost issues very soon.i just built a basic asp.net webpage and try to run it (ctrl+f5). localhost was not resolved and it resulted in “page not found error” on both internet explorer and firefox.

Read More »

Posted in Programming, Web and Internet, Windows | Leave a comment

error C2668: ‘log’: ambiguous call to overloaded function

this post is about dealing with “ambiguous call to overloaded function” type of errors in microsoft visual studio 2008.you are welcome to add solutions to similar type of errors in comment section.

case 1 : use of math .h header to make use of log function

suppose the code fragment is similar to this one.

t=log((count[leaf]+1))/log((2));

here  after debugging the error you get is given below.

error C2668: ‘log’: ambiguous call to overloaded function

Read More »

Posted in Visual Studio 2008 | 3 Comments

Inside Windows 7 :what i didnt know

windows7

Windows 7 has incorporated significant improvements over microsoft windows Vista.Apart from the eye-catching UI ,multi touch support,SUPERBAR, other application makeovers and other details and improvements,there are other very cool features which draws my attention….

Some of them which interested me are listed below.

Read More »

Posted in windows 7 | 2 Comments

adsense and dreamweaver spry tabbed panels


i was designing a new site where i was planning to integrate adsense into the html pages.i had a dreamweaver spry tabbed panels inserted in the html page.as we all know adsense allows only 3 ad units per page.

where i went wrong…..

so what i thought was i’ll integrate 2 ads on html page (outside spry tabbed panels) and the 3rd one inside the spry tabbed panels,like one ad for each tab.

Read More »

Posted in Uncategorized | Leave a comment

My first C program in ubuntu 8.10 (linux).


after installing ubuntu 8.10 on pendrive as start up disk i decided to write a simple c program in ubuntu.as you might have guessed its the helloworld program.the output of the program prints a hello world on the console.

step 1: click on applications>>accessories>>text editor.  text editor window pops up.

Read More »

Posted in Uncategorized | Tagged | Leave a comment

how to code simple splash screen for your application with vb 2008


this  tutorial shows you how to code splash screen for your application with vb 2008.

things you need

  1. splash screen (an image of your choice which you like to see when you open your application)
  2. installed atleast express edition of visual studio

Read More »

Posted in Uncategorized | Tagged , | Leave a comment

8 easy steps for installing ubuntu 8.10 on dell xps 1330 (pen drive)

you can now run ubuntu 8.10 on dell xps 1330 without having to install it completely.what i am talking about is using pen drive/flash drive as startup disk and using the startup disk to boot into ubuntu.

using pen drive as startup disk has its own set of advantages

retain your old file system

you need not make changes to existing file system or the default operating system which involves partitioning hard disk;tweaking  with boot records,dealing with post installation problems  can be avoided.the chances of running into problems trying to multi boot a system are fairly high.

Read More »

Posted in ubuntu 8.10 | Tagged , , | 3 Comments

migrating from turbo c++ to visual c++ 2008

here i am giving some tips for all those who are new to visual c++ 2008 and have decided to ditch turbo c++.if you are finding it difficult to run your old turbo c programs on visual c++ compiler,here are some tips to solve those frustrating compatibility issues.

Read More »

Posted in Programming | 3 Comments

creating custom flash banners in ten easy steps (part 2)

you should cover part 1 to continue reading

creating flash animation banners (part 2)

step 1:

decide on the size of flash banner and choose the images.you can see the 3 images below and i am building a banner of size 700*200.

Read More »

Posted in Flash | Tagged , , | Leave a comment

creating custom flash banners in ten easy steps (part 1)

creating simple flash banners for your website in ten easy steps


In this flash tutorial ,i will show you how to create a simple custom flash banner for your website. Building animation banners for your website was never this easy.
you can place this flash banner in your home page and make your landing page look better or you can use these animated banners to advertise your site.
no,this is not an action script tutorial so you need not know action script to do this .
all you need is adobe flash cs3 professional and images for your banner and little interest to do some flash animation.

what kind of flash banner?

this banner contains 3-4 images which change automatically after a particular interval of time.you would have seen this type of flash banners in the homepage of  very well designed dell site.

here i will be choosing 3 images.the images just wont swap abruptly,instead they transform.
they transform from first image to second one and the next one.that leaves a soothing impression on the visitor.
As the first image fades out,second image appears and similarly as the second image fades out,third image appears.and lastly the first image reappears and the process goes on as along as the visitor stays in that webpage.

it’s easy……..

things you need

  • lots of interest and little patience to go thru this tutorial
  • adobe flash cs3 professional or other version
  • couple of images

let’s get started….

whats the plan??

{warning :   next block involves some programming funda with very crude explanation .read it at your own  risk.its not necessary.you wont loose anything if you dont understand everything. :) }

umm…m…m….m…..m this is my requirement.
i want to randomly change the 3 images,but the change should not be abrupt or sudden.it should be continuous and smooth.

so……..
for the first image ,ill apply transition for 30  frames,that is image should fade out from “bright image to disappearing effect”.
for the second image, for 30 frames  the effect should be “from out of nowhere to a slow rise”
and for another 30 frames the effect should be “bright image to disappearing effect” for the same image.

this avoids the abrupt change.

the transition for the second image should start much before the transition for first image ends.so we are starting the transition a good 20 frames earlier .
In a new layer that is before the first image ends.
similarly for the third image the transition is going to be “from out of nowhere to a slow rise” for first 30 frames and “bright image to disappearing effect” for next 30 frames.
now the first image kicks in.here the effect is gonna be “from out of nowhere to a slow rise” for 30 frames and this patched everything and we are finished.
60 frames gives an ample time for your visitors to see it slowly.you can tweak around and decide the number of frames for your banner.

rest of the tutorial covered in part2.

Posted in Flash | Tagged , , | Leave a comment

Simple USB Cleaner (updated)..

cleans your usb drive from unwanted files,trojans,viruses.


the other day i thought of developing this application just to start off with visual basic 2008.i have named it simple usb cleaner

what does it do?

it simply shows you all the files present in the usb drive ,and you decide which one should stay .that is if you find  hidden autorun files ,or unknown .exe files or any other files which you didnt store ,you can safely delete it permanently ,and it will never show up again.

Read More »

Posted in Uncategorized | Tagged , , , , , | 4 Comments

SLIPSTREAMING-INTEGRATING SATA DRIVERS INTO BOOTABLE XP CD

this tutorial shows you how to slipstream sata  drivers into xp cd. you would need it to install xp in your laptop if it comes with a sata hard disk.  slipstreaming drivers,hotfixes and  softwares,slipstreaming vista is also possible by using this simple method.

Read More »

Posted in windows xp | 38 Comments

8 Easy Steps to Run Turbo C in Windows Vista

This tutorial is about running a  turboc compiler in windows vista in full screen mode.

i know ! running decade old turbo c compiler in vista doesnt make any sense when you have much advanced compilers.but there are some cases where you have to run turboc on your vista machine,just because your university doesnt use any other advanced compiler other than your grandpa’s compiler “turbo c”.

Read More »

Posted in Programming | 77 Comments

exiting your vb.net application completely.

i had written an app in which even after pressing the exit button or close button,i could still see the process occupy some memory in task manager.

to deal with this,i googled for a while and came to know that this situation arises when some of my application components or objects are still referencing in the memory.

so i came across various forums suggesting me to close ( ) all the forms in the application.i did the same and now i dont see my app in the task manager after exiting it.

Read More »

Posted in VB 2008 | Tagged , , | 1 Comment

INSTALLING XP ON HP DV2601TX.

this tutorial is about installing xp on special edition hp dv2601tx and hp dv 2701tx.it is 100% working .

Read More »

Posted in Uncategorized | Tagged , , , , , , , , | 72 Comments

Deleting autorun.inf and other trojans in pendrive

recently i scanned my pendrive for viruses and trojans using mcafee.mcafee couldnt remove one file winnthb.exe which remained in pendrive. however i knew another method.

i started cmd.exe in vista home premium.

removed system and hidden properties of the files of the removable drive and then deleted the file. :)

click on start ,then run—type cmd and press enter.you can see command prompt pop up.

f:                           (removable drive —->flash drive or pen drive)

f:>attrib -s -h -r  (removes superhidden property so that it becomes a regular file)

f:> dir                    (to find list of files )

f>del filename.extension

that is all.file gets deleted.

i thought of building a windows application to eliminate the process of using the commands.but i am stuck at deleting few autorun.inf files. i am getting unauthorisedaccessexception error,have to figure out the way soon.

edit: got through the tough part ,want some deadly pen drive viruses now. :)

will continue….

update: my simple application is ready to download .please report any bugs if any.

Posted in Uncategorized | Tagged , , , , , | 4 Comments

CONNECTING VISTA LAPTOP TO XP DESKTOP USING ETHERNET CROSSOVER CABLE

edit: “\\Hp22\C is not accessible. You might not have permission to use this network resource. Contact the administrator of this server to find out if you have access permissions… Access is denied.”

Solved!!

please upgrade to vista service pack 1 and xp service pack 3 BEFORE TRYING THIS TUTORIAL.:)

This is a tutorial about how to network two computers ,one running vista and other  computer running xp using simple  crossover ethernet cable.this also shows how to share internet connection through crossover ethernet cable.

Read More »

Posted in Boot section, Vista | Tagged , | 76 Comments

PORTFORWARDING BSNL/DATAONE MODEM UT300R2U (OLD FIRMWARE)

Solved!! solved!! solved!!

checkout the comments here first.if you dont find it working ,then reading down here may help.

this tutorial is for ut-300r2u modems with  old firmware.

for tutorial on new firmware visit here.

i am not using the modem which is using this particular firmware.i got this method from a friend of mine who is successfully using it ,and downloading data of 2.5 gb per session. i havent tested this method on my machine.

Read More »

Posted in portforwarding | 13 Comments

How To Load A Program Automatically at Startup (thru code)

i am using dev-c++ compiler (with MinGW) lately.and i am liking it very much .

loading a program at start-up automatically ( program is loaded automatically when system starts) can be done in many ways ,however i find following two ways easier.

  • in the system Startup’s folder
  • by making some changes in registry

Read More »

Posted in Programming | Leave a comment

My experience with Dev-c++ compiler

Migrating from Turbo C to Dev- C++ Compiler

all these days i was programming using the decade old compiler turboc which is still used in many of the engineering colleges in karnataka.i was very much interested about graphics turboc could offer.here i am going to share my experience with dev c++ compiler.

ive got many recommendations for this compiler which made me to try this one.first of all its free of cost.and i hear many more advantages of this compiler which i am going to explain soon.

first i downloaded this compiler from sourceforge and installed it on my computer with default settings.all the download versions were beta versions.although i’ve heard beta versions are fairly stable i am still reluctant to use beta softwares.i am running xp sp3 on my machine.installation was very easy,just like any other software.the version i downloaded was w/o MinGW (Minimalistic GUI for Windows) .when i started dev -c++ i got a message

“There doesn’t seem to be (a) GNU make file in PATH or in Dev-C++’s BIN path. P-lease make sure you have a GNU make and adjust the Bin setting or system path enviroment variable and make setting in Compiler Option contains the correct filename, otherwise you will not be able to compile anything.”

so looked up google,got into a forum which suggested to install the version with mingw,so downloaded the version with mingw.removed old version.installed the new one.this time i dint get any error messages.

Read More »

Posted in Programming | Leave a comment

PORTFORWARDING BSNL /DATAONE UT300R2U MODEM

why portforwarding ?

portforwarding enables you to get better torrent speeds. although the torrent speed depends upon number of seeders and leechers, portforwarding plays a main role in getting high torrent speeds!. experience download speed at maximum speed after portforwarding your modem!!

for old firmware visit here.

how to portforward your bsnl/dataone ut300r2u modem?

Read More »

Posted in portforwarding | Tagged , , , , , , , | 90 Comments