C-sharp demand on par with Assembler - Apache releases a Java app server (Re: Skills in most demand)

J

Jeff Relf

Hi J. P. Morgan,

Why was VB 6 " Right " ? Why did it " Win " ?

You're just slumming it. C# and Java are low rent.
 
J

J. P. Morgan

Jeff said:
Hi J. P. Morgan,

Why was VB 6 " Right " ? Why did it " Win " ?

You're just slumming it. C# and Java are low rent.

Yes, but VB6 got them beat by many years.

VB devolves the high and noble c down to the street level -- where any
bum can program.

c# and java are just fancy names for VB6
 
J

Jeff Relf

Hi J. P. Morgan,

Re: Slumming it with Java and C#.

You commented,
" Yes, but VB6 got them beat by many years.
VB devolves the high and noble c down to the street level
-- where any bum can program.
c# and java are just fancy names for VB6. "

Basic and C are about the same age, I assume.

But that's were the similarities end,
C was built for real work, from the ground up.

As for Visual Basic,
No Visual C for me ... It just makes things harder.

For example,
My multi-client, RRR_Puppy, has only one window as a rule.
No pop-ups for me, thank you.

And it's nothing to create that window, in WinMain() I do:

#define LOOP while ( 1 )

#define CW CreateWindow

typedef unsigned int uint;

int Left_Scr, Top_Scr, W_Me, H_Me, Right_Scr, Bot_Scr ;

HINSTANCE PID ; HFONT Fnt ;

typedef char * Line ;

enum { Sz_Ptr = sizeof Line,
Vis = WS_VISIBLE, Chi = WS_CHILD };

// Big-ER and little-er ... Get it ?
int ER ( int X, int Y ) { return X > Y ? X : Y ; }
int er ( int X, int Y ) { return X < Y ? X : Y ; }

int __stdcall WinMain( HINSTANCE _PID, HINSTANCE x0,
LPSTR CmdLn, int x1) { PID = _PID ;

{ long R [ 4 ];
SystemParametersInfo(
SPI_GETWORKAREA, 0, ( RECT * ) R, 0 );
Right_Scr = R[2]; Bot_Scr = R[ 3 ]; R
[ 2 ] -= R[ 0 ]; R[ 3 ] -= R[ 1 ];
Left_Scr = R[ 0 ]; Top_Scr = R[ 1 ];
W_Me = R[ 2 ]; H_Me = R[ 3 ]; }
float Sca = W_Me / 640.;
Rec_Me = _R( 0, 0, W_Me, H_Me );
.....
{ float Width = Sca * ( Font_Sz ); SIZE Sz;
Fnt = CreateFont( -Rnd( 81* Width/ 49 ),
0,0,0, 0 ,0,0,0,0,0,0,0,
FIXED_PITCH, "Lucida Console");
SetPtr( DC, Fnt );
GetTextExtentPoint( DC,"XXXXX", 5, & Sz );

// Character width and hight,
// one size, and one size only.
W = Rnd( Sz.cx / 5. ); H = Sz.cy;

// Columns and Rows, about 64 by 26.
Col_Me = W_Me / W ; Row_Me = H_Me / H ; }

{ WNDCLASS Class = {
0, WinProc, 0, 0, PID, 0, 0, 0, 0, "WinProc" };
RegisterClass( & Class ); }

{ WNDCLASS Class = {
0, WinProc, 0, 0, PID, 0, 0, 0, 0, "WinProcN" };
RegisterClass( & Class ); }

Win = CW("WinProc", "RRR_Puppy",
Vis | WS_POPUP | WS_EX_TOPMOST,
Left_Scr, Top_Scr, W_Me, H_Me, 0,0,PID,0);

// This is needed because of the way I minimize
// all tasks on WM_ACTIVATEAPP, see below.
ShowWindow( Win, SW_RESTORE );
.....

// Minimizes all tasks on WM_ACTIVATEAPP,
// except sometimes Win, which is my task.
int __stdcall Min_All ( HWND A_Win, long Z ) {
if ( A_Win == Win && ShowTime ) return 1 ;
int Style = GetWindowLong( A_Win, GWL_EXSTYLE );
if ( IsWindowVisible ( A_Win ) &&
! ( Style & WS_EX_TOOLWINDOW )
&& ( Style & WS_EX_APPWINDOW ||
! GetParent ( A_Win ) ) && ! IsIconic ( A_Win ) )
ShowWindow( A_Win, SW_MINIMIZE ); return 1 ; }

long __stdcall WinProc (
HWND Wnd, uint M, uint C, long C2 ) {
if ( M == WM_PAINT ) { Paint_Req = 1;
ValidateRect( Win, & Rec_Me ); return 0; }
if ( M == WM_ACTIVATEAPP ) { static int Ignore ;
if ( Ignore ) return 0 ;
ShowTime = ( ushort ) C ; Ignore = 1 ;
EnumWindows ( Min_All, 0 ); Ignore = 0 ;
if ( Sur_Scr && ShowTime ) { Paint_Req = 1;
Sur_Scr->Restore(); Sur_Draw->Restore(); Is_In = 0;
ShowWindow( Win, SW_RESTORE ); } }
return DefWindowProc( Wnd, M, C, C2); }
.....

But if, for some bizarre reason, I don't have enough
VRAM for Direct Draw 7 or something,
I will pop up an error window at the very start,
But that's the Only pop-up that I allow, I do this:

long __stdcall
WinProcN ( HWND Wnd, uint WM, uint wp, long lp ) {
return DefWindowProc( Wnd, WM, wp,lp ); }

Fatal ( Line S, ... ) { char B [ 300 ];
int Max = 0, Row = -1,
L = vsprintf( B, S, ( Line ) & S + Sz_Ptr );
Line E = B + L, Y = B, X ; * E ++ = '\n'; * E = 0 ;
LOOP { Row ++ ; X = Y ; Y = strchr ( X, '\n' );
if ( ! Y ) break ; L = Y - X ; if ( L > Max ) Max = L;
memmove( Y + 1, Y, E - Y + 1); E ++ ;
* Y = '\r'; Y += 2 ; }
float W_Mess = ( Max + 4 ) * W,
H_Mess = ( Row + 3 ) * H ;
HWND O, Txt, _Win =
CW( "WinProcN", "Notice", WS_POPUP | Vis | WS_CAPTION,
ER( 0, ( Right_Scr - W_Mess ) / 2),
( Bot_Scr - H_Mess ) / 2,
W_Mess, H_Mess, 0,0,PID,0 );
Txt= CW("EDIT", B, Chi | ES_MULTILINE | ES_NOHIDESEL,
W, 0, W_Mess, Row * H, _Win, 0, PID,0);
SendMessage( Txt, WM_SETFONT, ( int ) Fnt, 1 );
ShowWindow( Txt, SW_SHOW ); float _W = W * 3.5;
O = CreateWindow("BUTTON","Ok", BS_PUSHBUTTON | Chi,
( W_Mess - _W ) / 2, Row * H, _W, H * 1.3,
_Win, ( HMENU ) 1, PID, 0 );
SendMessage( O, WM_SETFONT, ( int ) Fnt, 1 );
ShowWindow( O, SW_SHOW ); SetForegroundWindow( O );
while( GetMessage( & Msg ,0,0,0 ) ) {
TranslateMessage( & Msg ); DispatchMessage( & Msg );
if( Msg.message == WM_KEYDOWN && Msg.wParam == 27
|| Msg.message == WM_LBUTTONUP
&& ( int ) GetMenu( Msg.hwnd ) == 1 ) break ; }
DestroyWindow( _Win ); exit( 1 ); }

See Bailo ?

There's nothing to it, no need for Visual anything.
And that Fatal() routine even allows one
to cut and paste the error message.
 
C

Chris

Jeff Relf said:
Hi Chris,

Re: Java being the slum of the computing world.

You said Java is, " the most in-demand skill ".

That figures, Most of the world lives in slums.

I write C++ programs for myself, that's the best way to go.

If you can afford it, that is. If not, enjoy your slum.

I was implying that if Java is the most in-demand skill, then I'm
likely to get paid more for using it (which I am).

Hopefully I'll be out of the slum soon and jeering at the c++
developers on the other side of the track.

- sarge
 
M

Mark Thornton

Jeff said:
Hi Mark Thornton,

You asserted,
" I have been using Java for over seven years
and know its strengths and weaknesses very well. "

The following C++ routines are used to print to any printer
( including Europe's A4 paper )
as well as to any sized screen.
( Only the HDC and a few variables change )

Can you show Java examples ?

I don't think I'll bother figuring out what all your code is intended to do.

The rough equivalent to an HDC is a java.awt.Graphics object, extended
(since Java 1.2) to java.awt.Graphics2D. These are used for drawing to
screens, printers or into a BufferedImage.

class MyPresentation implements Printable {
// create 12pt, bold serif font
Font font = new Font("Serif", Font.BOLD, 12);
String[] lines; // assume the required text placed in here

public void paint(Graphics g) {
g.setFont(font);
g.setColor(Color.BLACK);
FontMetrics fm = g.getFontMetrics();
int x = 36; // logical 1/2" from left
int y = fm.getLeading() + fm.getAscent();
for (int i=0; i<lines.length; i++) {
g.drawString(lines, x, y);
y += fm.getHeight();
}
}

public int print(Graphics g, PageFormat fmt, int pageIndex) {
if (pageIndex > 0) {
// we only have one page (zero based index)
return NO_SUCH_PAGE;
}
// The format will tell me the physical paper size, margins etc,
// but i'm ignoring that here. The Graphics object will be scaled
// so that one unit is 1/72"
paint(g);
return PAGE_EXISTS;
}
}


To actually print, all I need is

public void printPresentation(MyPresentation presentation) {
PrinterJob job = PrinterJob.getPrinterJob();
job.setPrintable(presentation);
if (job.printDialog())
job.print();
}

Regards,
Mark Thornton
 
G

Guest

thats a nice way to waste a lot of time isn´t it.

What I do in a week in VB.Net you´d take a semester to get done in C and I
am not talking about creating a windows form and be able to copy and paste
its error

lol
 
J

Jeff Relf

Hi Mark Thornton,

You wrote,
" The rough equivalent to an HDC is
a java.awt.Graphics object,
extended ( since Java 1.2 ) to java.awt.Graphics2D.
These are used for drawing to screens, printers
or into a BufferedImage. "

That's quit impressive,
But my bank simulation currently requires Excel,
which precludes Linux.

Also, if I ever moved my simulations to Direct Draw 7,
or even Direct 3D 9 ( instead of the GDI )
once again I'd be forced to use C++,
as DD7's interaction with MS windows is very tricky
and very OS specific.

For example,
Windows' taskbar hoards it's mouse messages.
The taskbar also turns on the system cursor,
which blocks VRAM-to-VRAM blts.
The solutions are very OS specific.

Would the bankers pay for that ? I doubt it.
 
T

The Ghost In The Machine

In comp.os.linux.advocacy, Chris
<[email protected]>
wrote
...

Weren't you assassinated?

But his spirit lives on... :)

(Though I for one have no idea why he'd want to live in such
a hodgepodge of technical newsgroups. :) Followups adjusted.)
 
M

Mark Thornton

Jeff said:
Hi Mark Thornton,

You wrote,
" The rough equivalent to an HDC is
a java.awt.Graphics object,
extended ( since Java 1.2 ) to java.awt.Graphics2D.
These are used for drawing to screens, printers
or into a BufferedImage. "

That's quit impressive,
But my bank simulation currently requires Excel,
which precludes Linux.

Also, if I ever moved my simulations to Direct Draw 7,
or even Direct 3D 9 ( instead of the GDI )
once again I'd be forced to use C++,
as DD7's interaction with MS windows is very tricky
and very OS specific.

The current Sun JVM will use GDI, DirectDraw or Direct 3D as it deems
appropriate (when running on Windows). There are command line switches
which can control which option is used. The next version adds OpenGL to
the collection of options. When running on Unix or Linux it will select
between another set of OS api. Apart from speed all this is invisible to
the Java programmer.

Mark Thornton
 
J

Jeff Relf

Hi Mark Thornton,

Re: Java, You wrote:
" The next version adds OpenGL to the collection of options.
When running on Unix or Linux
it will select between another set of OS api.
Apart from speed all this is
invisible to the Java programmer. "

Invisible to the Programmer ?

No need to test Direct 3D 9 on a Mac G5 or a hand-held ?

This is truly the age of miracles.

Ha-a-allle-e-e-ellluuuiiia-a-a brother.
 
M

Mark Thornton

Jeff said:
Hi Mark Thornton,

Re: Java, You wrote:
" The next version adds OpenGL to the collection of options.
When running on Unix or Linux
it will select between another set of OS api.
Apart from speed all this is
invisible to the Java programmer. "

Invisible to the Programmer ?

No need to test Direct 3D 9 on a Mac G5 or a hand-held ?

Exactly. The testing is done by the JVM itself. A lot of very hard work
for the people who write and maintain the JVM, but great for Java
programmers.

Mark Thornton
 
J

Jeff Relf

Hi Mark Thornton,

Re: Your claim that programmers don't need to test
Java's interface to Direct 3D 9,
whether it's on a Mac G5 or a hand-held.
( Because that work as already been done ? )

You wrote,
" The testing is done by the JVM itself.
A lot of very hard work for
the people who write and maintain the JVM,
but great for Java programmers. "

It's not that such things don't need to be tested,
because I assure you they do,
it's that it can't be done in Java.

Think about it,
Win98's taskbar hoards all mouse messages,
and it turns on a cursor that not only strews
annoying garbage on your window,
but also blocks VRAM-to-VRAM blts...

No matter how well you think the JVM is maintained,
I can assure you it's not good enough.
 
S

Shmuel (Seymour J.) Metz

on 06/13/2004 said:
You're going to have to clarify that... Are you talking about .NET
or the ECMA/ISO C#/CLI? Currently, Rotor - the ECMA/ISO reference
version of the C# compiler and CLI runs on Windows, FreeBSD, and
MacOS X. Mono runs on all of these and a lot more...

And doesn't run on others. Certainly not on as many platforms as,
e.g., Java, Perl. To say nothing of not relying on proprietary
protocols.
If there was no runtime for z/OS, then that would apply to your java
code as well.

If your grandmother had wheels she'd be a wagon. The fact is, as you
admit, that Java does have implimentations on far more platforms than
C# does.
Java wasn't always as cross platform as it is today....

And m$ is now playing catch up.

--
Shmuel (Seymour J.) Metz, SysProg and JOAT

Unsolicited bulk E-mail will be subject to legal action. I reserve
the right to publicly post or ridicule any abusive E-mail.

Reply to domain Patriot dot net user shmuel+news to contact me. Do
not reply to (e-mail address removed)
 
T

Tom Shelton

And doesn't run on others. Certainly not on as many platforms as,
e.g., Java, Perl. To say nothing of not relying on proprietary
protocols.

What proprietary protocols? XML? SOAP? A type system defined by the ECMA
and the ISO?
If your grandmother had wheels she'd be a wagon. The fact is, as you
admit, that Java does have implimentations on far more platforms than
C# does.

But it does have implementations on other platforms.... So, it is cross
platform. All that is required to run on your z/OS is someone to port the
runtime - just like what happened with Java.
And m$ is now playing catch up.

MS isn't doing anything - they're not porting to other OS's :)
 
M

Mike Schilling

Jeff Relf said:
Hi Mark Thornton,

Re: Java, You wrote:
" The next version adds OpenGL to the collection of options.
When running on Unix or Linux
it will select between another set of OS api.
Apart from speed all this is
invisible to the Java programmer. "

Invisible to the Programmer ?

No need to test Direct 3D 9 on a Mac G5 or a hand-held ?

This is truly the age of miracles.

What does one have to do with the other?

Win32 is supposed to make the differences between Win95, Win 98, NT 40,
Win2000, Win2003 etc. invisible to the programmer. High-level languages are
supposed to make the differences between processor architectures invisible
to the programmer. That's the purpose of an abstraction. Abstractions lead
to productivity, since they relieve the programmer from having to deal with
implementation details that aren't part of his problem space.

An application still needs to tested in each environment it's intended to
run on, since abstractions may not always work or may be misused. If you
think that proves that abstractions are evil or useless, go write some
microcode.
 
R

Raghar

Hi Mark Thornton,

Re: Your claim that programmers don't need to test
Java's interface to Direct 3D 9,
whether it's on a Mac G5 or a hand-held.
( Because that work as already been done ? )

You wrote,
" The testing is done by the JVM itself.
A lot of very hard work for
the people who write and maintain the JVM,
but great for Java programmers. "

It's not that such things don't need to be tested,
because I assure you they do,
it's that it can't be done in Java.
isHeadless();


Think about it,
Win98's taskbar hoards all mouse messages,
and it turns on a cursor that not only strews
annoying garbage on your window,
but also blocks VRAM-to-VRAM blts...

Cite from mickerosoft documentation. After someone aquires input device
in exclusive mode, windoze don't know where they should draw a cursor, so
they won't draw any cursor.

cite from NVIDIA. This graphic card supports hardware cursor with full
alpha up to xxxxxx pixels.

Common knowledge would also say to us that preffered method of graphic
manipulation is a page fliping.
 
J

Jeff Relf

Hi Raghar,

Re: How to do full-window painting
for a high-res maximized window,
when the taskbar turns on the cursor,
thus dropping junk on that window,
as it hoards all the mouse messages.

You wrote,
" Cite from mickerosoft documentation.
After someone aquires input device in exclusive mode,
windoze don't know where they should draw a cursor,
so they won't draw any cursor. "

That's quite true, and I've actually tried that...
Have you ?

The problem is that the the cursor still must be drawn...
Would you draw on the taskbar ? Huh ? I want to know.

Did you know that the mouse messages are
_ Still _ hoarded by the taskbar,
even when the input is captured as you described ?

Maybe you read the documentation, maybe...
but that just makes you stupid. I tested it, so I know.

You believe in Java and Santa Claus, not me.

And that is just one example of why
there are no shortcuts to cross-platform coding.
And one more reason why Java is a very bad joke.
( " Visual " programming being another... Shudder )

Re: How the system cursor prevents VRAM-to-VRAM blts.

You commented,
" cite from NVIDIA.
This graphic card supports hardware cursor with full
alpha up to xxxxxx pixels. "

Drawing cursors are no big deal.

So long as at least one fiftieth of a second has passed,
I draw the entire full screen window ( hi res )
every time the mouse moves...
I works like a dream, never a delay to scroll a dump.
So any delays must be due to something else...
Like waiting for data from a server.

It looks kind of like the following ( C++ ),
This is the event loop:

#define LOOP while ( 1 )

LOOP {
LOOP { Paint_Maybe();
if( ! ShowTime ||
PeekMessage( & Msg, 0,0,0, PM_NOREMOVE ) ) break ; }
GetMessage( & Msg, 0,0,0);
TranslateMessage( & Msg ); DispatchMessage( & Msg );
....

This is Paint_Maybe(),

typedef LARGE_INTEGER Quad ;

double Secnd_Dub, _Secs ;

__int64 _Tics, Secnd ;

// QueryPerformanceFrequency( ( Quad * ) & Secnd );
// Secnd_Dub = Secnd ;

#define Tics \
( QueryPerformanceCounter( ( Quad * ) & _Tics ), _Tics )

#define Secs ( _Secs = Tics / Secnd_Dub )

Paint_Maybe () { static double Next ;
if ( Secs < Next ) { Sleep( 0 ); return; }
Next = _Secs + 1 / 50. ;
In_Taskbar(); // This is too complex to describe here.
if ( ! Paint_Req || ! ShowTime ) return;
Sur_Draw->Blt(
& Rec_Me, 0,0, DDBLT_COLORFILL, & ErBlack );
WriteTxt( 0, 0, Bar );
....

You wrote,
" Common knowledge would also say to us that
preferred method of graphic
manipulation is a page flipping. "

I am drawing to a back buffer,
and I would page flip,
but I don't want to draw on the taskbar
and I only have 8 megs of VRAM... Not enough.

My crappy PC emulates having 64 megs by
using " shared system memory ".

All the video stuff is on my Intel motherboard,
not a card.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top