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
Today’s modular x86 servers are compute-centric, designed as a least common denominator to support a wide range of IT workloads. Those generic, virtualized IT workloads have much different resource optimization requirements than hyperscale and cloud applications. They have resulted in a “one size fits all” enterprise IT architecture that is not optimized for a specific set of IT workloads, and especially not emerging hyperscale workloads, such as web applications, big data, and object storage. In this report, you will learn how shifting the focus from traditional compute-centric IT architectures to an innovative disaggregated fabric-based architecture can optimize and scale your data center.
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
| 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 |
| Trying to Tame the Tablet | May 08, 2013 |
| Dart: a New Web Programming Experience | May 07, 2013 |
- RSS Feeds
- New Products
- Making Linux and Android Get Along (It's Not as Hard as It Sounds)
- Drupal Is a Framework: Why Everyone Needs to Understand This
- Home, My Backup Data Center
- A Topic for Discussion - Open Source Feature-Richness?
- Dart: a New Web Programming Experience
- Developer Poll
- What's the tweeting protocol?
- May 2013 Issue of Linux Journal: Raspberry Pi
Enter to Win an Adafruit Prototyping Pi Plate 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 Prototyping Pi Plate 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
- Next winner announced on 5-21-13!
Free Webinar: Linux Backup and Recovery
Most companies incorporate backup procedures for critical data, which can be restored quickly if a loss occurs. However, fewer companies are prepared for catastrophic system failures, in which they lose all data, the entire operating system, applications, settings, patches and more, reducing their system(s) to “bare metal.” After all, before data can be restored to a system, there must be a system to restore it to.
In this one hour webinar, learn how to enhance your existing backup strategies for better disaster recovery preparedness using Storix System Backup Administrator (SBAdmin), a highly flexible bare-metal recovery solution for UNIX and Linux systems.




26 min 16 sec ago
1 hour 43 min ago
2 hours 18 min ago
2 hours 40 min ago
7 hours 29 min ago
8 hours 16 min ago
9 hours 49 min ago
11 hours 26 min ago
13 hours 24 min ago
13 hours 41 min ago