Wednesday, January 21, 2015

New eclipse add tomcat

Hai all,


Just  a few points to add Tomcat 7.0 to new Eclipse

( Eclipse Java EE IDE for Web Developers.

  Version: Luna Service Release 1 (4.4.1) )

1. Window -->Preferences->Server--> Runtime Environment
2. Add BUTTON--->Apache Tomcat v7.0
3. Browse path to Tomcat Installation Folder (Usually C:\Program Files\Apache Software Foundation\Tomcat 7.0)
4. Press 'Finish' Button


Second set of steps

1. Window --> Show View ---> Servers
2. You will see Servers tab.  If tomcat 7.0 is not present, Right click in empty area inside Servers tab.
3. New--> Server --->Apache Tomcat v7.0 ---> Finish

Enjoy :)

Tuesday, April 15, 2014

MTURK : Oscar Smith -Card Image not loading


The reason behind this problem is -Parts of the page may not display when Chrome blocks the insecure content. The URL in the address bar will show https crossed out to indicate that the page is not fully secure.

Ref: https://support.google.com/chrome/answer/1342714?hl=en


On Windows  for Chrome Browser issue can be solved by following steps:

1. Right click on your Chrome icon.

2. Choose properties

3. At the end of your target line add the command line flag. For example --allow-running-insecure-content

4. With that example flag, it should look like chrome.exe --allow-running-insecure-content

5. Remember to quit the app completely and restart for flags to take effect.

Reference links:

Ref 1. www.chromium.org/developers/how-tos/run-chromium-with-flags

Ref 2. http://peter.sh/experiments/chromium-command-line-switches/

Try this,  but this is an unsafe method -not recommended by chrome


ON MOZILA FIREFOX, this can be solved by following steps:

1. Type in your address bar aboutconfig

2. Search for mixed

3. Right click to toggle the security.mixed_content.block_active_content option so that it says false.

The HIT display problem is solved by changing the above settings. But still unable to selectcrop company name or logo for many cards.

Ref: http://mturkforum.com/showthread.php?10292-problems-in-working-with-oscar-smith-hits-business-card-entry




Tuesday, September 24, 2013

Create jar file using all files in bin folder of eclipse

1.Open Command prompt
2. Go to C:\Eclipse projectworkspace\project\bin\ > jar -cvf  YourJarFilename.jar *

Thursday, February 14, 2013

Why malloc not recommended in Nesc



Just summarizing my google search.   Can malloc be used in Nesc programs?
THANKS TO TINYOS FORUM MEMBERS

Ans : Yes, program will run. But not at all recommended.

Ref: 1. http://mail.millennium.berkeley.edu/pipermail/tinyos-help/2005-February/007712.html
2. http://www.mail-archive.com/tinyos-help@millennium.berkeley.edu/msg19840.html





From Ref:1

> When i used malloc, it sometimes gives me a pointer at the 
> adress:0x29DB,
> which is , i think, not normal because this pointer goes to the 
> external SRAM
> (which is not present  on my cricket platform). So any write at this 
> adresse
> has no effect on further read...



The TinyOS programming methodology frowns on malloc, for several 
reasons:

1) No memory protection so you can smash your stack
2) Unforeseen rate mismatches can cause you to do 1 (you start 
receiving packets faster than you can forward them)
3) Event-driven execution models can make free()ing a hard thing to do 
right (hence pool allocations, etc.)

If you want dynamic allocation, look at TinyAlloc . It allows you to allocate a static chunk of RAM which you then parcel out dynamically. But using it in the presence of conflicting components is a recipe for disaster. Systems such as TinyDB 
get away with it because all their parts are designed to work together.

Wednesday, December 26, 2012

java.util.ConcurrentModificationException False belief

Dear all,


I faced the exception

java.util.ConcurrentModificationException

Immediately I started thinking ..., since two different functions{A() and B()} are executing parallel, some critical section variable might be accessed at the same time by both functions A() and B().

So to solve the issue, I used java function 'synchronized() {  } ' blocks inside both the functions A() and B().  But surprisingly the error was not solved.

Thanks to the link

http://stackoverflow.com/questions/8189466/java-util-concurrentmodificationexception

which told me that, the concurrent exception happens because of the Iterator I used in one of the function A().

Consider the program

 ------------------------------------------------------------------------------

set= myhashmap.entrySet();

i=set.Iterator();

while (i.hasNext())

      {

       myhashmap.remove(datanode);//This causes problem

        }

  --------------------------------------------------------------------------------------------------

 

'i' has already Iterator set values and pointers/ memory locations assigned to it.  But when you remove an item from hashmap, the 'i' is not getting updated(i =set.Iterator() is not called inside while).  So when while(i.hasNext () ) is checking for datanode location, it finds that somebody else has already removed/modified the data in that location.  So it thinks that Some body(some other program) is accessing the memory(critical section) alloted to it.  Hence shouts ConcurrentModificationException

Tuesday, June 26, 2012

Simple DLL for visual basic 2010 calculator

Steps to make a DLL Calculator

CREATING A DLL

Prerequist: Visual Studio 2010.
1. Open Visual Studio 2010
2. New Project--->  VC++---->MFC DLL
3. Give name to your dll project say "dllsampleadd"
4. OK creates new project
5. Delete all contents in dllsampleadd.cpp
6. Add the following contents:

#include "stdafx.h"
int _stdcall sum(int x , int y)
{
return x+y;
}


7. Open file dllsampleadd.def
8. Update the contents of dllsampleadd.def to

LIBRARY DLLSAMPLEADD

EXPORTS
sum @1








9. Build ---> Build Solution
10. You can see the DLL file 'dllsampleadd.dll' getting created at the Debug folder of your project

 VISUAL BASIC APPLICATION


1. File ---> NewProject --->  Other languages---> Visual Basic--->Windows Forms Application
2. Give name to your dll project say "add"
3. Drag and drop buttons and labels as shown in screenshot
 4. Double click on add button.
5. Make necessary changes to the code associated with add button as given below:

Private Declare Function sum Lib "C:\Users\hari\Documents\Visual Studio 2010\Projects\dllsampleadd\Debug\dllsampleadd.dll" (ByVal x As Int32, ByVal y As Int32) As Int32
    Private Sub Button1_Click() Handles Button1.Click
        Label4.Text = Str(sum(CInt(TextBox1.Text), CInt(TextBox2.Text)))
    End Sub


6. Run your program( Debug---->Start Debugging)
7. Make necessary changes to your dll program and VB program for adding subract, divide, multiply functions to the calculator.

Tuesday, May 15, 2012

TinyOS : problem in installing cygwin


SITUTATION :Running following command in Cygwin
                rpm -Uvh --ignoreos nesc-1.2.8a-1.cygwin.i386.rpm

Error :" unpacking of archive failed on file usr cpio: chmod failed permission denied"

SOLUTION: Right click Cywin start up file---> Run as administrator

Tuesday, December 20, 2011

Printing Malayalam as C program output at dos prompt, win32

Hai all,

I think we cannot print Malayalam letters in dos prompt. If any body gets a solution, please let me know.

I was just trying to print the malayalam letters using a C Program in windows. I used Visual Studio 2010 to run my  C++ program. Following is program:

Use header files like windows.h, conio.h, tchar.h etc

int _tmain(int argc, _TCHAR* argv[])
{
    TCHAR c;
    SetConsoleOutputCP(863);
    printf("\nHello SDL User!\n");
    printf ("The codepage is %d\n", GetConsoleOutputCP());
    for(c= 3333;c<3455;c++)
    {
              _tprintf(TEXT("%lc\n"),c);
    }
    getch();
    return 0;
}

c= 3333 is the decimal value  of UNICODE for first malayalam letter 'അ'  (0x0D05-hex value).
Ref: http://www.malayalamunicode.com/malayalam-unicode-fonts

But the output was
?
?
?
.
.
.
Why this is because the DOS supports only a few languages whose list can be seen by checking the codepages supported by DOS in following link.
Ref 1: http://en.wikipedia.org/wiki/Category:DOS_code_pages

For Malayalam to be displayed DOS must support code page
57009x-iscii-maISCII Malayalam
 This code page is not supported by DOS as listed in above reference.
Ref 2:http://msdn.microsoft.com/en-us/library/windows/desktop/dd317756%28v=vs.85%29.aspx

So Sad that unless DOS provides a support for this, we cannot print a malayalam letter in DOS

WIN32 program to print my name in Malayalam --MessageBox
-------------------------------------------------------------
This works for windows 7, but not working in XP
Create new project in visual studio 2010.
File-->New-->Project-->Win32 Project
Name the project
click OK
Finish

include header files stdafx.h, tchar.h.

int WINAPI WinMain(HINSTANCE hInstance,HINSTANCE hPrevInstance, PSTR szCommandline,int iCmdshow)
{
    TCHAR c[4];
    c[0]=3385;
    c[1]=3376;
    c[2]=3391;
    c[3]='\0';
    TCHAR szbuffer[100];
   
    _stprintf(szbuffer,_T("%ls"),c);
    MessageBox(NULL,szbuffer,TEXT("HELLO ALL"),0);
    return 0;
}


Please ensure that , Configuration Properties--->Character set---> Use Unicode Character Set option is selected.




Monday, December 19, 2011

BARE FOOTED GIRL

Bare footed , bare footed , bare footed girl
I just followed her all in the world.

Walking through the sea beach,
I found her footprints in sand.
That made me, follow her,
footprints on the sand.

Long in horizon,
Sun was watching me grant.
I feared somebody,
laughing loud like a band.

Still I followed her, followed her,
followed her footprints.
Droping from her legs,
sand into the sand.

I imagined the particles,
the sand particles,
dropping from her white legs,
droping into sand peg holes.

barefooted barefooted she walk alone,
Searching for somebody all the alone.

Never was she found,
Alone in the ground.
Along the ground.
And never in the crowd.

Followed the footprints,
I walked faster and there was an old man walking far
Bare footed , bare footed , barefooted
Oh, Thats not my barefooted girl...

Monday, October 25, 2010

Visual Stiudio 2008 bug

1>LINK : fatal error LNK1000: Internal error during IncrBuildImage
1> Version 9.00.21022.08
1> ExceptionCode = C0000005
1> ExceptionFlags = 00000000
1> ExceptionAddress = 012EFCF7 (01270000) "C:\Program Files\Microsoft Visual Studio 9.0\VC\bin\link.exe"
1> NumberParameters = 00000002
1> ExceptionInformation[ 0] = 00000000
1> ExceptionInformation[ 1] = 00DFD670
1>CONTEXT:
1> Eax = 400548EC Esp = 002AEDB4
1> Ebx = 40008150 Ebp = 002AEDDC
1> Ecx = 00DFD670 Esi = 40054780
1> Edx = 002AEDCC Edi = 0127D6C0
1> Eip = 012EFCF7 EFlags = 00010246
1> SegCs = 0000001B SegDs = 00000023
1> SegSs = 00000023 SegEs = 00000023
1> SegFs = 0000003B SegGs = 00000000
1> Dr0 = 00000000 Dr3 = 00000000
1> Dr1 = 00000000 Dr6 = 00000000
1> Dr2 = 00000000 Dr7 = 00000000





solution: Install hotfix @
http://code.msdn.microsoft.com/KB948127/Release/ProjectReleases.aspx?ReleaseId=871

Thursday, August 5, 2010

COCONUT TREE CLIMBER

A HOBBY PROJECT
Abstract: Attempt to design a coconut tree climber machine. Description: Main Components : BELT1, BELT2, BELT3, Robotic Arm, Leaf Cutter, Pipe Pairs X , Pipe Pairs Y

{Fig.1 .Skelton of Coconut Climber}






1.Working

{Fig.2}

The system works in two phases:

Climbing phase
Climbing phase does the climbing of the coconut tree. As shown in Fig .1, the machine has 3 belts. The user intialy has to place the machine at the bottom of coconut tree and tie the belts across the tree in a loosely manner.

Stage 1:When user press the Climbing phase switch belt 2 and Belt 3 tightens and machine's pipe pair X is tied tightly to the tree. The microcontroller orders the machine to start up motor M and it
{ Fig.3}
makes the pipe Y to be lifted up as shown in Fig.4. As the pipe Y
lifted to it maximum the belt 1 is tightened.


Stage 2:As a next step belt1 is tightened, belt 2 and 3 are made loose. The motor N's blade wheels are connected to two pulleys, which initially is wound with two seperate plastic strings, whose one end attached to Motor M and pipe X, the other end tied at fixture of motor N. Now when motor N rotates, the strings are wound over the pulleys and it lifts motor M and pipe pairs X (Fig. 4)
{Fig.4}
As stage 1 and stage 2 repeats the machine climbs the coconut tree. To handle the bends of the coconut tree the pipe X pair and pipe Y pair joining points can be made tiltable as shown in Fig. 5

Between the two motors is fixed the battery to run the two motors. Also the programmed microcontroller board placed to control the ON and OFF states of motors M and N. The Wi-Fi module board is also designed to place near microcontroller board,which accepts the data from the camera and sends to the user at the ground. {Fig.5}

The belts 1,2 and 3 are wound to three platic rods(p1,p2,p3) respectively at one end and other end tied in a fixed rod. As p1 rotates the belt 1 gets winded over p1, the belt1 becomes shorter and thus tighter tied to the coconut tree. To loosen the belt 1 the rod p1 is rotated in reverse direction. Similarly we use p2 and p3 rods to adjust the belts 2 and 3 respectively.

Reaping phase

The reaping phase is handled by the user controlling the coconut climbing machine. There are four micro cameras placed in the machine. Two cameras(C2 & C3) are placed at the top portion of the pipe pair Y. The other two cameras are placed at the Robotic Arm and Leaf Cutter modules of the Coconut

2.2.1.Robotic Arm
{Fig.6}
The Robotic Arm is designed to reap the coconut. It can be controlled by the user looking at the video communicated through network. There will one camera(C1) at the arm of the robotic arm module.

The Robotic arm has four type of joints as shown in Fig.6
Joint 1(J1): The joint 1 is designed to rotate 180 °
Joint 2(J2): The joint 2 is designed to rotate 360°.
Joint 3(J3): The joint 3 is desined so that it can rotate on its on axis 360°.
Joint 4(J4): It is a folder for the figures of robotic arm, it can rotate up to 60°.
2.2.2.Leaf cutter
The Leaf Cutter is designed to cut leafs of the coconut tree. Like robotic arm, it can also be controlled by the user looking at the video communicated through Wi-Fi network. There will one camera(C4) at the arm of the robotic arm module.
The Leaf Cutter has three type of joints as shown in Fig.7{Fig .7}
Joint 1(LJ1): The joint 1 is designed to rotate 180 °
Joint 2(LJ2): The joint 2 is designed to rotate 360°.
Joint 3(LJ3): The joint 3 is designed so that it can rotate on its on axis 360°.
Working of Leaf Cutter : The Leaf Cutter has a saw blade arm which can rotate the blades and cut the coconut leaf truncks as shown in Fig.7. User can place the saw near the coconut leaf trunck by controlling the movements at LJ1 and LJ2. Once the arm is properly placed touching the coconut leaf trunk, the user can select the leaf-cut button for starting the saw rotate. As soon as the cut-stop button in Leaf Cutter module is pressed the saw stops rotating and is place back in its initial position
The machine will climb down only when both Robotic Arm and Leaf Cutter are in Intial Position and CLD switch in remote is pressed.
The rotation at the all joints J1...J3 and LJ1...LJ3 is handled by the motor N. The chains from wheel blades of motor N is connected to wheel blades at the joints. Just like gear change in vechicle the chains fall in different wheel blades for each joints which is controlled via the joint selection mechanism in the users remote. The chains and wheel blades are present inside the internal body of mechanical hands of Robotic Arm and Leaf Cutter as shown in Fig.6.

Limitations :
1.Too Many wheels and chains reduce efficiency
2.High Cost
3.I used battery to run motors, but is it sufficient or power from ground is possible-(have to work out)
4.Lack of domain knowledge as I am a computer science engineer.

Conclusion:

This design is not a complete design in terms of efficiency and cost factors. I just want 2 share my thoughts to u. I am working on better designs...

That s all about my hobby project.

Monday, June 1, 2009

My thoughts....

  • An Engineer must be close to layman so that he can know the needs of a layman and design to satisfy the needs of the layman.
  • You can criticize an attitude, a behaviour, a book, a sentence or any thing..... But never criticize a person because everybody can be right in one or another manner.
  • Always try to learn and improve at your weak point because who knows one day it will become your strong point.

Tuesday, April 28, 2009

http server

Http server in windows
--->Go to httpd.apache.org

--->Download ---
Win32 Binary including OpenSSL 0.9.8i (MSI Installer): apache_2.2.11-win32-x86-openssl-0.9.8i.msi for windows


----> Open x:\Program Files\Apache Software Foundation\Apache2.2\htdocs has index.html

---> Add html files to be deployed inside this


Set path in windows command prompt

>path //will give you current path.

>set path=%PATH%;C:\Program Files\Java\jdk1.5.0_14\bin //This will set path to jdk bin...

To create a jar file

>jar cf jar-file input-file(s)            //where 'jar-file' is the name of the jar
file to be created


To make terminal's default path to our wish

open file ./bashrc in /root and add the command for change directory to
specify where u want to open terminal by default.

ie
>vim .bashrc
In the topmost portion of file add
-->cd /
-->cd media/disk-1/
now save the file and quit.
Close the terminal and open it again. Check the current path using pwd
>pwd
You will see current path as /media/disk-2

To create a stub class

rmic generates stubs, skeletons, ties for
remote objects using either the JRMP or IIOP protocols.

rmic [ options ] package-qualified-class-name(s)

Wednesday, July 4, 2007

MY FIRST BLOG......




  • Wishes happiness across the world.
  • Wishes crores in the world in hunger get food
  • And spread peace across world...




HARI