<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DZone Snippets: include code</title>
    <link>http://snippets.dzone.com/posts</link>
    <pubDate>Sun, 27 Jul 2008 02:01:39 GMT</pubDate>
    <description>DZone Snippets: include code</description>
    <item>
      <title>[ruby] plugin structure</title>
      <link>http://snippets.dzone.com/posts/show/5159</link>
      <description>plugin structure sorta thing. Use inherited to concatenate all plugins to a library in a Plugins constant in said library.&lt;br /&gt;&lt;br /&gt;&lt;code&gt;&lt;br /&gt;class Library&lt;br /&gt;  Plugins = []&lt;br /&gt;  &lt;br /&gt;  def initialize#(...)&lt;br /&gt;    Plugins.each do |plugin|&lt;br /&gt;      # Here you can run a certain class method or grab some data from each class&lt;br /&gt;    end&lt;br /&gt;  end&lt;br /&gt;  &lt;br /&gt;  # ...&lt;br /&gt;end&lt;br /&gt;&lt;/code&gt;&lt;br /&gt;&lt;br /&gt;&lt;code&gt;&lt;br /&gt;class LibraryPlugin&lt;br /&gt;  # ...&lt;br /&gt;  &lt;br /&gt;  def self.inherited(sub); Library::Plugins &lt;&lt; sub; end&lt;br /&gt;end&lt;br /&gt;&lt;/code&gt;&lt;br /&gt;&lt;br /&gt;&lt;code&gt;&lt;br /&gt;class LibraryFooer &lt; LibraryPlugin&lt;br /&gt;  &lt;br /&gt;end&lt;br /&gt;class LibraryBarer &lt; LibraryPlugin&lt;br /&gt;  &lt;br /&gt;end&lt;br /&gt;&lt;/code&gt;&lt;br /&gt;&lt;br /&gt;&lt;code&gt;Library::Plugins.inspect #=&gt; [LibraryFooer, LibraryBarer]&lt;/code&gt;</description>
      <pubDate>Thu, 21 Feb 2008 06:42:15 GMT</pubDate>
      <guid>http://snippets.dzone.com/posts/show/5159</guid>
      <author>elliottcable (elliott cable)</author>
    </item>
    <item>
      <title>Include text files in C source</title>
      <link>http://snippets.dzone.com/posts/show/4597</link>
      <description>This includes the contents of myfile.txt into the char array text.&lt;br /&gt;&lt;br /&gt;Note: This only works if ALL lines in the file are enclosed in "s.&lt;br /&gt;&lt;br /&gt;Wrong myfile.txt:&lt;br /&gt;Hello world&lt;br /&gt;Goodbye world&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Right myfile.txt:&lt;br /&gt;"Hello world"&lt;br /&gt;"Goodbyle world"&lt;br /&gt;""&lt;br /&gt;&lt;br /&gt;&lt;code&gt;&lt;br /&gt;char text[] = {&lt;br /&gt;#include "myfile.txt"&lt;br /&gt;}&lt;br /&gt;&lt;/code&gt;</description>
      <pubDate>Mon, 01 Oct 2007 10:04:48 GMT</pubDate>
      <guid>http://snippets.dzone.com/posts/show/4597</guid>
      <author>scvalex (Alexandru Scvortov)</author>
    </item>
    <item>
      <title>Include javascript by DOM</title>
      <link>http://snippets.dzone.com/posts/show/4373</link>
      <description>Orignial: http://www.codepost.org/browse/snippets/85&lt;br /&gt;&lt;br /&gt;&lt;code&gt;&lt;br /&gt;function include(file)&lt;br /&gt;{&lt;br /&gt;      var script  = document.createElement('script');&lt;br /&gt;      script.src  = file;&lt;br /&gt;      script.type = 'text/javascript';&lt;br /&gt;&lt;br /&gt;      document.getElementsByTagName('head').item(0).appendChild(script);&lt;br /&gt;}&lt;br /&gt;&lt;/code&gt;</description>
      <pubDate>Tue, 31 Jul 2007 13:55:45 GMT</pubDate>
      <guid>http://snippets.dzone.com/posts/show/4373</guid>
      <author>WanCW (WanCW)</author>
    </item>
    <item>
      <title>Include javascript by XMLHttpRequest</title>
      <link>http://snippets.dzone.com/posts/show/4372</link>
      <description>&lt;br /&gt;Original from &lt;a href="http://www.exit12.org/archives/12"&gt;http://www.exit12.org/archives/12&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;code&gt;&lt;br /&gt;function include(jsFileLocation)&lt;br /&gt;{&lt;br /&gt;	if(window.XMLHttpRequest)&lt;br /&gt;	{&lt;br /&gt;		var req = new XMLHttpRequest();&lt;br /&gt;	}&lt;br /&gt;	else&lt;br /&gt;	{&lt;br /&gt;		var req = new ActiveXObject("Microsoft.XMLHTTP");&lt;br /&gt;	}&lt;br /&gt;	req.open("GET", jsFileLocation,false);&lt;br /&gt;	req.onreadystatechange = function()&lt;br /&gt;	{&lt;br /&gt;		if (req.readyState == 4)&lt;br /&gt;		{&lt;br /&gt;			window.eval(req.responseText);&lt;br /&gt;		}&lt;br /&gt;	}&lt;br /&gt;	req.send(null);&lt;br /&gt;}&lt;br /&gt;&lt;/code&gt;</description>
      <pubDate>Tue, 31 Jul 2007 13:51:25 GMT</pubDate>
      <guid>http://snippets.dzone.com/posts/show/4372</guid>
      <author>WanCW (WanCW)</author>
    </item>
    <item>
      <title>Splitting large Scriptella ETL files</title>
      <link>http://snippets.dzone.com/posts/show/4216</link>
      <description>The following example demonstrates how to split a large &lt;a href="http://scriptella.javaforge.com"&gt;Scriptella ETL&lt;/a&gt; file into several parts. This example is based on a traditional XML parsed entities approach:&lt;br /&gt;&lt;br /&gt;&lt;code&gt;&lt;br /&gt;&lt;!DOCTYPE etl SYSTEM "http://scriptella.javaforge.com/dtd/etl.dtd"&lt;br /&gt;[&lt;br /&gt;    &lt;!-- Declaring the first external parsed entity to include --&gt;&lt;br /&gt;    &lt;!ENTITY part1 SYSTEM "part1.xml"&gt;&lt;br /&gt;    &lt;br /&gt;    &lt;!-- Declaring the second external parsed entity to include --&gt;&lt;br /&gt;    &lt;!ENTITY part2 SYSTEM "part2.xml"&gt;&lt;br /&gt;]&gt;&lt;br /&gt;&lt;etl&gt;&lt;br /&gt;    &lt;connection driver="text"/&gt;&lt;br /&gt;&lt;br /&gt;    &lt;!-- Including file #1 --&gt;&lt;br /&gt;    &amp;part1;&lt;br /&gt;&lt;br /&gt;    &lt;script&gt;&lt;br /&gt;        content of the script&lt;br /&gt;    &lt;/script&gt;&lt;br /&gt;    &lt;br /&gt;    &lt;!-- Including file #2 --&gt;&lt;br /&gt;    &amp;part2;&lt;br /&gt;&lt;br /&gt;&lt;/etl&gt;&lt;br /&gt;&lt;/code&gt;</description>
      <pubDate>Wed, 27 Jun 2007 20:33:23 GMT</pubDate>
      <guid>http://snippets.dzone.com/posts/show/4216</guid>
      <author>ejboy (Fyodor Kupolov)</author>
    </item>
  </channel>
</rss>
