Blog | Mezzanine, 14 Nov 2016 18:32:32 +0000Podcast feed for Connected Life Christian Church<p>I've been going to Connected Life Christian Church for over a decade.  Steve Downin has been capturing sermons at <a href=""></a> for a long time.  Now I've created a podcast rss feed to make it easier to access on mobile devices.  To use this, type the address <a href="/static/church/ConnectedLife.rss"></a> into your podcast application and enjoy.  The rss feed is hosted on my site, but it uses all the resources on <a href=""></a>.</p>senexMon, 14 Nov 2016 18:32:32 +0000 Sound Sink<p>Like me, you may have an extra headless linux computer laying around where you want to send sound to it over the network from another linux computer.  To do this you can use pulse audio and its networking capabilities.  There are dozens of articles covering this already, but none of them worked for me.</p> <p>Headless Computer setup</p> <ul> <li>First, be sure you have pulseaudio installed</li> <li>edit /etc/default/pulseaudio and change PULSEAUDIO_SYSTEM_START to a 1</li> <li>edit /etc/pulse/ and append the following to the file</li> </ul> <pre>load-module module-native-protocol-tcp auth-ip-acl=; load-module module-zeroconf-publish </pre> <ul> <li>restart your headless computer (Or you can (re)start pulseaudio</li> </ul> <p>On your desktop computer, you need to enable some things to see other network cards</p> <ul> <li>Makesure you have paprefs installed</li> <li>run paprefs</li> <li>Be sure to have the first tab called "Network Access" selected</li> <li>Check "Make discoverable PulseAudio network sound devices available locally"</li> <li>close</li> <li>Under Ubuntu launch system settings</li> <li>select sound</li> <li>under Output, you can now select between your local soundcard and your headless computer</li> </ul> <p>Much of this came from <a href=";t=11124">here</a> and many other articles</p>senexSun, 06 Jul 2014 00:12:09 +0000 2.4.3 Released<p>CppHeaderParser version 2.4.2 is now released</p> <p>Fixed 2 bugs related to default parameters:</p> <p>BitBucket <a href="">#15</a>: Failure parsing default floating point values.  The following function will now have all of its default values parsed correctly</p> <pre class="source">add(int a=100, b=0xfd, float c=1.7e-3, float d=3.14)</pre> <p>BitBucket <a href="">#16</a>: defaultValue typo.  This key has been corrected.</p>senexWed, 11 Jun 2014 00:27:28 +0000 2.4.2 Released<p>CppHeaderParser version 2.4.2 is now released<br><br>Fixed 2 more parsing bugs:<br>Bit Bucket <a href="">#13</a>:Not able to parse typedef struct<br>Now can parse anonymous structs (will be named &lt;anon-struct-x&gt; where x is a unique number.<br>Also, can parse typedef struct like the following:</p> <pre>typedef struct { int a; } Raspberry; </pre> <p><br>Bit Bucket <a href="">#14</a>: Parsing methods returning variables that are globally namespaced results in parsing error</p> <p>Can now parse bar from</p> <pre>struct Example { uint8_t foo() { return 4;} ::uint8_t bar() { return 0; } };</pre>senexSat, 24 May 2014 23:39:55 +0000 2.4.1 Released<p>CppHeaderParser version 2.4.1 is now released.</p> <p>This release accomplishes 3 things from BitBucket issue <a href="">#12</a>:</p> <ul> <li>Proper install with pip3</li> <li>Fixed import with python 3</li> <li>No more separation between python 3 and python 2 version of the code</li> </ul> <p>The python 3 version of the code runs just fine in python 2 and runs just as fast while passing all regression tests.  So now I just use that.  This also makes the ugly installation errors with pip3 go away when it tries to jit the code.</p> <p>Thanks 2to3.</p> <p>As always, just grab the latest code at <a href="">pypi</a>, or use easy_install/pip/pip3.</p>senexSun, 09 Mar 2014 01:28:09 +0000 2.4 Released<p>CppHeaderParser version 2.4 is now released.&nbsp; This is basically a bug fix release.<br></p><p><strong>Fixed Bugs:</strong><br>BitBucket issue <a title="#1" _mce_href="" href="">#1</a>: Fix line numbering when #define or comment is multi-line and only 2 lines<br>BitBucket issue <a title="#2" _mce_href="" href="">#2</a>: Work around classes defined after unsupported #define magic<br>Bitbucket issue <a href="" _mce_href="">#3</a>: Ignore list can now list macro functions to ignore such as "MAGIC_FUNC()". This will cause the parser to ignore this function and anything within the parens<br>BitBucket issue <a title="#4" _mce_href="" href="">#4</a>: Add support for regular typedefs to go into the typedefs list<br>BitBucket issue <a href="" _mce_href="">#5</a>: Nested class error: unexpected multiple definition<br>Bitbucket issue <a href="" _mce_href="">#6</a>: lines ending in / cause line numbers to be inacurate afterwards<br>BitBucket issue <a href="" _mce_href="">#7</a>: #include before function definition polutes return type<br>BitBucket issue <a href="" _mce_href="">#8</a>: friend functions can cause exceptions to be thrown<br>BitBucket bug <a href="" _mce_href="">#9</a>: Multiple variable declaration parsing error<br>SourceForge bug <a title="#54" _mce_href="" href="">#54</a>: Add support for __attribute__ by filtering it out<br>SourceForge bug <a title="#55" _mce_href="" href="">#55</a>: Add support for elaborate type specification of class</p>senexMon, 26 Aug 2013 21:45:30 +0000 2.3 Released<p>CppHeaderParser version 2.3 is now released.&nbsp; This release fixed many bugs and added support for #defines, #includes, #pragmas, line numbers and more.</p> <p>Project page can be found at <a href="/open-source/cppheaderparser/" _mce_href="/open-source/cppheaderparser/"></a><br _mce_bogus="1"></p><p><strong>Implemented Feature Request:</strong><br> Added the attribute "line_number" to methods/properties/classes etc.<br>Now #defines, #includes, and #pragmas are parsed into defines, includes, and pragmas lists that are part of the CppHeader class</p><p><br> <strong>Fixed bugs:</strong><br><a href=";group_id=231845&amp;atid=1084294&amp;aid=3567172" _mce_href=";group_id=231845&amp;atid=1084294&amp;aid=3567172">3567172</a>: Enums without inline definition are skipped such as enum Stem stem_property<br><a href=";group_id=231845&amp;atid=1084294&amp;aid=3567854" _mce_href=";group_id=231845&amp;atid=1084294&amp;aid=3567854">3567854</a>: Not creating instances of anonymous unions. Now anonymous unions will act like anonymous structs, the variable name will be "" (empyt string)<br><a href=";group_id=231845&amp;atid=1084294&amp;aid=3568241" _mce_href=";group_id=231845&amp;atid=1084294&amp;aid=3568241">3568241</a>: Crash parsing 2 anonymous unions in a struct. Now llow multiple variables of the same name if they are anonymous.<br><a href=";group_id=231845&amp;atid=1084294&amp;aid=3568629" _mce_href=";group_id=231845&amp;atid=1084294&amp;aid=3568629">3568629</a>: Crash parsing free function with derefence<br><a href=";group_id=231845&amp;atid=1084294&amp;aid=3569663" _mce_href=";group_id=231845&amp;atid=1084294&amp;aid=3569663">3569663</a>: Crashes parsing indented #define<br><a href=";group_id=231845&amp;atid=1084294&amp;aid=3569622" _mce_href=";group_id=231845&amp;atid=1084294&amp;aid=3569622">3569622</a>: Crashes parsing ::enum<br><a href=";group_id=231845&amp;atid=1084294&amp;aid=3570105" _mce_href=";group_id=231845&amp;atid=1084294&amp;aid=3570105">3570105</a>: Error parsing multi line non #define statements<br><a href=";group_id=231845&amp;atid=1084294&amp;aid=3577484" _mce_href=";group_id=231845&amp;atid=1084294&amp;aid=3577484">3577484</a>: Class template specialization plus inheritance mis-parsed<br> Ignore \f<br> </p>senexTue, 04 Dec 2012 21:32:38 +0000 Uses CppHeaderParser<p>The latest version of <a href="" _mce_href="">DOLFIN</a> now uses CppHeaderParser.&nbsp; DOLFIN is a C++/Python library that functions as the main user interface of <a href="" _mce_href="">FEniCS</a> (More <a href="" _mce_href="">here</a> on dolfin).&nbsp; FEniCS is a collection of free software with an extensive list of features for automated, efficient solution of differential equations.</p> <p>CppHeaderParser is used in the module that JITs code.&nbsp; CppHeaderParser will parse the header files, from there SWIG code will be generated then compiled.&nbsp; This allows Python to call native C++ code without manually generating intermediary bridge code as is traditionally required by SWIG.&nbsp;</p> <p>Thanks to Johan Hake for helping me find bugs and test improvements to CppHeaderParser.</p><p> CppHeaderParser can be found in action in compile_extension_module(...) found in <a href="" _mce_href="">/site-packages/dolfin/compilemodules/</a> which calls parse_and_extract_type_info(code) found in <a href="" _mce_href="">/site-packages/dolfin_utils/cppparser/</a><br _mce_bogus="1"></p>senexThu, 30 Aug 2012 20:32:22 +0000 2.2 Released<p>CppHeaderParser version 2.2 is now released.&nbsp; This release fixed many bugs and added support for parsing free functions.</p><p>Project page can be found at <a href="/open-source/cppheaderparser/" _mce_href="/open-source/cppheaderparser/"></a><br _mce_bogus="1"></p><p><strong>Implemented Feature Request:</strong><br><a href=";group_id=231845&amp;atid=1084294&amp;aid=3536266" _mce_href=";group_id=231845&amp;atid=1084294&amp;aid=3536266">3536266</a>: Parsing of free functions</p><p><strong>Fixed bugs:</strong><br><a href=";group_id=231845&amp;atid=1084294&amp;aid=3531219" _mce_href=";group_id=231845&amp;atid=1084294&amp;aid=3531219">3531219</a>: Nested Classes improperly parsed, when after a defined method<br><a href=";group_id=231845&amp;atid=1084294&amp;aid=3535465" _mce_href=";group_id=231845&amp;atid=1084294&amp;aid=3535465">3535465</a>: Initialization of data in constructors parsed incorrectly<br><a href=";group_id=231845&amp;atid=1084294&amp;aid=3536069" _mce_href=";group_id=231845&amp;atid=1084294&amp;aid=3536069">3536069</a>: templated base class crashes parser<br><a href=";group_id=231845&amp;atid=1084294&amp;aid=3536067" _mce_href=";group_id=231845&amp;atid=1084294&amp;aid=3536067">3536067</a>: virtual base classes is not parsed (when virtual is 2nd key word)<br><a href=";group_id=231845&amp;atid=1084294&amp;aid=3536071" _mce_href=";group_id=231845&amp;atid=1084294&amp;aid=3536071">3536071</a>: templated base class is not parsed<br><a href=";group_id=231845&amp;atid=1084294&amp;aid=3540172" _mce_href=";group_id=231845&amp;atid=1084294&amp;aid=3540172">3540172</a>: defined free functions are not parsed <br _mce_bogus="1"></p>senexThu, 05 Jul 2012 18:38:02 +0000 Sprinkler project 2.0 relesaed<p>Version 2.0 of the Python Sprinkler Project has been released.&nbsp; 2.0 makes the sprinlker system smarter and includes a bug fix.</p><p>Skip threshold was expanded from just a 24 hour view to a 24 hour and 48 hour view. This allows for skipping a session if it rained heavily 2 days prior if that days rain was very heavy.</p> <p>Code for detecting chance of rain was fixed, lookups should work now.</p> <p>Added watering duration adjustment to reduce water when it rains even if our threshold isn't met. Reduciton is proportional to the amount of rain received compaired to the 24 hour threshold. Example: if the threshold is .08 inches and it rains .04 inches in the last 24 hours, it will activate the sprinklers for 1/2 the time.</p><p>The original story can be found at <a _mce_href="/blog/python-sprinkler-project/" href="/blog/python-sprinkler-project/"></a><br _mce_bogus="1"></p><p>Project page can be found at <a _mce_href="/open-source/pysprinklers/" href="/open-source/pysprinklers/"></a><br _mce_bogus="1"></p>senexMon, 14 May 2012 21:40:02 +0000 2.1 Released<p>CppHeaderParser version 2.1 is now released.&nbsp; This release fixed many bugs and added support for more complex C++ header files.&nbsp; Some features where handling and support were added and improved include:</p><ul><li>unions</li><li>templates</li><li>virtual inheritance</li><li>anonymous structs (and structs in general)<br></li><li>operator overloading functions</li><li>function pointers</li></ul><p>Project page can be found at <a href="/open-source/cppheaderparser/" _mce_href="/open-source/cppheaderparser/"></a><br _mce_bogus="1"></p><p><br><strong>Fixed bugs:</strong><br><a href=";group_id=231845&amp;atid=1084294&amp;aid=3488053" _mce_href=";group_id=231845&amp;atid=1084294&amp;aid=3488053">3488053</a>: Nested classes have incorrect member access specifiers<br><a href=";group_id=231845&amp;atid=1084294&amp;aid=3488360" _mce_href=";group_id=231845&amp;atid=1084294&amp;aid=3488360">3488360</a>: Inheriting class with namespace causes error<br><a href=";group_id=231845&amp;atid=1084294&amp;aid=3487551" _mce_href=";group_id=231845&amp;atid=1084294&amp;aid=3487551">3487551</a>: Return types of virtual functions start with 'virtual '<br><a href=";group_id=231845&amp;atid=1084294&amp;aid=3488049" _mce_href=";group_id=231845&amp;atid=1084294&amp;aid=3488049">3488049</a>: Non-manifest constant arrays sizes cause incorrect parsing<br><a href=";group_id=231845&amp;atid=1084294&amp;aid=3488358" _mce_href=";group_id=231845&amp;atid=1084294&amp;aid=3488358">3488358</a>: Option to suppress printing of warnings and errors<br>&nbsp;To suppress errors do the following:<br>&nbsp;CppHeaderParser.print_errors = 0<br>&nbsp;To supress warnings do the following:<br>&nbsp;CppHeaderParser.print_warnings = 0<br><a href=";group_id=231845&amp;atid=1084294&amp;aid=3488054" _mce_href=";group_id=231845&amp;atid=1084294&amp;aid=3488054">3488054</a>: Out-of-line inlines / template methods<br><a href=";group_id=231845&amp;atid=1084294&amp;aid=3488275" _mce_href=";group_id=231845&amp;atid=1084294&amp;aid=3488275">3488275</a>: Template methods reported incorrectly<br><a href=";group_id=231845&amp;atid=1084294&amp;aid=3488275" _mce_href=";group_id=231845&amp;atid=1084294&amp;aid=3488275">3488275</a>: Template methods reported incorrectly<br><a href=";group_id=231845&amp;atid=1084294&amp;aid=3491240" _mce_href=";group_id=231845&amp;atid=1084294&amp;aid=3491240">3491240</a>: Explicit constructors are reported as normal methods<br><a href=";group_id=231845&amp;atid=1084294&amp;aid=3491178" _mce_href=";group_id=231845&amp;atid=1084294&amp;aid=3491178">3491178</a>: Certain template methods are not reported properly<br><a href=";group_id=231845&amp;atid=1084294&amp;aid=3491232" _mce_href=";group_id=231845&amp;atid=1084294&amp;aid=3491232">3491232</a>: Nested struct causes incorrect access specifiers for parent<br><a href=";group_id=231845&amp;atid=1084294&amp;aid=3491319" _mce_href=";group_id=231845&amp;atid=1084294&amp;aid=3491319">3491319</a>: Anonymous struct causes crash.<br>&nbsp;Also fixed variable instances followed by struct definitions detecting the type as that struct.<br><a href=";group_id=231845&amp;atid=1084294&amp;aid=3491334" _mce_href=";group_id=231845&amp;atid=1084294&amp;aid=3491334">3491334</a>: Virtual inheritance causes crash<br><a href=";group_id=231845&amp;atid=1084294&amp;aid=3492237" _mce_href=";group_id=231845&amp;atid=1084294&amp;aid=3492237">3492237</a>: Cast array size reports method named "["<br><a href=";group_id=231845&amp;atid=1084294&amp;aid=3497164" _mce_href=";group_id=231845&amp;atid=1084294&amp;aid=3497164">3497164</a>: Anonymous structs causes crash<br><a href=";group_id=231845&amp;atid=1084294&amp;aid=3497160" _mce_href=";group_id=231845&amp;atid=1084294&amp;aid=3497160">3497160</a>: Bad parse when friending forward class<br><a href=";group_id=231845&amp;atid=1084294&amp;aid=3497155" _mce_href=";group_id=231845&amp;atid=1084294&amp;aid=3497155">3497155</a>: Function declarations cause crash<br><a href=";group_id=231845&amp;atid=1084294&amp;aid=3497168" _mce_href=";group_id=231845&amp;atid=1084294&amp;aid=3497168">3497168</a>: Constant arithmetic reports bogus methods<br><a href=";group_id=231845&amp;atid=1084294&amp;aid=3497166" _mce_href=";group_id=231845&amp;atid=1084294&amp;aid=3497166">3497166</a>: Forward struct reports bogus property<br><a href=";group_id=231845&amp;atid=1084294&amp;aid=3497162" _mce_href=";group_id=231845&amp;atid=1084294&amp;aid=3497162">3497162</a>: Bad parse of nested union<br>&nbsp;Now treat unions like special classes since parsing is a subset<br>3497158 and 3517308: Fixed parsing of template declarations by filtering them out.<br><a href=";group_id=231845&amp;atid=1084294&amp;aid=3514728" _mce_href=";group_id=231845&amp;atid=1084294&amp;aid=3514728">3514728</a>: Multi-line Preprocessor confuses parser<br><a href=";group_id=231845&amp;atid=1084294&amp;aid=3517289" _mce_href=";group_id=231845&amp;atid=1084294&amp;aid=3517289">3517289</a>: Parser crashes if functions are declared under extern "C"<br><a href=";group_id=231845&amp;atid=1084294&amp;aid=3514671" _mce_href=";group_id=231845&amp;atid=1084294&amp;aid=3514671">3514671</a>: Does not parse struct datatype as a struct/class property<br><a href=";group_id=231845&amp;atid=1084294&amp;aid=3515330" _mce_href=";group_id=231845&amp;atid=1084294&amp;aid=3515330">3515330</a>: Namespace causes improper access level in nested classes<br><a href=";group_id=231845&amp;atid=1084294&amp;aid=3514672" _mce_href=";group_id=231845&amp;atid=1084294&amp;aid=3514672">3514672</a>: Incorrect parse of operator=()<br>&nbsp;Added support for all operator oveloads<br>&nbsp;Cleaned up tab warnings<br><a href=";group_id=231845&amp;atid=1084294&amp;aid=3497170" _mce_href=";group_id=231845&amp;atid=1084294&amp;aid=3497170">3497170</a>: Function pointers confuse parser<br><a href=";group_id=231845&amp;atid=1084294&amp;aid=3523010" _mce_href=";group_id=231845&amp;atid=1084294&amp;aid=3523010">3523010</a>: Support for multi-word accessor: Return type wrong<br><a href=";group_id=231845&amp;atid=1084294&amp;aid=3519178" _mce_href=";group_id=231845&amp;atid=1084294&amp;aid=3519178">3519178</a>: Problems with namespaces and templates<br>&nbsp;Fixed return type having colons<br><a href=";group_id=231845&amp;atid=1084294&amp;aid=3523196" _mce_href=";group_id=231845&amp;atid=1084294&amp;aid=3523196">3523196</a>: Problems with "advanced" namespace and template usage<br><a href=";group_id=231845&amp;atid=1084294&amp;aid=3524327" _mce_href=";group_id=231845&amp;atid=1084294&amp;aid=3524327">3524327</a>: Pure virtual method lost its constness<br><br><strong>Resolve feature requests:</strong><br><a href=";group_id=231845&amp;atid=1084294&amp;aid=3488051" _mce_href=";group_id=231845&amp;atid=1084294&amp;aid=3488051">3488051</a>: Classes are well reported but structs (which are classes except for default access specifier) are not reported at all.<br><a href=";group_id=231845&amp;atid=1084294&amp;aid=3488050" _mce_href=";group_id=231845&amp;atid=1084294&amp;aid=3488050">3488050</a>: Identify array data members as arrays<br>&nbsp;Variables have the following 2 new attributes:<br>&nbsp;* array: 0 or 1 depending on if its an array<br>&nbsp;* array_size: If something is between [ and ], that will go here<br>&nbsp;<br><strong>Implement feature request:</strong><br><a href=";group_id=231845&amp;atid=1084294&amp;aid=3491220" _mce_href=";group_id=231845&amp;atid=1084294&amp;aid=3491220">3491220</a>: structs are reported as classes<br><a href=";group_id=231845&amp;atid=1084294&amp;aid=3519502" _mce_href=";group_id=231845&amp;atid=1084294&amp;aid=3519502">3519502</a>: Support for Qt Slots<br>&nbsp;Now curAccessSpecifier supports multi-word accessor specifiers such as "public slots"<br><a href=";group_id=231845&amp;atid=1084294&amp;aid=3523198" _mce_href=";group_id=231845&amp;atid=1084294&amp;aid=3523198">3523198</a>: Add possibility to ignore some symbols<br>Now symbols in CppHeaderParser.ignoreSymbols are ignored.<br>Q_OBJECT is in the list initially<br><a href=";group_id=231845&amp;atid=1084294&amp;aid=3523235" _mce_href=";group_id=231845&amp;atid=1084294&amp;aid=3523235">3523235</a>: Save "constness" of functions/methods<br>&nbsp;Accessed via the "const" tag</p>senexSun, 13 May 2012 14:49:39 +0000 Mercurial server with multiple repositories on OpenSUSE<p>This tutorial is to configure a Mercurial/hg server for multiple repositories on OpenSUSE.  Be sure to follow these steps on the server you want to host the repositories on.</p> <p>First make sure Mercurial is installed</p> <pre>zypper install hg</pre> <p>Now create a location for the repositories</p> <pre>mkdir -p /var/hg/repos</pre> <p>Create some project as an example</p> <pre>cd /var/hg/repos<br>hg init super_proj</pre> <p>Create a config file for hg to know to what to serve (details <a href="">here</a>).  In /var/hg/hg_repos.conf insert the following</p> <pre>[paths]<br>/ = /var/hg/repos/*<br><br>[web]<br>push_ssl = false<br>allow_push = *</pre> <p>Now for a startup script (based on <a href="">this</a>).  In /etc/init.d/hg_serve put the following</p> <pre>#! /bin/sh<br>#<br># Startup script for mercurial server.<br>#<br>### BEGIN INIT INFO<br># Provides:       hg server <br># Required-Start: $local_fs $remote_fs $syslog $network <br># Required-Stop:  $local_fs $remote_fs $syslog $network<br># Should-Start:   $time sendmail httpd2 xntpd $named cron ndo2db<br># Should-Stop:    sendmail ndo2db<br># Default-Start:  3 5<br># Default-Stop:   0 1 2 6<br># Short-Description: hg server <br># Description:    hg server<br>### END INIT INFO<br># Change following ines<br>APP_BIN=/usr/bin/hg<br>SRC=/var/hg/repos<br># Path to PID file of running mercurial process.<br>PID_FILE=/var/hg/<br>CONFIG_FILE=/var/hg/hg_repos.conf<br><br>state=$1<br><br>case "$state" in<br>'start')<br>    echo "Mecurial Server service starting."<br>   ${APP_BIN} serve --webdir-conf=$CONFIG_FILE -d -p 8001 --pid-file ${PID_FILE}<br>  ;;<br><br>'stop')<br>  if [ -f "${PID_FILE}" ]; then<br>    PID=`cat "${PID_FILE}"`<br>    if [ "${PID}" -gt 1 ]; then<br>      kill -TERM ${PID}<br>      echo "Stopping the Mercurial service PID=${PID}."<br>    else<br>      echo Bad PID for Mercurial -- \"${PID}\"<br>    fi<br>  else<br>    echo No PID file recorded for mercurial<br>  fi<br>  ;;<br><br>'restart')<br>  $0 stop<br>  $0 start<br>  ;;<br><br>*)<br>  echo "$0 {start|stop|restart}"<br>  exit 1<br>  ;;<br>esac</pre> <p>Now to finalize things</p> <pre>chmod +x /etc/init.d/hg_serve<br>chkconfig --add hg_serve<br>service hg_serve start</pre> <p>(If you are using Debian/Ubuntu, to activate the script run "update-rc.d hg_serve defaults")</p> <p>Now you should be able to access the server via the web.  Just point your web browser to http://&lt;your server ip&gt;:8001</p> <p>Keep in mind, this setup is for internal servers.  Refer to other resources for securing your data!</p> <p>More information on Mercurial can be found at <a href=""></a></p>senexMon, 13 Feb 2012 20:39:02 +0000 2.0 released<p>Thanks to a great amount of work from <a _mce_href="" href="">HartsAntler</a>, CppHeaderParser has been greatly advanced.&nbsp; 2.0 adds support for parsing more complex C &amp; C++.&nbsp; Resolves some types. Generates much more information for parsed code.&nbsp; 2.0 integrates all changes HartsAntler has done for converting RPython to Javascript in his RPythonic project as covered <a _mce_href="/blog/rpython-to-javascript-uses-cppheaderparser/" href="/blog/rpython-to-javascript-uses-cppheaderparser/">in this article</a>.</p><p>Project page at <a _mce_href="/open-source/cppheaderparser/" href="/open-source/cppheaderparser/"></a><br _mce_bogus="1"></p>senexSat, 31 Dec 2011 15:47:45 +0000 Sprinkler project<p>When my sprinklers go off in the middle of the night after it was raining that day, I get annoyed.&nbsp; I wanted an intelligent home brew solution to this problem that was cheap and was mostly COTS and not requiring much electrical engineering know how.&nbsp; There are systems out there you can buy that do everything for you that cost hundreds, but thats no fun.&nbsp; I have a system that cost me $45 plus things I already had.</p><p>This system, pysprinklers, is written in python and targeted for Linux.&nbsp; With pysprinklers, you can configure when your sprinklers go off, for how long.&nbsp; Also, if it has rained enough in the past 24 hours it will skip watering the lawn that time to save water.&nbsp; Further, before watering, it will check the forecast to see if its likely to rain soon.&nbsp; If it is, then it will hold off a bit and try again in hopes to conserve water.&nbsp; Oh, and it tweets the whole thing along with rain activity.&nbsp; You can find its twitter account <a title="@jash_the_robot" _mce_href="!/jash_the_robot" href="">@jash_the_robot</a>.<br></p><p><br></p><h2>The Hardware<br></h2><p><strong>Linux Machine:</strong><br></p><p>I already have a Linux machine that acts as a hobby server.&nbsp; This is built out of an old laptop which hosts many things.&nbsp; I use <a _mce_href="" href="">openSUSE</a>.&nbsp; If you dont already have one (and who doesn't), this would be a great use of <a _mce_href="" href="">raspberrypi</a>.<br _mce_bogus="1"></p><p><strong>Rain Gauge:</strong></p><p>I found the<a _mce_href="" href=""> WS-9005TWC-IT</a> on clearance for $5.&nbsp; The display unit is useless.&nbsp; To this day it has never connected with the rain gauge.&nbsp; But the tipping bucket rain gauge was exactly what I needed... after a little hacking.</p><p><strong>Game Controller:</strong></p><p>I had an old USB Microsoft sidewinder game pad laying around.</p><p><strong>Window magnet sensor:</strong></p><p>I had one laying around, its one of <a _mce_href="" href="">these</a>.<br></p><p><strong>X10 controller &amp; appliance module:</strong></p><p>You need some method of turning the sprinkler system on and off via a computer.&nbsp; You can control X10 from Linux, so I am using this.&nbsp; I got the controller &amp; module as a gift so that made it a great candidate.&nbsp; The controller I have is a <a _mce_href="" href="">CM15A</a> and the module is a <a _mce_href="" href="">AM466</a>.<br></p><p><strong>Automatic Sprinkler system:</strong></p><p>In order for this solution to work, you need a sprinkler system where you can put it in a constant on state.&nbsp; While in the on state plugging it in turns the sprinklers on, unplugging it turns them off, plugging them in again turns them on and puts them in a new zone.&nbsp; Most houses with automatic sprinkler systems have exactly this.<br></p><h2>Rain Gauge</h2><p>A tipping bucket rain gauge basically teeter totters back and forth as it is raining.&nbsp; When 1 side fills up, it tips to the other side till the other side fills up.&nbsp; The method to read such a rain gauge is to detect when it "clicks".&nbsp; It will either be on the left (on position/close circuit) or it will be on the right position (off position/open circuit).&nbsp; A click is when we alternate between on and off.&nbsp; This particular rain gauge has a magnet on the bucket system.&nbsp; I first add a magnet sensor inside the rain gauge so that in one position it can read the magnet (making sure when the bucket is in the other direction it does not read the magnet).&nbsp; I then connect the wires for the magnet sensor to the game controller so that I can read the button as either being pressed or not pressed.<br></p><p><img title="Rain guage with added sensor" alt="Rain guage with added sensor" src="/site_media/uploads/rain_guage/rain_guage_hacked1.jpg" _mce_src="/site_media/uploads/rain_guage/rain_guage_hacked1.jpg" height="397" width="600"></p><p><br></p><p><img title="Rain guage with added sensor" alt="Rain guage with added sensor" src="/site_media/uploads/rain_guage/rain_guage_hacked2.jpg" _mce_src="/site_media/uploads/rain_guage/rain_guage_hacked2.jpg" height="640" width="400"><br></p><p>At this point the game controllers button state is the same as the rain gauge button state and you can use game controller software to read the rain gauge.&nbsp; In pysprinklers you can find that does exactly this.&nbsp; The clicks will be stored into a sqlite3 database for other applications to use.&nbsp; To use, just start the process and keep it running (Follow the included README).</p><h2>Sprinkler Control</h2><p>To control the sprinklers you first need to make sure you can do it via command line (in my case via X10).&nbsp; I found a project that can control my X10 module <a _mce_href="" href="">here</a>.&nbsp; With that, I created a wrapper called usbheyu.&nbsp; Connect the X10 controller to your Linux box and the appliance module to your sprinkler system.&nbsp; Make sure that you can turn the sprinklers on &amp; off manually via command line.&nbsp; With this in place your sprinklers should be controllable via (view README for more info).</p><h2>Tweeting</h2><p>If you would like to have everything tweeted, including the rain activity you need to install the <a _mce_href="" href="">python twitter module</a>.&nbsp; This comes with a command line twitter tool.&nbsp; Run this so that it can update your desired twitter account.</p><p>With twitter setup, I run every 5 minutes so it can poll for changes.&nbsp; When it detects raining started, it will post.&nbsp; When it detects its done raining, it will post again with the rain fall for the past 24 hours.</p><p>Also, when calling, use the --tweet option for it to tweet as well.</p><h2>Scheduling/Configuration</h2><p>So you have your rain gauge working, X10(or alternative) controlling your sprinkler system...&nbsp; How do you get it all to work?</p><p>First you need to always be running.&nbsp; I just have a script that keeps it running called; After that, everything is just a cron job.&nbsp; Here is my crontab</p><p><br></p><pre>#Tweet rain activity<br>*/5 * * * * /opt/pysprinklers/ &gt;&gt; /var/lib/house/rain_tweeter.log<br><br>#Keep rain gauge alive (start up if machine was rebooted)<br>*/5 * * * * /bin/sh /opt/pysprinklers/<br><br>#Run the sprinklers<br>00 02 * * thu,sun&nbsp; /opt/pysprinklers/ --tweet \<br>&gt;&gt;&nbsp; /var/lib/house/sprinkler_manager.log<br><br>#Make sure sprinklers werent left on<br>* * * * thu,sun&nbsp; /opt/pysprinklers/ --rs-check --tweet \<br>&gt;&gt; /var/lib/house/sprinkler_manager.log<br></pre><p>You will want to adjust when to run your sprinklers.</p><p>If you end up using this, let me know in the comments section and give me the twitter account for your bot.&nbsp; <a _mce_href="" href="">@jash_the_robot</a> would like to follow other pysprinkler robots out there.</p><p>Grab the software at <a _mce_href="" href=""></a>, its opensource released under BSD 2.0</p><p>Post regarding version 2.0 available at <a _mce_href="" href=""></a><br _mce_bogus="1"></p>senexThu, 10 Nov 2011 21:16:30 +0000 Comic<p><img src="/site_media/uploads/comics/comic_5000_fish.png" _mce_src="/site_media/uploads/comics/comic_5000_fish.png" height="764" width="500"><br _mce_bogus="1"></p>senexSun, 10 Jul 2011 20:49:37 +0000 to Javascript uses CppHeaderParser<p>A new opensource project at <a _mce_href="" href=""></a> used to convert RPython to Javascript uses <a _mce_href="" href="">CppHeaderParser</a>.&nbsp; CppHeaderParser included is heavily modified to support parsing of C++ source files.&nbsp; Should changes be integrated into the next release of CppHeaderParser?<br></p><p><br></p><p><br></p>senexTue, 17 May 2011 21:46:54 +0000 1.9 released<p>CppHeaderParser 1.9 has just been released.&nbsp; 1.9 is functionally equivelant to 1.8 except support for python 3 was added.&nbsp; More information on CppHeaderParser can be found at <a _mce_href="/open-source/cppheaderparser/" href="/open-source/cppheaderparser/"></a><br _mce_bogus="1"></p>senexMon, 07 Mar 2011 21:30:29 +0000 to add dropdown menus to mezzanine<p>This is a quick tutorial on how to get mezzanine to give you dropdown menus.</p><p>First, at the top of base.html where you link style sheets add the following line:</p><pre>&lt;link rel="stylesheet" href="{{ MEDIA_URL }}css/dropdown_menu.css" type="text/css" /&gt;</pre><p>Second you need to change base.html.&nbsp; Find somewhere at the top where you want your menu that is not within a grid960 container element. and add the following snippet:</p><pre>&lt;!-- start menu --&gt;<br>&lt;div class="container_12 clearfix" id="top-nav-section"&gt;<br>&nbsp; &lt;div id="grid-top"&gt;<br>&nbsp;&nbsp;&nbsp; &lt;div id="menu"&gt;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {% page_menu "pages/menus/tree.html" %}<br>&nbsp;&nbsp;&nbsp; &lt;/div&gt;<br>&nbsp; &lt;/div&gt;<br>&lt;/div&gt;<br>&lt;!-- end menu --&gt;</pre><p>finally, create the file at {{MEDIA_URL}}css/dropdown_menu.css and insert the following content:</p><pre>/* Take from */<br>#menu{<br>&nbsp;&nbsp;&nbsp; border:none;<br>&nbsp;&nbsp;&nbsp; border:0px;<br>&nbsp;&nbsp;&nbsp; margin:0px;<br>&nbsp;&nbsp;&nbsp; padding:0px;<br>}<br>#menu ul{<br>&nbsp;&nbsp;&nbsp; height:35px;<br>&nbsp;&nbsp;&nbsp; list-style:none;<br>&nbsp;&nbsp;&nbsp; margin:0;<br>&nbsp;&nbsp;&nbsp; padding:0;<br>}<br>#menu li{<br>&nbsp;&nbsp;&nbsp; float:left;<br>&nbsp;&nbsp;&nbsp; padding:0px;<br>}<br>#menu li a{<br>&nbsp;&nbsp;&nbsp; background:#000000;<br>&nbsp;&nbsp;&nbsp; color:#cccccc;<br>&nbsp;&nbsp;&nbsp; display:block;<br>&nbsp;&nbsp;&nbsp; font-weight:normal;<br>&nbsp;&nbsp;&nbsp; line-height:35px;<br>&nbsp;&nbsp;&nbsp; margin:0px;<br>&nbsp;&nbsp;&nbsp; padding:0px 25px;<br>&nbsp;&nbsp;&nbsp; text-align:center;<br>&nbsp;&nbsp;&nbsp; text-decoration:none;<br>}<br>#menu li ul{<br>&nbsp;&nbsp;&nbsp; background:#000000;<br>&nbsp;&nbsp;&nbsp; display:none;<br>&nbsp;&nbsp;&nbsp; height:auto;<br>&nbsp;&nbsp;&nbsp; padding:0px;<br>&nbsp;&nbsp;&nbsp; margin:0px;<br>&nbsp;&nbsp;&nbsp; border:0px;<br>&nbsp;&nbsp;&nbsp; position:absolute;<br>&nbsp;&nbsp;&nbsp; width:225px;<br>&nbsp;&nbsp;&nbsp; z-index:200;<br>}<br>#menu li:hover ul{<br>&nbsp;&nbsp;&nbsp; display:block;<br>}<br>#menu li li {<br>&nbsp;&nbsp;&nbsp; display:block;<br>&nbsp;&nbsp;&nbsp; float:none;<br>&nbsp;&nbsp;&nbsp; margin:0px;<br>&nbsp;&nbsp;&nbsp; padding:0px;<br>&nbsp;&nbsp;&nbsp; width:225px;<br>}<br>#menu li:hover li a{<br>&nbsp;&nbsp;&nbsp; background:none;<br>}<br>#menu li ul a{<br>&nbsp;&nbsp;&nbsp; display:block;<br>&nbsp;&nbsp;&nbsp; height:35px;<br>&nbsp;&nbsp;&nbsp; font-size:12px;<br>&nbsp;&nbsp;&nbsp; font-style:normal;<br>&nbsp;&nbsp;&nbsp; margin:0px;<br>&nbsp;&nbsp;&nbsp; padding:0px 10px 0px 15px;<br>&nbsp;&nbsp;&nbsp; text-align:left;<br>}<br>#menu li ul a:hover, #menu li ul li:hover a{<br>&nbsp;&nbsp;&nbsp; border:0px;<br>&nbsp;&nbsp;&nbsp; text-decoration:none;<br>&nbsp;&nbsp;&nbsp; color: #bbbbbb;<br>}<br>#menu p{<br>&nbsp;&nbsp;&nbsp; clear:left;<br>}</pre><p>Now if you hover over menu items with subpages you should see those secondary pages.&nbsp; You may have to change the background color from black to whatever fits best with your site.<br></p>senexMon, 07 Feb 2011 21:21:52 +0000 re-design complete!<p>It's been a few months in the making, but the new <a _mce_href="" href=""></a> is complte!&nbsp; With the new design clients and potential customers can do a search within the web site.&nbsp; There is no more flash, this means that iPhones and other mobile devices won't be greeted by broken sections within the web page.&nbsp; The entire site is pure html + css + javascript.&nbsp; Speaking of iPhones.&nbsp; If you access the site from a mobile device (Android, iPhone...), the site will look completely different.&nbsp; You will get the mobile version of the site that has that native app look and feel.</p><p>The new site is built on the latest tech!&nbsp; The quickly emerging <a _mce_href="" href="">Python</a> dynamic programming language.&nbsp; The <a _mce_href="" href="">Django </a>framework sky rocketing in use.&nbsp; And built atop the 2 is <a _mce_href="" href="">Mezzanine</a> which did all the hard work for me.</p><p>The new <a href="" _mce_href=""></a> is a site that is now awesome.&nbsp; For a company that is awesome and filled with employees that are awesome.<br></p>senexSun, 30 Jan 2011 13:19:41 +0000 to enable editing of the home page from the admin interface for mezzanine<h2>UPDATE</h2> <p>Mezzanine has gone through a lot in 2+ years and has a proper way f supporting the home page now.  Following are the new instructiosn that come with</p> <pre>    # HOMEPAGE AS AN EDITABLE PAGE IN THE PAGE TREE<br>    # ---------------------------------------------<br>    # This pattern gives us a normal ``Page`` object, so that your<br>    # homepage can be managed via the page tree in the admin. If you<br>    # use this pattern, you'll need to create a page in the page tree,<br>    # and specify its URL (in the Meta Data section) as "/", which<br>    # is the value used below in the ``{"slug": "/"}`` part.<br>    # Also note that the normal rule of adding a custom<br>    # template per page with the template name using the page's slug<br>    # doesn't apply here, since we can't have a template called<br>    # "/.html" - so for this case, the template "pages/"<br>    # should be used if you want to customize the homepage's template.</pre> <h2>Old method</h2> <p>A drawback of using <a href="">mezzanine</a> is that you cannot edit the home page from the admin interface.  Here are quick instructions of how to change this</p> <p>1) Create a page and call it "home"</p> <p>2) edit and add the following snippet</p> <pre>from mezzanine.pages.views import page<br><br>def home_page(request):<br>    request.path = "/"<br>    return page(request, "home")</pre> <p>3) Still in, replace</p> <pre>url("^$", direct_to_template, {"template": ""}, name="home")</pre> <p>with</p> <pre>url("^$", home_page, name="home"),</pre> <p>You should end up with something that looks like the following:</p> <pre>urlpatterns = patterns("",<br>    ("^admin/", include(,<br>    url("^$", home_page, name="home"),<br>    ("^", include("mezzanine.urls")),<strong><br><br><br></strong></pre>senexSat, 29 Jan 2011 20:24:54 +0000