I want to make a two dimensional array. I know there are better solutions but I'm practising this way.
It's actually not that bad. You get something that acts like a 2D array without any hardcoded dimensions, that uses the standard [] operators directly without any classes or operator overloading. It also allows the array to be very large, where local variables might be quite limited in maximum size. It's also very simple.
Yours has a hardcoded size of 10 in one dimension, but the idea can be taken farther:
Last edited by Corona688; 12-19-2010 at 12:27 PM..
Reason: minor but vital code fix (n<r, not n<c!)
Hi,
I'm working with Mercury tools: Loadrunner, and I'm trying to monitor a unix server by rstatd, and I got next error:
Mar 4 11:25:56 sacindt rpc.rstatd: incompatible to /proc. Could not read disk_io: data
does any one have an idea about this..
regards (0 Replies)
while compiling my code with -pg option
i got the following error:
ld (prelink):
-pg incompatible with -shared; assuming -nopg
any idea to overcome this problem?
how can i use gprof profiler for a program using shared libraries? (2 Replies)
I have a Sun Sparc machine with Solaris 9 on it as oracle server. We added two patches (112233-11: SunOS 5.9:Kernel Patch and 111722-04: SunOS 5.9:MathLibrary(libm)patch). When I prepared the server for Oracle installation, I checked patch with command: $/usr/sbin/patchadd -p | grep <patch_number>.... (0 Replies)
AIM- Install Oracle 11g on Solaris using VMWare
Steps
1.Logged on as root
2.Created subfolders à /usr/local/bin & /usr/local/bin/gcc
3.Downloaded gcc & libiconv & unzipped them on my harddrive & burnt them on CD
4.Copied files from CD to /usr/local/bin/gcc
5.Terminal (root) à pkgadd -d... (8 Replies)
If one wants to get a start address of a array or a string or a block of memory via a function, there are at least two methods to achieve it:
(1) one is to pass a pointer-to-pointer parameter, like:
int my_malloc(int size, char **pmem)
{
*pmem=(char *)malloc(size);
if(*pmem==NULL)... (11 Replies)
Hi all, this warning is driving me nuts. I use -pedantic with -Wall and -Werror so this needs to be fixed.
BUILD: GNU-Linux-x86
Any ideas?
struct sockaddr_in server_addr;
int addr_len = sizeof (server_addr);
fd = accept(link->socket_fd,
(struct sockaddr_in *)... (2 Replies)
I'm compiling an application someone gave me. It uses XLC on a Power7, running Red Hat (4? 5?). It compiles and links, but I get the following message for every .o and .exe...
xlc_r: 1501-274 (W) An incompatible level of gcc has been specified.
I've tried googling on this error, and I'll I... (2 Replies)
This is from a program I wrote over in 1998 that I am trying to compile on a linux machine:
void write_line (FILE *fp, int rec_no, line_rec *arec)
{
fpos_t woffset;
woffset = (rec_no - 1) * sizeof(line_rec);
fsetpos(fp,&woffset);
fwrite(arec,sizeof(line_rec),1,fp);
}On the line... (2 Replies)
I have a function from the Sedgewick's book
// return the shortest path from v to s as an Iterable
public Iterable<String> pathTo(String v) {
Stack<String> path = new Stack<String>();
while (v != null && dist.contains(v)) {
path.push(v);
v =... (2 Replies)
Discussion started by: yifangt
2 Replies
LEARN ABOUT OPENSOLARIS
ppmtosixel
ppmtosixel(1) General Commands Manual ppmtosixel(1)NAME
ppmtosixel - convert a portable pixmap into DEC sixel format
SYNOPSIS
ppmtosixel [-raw] [-margin] [ppmfile]
DESCRIPTION
Reads a portable pixmap as input. Produces sixel commands (SIX) as output. The output is formatted for color printing, e.g. for a DEC
LJ250 color inkjet printer.
If RGB values from the PPM file do not have maxval=100, the RGB values are rescaled. A printer control header and a color assignment table
begin the SIX file. Image data is written in a compressed format by default. A printer control footer ends the image file.
OPTIONS -raw If specified, each pixel will be explicitly described in the image file. If -raw is not specified, output will default to com-
pressed format in which identical adjacent pixels are replaced by "repeat pixel" commands. A raw file is often an order of magni-
tude larger than a compressed file and prints much slower.
-margin
If -margin is not specified, the image will be start at the left margin (of the window, paper, or whatever). If -margin is speci-
fied, a 1.5 inch left margin will offset the image.
PRINTING
Generally, sixel files must reach the printer unfiltered. Use the lpr -x option or cat filename > /dev/tty0?.
BUGS
Upon rescaling, truncation of the least significant bits of RGB values may result in poor color conversion. If the original PPM maxval was
greater than 100, rescaling also reduces the image depth. While the actual RGB values from the ppm file are more or less retained, the
color palette of the LJ250 may not match the colors on your screen. This seems to be a printer limitation.
SEE ALSO ppm(5)AUTHOR
Copyright (C) 1991 by Rick Vinci.
26 April 1991 ppmtosixel(1)