Another project, another bump in the road and another chance to learn. I've been trying to open gzipped files and parse data from them and hit a snag. I have data in gzips with a place followed by an ip or ip range sort of like this:
I was able to modify some code I found that works fine for parsing the data to only show the ips:
Result:
However, when I add it to the code I have for opening the gzips and reading them I get a segmentation fault. Here is the code I am trying to work from now:
I tried to look at this with strace and it seems to die directly after reading the first line. Any thoughts appreciated.
I have data that looks like this
aaa!bbb!ccc/ddd/eee
It is not fixed format. I need to parse ddd into a var in order to decide if I want to process that row. If I do I need to put ccc and bbb into vars to process it. I need to do this during a while loop one record at a time. Any... (11 Replies)
i am trying to use the history functions in a c++ program along with a custom signal handler for SIGINT.
the prog works fine catching signals without the line:
add_history(*args);
but as soon as this line is added, the prog segfaults on SIGINT.
does anyone have experience using gnu... (2 Replies)
Hello, sorry if this has been posted before but i was wondering if there is a way to run a program until a segmentation fault is found.
Currently i'm using a simple shell script which runs my program 100 times, sleeps 1 second because srand(time(0)) is dependent on seconds. Is there a possible... (1 Reply)
We have a Solaris 8 server which users login to via VNC to get a desktop. On that desktop these users use Netscape Communicator 4.9 to access a very important mail account. Unfortunately Netscape has started segfaulting regularly.
Does anyone have any ideas how I can try to find out what point... (1 Reply)
1. Even if i have the handles for ctrl+c it gives off a segfault
2. syslog doesn't log LOG_ERR event with log masked specified or non specified, it logs LOG_WARNING however...
#include <sys/types.h> /* include this before any other sys headers */
#include <sys/stat.h>
#include <fcntl.h>... (2 Replies)
Hello everyone,
I'm writing a program using the id3lib unfortunately I've encountered with memory issue that cause segmentation fault. I tried to rerun and analyze the program with valgrind but it doesn't point me anywhere. I really stuck on this one.
Valgrind output:
==14716== Invalid read of... (2 Replies)
I have a program that allows users to specify the debug log file location and name.
I have tried using the access() and stat() but they both segfault if the drive say (d:\) is invalid. Both seem to be fine if the drive exists.
Could someone please point me in the direction to a function that... (1 Reply)
hello all,
my question is not about How code can be rewritten, i just wanna know even though i am not using read only memory of C (i have declared str) why this function gives me segfault :wall:and the other code executes comfortably though both code uses same pointer arithmetic.
... (4 Replies)
I am populating an array of string and print it.
But it going in infinite loop and causing segfault.
char Name = {
"yahoo",
"rediff",
"facebook",
NULL
};
main(int argc, char* argv)
{
int j = 0;
... (7 Replies)
Hello:
I have some text output, on SunOS 5.11 platform using KSH:
I am trying to parse out each string within the () for each line.
I tried, as example:
perl -lanF"" -e 'print "$F $F $F $F $F $F"'
But for some reason, the output gets all garbled after the the first fields.... (8 Replies)
Discussion started by: gilgamesh
8 Replies
LEARN ABOUT PLAN9
road
ROAD(7) Miscellaneous Information Manual ROAD(7)NAME
road, gps - road map of the United States
SYNOPSIS
games/road [ -g ] [ -s scale ]
games/gps
DESCRIPTION
Road displays a road map centered around some specified place in the United States. The data comes from the Census Bureau Tiger Database.
The map is drawn in three shades of grey. Light grey is used for water features such as rivers, streams and lakes. Dark grey is used for
railroads and airports. Black is used for roads. On terminals with ldepth zero, all shades appear black.
Without options, the center of the map is the latitude and longitude specified in the file /lib/sky/here. If the -g option is given, the
center of the map will be the latitude and longitude specified by continually monitoring the end of the file /tmp/gpslog. This file is
written by the GPS satellite receiver program gps. With this option, and with gps running, road becomes a moving map display suitable for
cars or planes.
Keyboard commands
s number
sets the scale of the map to number. The number can be prefixed with + or - to increase/decrease the current scale. Scale 6 is
about one mile across the screen and scale 10 is about ten miles across. Scales 1 through 10 are drawn with maximum detail showing
all roads, trails, rivers, streams and airports. Scales 11 through 14 show highways, rivers, airports and county boundaries.
Scales 15 through 20 show interstate highways and state boundaries.
/regexp
All features labeled by text matching the regular expression are highlighted.
p place
centers the map at the specified place. Usually the place must have the associated state code, (eg murrayhill,nj) but places like
lax and ewr are also known.
l latitude longitude
centers the map at the specified coordinate.
g toggles the -g option described above.
q Exit.
Mouse button commands
Button 1
displays the text of the line nearest the cursor. Normally this is the name of a street or river.
Button 2
displays the text of the place nearest the cursor. Normally this is a town.
Button 3
centers the display on the cursor position.
Gps reads /dev/eia0 assumed connected to a Garmin GPS-55 satellite receiver and writes the current location on the end of the file
/tmp/gpslog. It is intended to be used with mobile PC's.
FILES
/lib/roads/LLLL/LLLLGGGG.h
scale 1-10 database files where LLLL is the latitude multiplied by 5 and GGGG is the longitude multiplied by 5.
/lib/roads/LLL/LLLGGG.h
scale 11-14 database files where LLL is the latitude multiplied by 1 and GGG is the longitude multiplied by 1.
/lib/roads/LL/LLGG.h
scale 15-20 database files where LL is the latitude multiplied by 0.2 and GG is the longitude multiplied by 0.2.
/lib/roads/place
/lib/roads/place.local are the translations between place names and locations. These files must be sorted.
/lib/sky/here
default starting map center.
/tmp/gpslog
moving map location.
SOURCE
/sys/src/games/road
/sys/src/games/gps
ROAD(7)