<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DZone Snippets: background code</title>
    <link>http://snippets.dzone.com/posts</link>
    <pubDate>Sun, 27 Jul 2008 08:23:56 GMT</pubDate>
    <description>DZone Snippets: background code</description>
    <item>
      <title>Unix Console Styler</title>
      <link>http://snippets.dzone.com/posts/show/4822</link>
      <description>This modue can be used to apply many style on Unix* terminals&lt;br /&gt;&lt;br /&gt;&lt;code&gt;&lt;br /&gt;# Unix Console Style&lt;br /&gt;# You can use this module to apply a style on the terminal&lt;br /&gt;#&lt;br /&gt;# &lt;b&gt;DON'T WORK ON WINDOWS (Only on *nix Terminal)&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;module UnixConsoleStyler&lt;br /&gt;  class StyleNotFoundException &lt; Exception; end&lt;br /&gt;  &lt;br /&gt;  # Availables Styles&lt;br /&gt;  STYLE = {&lt;br /&gt;      :default    =&gt;    "\033[0m",&lt;br /&gt;    	# styles&lt;br /&gt;    	:bold       =&gt;    "\033[1m",&lt;br /&gt;    	:underline  =&gt;    "\033[4m",&lt;br /&gt;    	:blink      =&gt;    "\033[5m",&lt;br /&gt;    	:reverse    =&gt;    "\033[7m",&lt;br /&gt;    	:concealed  =&gt;    "\033[8m",&lt;br /&gt;    	# font colors&lt;br /&gt;    	:black      =&gt;    "\033[30m", &lt;br /&gt;    	:red        =&gt;    "\033[31m",&lt;br /&gt;    	:green      =&gt;    "\033[32m",&lt;br /&gt;    	:yellow     =&gt;    "\033[33m",&lt;br /&gt;    	:blue       =&gt;    "\033[34m",&lt;br /&gt;    	:magenta    =&gt;    "\033[35m",&lt;br /&gt;    	:cyan       =&gt;    "\033[36m",&lt;br /&gt;    	:white      =&gt;    "\033[37m",&lt;br /&gt;    	# background colors&lt;br /&gt;    	:on_black   =&gt;    "\033[40m", &lt;br /&gt;    	:on_red     =&gt;    "\033[41m",&lt;br /&gt;    	:on_green   =&gt;    "\033[42m",&lt;br /&gt;    	:on_yellow  =&gt;    "\033[43m",&lt;br /&gt;    	:on_blue    =&gt;    "\033[44m",&lt;br /&gt;    	:on_magenta =&gt;    "\033[45m",&lt;br /&gt;    	:on_cyan    =&gt;    "\033[46m",&lt;br /&gt;    	:on_white   =&gt;    "\033[47m" }&lt;br /&gt;  &lt;br /&gt;  # Methods to use if you want to apply a style&lt;br /&gt;  def UnixConsoleStyler::apply_style(style)&lt;br /&gt;    if STYLE.has_key? style&lt;br /&gt;      STDOUT.write STYLE[style]&lt;br /&gt;    else&lt;br /&gt;      raise StyleNotFoundException, "Style #{style} not found"&lt;br /&gt;    end&lt;br /&gt;  end&lt;br /&gt;  &lt;br /&gt;end&lt;br /&gt;&lt;/code&gt;</description>
      <pubDate>Wed, 28 Nov 2007 19:21:49 GMT</pubDate>
      <guid>http://snippets.dzone.com/posts/show/4822</guid>
      <author>kedare (Mathieu Poussin)</author>
    </item>
    <item>
      <title>text input /w background image</title>
      <link>http://snippets.dzone.com/posts/show/4444</link>
      <description>// self-explanatory. see title.&lt;br /&gt;&lt;br /&gt;&lt;code&gt;&lt;br /&gt;&lt;style type="text/css"&gt;&lt;br /&gt;.searchBox{&lt;br /&gt;  background-image:url('http://www.dhtmlgoodies.com/tips-and-tricks/input-with-background/images/magnifying-glass.gif');&lt;br /&gt;  background-repeat:no-repeat;&lt;br /&gt;  padding-left:20px;&lt;br /&gt;}&lt;br /&gt;&lt;/style&gt;&lt;br /&gt;&lt;br /&gt;&lt;input type="text" name="search" style="border:2px inset gray;color:black;background-color:lightyellow;font-family:arial narrow;font-weight:bold;font-size:9pt;" class="searchBox"&gt;&lt;br /&gt;&lt;/code&gt;</description>
      <pubDate>Wed, 22 Aug 2007 14:43:56 GMT</pubDate>
      <guid>http://snippets.dzone.com/posts/show/4444</guid>
      <author>thescriptkeeper (mona)</author>
    </item>
    <item>
      <title>Linux - random BG enligthnment</title>
      <link>http://snippets.dzone.com/posts/show/3106</link>
      <description>&lt;code&gt;&lt;br /&gt;import os&lt;br /&gt;import random&lt;br /&gt;&lt;br /&gt;listBG = os.popen('eesh background list').readlines()[:-5]&lt;br /&gt;elemBG = random.choice(listBG)&lt;br /&gt;os.popen('eesh background use ' + elemBG[:-2])&lt;br /&gt;&lt;/code&gt;</description>
      <pubDate>Fri, 08 Dec 2006 04:55:34 GMT</pubDate>
      <guid>http://snippets.dzone.com/posts/show/3106</guid>
      <author>whitetiger ()</author>
    </item>
    <item>
      <title>Switch application to foreground in pys60</title>
      <link>http://snippets.dzone.com/posts/show/814</link>
      <description>Taken from the 'appswitch' module &lt;a href=http://pymbian.sourceforge.net/misc/appswitch-v0.20051019.zip&gt;here&lt;/a&gt;&lt;br /&gt;&lt;code&gt;&lt;br /&gt;import appswitch&lt;br /&gt;print appswitch.switch_to_fg(u"Menu")&lt;br /&gt;&lt;/code&gt;&lt;br /&gt;Updated (19 Oct 05)&lt;br /&gt;==================&lt;br /&gt;Now it can&lt;br /&gt;- listing running applications&lt;br /&gt;- switching them to foreground/background&lt;br /&gt;- closing/killing apps&lt;br /&gt;&lt;code&gt;&lt;br /&gt;# listing&lt;br /&gt;apps = appswitch.application_list(True) # true = include all&lt;br /&gt;                                       # false = no hidden apps &lt;br /&gt;print apps&lt;br /&gt;&lt;br /&gt;# to background and closing&lt;br /&gt;print appswitch.switch_to_bg(u"TODO")&lt;br /&gt;print appswitch.end_app(u"TODO")&lt;br /&gt;&lt;/code&gt;&lt;br /&gt;</description>
      <pubDate>Mon, 17 Oct 2005 21:06:29 GMT</pubDate>
      <guid>http://snippets.dzone.com/posts/show/814</guid>
      <author>korakot (Korakot Chaovavanich)</author>
    </item>
  </channel>
</rss>
