Librenix
Headlines | Linux | Apps | Coding | BSD | Admin | News
Information for Linux System Administration 

Tutorial: Build a C/C++ memory manager

Up
vote
Down

As a developer, one of the most powerful tools that C/C++ arms you with to improve processing time and prevent memory corruption is the control over how memory is allocated or deallocated in your code. This tutorial demystifies memory management concepts by telling you how to create your very own memory manager for specific situations. read more...
permapage | score:9250 | -BlueVoodoo, February 23, 2008

perl dispatch table examples

Up
vote
Down

Dispatch Table: The fancy name for a hash of code-refs...
In perl, code is a first class data type... you can talk about it in the same way you would talk about arrays or hashes, you can take references to them (giving you a code-ref ) and you can de-reference them (which runs the code);

Code-references are just scalars that refers to something, and you get them by using the reference-to operator:
read more...
permapage | score:9217 | -f00li5h, December 17, 2010

Tutorial: Android app build environment with Eclipse, PhoneGap (Ubuntu 11.04)

Up
vote
Down

This tutorial describes how you can set up an development environment for building Android apps on an Ubuntu 11.04 desktop using Eclipse, the Android SDK, and PhoneGap. I will describe how to build Android apps from the command line with PhoneGap and from the GUI with Eclipse and PhoneGap and how to test them in an Android emulator and on a real Android device. PhoneGap allows you to develop your Android applications using web technologies such as HTML, CSS, and JavaScript (e.g. with JavaScript libraries such as jQuery/jQTouch), and it will turn these web apps into native Android apps (in fact, PhoneGap supports multiple platforms such as Android, iPhone, Palm, Windows Mobile, Symbian, so you can use the same sources to create apps for multiple platforms). read more...
mail this link | permapage | score:9204 | -falko, June 28, 2011

e-book: Sed One-Liners Explained

Up
vote
Down

I love writing about programming and I am happy to announce my second e-book called "Sed One-Liners Explained".

Sed one-liners are short sed scripts for everyday situations in the shell, such as changing line spacing, numbering lines, and converting and deleting text.

For example, the following sed one-liner numbers the lines of a file:

sed = file | sed 'N; s/n/: /'

Here is how it works - it's made out of two sed commands. The first one uses the = command that inserts a line containing the line number before every original line in the file. Then this output gets piped to the second sed command that joins two adjacent lines with the N command. When joining lines with the N command, a newline character n is placed between them. Therefore it uses the s command to replace this newline n with a colon followed by a space ": ".

The e-book is 98 pages long and it explains exactly 100 one-liners. It's divided into the following chapters:

Preface.
1. Introduction to sed.
2. Line Spacing.
3. Line Numbering.
4. Text Conversion and Substitution.
5. Selective Printing of Certain Lines.
6. Selective Deletion of Certain Lines.
7. Special sed Applications.
Appendix A. Summary of All sed Commands.
Appendix B. Addresses and Ranges.
Appendix C. Debugging sed Scripts with sed-sed.
Index.

Did you know that sed was as powerful as any other programming language? Someone even wrote Tetris in it.

After you read the e-book, you'll be able to write your own Tetris if you wanted to. read more...
mail this link | permapage | score:9204 | -pkrumins, September 19, 2011

Scripting: Bash Array Tutorial

Up
vote
Down

An excellent introduction to bash arrays including 15 examples...
$ cat arraymanip.sh
#! /bin/bash
Unix[0]='Debian'
Unix[1]='Red hat'
Unix[2]='Ubuntu'
Unix[3]='Suse'

echo ${Unix[1]}

$./arraymanip.sh
Red hat
read more...
permapage | score:9189 | -Ray, June 7, 2010

Open source Cloud Computing with PHP and MySQL

Up
vote
Down

In this article you will learn how Aptana makes it easy to develop applications based on PHP and MySQL, and how to deploy them to the cloud. Also explore some of the critical design differences between a cloud application and a traditional N-tier application. read more...
permapage | score:9187 | -solrac, May 18, 2009

Tutorial: Creating graphics with PHP

Up
vote
Down

Imagine creating Web-page graphics dynamically using just code. Creating and manipulating images is yours for the doing with the power of PHP. This tutorial steps through using the GD library, showing you how to create and alter images on Web pages. It starts with the GD construct, and then builds on it to showcase graphics techniques. read more...
permapage | score:9183 | -jmalasko, July 8, 2008

Introduction to Java programming

Up
vote
Down

This two-part tutorial introduces the structure, syntax, and programming paradigm of the Java language and platform. In Part 1, learn the essentials of object-oriented programming on the Java platform, including fundamental Java syntax and its use. In Part 2 explore the more-sophisticated syntax and libraries you will need to develop complex, real-world Java applications. read more...
mail this link | permapage | score:9174 | -solrac, August 24, 2010

More CommandLineFu One-Liners Explained

Up
vote
Down

Remember the previous post on CommandLineFu One-Liners Explained?

This article explains the next ten top one-liners.

For example, did you know "dd if=/dev/dsp | ssh username@host dd of=/dev/dsp" outputs your microphone on remote computers's speaker? This article explains how it works. read more...
permapage | score:9167 | -pkrumins, March 25, 2010

Dojo for Java programmers

Up
vote
Down

Many developers have strong skills in Java programming, but only limited experience in JavaScript. They can struggle with the conceptual leap from a strongly typed, object-oriented compilation language to a dynamic, weakly typed scripting language. This article helps you bridge the gap from Java code to Dojo, shows why it may be necessary to set context, and describes how to go about it. read more...
permapage | score:9161 | -jmalasko, October 21, 2008

Space Tyrant: Multithreading lessons learned on SMP hardware

Up
vote
Down

There is much to report in this update of Space Tyrant. Before getting into the new features and functions, I’ll dispense with the crisis of The Bug.

For a couple of weeks, we had been noticing odd anomalies with Space Tyrant (ST) running on the virtual server at Ioresort.com (now offline -Ed.). We never saw the problem on any other box -- and it was tested on at least four other Linux boxes and a Mac OS X system. We did all manner of stress testing, locally and over the Internet, script based and even feeding the game the output of /dev/random. Nothing caused the anomaly on any other box.

At first, I suspected that it might just be an obscure problem with the virtual server itself; after all, I had been forced to modify the TLR code to get it to run properly there. That problem turned out to be merely a limitation of NFS, not a bug with the virtual server software. However, the environment was clearly different from any other system I had used which raised my suspicions -- and reduced my urgency about looking for the bug.

While the bug wasn’t frequent, it was persistent. The bug appeared to be related to corrupted buffers or corrupted buffer indexes. Out of idle curiosity, I lowered the number of buffers used by ST to see if that affected the bug. Somewhat counter-intuitively, it substantially raised the frequency of the problem.

Brian Estabrooks (the hero of this release) and I spent more and more of our efforts hunting this incredibly elusive bug until that was all we were doing. I implemented various diagnostic routines hunting for clues. The all seemed to point to buffer indexes being changed incorrectly. Both Brian and I audited the code. It seemed impossible for the indexes to be changed improperly. Brian even went so far as to replace the ring buffer scheme with a high watermark approach but to no avail.

While I continued to suspect it to be a simple logic error in the code, Brian turned his efforts elsewhere. What he came up with was quite interesting. It seems that on many hardware architectures (most? all?), modifying a bit field can temporarily modify other bit fields in the same word! Now, this isn’t a problem on a single-CPU system; it repairs the damage in the same operation, making it, effectively, atomic. On an SMP machine, however, two different CPU’s working on different bit fields of the same word simultaneously create havoc. The operation isn’t really atomic and it doesn’t work.

Did I mention that the virtual server is a 4-way Xeon system?

The ring buffer indexing in ST relies on unsigned integer bit fields to automate wrapping back around to the first buffer after using the last one. My parsimonious programming, of course, packed all the bit fields together, several to a word. Brian’s test version of ST added a pad after each buffer index to round it out so that each bit field lived alone in its own complete word. We abused the new version for nearly an hour before either of us would dare say it. The bug was gone.

Yay!

So, the moral of this story is: Operations on sub-word fields affect other bits in that word (at least on many hardware architectures). Tread very carefully if multiple threads are accessing different bits in shared words. It may appear to work perfectly, only to crumble into a pile of smoldering rubble the first time it's loaded on a multiple CPU system!

Other than the primary lesson, some other good things came out of (the search for) the bug. Several other latent bugs were found and fixed and Brian and I are both much more intimate with the code.

And, on to the enhancements. ST is starting to look like an actual playable game. The following functions implement the new major features.

players(): We now have player rankings. It works by adding all the players’ ship resources to an integer array. Then it scans the universe looking for deployed fighters and adds those to the array as well. Currently, those two items comprise the total strength of a player.

It then sorts the array with a recursive bit-plane sort that I wrote for Starship Traders in 1998. The qsort() function in the C library was plenty fast, but took too much memory for my taste. Memory was a bit scarcer in those days and, worse, the SST software model gave each player his own copy of the server.

The sort reorders the array in place as follows. It scans the high-order bit in each element of the array. It then moves all elements starting with ‘1’ bits to the top and all starting with ‘0’ bits to the bottom. Next, it calls itself twice to reorder the first and second chunks of the array on the second bit. Each of those two instances of the sort then call the sort twice again, now giving 4 new sorts for the third bit, and so on. When all 32 bits are accounted for, the array is in the correct order with the top player on top, etc.

Scanning the entire universe can be expensive with a large map. Therefore, the player rankings function keeps the result and time stamps it. If another player asks for a player ranking within five seconds, the system just gives them the old one. After five seconds, however, any new request triggers a fresh listing.

autopilot(): We’ve added an autopilot to let a player find a specific sector -- or to locate the nearest planet. If you type a ‘0’ (zero), you’ll be prompted for a sector number within 1000 of the sector you’re currently in. You then will have the option of pressing ‘/’ to automatically warp to the destination sector.

If you’re looking for a planet, type the ‘L’ command that you would normally use to land on a planet in your sector. In the absence of a planet, the L key will engage the autopilot which will search for the nearest planet and give you a ‘/’ command to autowarp to it.

The new autopilot function consists of two other functions in addition to autopilot(), which is merely a control function. I had intended to use the old shortest path algorithm function from TLR but it was big and complicated. I decided to try to write a simpler, recursive shortest path algorithm instead. The new recursive function is much simpler but not quite as efficient as the giant for loop in TLR.

The actual algorithm is implemented in two functions called pathdepth() and pathcalc(). The pathdepth() function repeatedly calls pathcalc() with an increasing ‘depth’ parameter. ‘Depth’ tells pathcalc() how many levels deep to search before giving up.

The pathcalc() function simply looks to see if the sector it is looking at is the target sector. If not, it calls itself for each new sector that the current sector connects to. If the current sector is the target sector, it starts filling in an array for the autowarp() function to follow to reach the target sector. As the previous recursive calls to the pathcalc() function exit, they fill in the remainder of the path array.

And, yes, I seem to like reinventing the wheel. ;-)

The other interesting addition to the code is the backup thread. It is implemented by a function called backupdata() and works as follows: It scans the player data, the map data, and the history data looking for ‘dirty’ flags. (Whenever any persistent data is changed anywhere in the game, a dirty flag is set to tell the backup thread to write it out to disk.) This process is quite fast for a small game, but for a game with millions of sectors, it’s a significant waste of resources to scan the dirty flag array frequently.

Therefore, for the map and history data, I’ve implemented a ‘dirty block’ scheme as well. When a dirty flag is set, its corresponding dirty block flag is set too. Then, the backup thread need only scan the dirty block arrays, typically only about one percent the size of the arrays it represents. When a dirty block is found, only the hundred or so records it points to are scanned to find the actual dirty records for backup.

The backup file, named ‘st.9999.dat’ -- where ‘9999’ varies with the port number you run the game on -- goes into the current working directory from where you start the daemon. If the file doesn’t exist, a new game is started. Also, if you’ve modified the game in a way that changes the size of the data -- by increasing the map size, for example -- it will start a new game upon startup.

The game can be shut down from the command line by sending a signal 15 (kill -15 pid) or by the admin with the ^ command. Note that the first player to create an account in a new game automatically becomes the admin of the game!

makehistory(): The storing of historical data is new as well. Whenever another player attacks your ship while you’re logged off, you’ll get a report of the action and any losses when you next log on. Also, for remote deployed fighters, you never get immediate notification, so that information is stored in the history log even if you're logged on when it happens. You can view any accumulated event information since your login time by pressing the ‘e’ key.

deploy(): This simple function allows a player to deploy, or retrieve, guard fighters in a sector. Those fighters will not let another player pass through or view any of the contents of that sector. Any ships parked under the fighters are automatically protected against all attacks except for an attack by the fighters’ owner. Once the fighters are destroyed, of course, all ships there are visible and can be attacked.

There is also a newly implemented time limit in the game to limit the total online time of a day’s sessions to 4 hours. Like most other parameters, it can be changed by modifying a #define statement near the top of the code.

command(): The help page, a menu of available commands that a player can perform, has been redesigned and rewritten. This menu is attached to the '?' key.

The old debugger thread is gone, replaced by an in-game command function called showdata(). Press the ‘z’ key to see information on buffers, buffer indexes, and the backup thread’s state and history. Only if you’re serious about modifying the code will this information be useful.

The section of the gameloop thread that broadcasts radio and news messages has been modified to show only one of each type of message per pass. That way, replaying a long radio history won’t flood the output buffers and longer radio and news histories can therefore be retained.

The old jumprtn() movement function has been consolidated into the warprtn() function. It’s only slightly more complicated than having them separate.

The current source code can be downloaded from http://librenix.com/st/st.158.c. and the original article in this series is here. As usual, the compile script is embedded in the comments at the top of the source file. You’ll have to rename the source st.c for the script to work unchanged.

[A Space Tyrant home page has been created as a central index to the various ST articles, links, and files.]
mail this link | permapage | score:9151 | -Ray, June 26, 2005 (Updated: July 26, 2008)

Space Tyrant: A multiplayer network game for Linux

Up
vote
Down

Since the last release of Space Tyrant, it has gained some actual game-like functionality. The new code can be downloaded from st2.c. Download it as well as the shell script you’ll need to compile it: makeit2.sh.

It’s now possible to connect to the game via telnet and to create an account, log in, and be issued a ship. Once you’re logged in, there is a universe to explore filled with ports for buying and selling goods and planets for scooping free goods. From those trading activities you can earn money, called microbots. Other than trading to earn more money, you only use your microbots to buy fighters -- which you can use to attack other players or the neutral fighters that guard some sectors.

The neutral fighters are only good for parking under while you’re not playing. They afford a little bit of free protection for your ship since no one can attack you until they first destroy the neutral fighters. Note that you can attack other players whether they are logged in or not and any fighters with their ship will automatically try to defend them.

Each player starts out with a specific supply of fuel, called antimatter. Each minute a small amount of additional antimatter is issued by a function called updatefuel(). If you’re not logged in, fuel just accumulates in your ship. This continuous allocation of fuel makes Space Tyrant a type of turn-based game. Unlike traditional turn-based games, however, you can play your fuel all at once or a little at a time and completely independently of how and when other players play.

You can also talk to other players on the radio. There is only one channel so everyone who is logged in hears everything that is said on the radio.

The game isn’t yet playable in any reliable sense, however, because it doesn’t yet back up and reload the data from disk files. The software creates an instance of the game when you run it and it remains running until you stop it or the system goes down. There is also no way to establish a time limit on a game.

That’s pretty much the extent of the functionality changes. Now, on to the code.

First, there is a login function. That function looks in the player database struct and, if the player name doesn’t already exist, it creates an account there. If the name does exist, it prompts for a password, matches it against the stored password, and logs you in if the two match. There is not yet a way to change your password.

Once a player is logged in, he is faced with a sector description and a ‘choice:’ prompt. Any character that the player types at this prompt is immediately acted on as if it were a command. There is a string called ‘commlist’, short for command list, containing the letters and characters that are used as commands. A function pointer array, ‘fp[]()’, is used to store the locations of the command functions. Another function called ‘commscan()’ looks up the command letter typed and returns an index into the fp[]() function pointer array. This combination of the commlist string, the commscan function, and the fp function pointer array constitute the command processing loop of the game, as shown below:

userndx=commscan(
tolower(
threc[th].inbuf
[threc[th].inptr][0]
),commlist
);
result=fp[userndx](th);

These lines are embedded in a loop where each user’s input thread, represented by the variable ‘th’, is examined for new input. The new input arrives in string called inbuf. Since each thread has several buffers, an index called inptr is used to keep track of which one is currently being processed.

And, as described above, commscan is used to extract the appropriate function index and place it in a variable called ‘userndx’. Then, userndx is used to index into the fp function pointer array and the thread index (th) is passed to the appropriate command-processing function.

There’s a small amount of misdirection in that first line but, once understood, it becomes trivial to add additional commands. Basically, you just need to replace the placeholder function, ‘nullrtn’, with your new function name adjacent to the command letter you select in the fp[]() definition list.

The new functions are discussed below.

makemap()
In keeping with the evolving game nature of this project, several actual game functions have been added. The first new function, makemap(), builds a 20,000-sector single-galaxy universe and populates it with objects. By changing the GAMESIZE constant, you can build a universe of arbitrary size, but make sure you don’t try to build a universe so big as to consume too much of your system’s memory. I’ve tested universes of up to 1,000,000 sectors, which seem to work just fine. The makemap() function randomly puts ports, planets, fleets of neutral fighters, and nebulas in various sectors throughout the universe, and interconnects the sectors with randomly-generated one-way ‘warps’. Note that planets and ports are randomly given varying productivity's and random initial inventories of our three commodities: Iron, Alcohol, and Hardware.

Note that makemap() builds each sectors array of six warps, sorts them into ascending order, and then looks for duplicate warps. If any duplicates are found, it decrements the loop-controlling variable and simply rebuilds that entire sector from scratch. The sorted warps are a convention that we will maintain throughout the project. Each new galaxy type that we add in the future will adhere to that convention and other functions (and users) will be allowed to assume that warps are in ascending order.

command()
We have added a function to simply list the implemented commands and a short line of description. For now, the function is attached to the command letters ‘?’ and ‘H’ via the function pointer array and the commlist array. This function is mostly useful to illustrate a design limitation. The output of any single sprintf buffer-building function cannot exceed the MAXLINE buffer size constant. This function produces a single buffer out output very near the current 511-byte limit and will soon have to be split to produce two buffers of output. Assuming, of course, that we don’t increase the MAXLINE buffer size.

jettison()
The ‘J’ command activates the jettison() function. It’s only purpose is to dump any cargo out of your cargo holds. It illustrates the method we use to let a function that requires multiple characters of input -- or simple confirmation -- to temporarily turn off command processing and send the next character of input back to it. Jettison requires confirmation so that you don’t accidentally dump your cargo just by hitting the J key. (Since all commands operate as ‘hot’ keys you do not have to hit the [Enter] key to activate a command -- each command immediately executes as soon as you press a key.)

Each command function has the ability to set the thread’s control variable to it’s own command letter. That way, the command processing loop can simply check ‘control’ pass the next buffer of input directly to whichever function is indicated.

warprtn()
jumprtn()
The warprtn and jumprtn functions process requests to move to another sector. warprtn() processes the commands 1, 2, 3, 4, 5, and 6, which represent a user’s request to move to the first through the sixth sector number in the warp list, respectively. jumprtn() processes requests to move to a randomly selected sector in the warp list via the ‘-’ (or ‘=’) key. jumprtn() also implements commands to move to the next larger sector, the next smaller sector, as well as the largest and smallest sector number via the ‘.’, ‘,’, ‘>’, and ‘game design and the programming model. The second article discusses the IO handling code and more of the details of the programming model.]

[Update, June 25, 2005: A Space Tyrant home page has been created as a central index to the various ST articles, links, and files.]

[Update, March 21, 2007: Space Tyrant now has a website of its own!. This site is new but growing and will be the quickest way to find new information and code on the Space Tyrant project.]
mail this link | permapage | score:9146 | -Ray, May 30, 2005 (Updated: March 21, 2007)

Tutorial: Build an Arduino laser game

Up
vote
Down

Arduino is an easy-to-use electronics platform. The entire platform, both the hardware and the software, is completely open source, and the language is loosely based on C/C++. Whether you're new to Arduino or a seasoned builder, this project has something for you. There's nothing quite as satisfying as creating an interactive physical object. Use this tutorial to create an interactive laser game called "'Duino tag," where players can play tag using devices built nearly from scratch. read more...
permapage | score:9111 | -solrac, February 2, 2009

Sed One-Liners Explained

Up
vote
Down

My previous post was about Awk One-Liners Explained and now I bring to you Sed One-Liners Explained!

Most people are only familiar with one particular command of sed, namely the "s" (substitute) comand. s/comand/command/. That is unsatisfactory. Sed has at least 20 different commands for you.

For example, any ideas what this sed one-liner does?

sed '/n/!G;s/(.)(.*n)/&21/;//D;s/.//'

Read the article to find it out! read more...
permapage | score:9105 | -pkrumins, November 22, 2008

Vim plugins: snipmate.vim

Up
vote
Down

This article introduces the snipmate vim plugin.

Snipmate.vim is probably the best snippets plugin for vim. A snippet is a piece of often-typed text or programming construct that you can insert into your document by using a trigger followed by a .

For example, you type "for" and press TAB, and the plugin inserts "for (i = 0; i < n; i++) { }" in your code! read more...
permapage | score:9104 | -pkrumins, August 10, 2009

Unix signals list

Up
vote
Down

Processes are required to respond to signals sent to them. This is one way a user can communicate with signals and control them.
Signals are asynchronous events that can occur to a running process and may be caused by hardware, software or users. Signals are numeric integer messages that have been predefined so they understand what these signals mean. When a process receives a signal, that process must respond to the signal. Uncaught signals will cause default actions to take place, which often means the process is terminated. If you use “kill -l”, or “trap -l” you can get a list of available signals:
read more...
mail this link | permapage | score:9103 | -aweber, December 31, 2010

Vim Plugins: matchit.vim

Up
vote
Down

This is the third post in the article series "Vim Plugins You Should Know About". This time I am going to introduce you to a plugin called "matchit.vim".

Matchit extends the existing functionality of “%” key (percent key). I'll first briefly remind you what the original “%” does and then explain how matchit.vim enhances it. read more...
permapage | score:9098 | -pkrumins, February 6, 2009

Space Tyrant Index Page: Linux game server development project

Up
vote
Down

This page links to the various articles that have been published about Space Tyrant, a multithreaded, network socket programming Linux game server project in C.

[Update: 07Jun2014 You can play a development version of an upcoming MMORPG in text mode at telnet://textMMOde.com:2323
or, on a command line, enter:
telnet textmmode.com 2323
to log in and play. This game is based on Space Tyrant and the scenario is based on a modified Starship Traders.]

[Update: 03Jun2014 Starshiptraders, the parent of Space Tyrant, and the descendant of Czarwars, Lives Again]

Read below for the history and overview or just click these links for the articles:Space Tyrant is a C language Linux game server development project. It started out in February, 2005 as a humble echo server with high ambitions. On March 18, ST had its design and intentions announced to the world.
Today we kick off a new multithreaded, network socket programming project which we will call Space Tyrant. Our mission is to write an open source, multiplayer, networked, strategy game in the C programming language. The goal of this project is to make a solid code base which implements a simple space trading game upon which other games can then be built. The game will be a subset of The Last Resort (TLR) that currently runs at Ioresort.com. This project will be a learning exercise for me as well as for any interested readers. The current state of the source code will be released with each article update.
Source code to ST, then just an echo server, was not released.

Then, on March 27, 2005, ST was promoted to a crude chatserver.
This is the first code release of Space Tyrant. This is an early stage of development and, at this point, only implements the listening thread, the two IO threads for each player connection, and a skeletal game logic thread that does little beyond proof-of-concept code.
Next, on May 30, 2005, ST started to resemble some sort of incomplete text game.
It’s now possible to connect to the game via telnet and to create an account, log in, and be issued a ship. Once you’re logged in, there is a universe to explore filled with ports for buying and selling goods and planets for scooping free goods. From those trading activities you can earn money, called microbots. Other than trading to earn more money, you only use your microbots to buy fighters -- which you can use to attack other players or the neutral fighters that guard some sectors.
As of this release, the source code was placed under the GPL, version 2.

On June 26, 2005, Space Tyrant was released with many shiny new abilities. Players can now deploy fighters to guard sectors, navigate with the aid of an autopilot, rank the various players in the universe, and sleep peacefully knowing their alternate universe is being backed up constantly by a sporty new backup thread. Yes, good times are surely upon us.
If you’re looking for a planet, type the ‘L’ command that you would normally use to land on a planet in your sector. In the absence of a planet, the L key will engage the autopilot which will search for the nearest planet and give you a ‘/’ command to autowarp to it.
There is normally a copy of the development version of the server running on my decTOP on port 23. To access it, type (or click, if it works for you) the following command:

(telnet to my ST server)

The current development version of the code is usually at http://librenix.com/st/st.c but the individual articles link to the specific versions discussed in each article.

You can mail me about the project at spacetyrant [at] librenix.com -- or you can just telnet into Space Tyrant, as listed above, and send me a radio message. I'm likely to get that faster. ;)


The Space Tyrant project has a new website, SpaceTyrant.com, where the latest source code is always available. Also, new articles about ST programming and about ST gameplay will be posted there as they come available.


Information on The Last Resort follows. TLR is one of the two games that Space Tyrant is intended to replace someday. Space Tyrant has a long way to go before it replicates TLR's 25,000 lines of C code. So far, it has reused only about 40 lines of TLR code, a handy 'bit-plane' sort dating back to 1998.

  • TLR Survival Manual
  • Is this game for you? read more...
  • mail this link | permapage | score:9098 | -Ray, June 25, 2005 (Updated: June 7, 2014)

    The Real Microsoft Monopoly

    Up
    vote
    Down

    The courts have ruled that Microsoft holds a monopoly position in Intel PC Operating Systems. Business users have long been aware of Microsoft's lock on office productivity applications that require them to use MS Office in order to remain compatible with their business partners and customers. And web-surfing users are now using Internet Explorer in a ratio of about 8:1 over alternative browsers.

    But one aspect of Microsoft's monopoly is more fundamental than any of those; the investment in skill, experience, training, and tools of Windows software developers themselves.

    Those programmers, who have logged many long sessions of coding for the Windows environments, and with their deep immersion in its assumptions, tools, and API's, represent millions of person-years of Microsoft assets.

    For years it has been a difficult decision for a professional developer to choose an environment other than Windows. The scale of that market dwarfs its competitors and opens to developers many more specialty markets than any alternative platform. Further, the sheer size of the Windows installed base is seen as a hedge against market change. Windows is perceived as a platform that will be with us for a long time to come.

    Because it can take years of effort to reach the highest levels of productivity in a complex development environment, Windows-specialized programmers have, through economic necessity, been unable to switch to a different platform. With a large majority of developers writing code for Windows, the continued dominance of Windows applications was also assured. The monopoly was elegantly self-perpetuating.

    Many companies, failing to appreciate the depth of Microsoft's monopoly and its determination to defend it, squandered valuable resources probing Microsoft's markets for an opportunity. After several spectacular failures, it seemed nearly impossible for such a locked market to break free of this cycle.

    It seemed impossible, that is, until recently. Windows is no longer leading the growth curve among operating systems. The near perfect seal at the margins of the monopoly, it turns out, is only effective against competitors with a requirement to make money.

    While Microsoft once made the fending off of mighty IBM look easy, the Linux phenomenon presents a very different kind of challenge. It needs no profits, corporate partnerships, or investors in order to succeed. Linux depends only on hobbyists' passion for programming and their self-imposed standards of quality in their own work. Further, the Linux community seems to draw motivation from its dissatisfaction with the computing landscape that Microsoft has created.

    This noncorporate juggernaut has grown so large that it is spilling into commercial markets on many fronts. Now, with the additional support of several large corporations, the expansion rate of Linux could actually accelerate.

    Much of the continued growth of Linux will come at the expense of Microsoft. Others will lose business along the way, of course, but the ubiquitous presense of Microsoft astride the market presents many targets that are simply too broad to miss.

    Unfortunately for Windows programmers, at some point the rapid growth of Linux will force the saturated Windows market to start shrinking. Soon thereafter, the seller's market for Windows programming services will become a buyer's market -- and pay scales will begin to drop. Although the computer industry has experienced many of these disruptions in the past as new competition entered the market, this will be the largest such contraction by far.

    Confidence in the impenetrable market lock of MS Windows is slowly fading. Some years from now when this trend reversal is complete and documented, we will look back to a single turning point to call the end of Windows' dominance. I'm making my pick a little prematurely. I think the critical point was IBM's decision to support and invest heavily in Linux.
    mail this link | permapage | score:9098 | -Ray, July 9, 2001 (Updated: April 18, 2007)

    C Source Code Example: Multithreaded RPC Server

    Up
    vote
    Down

    This can be considered an example, how to build multithreaded RPC Server for White Box Linux 3. Actually, approach described is universal , i.e. doesn't depend on particular code has been modified.

    [Update June 26, 2005: Librenix is now featuring a C language multithreaded network socket programming game server project for Linux called Space Tyrant. As of June 26, there have been four code releases and the game is already playable from telnet.]

    (here are some white canvas prints) read more...
    mail this link | permapage | score:9088 | -Boris Derzhavets, May 14, 2005 (Updated: April 24, 2012)
    More coding articles...
    Beautiful Abstract Art Prints

    coding headlines

    JSEclipse Tutorial: A JavaScript Eclipse Tool

    Scripting: Put a clock in your bash terminal

    Forking vs. Threading

    DWR Java Ajax: User Interface (pdf)

    Import XML into OpenOffice Calc with XSLT

    Debugging Shell Scripts

    Programming the Sony PS3 SPE cores under Linux

    Pattern matching in shell scripting

    Tutorial: Linux Dialog Boxes

    Online Ruby Interpreter

    Space Tyrant: A threaded game server project in C

    Space Tyrant: A threaded C game project: First Code

    PowerPC assembly language

    Porting C / C++ code from Windows to Linux / Unix

    Build Apps with Android SDK, Eclipse, PhoneGap (Ubuntu 10.10)

    Tutorial: Build your first application with Spring Framework

    String matching in regular expressions

    Mono-culture and the .NETwork effect

    Why Programmers are not Software Engineers

    Tutorial: Write your own operating system

    I wrote my first programming e-book: Awk One-Liners Explained

    Tutorial: UDP socket based client server C programs

    Review: DevelopGo: A Linux Live CD for Programmers

    Tutorial: Write a Qt program with Qt Designer

    Java: Real numbers

    Tutorial: Android app development environment on Debian 6

    Tutorial: MySQL Select statement

    13 Regex Features

    PHP: Associative Array Tricks

    Why software sucks

    Ten more One-Liners from CommandLineFu explained

    Development tools: Autotools vs. CMake

    Create native looking Firefox web apps

    Quick and Dirty Vimdiff Tutorial

    PHP vs. ASP

    Tutorial: Android development environment on Fedora 14

    Command line functions

    Programming Language Tradeoffs: 3GL vs 4GL

    Secure String Coding in C and C++

    Python for Kids

     

    Firefox sidebar

    Site map

    Site info

    News feed

    Features

    Login
    (to post)

    Search

     
    Articles are owned by their authors.   © 2000-2012 Ray Yeargin