baaru so

Greenhorn
+ Follow
since Apr 02, 2008
Merit badge: grant badges
For More
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
0
Received in last 30 days
0
Total given
0
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by baaru so

hello

i am trying to get a responce from a button such that it redirects to a page

does response.sendRedirect work it says to create class for me
do we need to import any package for that
14 years ago
JSF
hie

im totally confused how to connect to the ontology using the jsf pages

i.e., on a button click it should search for the ontology given and respond to the result

can any one explain me hte process and the sample code to do that.

thanking you in advance
14 years ago
JSF
a1 is of type Cell
and i want to parse the values of a1 to some array a of type integer and do sorting cal mx and min values

i initialized the array cell a1 to null first
actually if i wont use array there i get the result

but when i make array then i get null exception
i have checked it first initializing sheet to null and cell to null
the line
a1[i]= sheet.getCell(6,i);


is giving null exception
ya now i get the values out


but is there a way to store the values which are retrieved from excel sheet into an array
so that i can sort them

when i try to bring an array on

it says :::::::: Exception in thread "main" java.lang.NullPointerException


i used this part for it

Cell a1[]=null;
try
{
workbook=jxl.Workbook.getWorkbook(f);
for(int i=0;i<30;i++){
sheet=workbook.getSheet(0);
a1[i]= sheet.getCell(6,i);
System.out.println(a1[i].getContents());

}
workbook.close();
}catch(IOException ex){

and if i wont initialize the array i get an error saying not initialized.....

what can i do now
yea i even tried it with POI package and now i get another exception saying

::::: java.io.IOException: Invalid header signature; read 1688935826934608, expected -2226271756974174256



oh im sorry i forgot to mention it

the excel file i am trying to load is of about 26 mb with over 3lakh lines and it raises the exception to load that file
i thought i mentioned it

i get ::::: jxl.read.biff.BiffException: Unable to recognize OLE stream exception when i run the code


hmm yea i have seen those files and tried to get the result from it but my case is different i am not creating the excel file now

i have the file and i need to retrive the columns of the file and find the average of the particular column
could it be done
can any one tell me how to code in java so that i can access the excel sheet and do manipulations in the specific column

say if i have to read the data from the column 7 in excel sheet and find the average of the 7th column
is that possible to do

please help me
hiee

can any one tell me how to analyze the packet size distribution of a packet trace which we got from a publicly available network using java and any other language for visualization i have the packet size distribution but im little bit confused how to do the distribution process
MAIN CRITERIA IS TO FIND THE

The empirical probability THAT IS

(frequency of the packet)/(total number of packets)

i.e., (the number of packets of that size)/(total number of packets)

DOES ANY ONE HAVE ANY IDEA REGARDING THIS ONE

here i have the perl code for converting the data in to ascii format


#! /usr/local/bin/perl

# input file format:
#
# 512 byte header
# 17408*60 bytes data
# 512 byte header
# 17408*60 bytes data
# . . . .
#
# bytes 2/3 in the headers contain the usable cell count for the data portion
# bytes 4/5 contain the interface number for the data portion
#
# for the data part:
#
# 0 1 2 3
# 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
# +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
#0 | clockstamp | Header
# +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
#1 | clockstamp | FIFO depth |
# +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
#2 | ATM header |
# +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
#3 | LLC/SNAP |
# +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
#4 | LLC/SNAP |
# +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
#5 |Version| IHL |Type of Service| Total Length | IP
# +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
#6 | Identification |Flags| Fragment Offset |
# +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
#7 | Time to Live | Protocol | Header Checksum |
# +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
#8 | Source Address |
# +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
#9 | Destination Address |
# +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
#
# option(s) or other header following; e.g., for TCP:
#
# | Source Port | Destination Port | TCP
# +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
# | Sequence Number |
# +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
# | Acknowledgment Number |
# +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
# | Data | |U|A|P|R|S|F| |
# | Offset| Reserved |R|C|S|S|Y|I| Window |
# | | |G|K|H|T|N|N| |
# +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
#

open(infile,$ARGV[0]) || die("Can't open input file\n");
$if=$ARGV[1]; # requested interface

$tdelta=0.01;
$oldtimestamp=0;

# skip header
while(read(infile,$record,512)){
$cflag=vec($record,0,16); #non-byte-swapped clock if -1
$cellcount=vec($record,2,8)*256+vec($record,3,8);
$interface=vec($record,4,8)*256+vec($record,5,8);
#printf stderr "$interface\t$cellcount\n";
# Start reading in entries
for ($lccnt = 1; $lccnt <= 17408; $lccnt++) {
read(infile,$record,60) || exit;
if($lccnt > $cellcount){next;}
if(($if ne "") && ($if != $interface)){next;}
$tpcount++;

if($cflag == 0xffff) {
$ts1= vec($record,3,8); $ts2= vec($record,2,8);
}else{
$ts1= vec($record,4,8); $ts2= vec($record,5,8);
}
$clock=($ts1<<8)+$ts2;
if($clock < $oldclock){$clock2++;}
$oldclock=$clock;
$timestamp=(($clock2*65536)+$clock)*0.00000004;

if(vec($record,18,8) == 0x08){
$src = vec($record,8,32);
$dst = vec($record,9,32);
$src1 = vec($record,32,8);
$src2 = vec($record,33,8);
$src3 = vec($record,34,8);
$src4 = vec($record,35,8);
$dst1 = vec($record,36,8);
$dst2 = vec($record,37,8);
$dst3 = vec($record,38,8);
$dst4 = vec($record,39,8);

$plen = vec($record,22,8)*256+vec($record,23,8);
$prot = vec($record,29,8);

$ihl = (vec($record,20,8)&0xf)*4;
$sport = vec($record,$ihl+20,8)*256+vec($record,$ihl+21,8);
$dport = vec($record,$ihl+22,8)*256+vec($record,$ihl+23,8);
#1 (0x01) ICMP protocol
#2 (0x02) IGMP protocol
#4 (0x04) IP over IP
#6 (0x06) TCP protocol
#17 (0x11) UDP protocol
#41 (0x29) IPv6 protocol
if (($prot == 2) || ($prot == 4) || ($prot == 6) || ($prot == 17) ||($prot == 41) ) {
printf"%d\t%d\t%.8f\t%.8f\t%d.%d.%d.%d\t%d.%d.%d.%d\t%d\t%d\t%d\t%d\n",
$interface,$tpcount,$timestamp,$timestamp-$oldtimestamp,
$src1,$src2,$src3,$src4,
$dst1,$dst2,$dst3,$dst4,
$plen,$prot,$sport,$dport;
} # if $prot
#if(($timestamp > ($oldtimestamp+$tdelta)) || ($timestamp < $oldtimestamp)){
#printf stderr "Time delta: $oldtimestamp $timestamp (%s)\n",
#$timestamp-$oldtimestamp;
#}
$oldtimestamp=$timestamp;

#}else{
#$nippcount++;
#printf"%d\t%d\t%.8f\t%.8f\t",$interface,$tpcount,$timestamp,$timestamp-$oldtimestamp;
#for ($j= 0; $j<=19; $j++){printf"%2x ",vec($record,$j,8);}
#printf"\n\t\t\t\t\t\t";
#for ($j=20; $j<=39; $j++){printf"%2x ",vec($record,$j,8);}
#printf"\n\t\t\t\t\t\t";
#for ($j=40; $j<=59; $j++){printf"%2x ",vec($record,$j,8);}
#printf"\n\n";
}
}
}
so please help me in finding the code to trace packet in java.

14 years ago

hie
could any one tell me how to program in perl language or any other language to find the packet size distribution in a data

47204 1 0.00188816 0.00188816 10.0.78.3 10.0.225.125 52 6 17522 80
47204 17 0.02023824 0.01835008 10.0.1.137 10.0.1.136 40 6 119 46904
47204 33 0.04120976 0.02097152 10.0.0.4 10.0.1.25 1500 6 55893 119
47204 49 0.06218128 0.02097152 10.0.0.34 10.0.0.33 40 6 119 31810
47204 65 0.08839568 0.02621440 10.0.4.141 10.0.0.3 104 6 119 4041
47204 81 0.10936720 0.02097152 10.62.146.226 10.0.1.76 40 6 18264 20
47204 97 0.12509584 0.01572864 10.0.0.169 10.0.0.168 1500 6 3485 1214
47204 113 0.14082448 0.01572864 10.0.10.191 10.0.158.189 805 6 6699 3391
47204 129 0.16179600 0.02097152 10.0.3.166 10.0.3.165 40 6 1271 20
47204 145 0.18014608 0.01421476 10.1.159.76 10.0.3.251 40 6 49243 8000
47204 161 0.19849616 0.01686072 10.2.75.65 10.3.174.100 431 6 2322 80
47204 177 0.21946768 0.02097152 10.0.2.111 10.0.0.33 83 6 64489 119
47204 193 0.24306064 0.01704964 10.62.147.53 10.0.9.116 40 6 1214 1971
47204 209 0.26141072 0.01410512 10.38.188.166 10.0.75.141 52 6 22 59666
47204 225 0.28500368 0.02359296 10.0.2.158 10.0.2.157 40 6 33216 388
47204 241 0.30335376 0.00642448 10.0.1.114 10.0.1.113 1500 6 873 1167
47204 257 0.32694672 0.02359296 10.0.13.143 10.1.59.81 1420 6 4662 2354
47204 273 0.34529680 0.01835008 10.0.0.221 10.62.148.8 148 17 32776 7004
47204 289 0.36364688 0.01835008 10.0.9.79 10.0.9.78 40 6 3663 2436
47204 305 0.38461840 0.02097152 10.0.11.49 10.0.45.46 1420 6 80 22733
47204 321 0.40296848 0.01835008 10.0.19.16 10.0.110.150 40 6 2133 1214
47204 337 0.42131856 0.01835008 10.3.119.29 10.0.6.74 48 6 1582 80
47204 353 0.43966864 0.01835008 10.0.9.156 10.0.7.200 149 6 6699 1313
47204 369 0.46326160 0.02359296 10.0.41.9 10.38.188.40 40 6 1941 79
47204 385 0.48423312 0.02097152 10.63.79.152 10.1.231.27 40 6 54851 80
47204 401 0.50258320 0.01835008 10.0.38.146 10.1.162.167 249 17 53 32769
47204 417 0.52355472 0.02097152 10.38.191.193 10.39.99.59 1500 17 0 0
47204 433 0.54190480 0.01835008 10.0.36.139 10.0.36.138 52 6 1214 3150
47204 449 0.56025488 0.01835008 10.0.78.3 10.0.2.42 52 6 5055 80
in the given file where the 7th column is the packet size i need the how to write a code for it using the perl and for visualization the matlab
14 years ago
haha actually im not asking the complete project
just asking for an over view over it how to start over and that too its not just asking for url actually i was not clear about the code which i asked
its like this

we need to give the http request with some port number such that it recognizes the port number and grants the request of the url depending on port number here is the place im confused

please help me so that i can make the code for it

thank you
15 years ago
actually i didn't metion the complete requirement of the project

it is a web server creation
could you help me
15 years ago
oh thank you very much
and could there be some thing more implementation for this program in such a way that we can implement a client and server implementation
15 years ago