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