Code/Resource
Windows Develop
Linux-Unix program
Internet-Socket-Network
Web Server
Browser Client
Ftp Server
Ftp Client
Browser Plugins
Proxy Server
Email Server
Email Client
WEB Mail
Firewall-Security
Telnet Server
Telnet Client
ICQ-IM-Chat
Search Engine
Sniffer Package capture
Remote Control
xml-soap-webservice
P2P
WEB(ASP,PHP,...)
TCP/IP Stack
SNMP
Grid Computing
SilverLight
DNS
Cluster Service
Network Security
Communication-Mobile
Game Program
Editor
Multimedia program
Graph program
Compiler program
Compress-Decompress algrithms
Crypt_Decrypt algrithms
Mathimatics-Numerical algorithms
MultiLanguage
Disk/Storage
Java Develop
assembly language
Applications
Other systems
Database system
Embeded-SCM Develop
FlashMX/Flex
source in ebook
Delphi VCL
OS Develop
MiddleWare
MPI
MacOS develop
LabView
ELanguage
Software/Tools
E-Books
Artical/Document
blue.c
Package: leda.tar.gz [view]
Upload User: gzelex
Upload Date: 2007-01-07
Package Size: 707k
Code Size: 1k
Category:
Mathimatics-Numerical algorithms
Development Platform:
MultiPlatform
- #include <fstream.h>
- #include <LEDA/list.h>
- #include <LEDA/window.h>
- main(int argc, char** argv)
- {
- ifstream colors("/usr/lib/X11/rgb.txt");
- int r,g,b;
- char c;
- string s;
- string pat = "blue";
- if (argc > 1) pat = argv[1];
- list<string> L;
- while (colors >> r >> g >> b >> c)
- { colors.putback(c);
- s = read_line(colors);
- if (s.pos(pat) != -1) L.append(s);
- }
- int n = L.length();
- window W(500,500);
- W.init(0,n,0);
- W.set_show_coordinates(false);
- int i = 0;
- forall(s, L)
- { cout << s << endl;
- W.draw_filled_rectangle(i,0,i+1,n,color(~s));
- //W.draw_rectangle(i,0,i+1,n,black);
- i++;
- }
- cout << i << endl;
- W.read_mouse();
- return 0;
- }