upFRONT
// gcc -Wall -O2 sine.c -lvgagl -lvga -lm
#include <vga.h> /* vgalib */
#include <vgagl.h> /* advanced */
#include <math.h> /* sines! */
#include <stdlib.h> /* malloc */
#define VGAMODE G320x200x256
GraphicsContext *physical_screen;
GraphicsContext *virtual_screen;
GraphicsContext *scroll_board;
int main(void)
{
double a, b, c, d; /* amp, phase, period, shift */
double aa,bb,cc,dd; /* random values for fun */
short int p_pos, t_pos; /* pixel & text */
short int x,y,z; /* y coord, x & z counters */
char key; /* to wait for keypress */
12345678901234567890123456789012345678901234567890
/* The following text between quotes should be all
one line. Ignore wrapping */
char text[] = "....................................Hello happy world and welcome to another episode of Stupid Programming Tricks. This is our scrolltext, well the idea is that you replace this text with your megagreetings list or the number to your pirate BBS. I wrote this one on Conectiva Linux which has the coolest characters but SVGALIB won't print them properly. Please experiment with different values, and try plugging sines into other sines, you can create the most remarkable though often illegible effects. Shout outs to Rigor Mortis (Riggie!), Red Sector, Triad, Fairlight, Quartex, Cynas, DM, RAiD and everyone else who's still alive! Hy3n4 m4s f1n4 out.........................................";
double textl=sizeof(text); /* text length */
vga_init(); /* here begin standard inits */
vga_setmode(VGAMODE); /* we'll allocate our */
gl_setcontextvga(VGAMODE); /* graphics areas */
physical_screen=gl_allocatecontext();
gl_getcontext(physical_screen);
gl_setcontextvgavirtual(VGAMODE);
virtual_screen=gl_allocatecontext();
gl_getcontext(virtual_screen);
gl_clearscreen(0); /* better clear the screen */
scroll_board = malloc( (WIDTH/8+1)*8*8*BYTESPERPIXEL);
gl_setcontextvirtual(WIDTH+8,8,BYTESPERPIXEL,8,scroll_board);
scroll_board = gl_allocatecontext(); /* ready */
gl_getcontext(scroll_board);
gl_setwritemode(FONT_COMPRESSED);
gl_setfont(8,8,gl_font8x8);
gl_setfontcolors(0,1);
gl_setpalettecolor(1,63,13,24);
srand(time(NULL));
a=b=c=d=x=y=0; /* amp, phase, period, shift */
t_pos=p_pos=0; /* text & pixel position */
aa=rand()%64+16.0; bb=rand()%64+16.0;
cc=rand()%64+16.0; dd=rand()%128+128.0;
gl_setcontext(virtual_screen);
/* main loop */
for (key=0; key==0; key=vga_getkey()) {
p_pos += 2; /* adjust speed here */
/* this redraws the text at each new letter */
while (p_pos > 8) {
gl_setcontext(scroll_board);
gl_writen(0,0,WIDTH/8, &text[t_pos]);
t_pos++; /* advance text */
p_pos-=8; /* reset p_pos */
if (t_pos >= textl)
t_pos=0; /* reset t_pos */
gl_setcontext(virtual_screen);
}
/* These equations produce readable text
* but please experiment to witness the
* potential of illegible sine scrolling
*/
x+=1; /* a counter for more phase shift */
for (z=0; z<320; z++) {
a = 24*sin((z+x)/aa)+24;
b = 64*sin((x)/bb)+32;
c = cc*sin((z+x)/cc)+128;
d = (32-a)*sin((x-z)/dd)+124-a;
y = a*sin((z+b)/c)+d; /* standard format */
gl_copyboxfromcontext(scroll_board, z+p_pos,
0, 1, 8, z, y);
}
gl_setpalettecolor(1,31*sin(t_pos/2.0)+32,
31*sin(t_pos/4.0)+32,
31*sin(t_pos/8.0)+32);
gl_copyscreen(physical_screen); /* update */
gl_clearscreen(0); /* otherwise it smears */
vga_waitretrace(); /* hold still a*/
}
return 0; /* on principle ;) */
}
Total number of patented applications listed by the U.S. Patent & Trademark Office as of June 30, 1999: 2,090,902
Percentage of those patents with foreign origins: 43%
Position of Japan among foreign countries holding U.S. patents: #1
Percentage of foreign-origin patents held by Japan: 41%
Position of IBM among U.S. patent holders: #1
Number of patents held by IBM: 20,725
Position of Canon among U.S. patent holders: #2
Number of patents held by Canon: 18,043
Number of Japanese companies among the top ten U.S. patent holders: 6
Number of patents held by Microsoft: 1,167
Number of patents held by Walker Asset Management Corporation (best known for Priceline.com): 36
Number of patents in which the name “Amazon.com” is mentioned: 9
Number of patents held by Amazon.com: 7
Number of patents that mention the word “Linux”: 49
Percentage of those in which Linux is used to demonstrate the patent's purpose: 100%
Revenues from patent licensing in 1990: $15 billion US
Revenues from patent licensing in 1998: $100 billion US
Number of shares of Microsoft stock owned by Bill Gates: 780 million
Number of shares of Microsoft stock owned by Paul Allen: 260 million
Number of shares Bill Gates filed with securities regulators to sell: 300,000
Percentage change in the stock price of RHAT in the five weeks after the antitrust ruling: +218
Number of feet by which Arctic sea ice has thinned since 1976: 4
Number of colonies of Antarctic Adélie penguins that have disappeared since 1988: 11
Realizing the promise of Apache® Hadoop® requires the effective deployment of compute, memory, storage and networking to achieve optimal results. With its flexibility and multitude of options, it is easy to over or under provision the server infrastructure, resulting in poor performance and high TCO. Join us for an in depth, technical discussion with industry experts from leading Hadoop and server companies who will provide insights into the key considerations for designing and deploying an optimal Hadoop cluster.
Sponsored by AMD
Built-in forensics, incident response, and security with Red Hat Enterprise Linux 6
Every security policy provides guidance and requirements for ensuring adequate protection of information and data, as well as high-level technical and administrative security requirements for a system in a given environment. Traditionally, providing security for a system focuses on the confidentiality of the information on it. However, protecting the data integrity and system and data availability is just as important. For example, when processing United States intelligence information, there are three attributes that require protection: confidentiality, integrity, and availability.
Learn more about catching the bad guy in this free white paper.
Sponsored by DLT Solutions
| Dynamic DNS—an Object Lesson in Problem Solving | May 21, 2013 |
| Using Salt Stack and Vagrant for Drupal Development | May 20, 2013 |
| Making Linux and Android Get Along (It's Not as Hard as It Sounds) | May 16, 2013 |
| Drupal Is a Framework: Why Everyone Needs to Understand This | May 15, 2013 |
| Home, My Backup Data Center | May 13, 2013 |
| Non-Linux FOSS: Seashore | May 10, 2013 |
- RSS Feeds
- Making Linux and Android Get Along (It's Not as Hard as It Sounds)
- Using Salt Stack and Vagrant for Drupal Development
- Dynamic DNS—an Object Lesson in Problem Solving
- New Products
- Validate an E-Mail Address with PHP, the Right Way
- Drupal Is a Framework: Why Everyone Needs to Understand This
- A Topic for Discussion - Open Source Feature-Richness?
- Download the Free Red Hat White Paper "Using an Open Source Framework to Catch the Bad Guy"
- Tech Tip: Really Simple HTTP Server with Python
Enter to Win an Adafruit Pi Cobbler Breakout Kit for Raspberry Pi

It's Raspberry Pi month at Linux Journal. Each week in May, Adafruit will be giving away a Pi-related prize to a lucky, randomly drawn LJ reader. Winners will be announced weekly.
Fill out the fields below to enter to win this week's prize-- a Pi Cobbler Breakout Kit for Raspberry Pi.
Congratulations to our winners so far:
- 5-8-13, Pi Starter Pack: Jack Davis
- 5-15-13, Pi Model B 512MB RAM: Patrick Dunn
- 5-21-13, Prototyping Pi Plate Kit: Philip Kirby
- Next winner announced on 5-27-13!
Free Webinar: Hadoop
How to Build an Optimal Hadoop Cluster to Store and Maintain Unlimited Amounts of Data Using Microservers
Realizing the promise of Apache® Hadoop® requires the effective deployment of compute, memory, storage and networking to achieve optimal results. With its flexibility and multitude of options, it is easy to over or under provision the server infrastructure, resulting in poor performance and high TCO. Join us for an in depth, technical discussion with industry experts from leading Hadoop and server companies who will provide insights into the key considerations for designing and deploying an optimal Hadoop cluster.
Some of key questions to be discussed are:
- What is the “typical” Hadoop cluster and what should be installed on the different machine types?
- Why should you consider the typical workload patterns when making your hardware decisions?
- Are all microservers created equal for Hadoop deployments?
- How do I plan for expansion if I require more compute, memory, storage or networking?




54 min 57 sec ago
4 hours 6 min ago
6 hours 21 min ago
6 hours 50 min ago
7 hours 48 min ago
9 hours 17 min ago
10 hours 25 min ago
11 hours 12 min ago
17 hours 47 min ago
23 hours 26 min ago