Win a copy of OCP Java SE 8 Programmer II Exam Study Guide this week in the OCP forum!

bob connolly

Ranch Hand
+ Follow
since Mar 10, 2004
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 bob connolly

hello, is there a utility that will re-generate the java source from the class file by any change? or attempt to do that?

thanks!
bc
10 years ago
i've uploaded a bunch of .vb programs from DOS and am rebuilding the programs using Java so i can implant display statments, not sure if i am creating the ^M or if it already had the ^M:

^M
#Region "Controls"^M
^M
Protected WithEvents cmdHelp As System.Web.UI.WebControls.LinkButton^M
Protected WithEvents imgHelp As System.Web.UI.WebControls.Image^M
Protected WithEvents lblHelp As System.Web.UI.WebControls.Label^M
Protected WithEvents pnlHelp As System.Web.UI.WebControls.Panel^M
^M
#End Region^M
^M
#Region "Private Members"^M
^M
^M
10 years ago
hello,

does anyone know how i can remove the ^M character programatically, i could use the dos2unix but i'd like to see if i could remove it with a java program before the other route.

thanks
bc
10 years ago
Thanks all for the excellent information, didn't know about these utiliies whatsoever, appreciate the help very much!

bc
10 years ago
Hello,

Is there a quick and dirty way to move a numeric value into a string, shift that value to the right and pad the string with zeroes?

Need to sort by size and the only way to show the sorted data correctly is if they all line up on the same columnar position ie:

0000001
0000002
0000544

ect

Thanks for any insights
bc
10 years ago
ok got it, this works

java parmMgr aaaaaaaaaaaaaaa \
bbbbbbbbbbbbbbbbbbbbb \
cccccccccccccccccccccccccc \
ddddddddddddddddddddddddddddddd \

bk
11 years ago
Hello i'm wondering how i can input many long arg[] values in a file input format?

java parmMgr <<EOF
39_CQR_cnt_current_qtr_hold_aftTrunc|rec_count=0|
40_CQR_insert_current_qtr_hold|rec_count=635181|
41_CQR_cnt_current_qtr_hold_aftload|rec_count=635181|
44_CQR_cnt_test_current_qtr_valRowid|rec_count=635181|
50_CQR_cnt_test_current_qtr_aftDelete|rec_count=20837450|
44_CQR_cnt_test_current_qtr_valRowid|rec_count=635181|
50_CQR_cnt_test_current_qtr_aftDelete|rec_count=20837450|
44_CQR_cnt_test_current_qtr_valRowid|rec_count=635181|
45_CQR_table_delete_module|rec_count=9|
EOF`

Thanks very much!
bc
11 years ago
Thanks for the reference Joe looks good!

bc
11 years ago
Hello,

I've been trying to determine what Swing component to use in order to, in a UNIX script, open a file and allow a user to scroll thru a file and maybe edit and save the file, just as if they were opening the file using 'vi' or some other editor?

Or if you may know of a good example on the WEB i can review?

I'm basically trying to automatate a datbase build process and would like a screen to pop up at certain places in the script, asking the user to verify and OK what's been configured at each phase of the process.

Thanks for any references or examples!
bc
11 years ago
Thanks alot Guy! appreciate the help!

bc
11 years ago
I quess what i'm trying to figure out is how to make my Java record count program work as fast as an equivalent PERL program. This Perl program must be avoiding the loading of the record somehow maybe? because it runs at least 2X faster than the JAVA program and i'd prefer to use JAVA for this process!

#!/usr/bin/perl

$filename = $ARGV[0];

#open the list of files
open (FILE_IN,$filename) || die ("Open Failed1: $!\n");


while (defined($infile=<FILE_IN> ) {
print "$infile\n";
chomp ($infile);
open (IN,$infile) || die ("Open Failed2: $!\n");
while (defined($line=<IN> ) {
$nlines++; # counts the lines
}
}
close IN;
close FILE_IN;
print "rows: $nlines\n";
11 years ago
Good evening!

Is there a more efficient way to get record counts other than actually reading each record into the buffer, ie:
lineu = textReader.readLine?

Thanks again!
bc

if(filename.indexOf(".TXT.out")>-1 && typ.equals(".TXT.out") )
{
try
{
BufferedReader textReader = new BufferedReader(new FileReader(filename));
String lineu = null;
while ((lineu = textReader.readLine()) != null)
{
if(filename.indexOf("BQ")>-1) rcqcnt++;
if(filename.indexOf("XS")>-1) rcscnt++;
if(filename.indexOf("MS")>-1) rmstrcnt++;
read_cnt++;
}
textReader.close();
System.out.println(filename+" "+read_cnt);
}
catch(Exception e){System.out.println("reading excpection xx:"+e);}
}
}
11 years ago
Thanks alot Jeanne!

bc
11 years ago
Hello,

I thought i'd be able to use the System.exit(calcval) to pass a final value of the a Java program and into a kshell variable ie:

#!bin/ksh

java jpgm1
passvar=$?

but it looks like the .exit method only passes numeric values up to a certain value, ie under 500 looks like.

Is there another Java method i could use to accomplish this same feat?

I could write it to a file of course, but then i would need to figure a way to get it from the file to the $passvar!

Thanks for any suggestions!
bc
11 years ago
Thanks William, very good article!

I'm going to take a closer look into the specifications for that Fast Infoset technique!

And it's good to know that the zipping is about the best anyone can do for right now!

Have a good one William!

bc