Circuit Negma

C++, C, VB.NET, PCB, Electronics, Circuit Design

Archive for the ‘Java’ Category

My University Java Projects

AI Communications System

Posted by Circuit Negma on May 24, 2011


Created By: Hussein Nosair

Date: 2011.05.23

This is a java application/tool that I created to use in my work.

There are a few minor bugs need to be resolved and I need to test again to make sure it is working properly before I post it online.

Posted in Java | Leave a Comment »

JTable :: Row Selection Method

Posted by Circuit Negma on April 30, 2009


Created By: Hussein Nosair

This code is not tested yet.

   1: int row = Integer.parseInt(JOptionPane.showInputDialog("Enter Row"));
   2: jTable1.setRowSelectionInterval(row, row);

Posted in Java | 1 Comment »

LCD Custom Character Creator

Posted by Circuit Negma on January 13, 2009


Created By: Hussein Nosair

Project: LCD :: Custom Character Creator

Description:

             This tool will aid the user in creating a custom character for use in projects that utilize the use of Character LCDs.

 

Download:

1. Click on one of the above pictures.

2. Right Click on the picture and save the image to your hard drive.

3. Either use a Winzip software to open the picture and extract the program or need to rename the image file name to some_thing.zip and then double click on the zip file to extract the program.

Run Program:

1. Double click on “LCD-Bit_2.jar” or “LCD-Bit_2”.

     A. If this does not work, go to START –> RUN –> type in “CMD” (without the “”), then type in the following command :

java -jar “X:\folder name\LCD-Bit_2.jar”
                                X: is the drive name, EX: C
                                location of the program, Ex: LCD-Bit_2
                                EX:            java -jar C:\LCD-Bit_2\LCD-Bit_2.jar

     B. If this does not work, then you need to download –> J2SE v 1.4.2_13  JRE [Java(TM) 2 Runtime Environment, Standard Edition 1.4.2_13] or higher and then try again.

https://sdlc6e.sun.com/ECom/EComActionServlet;jsessionid=65A1E940BCCCB55A2E1FA2802BBE5CED

Posted in Java, Microchip PIC | 1 Comment »

New Project

Posted by Circuit Negma on January 5, 2009


Created By: Hussein Nosair

Project Scope:

The project focuses on using a shared memory between 2 java programs.

stage:

Gathering Info.

 

Info:

1. http://www.velocityreviews.com/forums/t141702-shared-memory-in-java.html

(“

Is there someting which may be termed as “shared memory in java” ?
(I mean something which may connect 2 Java processes but is not a
socket ;
something like CreateFileMapping() in windows or shmget/shmat() (Unix
System V IPC) or
shm_open() (Unix Posix IPC).
Googling for “shared memory in java” in groups gave 7 results which did
not

“)

 

2. http://www.velocityreviews.com/forums/t124877-share-memory-between-c-and-java.html

(“

I have the following problem :
i want to create something similar to windows’ FileMapping.
I have an application in C that had allocated some memory buffer and
now it writes to this buffer every once in a while.
I want this buffer to be available for reading from JAVA applications,
but :
since performance is really an issue here, i don’t want to issue a jni
call
each time i want my java application needs to access the buffer, (even
if the C application can fire some kind of event)
I would like the java app. call the jni method once, get the shared
memory location and be able to treat it as a buffer as well – with
changes appearing directly as they are seen to the C program.
(For example the Java app. could spin loop on some location in the
shared memory and act as soon the value changes…)
Is there a conceptual problem to accomplish my mission ?
If not ,how can i achieve that ?
thanks in advance.

“)

 

3. http://www2.roguewave.com/support/docs/hydrasdo/xml/standard1.1-ga/html/sdoxmlug/6-4.html

“Java access to shared memory”

(“

6.4 Java Access to Shared Memory

This discussion is based on the shipped example java-interop, located in your <installdir>\tutorials\sdo directory.

This example illustrates how to access a C++ application’s data in shared memory from a Java application.

6.4.1 Procedure Overview

This tutorial illustrates how to write a class in Java that parses a DataGraph to shared memory, and pass that data back and forth between a C++ application. This includes developing a Java class that declares a native method implemented in C++.

Here is the procedure in more detail:

  1. The Java class Interop.java creates a DataObject that contains two integers, a and b. It wraps this DataObject into a DataGraph.

  2. Interop.java then calls to another Java class containing a native method calculateTotal() implemented in a C++ function. This method performs a calculation on the data. Here’s how this works:

    a.

    The Interop.calculateTotal() method calls another Java application, InteropCpp.java, which declares the native method. This class uses the JNI method loadLibrary() to access the implementation of calculateTotal() on the C++ side.

    b.

    InteropCpp.java then invokes the native method, which calls InteropCpp.cpp through its interface InteropCpp.h. This is the C++ function that contains the implementation of calculateTotal().

  3. The C++ file InteropCpp.cpp performs the calculation and passes the data back to the Java application Interop.java.

  4. Interop.java prints the changed values to illustrate the successful cross-platform data exchange.

Before discussing this particular tutorial in more detail, it may be useful to understand how to use JNI in your own applications.

“)

 

4. http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=4416624

(“

multiple JVM runtimes do not share memory between themselves

“)

 

5. http://www.artima.com/legacy/answers/Aug2001/messages/22.html

(“

1. Two different java programs running in two different user areas
needs to communicate with each other. Can there be anything like a
shared memory. There are considerations, due to which I can
not use a port or a file.

Is there a way to have a shared memory or is there a way, how I
can share an object between two java programs, which are running
in two different user areas.

“)

 

6. http://www.google.com/search?hl=en&q=sharing+memory+between+java+programs&btnG=Search

(“

Keyword search: sharing memory between java programs

“)

Posted in Java | Leave a Comment »

How to install The Java Communications API in a Windows Environment

Posted by Circuit Negma on February 7, 2007


Fix to the previous Port on :: ” How to install The Java Communications API “.
————————————————————————————-

There is a trick to install the Java Communications API correctly on a Windows system Machine. The following files are the core of JAVA Communiccation API, and they are very important to have them installed on your system for a proper operation:

  • comm.jar
  • win32com.dll
  • javax.comm.properties

For the jdk (Java Developnment Kit) to recognize the serial ports on your machine, it is important to properly place these files in the right folders on your local machine :

%Java_HOME% = the location of your jdk directory.

To Find your JDK directory, Use the Following steps:

1. Click on Start
2. Click on Search
3. Click on For Files or Folders …
4. In the Left hand Side, Click on All Files and Folders
5. Type in jdk* in the textbox under All or part of the file name:
6. Click Search
7. Look for yellow icon that looks like a folder
8. Double Clikc on the folder to open the jdk folder

comm.jar should be placed in:

    %JAVA_HOME%/lib

    %JAVA_HOME%/jre/lib/ext

win32com.dll should be placed in:

    %JAVA_HOME%/bin

    %JAVA_HOME%/jre/bin

    %windir%System32

javax.comm.properties should be placed in:

    %JAVA_HOME%/lib

    %JAVA_HOME%/jre/lib

Download Link:

coming soon

Posted in Java | 99 Comments »

How to install The Java Communications API

Posted by Circuit Negma on February 5, 2007


1. Need to download the java API to your local machine.
http://www.megaupload.com/?d=Q6LNVH8X

2. Unzip the File

3. Doublw Click on Install_javaxcomm.bat

Posted in Java | Leave a Comment »

Custom LCD Character Bit Map v1.2

Posted by Circuit Negma on January 16, 2007


Custom LCD Character Bit Map v1.2

Download Link:
—————-

http://www.megaupload.com/?d=1QXFQ7IM

Download Instructions:
————————

1. Right Click on the downloaded File.

2. Left Click on unzip. if you can not see winzip or unzip in the poped up menu. you need to download winzip.
     http://www.winzip.com

3. Double click the unziped folder.

4. double click on “LCD-Bit_2.jar” or “LCD-Bit_2”.

     A. If this does not work, go to START –> RUN –> type in “CMD” (without the “”), then type in the following command :

               java -jar “X:\folder name\LCD-Bit_2.jar”
                                X: is the drive name, EX: C
                                location of the program, Ex: LCD-Bit_2
                                EX:            java -jar C:\LCD-Bit_2\LCD-Bit_2.jar

     B. If this does not work, then you need to download –> J2SE v 1.4.2_13  JRE [Java(TM) 2 Runtime Environment, Standard Edition 1.4.2_13]

https://sdlc6e.sun.com/ECom/EComActionServlet;jsessionid=65A1E940BCCCB55A2E1FA2802BBE5CED

Posted in Electronics, Java | 5 Comments »