<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DZone Snippets: line code</title>
    <link>http://snippets.dzone.com/posts</link>
    <pubDate>Fri, 16 May 2008 22:27:27 GMT</pubDate>
    <description>DZone Snippets: line code</description>
    <item>
      <title>TimeLine //JavaScript Class</title>
      <link>http://snippets.dzone.com/posts/show/5293</link>
      <description>&lt;br /&gt;&lt;br /&gt;&lt;a href="http://jsfromhell.com/classes/timeline"&gt;&lt;br /&gt;Simulates the Adobe Flash timeline. You define the amount of frames, the speed in fps (frames per second) and, at each frame passage an event is called, useful for animations.&lt;br /&gt;&lt;br /&gt;[UPDATED CODE AND HELP CAN BE FOUND HERE]&lt;br /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;code&gt;&lt;br /&gt;//+ Jonas Raoni Soares Silva&lt;br /&gt;//@ http://jsfromhell.com/classes/timeline [v1.0]&lt;br /&gt;&lt;br /&gt;TimeLine = function(fps, f){&lt;br /&gt;	this.fps = fps, this.frames = f;&lt;br /&gt;};&lt;br /&gt;with({o: TimeLine, $: TimeLine.prototype}){&lt;br /&gt;	o.timers = [];&lt;br /&gt;	$.running = !!($.current = +(o.timer = $.time = null));&lt;br /&gt;	o.run = function(){&lt;br /&gt;		var o = this;&lt;br /&gt;		o.timer || (o.timer = setInterval(function(){&lt;br /&gt;			for(var h, d = +(new Date), t = o.timers, i = t.length; i--;){&lt;br /&gt;				(!t[i].running || ((d - t[i].time) / (1e3 / t[i].fps) &gt; t[i].current + 1 &amp;&amp;&lt;br /&gt;				t[i].onframe(++t[i].current), t[i].current &gt;= t[i].frames)) &amp;&amp;&lt;br /&gt;				(h = t.splice(i, 1)[0], h.stop(1));&lt;br /&gt;			}&lt;br /&gt;		}, 1));&lt;br /&gt;	};&lt;br /&gt;	$.start = function(c){&lt;br /&gt;		var o = this, t = TimeLine;&lt;br /&gt;		if(o.running) return;&lt;br /&gt;		o.running = true, o.current = c || 0;&lt;br /&gt;		o.time = new Date, o.onstart &amp;&amp; o.onstart();&lt;br /&gt;		if(!o.onframe || o.frames &lt;= 0 || o.fps &lt;= 0)&lt;br /&gt;			return o.stop(1);&lt;br /&gt;		t.timers.push(this), t.run();&lt;br /&gt;	};&lt;br /&gt;	$.stop = function(){&lt;br /&gt;		var o = this;&lt;br /&gt;		o.running = false;&lt;br /&gt;		if(!TimeLine.timers.length)&lt;br /&gt;			TimeLine.timer = clearInterval(TimeLine.timer), null;&lt;br /&gt;		arguments.length &amp;&amp; o.onstop &amp;&amp; o.onstop();&lt;br /&gt;	};&lt;br /&gt;}&lt;br /&gt;&lt;/code&gt;&lt;br /&gt;&lt;br /&gt;Example&lt;br /&gt;&lt;br /&gt;&lt;code&gt;&lt;br /&gt;&lt;br /&gt;&lt;div id="box" style="position: absolute; top: 100px; background: #efe; width: 100px; height: 100px"&gt;25 fps&lt;/div&gt;&lt;br /&gt;&lt;div id="box2" style="position: absolute; top: 300px; background: #ff9; width: 100px; height: 100px"&gt;12 fps&lt;/div&gt;&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;TimeLine working together with the ease in quad function.&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;script type="text/javascript"&gt;&lt;br /&gt;Math.ease = function (t, b, c, d) {&lt;br /&gt;	if ((t /= d / 2) &lt; 1)&lt;br /&gt;		return c / 2 * t * t + b;&lt;br /&gt;	return -c / 2 * (--t * (t - 2) - 1) + b;&lt;br /&gt;};&lt;br /&gt;&lt;br /&gt;var o = new TimeLine(25, 50), d = document, b = d.getElementById("box");&lt;br /&gt;o.onframe = function(){&lt;br /&gt;	b.style.left = Math.ease(this.current, 0, 400, 30) + "px";&lt;br /&gt;};&lt;br /&gt;o.onstart = function(){&lt;br /&gt;	d.body.appendChild(d.createTextNode("Started"));&lt;br /&gt;};&lt;br /&gt;o.onstop = function(){&lt;br /&gt;	d.body.appendChild(d.createTextNode(" - Finished (" + (((new Date) - this.time)) + " msec)"))&lt;br /&gt;	d.body.appendChild(d.createElement("br"));&lt;br /&gt;	this.start();&lt;br /&gt;};&lt;br /&gt;o.start();&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;var o2 = new TimeLine(12, 50), b2 = d.getElementById("box2");&lt;br /&gt;o2.onframe = function(){&lt;br /&gt;	b2.style.left = Math.ease(this.current, 0, 400, 30) + "px";&lt;br /&gt;};&lt;br /&gt;o2.onstop = function(){&lt;br /&gt;	this.start();&lt;br /&gt;};&lt;br /&gt;o2.start();&lt;br /&gt;&lt;/script&gt;&lt;br /&gt;&lt;/code&gt;</description>
      <pubDate>Sun, 30 Mar 2008 16:49:21 GMT</pubDate>
      <guid>http://snippets.dzone.com/posts/show/5293</guid>
      <author>jonasraoni (Jonas Raoni Soares Silva)</author>
    </item>
    <item>
      <title>Twitter and Jaiku from the command line</title>
      <link>http://snippets.dzone.com/posts/show/5265</link>
      <description>The following instructions make it easy to post to Twitter and Jaiku from the command line. The instructions were copied from the article &lt;a href="http://snipr.com/22b38"&gt;"Ubuntu Unleashed: Howto Twitter From the Command Line in Ubuntu!"&lt;/a&gt;  [ubuntu-unleashed.com] and modified to post via Rorbuilder's ProjectX API.&lt;br /&gt;&lt;br /&gt;&lt;code&gt;sudo apt-get install curl&lt;/code&gt;&lt;br /&gt;&lt;code&gt;sudo gedit /usr/bin/jaitwit&lt;/code&gt;&lt;br /&gt;Now Paste this in gEdit and simply replace "YourUsername" with your username and "YourPassword" with your twitter passwd, then replace the Jaiku variables (YourUsername, YourPassword, YourCity, YourAccessKey) and ctrl-s to save, then alt-F4 to exit!&lt;br /&gt;&lt;code&gt;&lt;br /&gt;curl http://rorbuilder.info/api/projectx.cgi?xml_project=%3Cproject%20name=%22micro_blog%22%3E%3Cmethods%3E%3Cmethod%20name=%22post2jaiku%22%3E%3Cparams%3E%3Cparam%20var=%22user%22%20val=%22YourUsername%22/%3E%3Cparam%20var=%22msg%22%20val=%22`echo $@|tr ' ' '+'`%22/%3E%3Cparam%20var=%22location%22%20val=%22YourCity%22/%3E%3Cparam%20var=%22apikey%22%20val=%22YourAccessKey%22/%3E%3C/params%3E%3C/method%3E%3Cmethod%20name=%22post2twitter%22%3E%3Cparams%3E%3Cparam%20var=%22user%22%20val=%22YourUsername%22/%3E%3Cparam%20var=%22msg%22%20val=%22`echo $@|tr ' ' '+'`%22/%3E%3Cparam%20var=%22password%22%20val=%22YourPassword%22/%3E%3C/params%3E%3C/method%3E%3C/methods%3E%3C/project%3E -o /dev/null&lt;br /&gt;echo Message Sent!&lt;br /&gt;&lt;/code&gt;&lt;br /&gt;Then chmod for exec privileges:&lt;br /&gt;&lt;code&gt;chmod +x /usr/bin/jaitwit&lt;/code&gt;&lt;br /&gt;Then from the CLI type jaitwit followed by your message.&lt;br /&gt;&lt;code&gt;jaitwit "message here without the quotes"&lt;/code&gt;</description>
      <pubDate>Fri, 21 Mar 2008 18:28:00 GMT</pubDate>
      <guid>http://snippets.dzone.com/posts/show/5265</guid>
      <author>jrobertson (James Robertson)</author>
    </item>
    <item>
      <title>Simple way to check command line arguments in a C program</title>
      <link>http://snippets.dzone.com/posts/show/5175</link>
      <description>A simple way to check command line arguments.&lt;br /&gt;&lt;br /&gt;Author: &lt;a href="http://www.inf.ufrgs.br/~jmftrindade"&gt;Joana Matos Fonseca da Trindade&lt;/a&gt;&lt;br /&gt;Date: 2008.02.25&lt;br /&gt;&lt;br /&gt;&lt;code&gt;&lt;br /&gt;#include &lt;stdio.h&gt;&lt;br /&gt;#include &lt;stdlib.h&gt;&lt;br /&gt;#include &lt;string.h&gt;&lt;br /&gt;&lt;br /&gt;/* minimum required number of parameters */&lt;br /&gt;#define MIN_REQUIRED 2&lt;br /&gt;&lt;br /&gt;/* display usage */&lt;br /&gt;int help() {&lt;br /&gt;   printf("Usage: myprogram [-s &lt;arg0&gt;] [-n &lt;arg1&gt;] [-true]\n");&lt;br /&gt;   printf("\t-s: a string a\n");&lt;br /&gt;   printf("\t-n: a number\n");&lt;br /&gt;   printf("\t-true: a single parameter\n");&lt;br /&gt;&lt;br /&gt;   return 1;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;/* main */&lt;br /&gt;int main(int argc, char *argv[]) {&lt;br /&gt;   if (argc &lt; MIN_REQUIRED) {&lt;br /&gt;      return help();&lt;br /&gt;   }&lt;br /&gt;   int i;&lt;br /&gt;&lt;br /&gt;   /* iterate over all arguments */&lt;br /&gt;   for (i = 1; i &lt; (argc - 1); i++) {&lt;br /&gt;       if (strcmp("-s", argv[i]) == 0) {&lt;br /&gt;          /* do something with it */ &lt;br /&gt;          printf("string = %s\n", argv[++i]);&lt;br /&gt;          continue;&lt;br /&gt;       }&lt;br /&gt;       if (strcmp("-n", argv[i]) == 0) {&lt;br /&gt;          /* do something with it. for example, convert it to an integer */&lt;br /&gt;          printf("number = %i\n", atoi(argv[++i]));&lt;br /&gt;          continue;&lt;br /&gt;       }&lt;br /&gt;       if (strcmp("-true", argv[i]) == 0) {&lt;br /&gt;          printf("true activated\n");&lt;br /&gt;          continue;&lt;br /&gt;       }&lt;br /&gt;       return help();&lt;br /&gt;   }&lt;br /&gt;   return 0;&lt;br /&gt;}&lt;br /&gt;&lt;/code&gt;</description>
      <pubDate>Mon, 25 Feb 2008 22:49:18 GMT</pubDate>
      <guid>http://snippets.dzone.com/posts/show/5175</guid>
      <author>jmftrindade (Joana M. F. da Trindade)</author>
    </item>
    <item>
      <title>ARGV Parser</title>
      <link>http://snippets.dzone.com/posts/show/5099</link>
      <description>This function parse ARGV and return a string.&lt;br /&gt;See exemples for more informations :&lt;br /&gt;&lt;br /&gt;// Go : http://blackh.badfile.net/wordz/&lt;br /&gt;&lt;br /&gt;Function :&lt;br /&gt;&lt;br /&gt;&lt;code&gt;&lt;br /&gt;  def options(param)&lt;br /&gt;  &lt;br /&gt;	i = 0&lt;br /&gt;		ARGV.each  { |valeur|&lt;br /&gt;		&lt;br /&gt;    		if (valeur == '-' + param.to_s)&lt;br /&gt;				return ARGV[i+1]&lt;br /&gt;			elseif (valeur != '-' + param.to_s)&lt;br /&gt;				return false&lt;br /&gt;			end&lt;br /&gt;		i += 1&lt;br /&gt;		}&lt;br /&gt;		&lt;br /&gt;   end&lt;br /&gt;&lt;/code&gt;&lt;br /&gt;&lt;br /&gt;Usage :&lt;br /&gt;&lt;br /&gt;// cmd&gt; ruby test.rb -o foo&lt;br /&gt;&lt;code&gt;&lt;br /&gt;&lt;br /&gt;	out =  self.options('o')&lt;br /&gt;&lt;br /&gt;	if (out != false and out.empty? == false)&lt;br /&gt;                   puts out # print -&gt; foo&lt;br /&gt;	end&lt;br /&gt;&lt;/code&gt;</description>
      <pubDate>Sun, 03 Feb 2008 20:24:59 GMT</pubDate>
      <guid>http://snippets.dzone.com/posts/show/5099</guid>
      <author>Black_H (Black_H)</author>
    </item>
    <item>
      <title>Parsing simple command line arguments in java, using the the Commons CLI library.</title>
      <link>http://snippets.dzone.com/posts/show/3504</link>
      <description>// Skeleton to read in two command line arguments, one mandatory, one optional&lt;br /&gt;&lt;br /&gt;&lt;code&gt;&lt;br /&gt;package snippets;&lt;br /&gt;&lt;br /&gt;import org.apache.commons.cli.*;&lt;br /&gt;&lt;br /&gt;/* &lt;br /&gt; * Stub program that reads command line arguments&lt;br /&gt; */&lt;br /&gt;public class CommandLineProgram {&lt;br /&gt;&lt;br /&gt;	private static Options options = null; // Command line options&lt;br /&gt;	&lt;br /&gt;	private static final String PROPERTIES_LOCATION_OPTION = "f";&lt;br /&gt;	private static final String OUTPUT_FILE_OPTION = "o";&lt;br /&gt;	private static final String DEFAULT_OUTPUT_FILE = "out.feed";&lt;br /&gt;	&lt;br /&gt;	private CommandLine cmd = null; // Command Line arguments&lt;br /&gt;	&lt;br /&gt;	private String outputFile = DEFAULT_OUTPUT_FILE;&lt;br /&gt;	&lt;br /&gt;	static{&lt;br /&gt;		options = new Options();&lt;br /&gt;		options.addOption(PROPERTIES_LOCATION_OPTION, true, &lt;br /&gt;				"Data file location");&lt;br /&gt;		options.addOption(OUTPUT_FILE_OPTION, false, "Output file. " + DEFAULT_OUTPUT_FILE + " by default ");&lt;br /&gt;		&lt;br /&gt;	}&lt;br /&gt;	&lt;br /&gt;	/**&lt;br /&gt;	 * @param args&lt;br /&gt;	 */&lt;br /&gt;	public static void main(String[] args) {&lt;br /&gt;		&lt;br /&gt;		CommandLineProgram cliProg = new CommandLineProgram();&lt;br /&gt;		cliProg.loadArgs(args);&lt;br /&gt;	}&lt;br /&gt;	&lt;br /&gt;	/**&lt;br /&gt;	 * Validate and set command line arguments.&lt;br /&gt;	 * Exit after printing usage if anything is astray&lt;br /&gt;	 * @param args String[] args as featured in public static void main()&lt;br /&gt;	 */&lt;br /&gt;	private void loadArgs(String[] args){&lt;br /&gt;		CommandLineParser parser = new PosixParser();&lt;br /&gt;		try {&lt;br /&gt;			cmd = parser.parse(options, args);&lt;br /&gt;		} catch (ParseException e) {&lt;br /&gt;			System.err.println("Error parsing arguments");&lt;br /&gt;			e.printStackTrace();&lt;br /&gt;			System.exit(1);&lt;br /&gt;		}&lt;br /&gt;		&lt;br /&gt;		// Check for mandatory args&lt;br /&gt;		&lt;br /&gt;		if (! cmd.hasOption(PROPERTIES_LOCATION_OPTION)){&lt;br /&gt;			HelpFormatter formatter = new HelpFormatter();&lt;br /&gt;			formatter.printHelp("java -jar this_jar.jar", options);&lt;br /&gt;			System.exit(1);&lt;br /&gt;		}&lt;br /&gt;		&lt;br /&gt;		// Look for optional args.&lt;br /&gt;		&lt;br /&gt;		if (cmd.hasOption(OUTPUT_FILE_OPTION)){&lt;br /&gt;			outputFile = cmd.getOptionValue(OUTPUT_FILE_OPTION);&lt;br /&gt;			&lt;br /&gt;		}&lt;br /&gt;	}&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;&lt;/code&gt;</description>
      <pubDate>Tue, 13 Feb 2007 00:51:34 GMT</pubDate>
      <guid>http://snippets.dzone.com/posts/show/3504</guid>
      <author>tunaranch (Haikal Saadh)</author>
    </item>
    <item>
      <title>Sort file by length of lines</title>
      <link>http://snippets.dzone.com/posts/show/3280</link>
      <description>Sort file by length of lines&lt;br /&gt;&lt;br /&gt;&lt;code&gt;&lt;br /&gt;cat $@ | awk '{ print length, $0 }' | sort -n | awk '{$1=""; print $0}'&lt;br /&gt;&lt;/code&gt;</description>
      <pubDate>Sun, 14 Jan 2007 03:41:12 GMT</pubDate>
      <guid>http://snippets.dzone.com/posts/show/3280</guid>
      <author>AlpT (AlpT)</author>
    </item>
    <item>
      <title>yubnub.py</title>
      <link>http://snippets.dzone.com/posts/show/3120</link>
      <description>&lt;code&gt;&lt;br /&gt;#!/usr/bin/env python&lt;br /&gt;&lt;br /&gt;__author__="Andrew Pennebaker (andrew.pennebaker@gmail.com)"&lt;br /&gt;__date__="9 Dec 2006 - 10 Dec 2006"&lt;br /&gt;__copyright__="Copyright 2006 Andrew Pennebaker"&lt;br /&gt;__license__="GPL"&lt;br /&gt;__version__="0.0.1"&lt;br /&gt;__credits__="Based on Yubnub for Windows (http://www.opbarnes.com/blog/Programming/OPB/Utilities/yubnub.html)"&lt;br /&gt;__URL__="http://snippets.dzone.com/posts/show/3120"&lt;br /&gt;&lt;br /&gt;from html2txt import html2txt&lt;br /&gt;&lt;br /&gt;import webbrowser&lt;br /&gt;from urllib import urlopen&lt;br /&gt;import re&lt;br /&gt;&lt;br /&gt;import sys&lt;br /&gt;from getopt import getopt&lt;br /&gt;&lt;br /&gt;PARSER="http://yubnub.org/parser/parse?command="&lt;br /&gt;&lt;br /&gt;BROWSER_MODE="BROWSER"&lt;br /&gt;PLAIN_MODE="PLAIN"&lt;br /&gt;&lt;br /&gt;def space2plus(s):&lt;br /&gt;	return "+".join(s.split())&lt;br /&gt;&lt;br /&gt;def yubnub(command=""):&lt;br /&gt;	global PARSER&lt;br /&gt;&lt;br /&gt;	return PARSER+space2plus(command)&lt;br /&gt;&lt;br /&gt;def yubnubBrowser(command):&lt;br /&gt;	return webbrowser.open(yubnub(command))&lt;br /&gt;&lt;br /&gt;def cleanHTML(html):&lt;br /&gt;	h=html2txt()&lt;br /&gt;	h.feed(html)&lt;br /&gt;	h.close()&lt;br /&gt;&lt;br /&gt;	return h.output()&lt;br /&gt;&lt;br /&gt;def yubnubPlain(command, clean=True):&lt;br /&gt;	command=yubnub(command)&lt;br /&gt;&lt;br /&gt;	try:&lt;br /&gt;		url=urlopen(command)&lt;br /&gt;		lines=url.readlines()&lt;br /&gt;		url.close()&lt;br /&gt;&lt;br /&gt;		lines="".join(lines)&lt;br /&gt;&lt;br /&gt;		if clean:&lt;br /&gt;			return cleanHTML(lines)&lt;br /&gt;&lt;br /&gt;		return lines&lt;br /&gt;&lt;br /&gt;	except IOError, e:&lt;br /&gt;		return "Error connecting to "+command&lt;br /&gt;&lt;br /&gt;def usage():&lt;br /&gt;	print "Usage: "+sys.argv[0]+" [options] &lt;command&gt;"&lt;br /&gt;	print "-b --browser"&lt;br /&gt;	print "\n--plain (default)"&lt;br /&gt;	print "\t-c --clean (default)"&lt;br /&gt;	print "\t-d --dirty"&lt;br /&gt;	print "\n--parser &lt;parser&gt; (experimental)"&lt;br /&gt;	print "\n-h --help"&lt;br /&gt;&lt;br /&gt;	sys.exit()&lt;br /&gt;&lt;br /&gt;def main():&lt;br /&gt;	global PARSER&lt;br /&gt;&lt;br /&gt;	global BROWSER_MODE&lt;br /&gt;	global PLAIN_MODE&lt;br /&gt;&lt;br /&gt;	mode=PLAIN_MODE&lt;br /&gt;	parser=PARSER&lt;br /&gt;	clean=True&lt;br /&gt;&lt;br /&gt;	systemArgs=sys.argv[1:]&lt;br /&gt;	optlist, args=[], []&lt;br /&gt;	try:&lt;br /&gt;		optlist, args=getopt(systemArgs, "bhcd", ["browser", "plain", "clean", "dirty", "parser=", "help"])&lt;br /&gt;	except:&lt;br /&gt;		usage()&lt;br /&gt;&lt;br /&gt;	for option, value in optlist:&lt;br /&gt;		if option=="-h" or option=="--help":&lt;br /&gt;			usage()&lt;br /&gt;&lt;br /&gt;		elif option=="-b" or option=="--browser":&lt;br /&gt;			mode=BROWSER_MODE&lt;br /&gt;		elif option=="--plain":&lt;br /&gt;			mode=PLAIN_MODE&lt;br /&gt;		elif option=="-c" or option=="--clean":&lt;br /&gt;			clean=True&lt;br /&gt;		elif option=="-d" or option=="--dirty":&lt;br /&gt;			clean=False&lt;br /&gt;		elif option=="--parser":&lt;br /&gt;			parser=value&lt;br /&gt;&lt;br /&gt;	command=" ".join(args)&lt;br /&gt;&lt;br /&gt;	if mode==BROWSER_MODE:&lt;br /&gt;		yubnubBrowser(command)&lt;br /&gt;	elif mode==PLAIN_MODE:&lt;br /&gt;		for line in yubnubPlain(command, clean):&lt;br /&gt;			sys.stdout.write(line)&lt;br /&gt;		print ""&lt;br /&gt;&lt;br /&gt;if __name__=="__main__":&lt;br /&gt;	main()&lt;br /&gt;&lt;/code&gt;</description>
      <pubDate>Sun, 10 Dec 2006 08:16:14 GMT</pubDate>
      <guid>http://snippets.dzone.com/posts/show/3120</guid>
      <author>mcandre (Andrew Pennebaker)</author>
    </item>
    <item>
      <title>Line intersection</title>
      <link>http://snippets.dzone.com/posts/show/2087</link>
      <description>the function gives the point where 2 lines intersect&lt;br /&gt;&lt;br /&gt;&lt;code&gt;&lt;br /&gt;float[] checkIntersection(float lineAx1,float lineAy1,float lineAx2,float lineAy2,float lineBx1,float lineBy1,float lineBx2,float lineBy2){&lt;br /&gt;  float aM, bM, aB, bB, isX=0, isY=0;&lt;br /&gt;  if((lineAx2-lineAx1)==0){&lt;br /&gt;    isX=lineAx1;&lt;br /&gt;    bM=(lineBy2-lineBy1)/(lineBx2-lineBx1);&lt;br /&gt;    bB=lineBy2-bM*lineBx2;&lt;br /&gt;    isY=bM*isX+bB;&lt;br /&gt;  }&lt;br /&gt;  else if((lineBx2-lineBx1)==0){&lt;br /&gt;    isX=lineBx1;&lt;br /&gt;    aM=(lineAy2-lineAy1)/(lineAx2-lineAx1);&lt;br /&gt;    aB=lineAy2-aM*lineAx2;&lt;br /&gt;    isY=aM*isX+aB;&lt;br /&gt;  }&lt;br /&gt;  else{&lt;br /&gt;    aM=(lineAy2-lineAy1)/(lineAx2-lineAx1);&lt;br /&gt;    bM=(lineBy2-lineBy1)/(lineBx2-lineBx1);&lt;br /&gt;    aB=lineAy2-aM*lineAx2;&lt;br /&gt;    bB=lineBy2-bM*lineBx2;&lt;br /&gt;    isX=max(((bB-aB)/(aM-bM)),0);&lt;br /&gt;    isY=aM*isX+aB;&lt;br /&gt;  }&lt;br /&gt;  float[] r={&lt;br /&gt;    isX,isY  };&lt;br /&gt;  return r; &lt;br /&gt;}&lt;br /&gt;&lt;/code&gt;</description>
      <pubDate>Tue, 23 May 2006 11:19:02 GMT</pubDate>
      <guid>http://snippets.dzone.com/posts/show/2087</guid>
      <author>eskimoblood ()</author>
    </item>
    <item>
      <title>UNIX tar Commands</title>
      <link>http://snippets.dzone.com/posts/show/1976</link>
      <description>// how the heck do you do the stuff you do with zip but with tar&lt;br /&gt;&lt;br /&gt;&lt;code&gt;&lt;br /&gt;create tar file&lt;br /&gt;tar cvf filename.tar monkey.txt monkey2.txt&lt;br /&gt;&lt;br /&gt;add a file&lt;br /&gt;tar uvf filename.tar monkey.txt&lt;br /&gt;&lt;br /&gt;extract tar file&lt;br /&gt;tar xvf filename.tar&lt;br /&gt;&lt;br /&gt;list contents&lt;br /&gt;tar tf monkey.tar&lt;br /&gt;&lt;br /&gt;&lt;/code&gt;</description>
      <pubDate>Wed, 03 May 2006 20:37:24 GMT</pubDate>
      <guid>http://snippets.dzone.com/posts/show/1976</guid>
      <author>offspinner ()</author>
    </item>
    <item>
      <title>Find the most recently changed files (recursively)</title>
      <link>http://snippets.dzone.com/posts/show/1740</link>
      <description>&lt;code&gt;&lt;br /&gt;find . -type f -printf '%TY-%Tm-%Td %TT %p\n' | sort&lt;br /&gt;&lt;/code&gt;</description>
      <pubDate>Thu, 23 Mar 2006 21:23:46 GMT</pubDate>
      <guid>http://snippets.dzone.com/posts/show/1740</guid>
      <author>morten ()</author>
    </item>
  </channel>
</rss>
