Popular Text recipes http://code.activestate.com/recipes/langs/text/popular/2016-09-22T15:32:17-07:00ActiveState Code RecipesFunctional D plus Python pipeline to generate PDF (Text) 2016-09-22T15:32:17-07:00Vasudev Ramhttp://code.activestate.com/recipes/users/4173351/http://code.activestate.com/recipes/580701-functional-d-plus-python-pipeline-to-generate-pdf/ <p style="color: grey"> Text recipe 580701 by <a href="/recipes/users/4173351/">Vasudev Ram</a> (<a href="/recipes/tags/pdfwriter/">pdfwriter</a>, <a href="/recipes/tags/pdf_generation/">pdf_generation</a>, <a href="/recipes/tags/pipe/">pipe</a>, <a href="/recipes/tags/pipeline/">pipeline</a>, <a href="/recipes/tags/xtopdf/">xtopdf</a>). </p> <p>This recipe is a command pipeline. The first component of the pipeline is a D language program that makes use of simple functional programming and template / generic programming features of D, to transform some input into the desired output. Both input and output are text. The D program writes the output to standard output, which is then read by a Python program that reads that as input via standard input, and converts it to PDF.</p> Add function to Python's __builtin__ module through C API - makefile (Text) 2015-10-16T12:11:36-07:00airweenhttp://code.activestate.com/recipes/users/4192997/http://code.activestate.com/recipes/579111-add-function-to-pythons-__builtin__-module-through/ <p style="color: grey"> Text recipe 579111 by <a href="/recipes/users/4192997/">airween</a> (<a href="/recipes/tags/api/">api</a>, <a href="/recipes/tags/c/">c</a>, <a href="/recipes/tags/makefile/">makefile</a>, <a href="/recipes/tags/python/">python</a>). </p> <p>Makefile for add function to __builtin__ module through C API.</p> <p>C source is here:</p> <p><a href="https://code.activestate.com/recipes/579110-add-function-to-__builtin__-module-through-c-api/" rel="nofollow">https://code.activestate.com/recipes/579110-add-function-to-__builtin__-module-through-c-api/</a></p> <p>Python script is here:</p> <p><a href="https://code.activestate.com/recipes/579112-add-function-to-__builtin__-module-through-c-api-c/" rel="nofollow">https://code.activestate.com/recipes/579112-add-function-to-__builtin__-module-through-c-api-c/</a></p> how to solder (Text) 2015-04-11T00:43:28-07:00Danilo Marianohttp://code.activestate.com/recipes/users/4192007/http://code.activestate.com/recipes/579045-how-to-solder/ <p style="color: grey"> Text recipe 579045 by <a href="/recipes/users/4192007/">Danilo Mariano</a> . </p> <p>Tip and tricks on soldering.</p> Get external IP (Text) 2013-07-01T05:52:39-07:00greg zakharovhttp://code.activestate.com/recipes/users/4184115/http://code.activestate.com/recipes/578584-get-external-ip/ <p style="color: grey"> Text recipe 578584 by <a href="/recipes/users/4184115/">greg zakharov</a> (<a href="/recipes/tags/ipv4/">ipv4</a>). Revision 2. </p> <p>In addition to the posts about IPv4. Examples on Python.</p> Movable button (Text) 2013-02-18T09:24:24-08:00greg zakharovhttp://code.activestate.com/recipes/users/4184115/http://code.activestate.com/recipes/578463-movable-button/ <p style="color: grey"> Text recipe 578463 by <a href="/recipes/users/4184115/">greg zakharov</a> (<a href="/recipes/tags/button/">button</a>, <a href="/recipes/tags/ironpython/">ironpython</a>). </p> <p>Just for fun. This IronPython script shows how you can create a form with movable button.</p> MUICacheView (Text) 2013-02-18T09:25:17-08:00greg zakharovhttp://code.activestate.com/recipes/users/4184115/http://code.activestate.com/recipes/578462-muicacheview/ <p style="color: grey"> Text recipe 578462 by <a href="/recipes/users/4184115/">greg zakharov</a> (<a href="/recipes/tags/ironpython/">ironpython</a>, <a href="/recipes/tags/muicacheview/">muicacheview</a>, <a href="/recipes/tags/nirsofer/">nirsofer</a>). </p> <p>Do you like Nir Sofer's MUICacheView tool? Why do you not write own? This sample correctly work on WinXP but there is no problem to edit it for Win7.</p> Eject\close CDRom door with IronPython using CPython libraries (Text) 2012-12-21T15:54:56-08:00greg zakharovhttp://code.activestate.com/recipes/users/4184115/http://code.activestate.com/recipes/578388-ejectclose-cdrom-door-with-ironpython-using-cpytho/ <p style="color: grey"> Text recipe 578388 by <a href="/recipes/users/4184115/">greg zakharov</a> (<a href="/recipes/tags/cdrom/">cdrom</a>, <a href="/recipes/tags/close/">close</a>, <a href="/recipes/tags/eject/">eject</a>). </p> <p>Of course, ActivePython is a great stuff and there are not problems which it can not solve. But I do like experiment with different technologies. The following script demonstrates how you can eject\close CDRom door with IronPython using standard CPython libraries.</p> Product Key (Text) 2012-11-01T19:03:23-07:00greg zakharovhttp://code.activestate.com/recipes/users/4184115/http://code.activestate.com/recipes/578317-product-key/ <p style="color: grey"> Text recipe 578317 by <a href="/recipes/users/4184115/">greg zakharov</a> (<a href="/recipes/tags/ironpython/">ironpython</a>, <a href="/recipes/tags/productkey/">productkey</a>). </p> <p>IronPython script for retrieving MS products' keys. There is how to get Windows key in following example.</p> Conjunction select using foreign keys (Text) 2011-06-11T02:43:22-07:00Kaushik Ghosehttp://code.activestate.com/recipes/users/4166965/http://code.activestate.com/recipes/577747-conjunction-select-using-foreign-keys/ <p style="color: grey"> Text recipe 577747 by <a href="/recipes/users/4166965/">Kaushik Ghose</a> (<a href="/recipes/tags/conjunction/">conjunction</a>, <a href="/recipes/tags/foreign/">foreign</a>, <a href="/recipes/tags/key/">key</a>, <a href="/recipes/tags/select/">select</a>, <a href="/recipes/tags/sql/">sql</a>). </p> <p>Say we have a table (notes) containing rows we want to select. Each note has one or more keywords (stored in a table of the same name). We want to select notes that have a conjunction of keywords (AND). notes and keywords are linked through a foreign key table notes_keywords. The following SQL statement allows us to do this</p> Wake On Lan for Python 3 (Text) 2011-03-14T16:31:14-07:00Jesús Gómezhttp://code.activestate.com/recipes/users/4172540/http://code.activestate.com/recipes/577609-wake-on-lan-for-python-3/ <p style="color: grey"> Text recipe 577609 by <a href="/recipes/users/4172540/">Jesús Gómez</a> (<a href="/recipes/tags/python/">python</a>, <a href="/recipes/tags/wol/">wol</a>). </p> <p>patch to upgrade <a href="http://code.activestate.com/recipes/358449-wake-on-lan/">Wake On Lan Recipe</a> that "Switches on remote computers using WOL". </p> Arduino Diecimila Board Access Inside A Linux Bash Shell. (Text) 2011-03-30T18:08:11-07:00Barry Walkerhttp://code.activestate.com/recipes/users/4177147/http://code.activestate.com/recipes/577627-arduino-diecimila-board-access-inside-a-linux-bash/ <p style="color: grey"> Text recipe 577627 by <a href="/recipes/users/4177147/">Barry Walker</a> (<a href="/recipes/tags/access/">access</a>, <a href="/recipes/tags/arduino/">arduino</a>, <a href="/recipes/tags/bash/">bash</a>, <a href="/recipes/tags/linux/">linux</a>, <a href="/recipes/tags/shell/">shell</a>, <a href="/recipes/tags/text/">text</a>). </p> <p>The "code" in this recipe is a step by step "root" shell command line procedure for testing whether a(n) USB Arduino Dev Board is working or not. To get more recognisable characters displayed it is best to use a potentiometer wired as one end to +5V, the other end to Gnd and thw wiper to ANALOG IN 0. This has been tested on various Linux Distros and kept as simple as possible so that anyone can understand it.</p> <p>The required ?.pde file for the Arduino Board can be found here:-</p> <p><a href="http://code.activestate.com/recipes/577625-arduino-diecimila-board-access-inside-winuae-demo/?in=lang-python" rel="nofollow">http://code.activestate.com/recipes/577625-arduino-diecimila-board-access-inside-winuae-demo/?in=lang-python</a></p> <p>It is issued entirely as Public Domain by B.Walker, G0LCU, 30-03-2011, and you may do with it as you please.</p> <p>Similar assumptions are made as in the URL above.</p> <p>Enjoy finding simple solutions to often very difficult problems... ;o)</p> Using SQLite as an embedded database with C# instantly (Text) 2010-12-15T01:24:06-08:00Stephen Akikihttp://code.activestate.com/recipes/users/4172143/http://code.activestate.com/recipes/577500-using-sqlite-as-an-embedded-database-with-c-instan/ <p style="color: grey"> Text recipe 577500 by <a href="/recipes/users/4172143/">Stephen Akiki</a> (<a href="/recipes/tags/akiscode/">akiscode</a>, <a href="/recipes/tags/csharp/">csharp</a>, <a href="/recipes/tags/database/">database</a>, <a href="/recipes/tags/embedded/">embedded</a>, <a href="/recipes/tags/sqlite/">sqlite</a>). </p> <p><a href="http://akiscode.com/articles/sqlite-csharp.shtml" rel="nofollow">http://akiscode.com/articles/sqlite-csharp.shtml</a></p> <p>There are a few libaries that every programmer loves and knows because they either:</p> <ul> <li>Saves you a ton of time coding</li> <li>Does something that you don't know how to do yourself</li> </ul> <p>Examples include cURL, SQLite, or even the .NET library itself. Many of us have to create CRUD (Create, Read, Update, Delete) projects on a semi-regular routine. SQLite is nice in the fact that it handles all the CRUD-y stuff (bad pun I know) in a simple, small and standalone package. But because SQLite is so nice to use (when compared to say XML), the Gods have cursed SQLite to cause many headaches if you are a new to it on C# to balance the world karma (or something like that). Also note that i'm not going to explain what any of the code does as its pretty self explanatory. Anyway, here is a complete example on how to setup an embedded SQLite database, insert some data into it, and then update a listview with only certain columns from the database:</p> <p><strong>The Fun Stuff</strong></p> <ol> <li><p><em>*NOTE: I've made a demo project that you can download <a href="http://akiscode.com/articles/Akiscode-SQLiteTest.zip">here</a>. It includes the DLLs and everything that i've talked about below. *</em></p></li> <li><p>Download the setup from <a href="http://sqlite.phxsoftware.com/">these guys</a> and install it.</p></li> <li><p>Start a new Project in Visual C# Studio (I'm using version 2010 Express). Make it a Windows Forms Application. Save it anywhere. For this example, I will save it on the Desktop and call the project "Akiscode-SQLiteTest. At the time I was doing this, the SQLite dll only worked with a program targeted at .NET version 3.5. To learn how to change that go <a href="http://msdn.microsoft.com/en-us/library/bb772098(v=vs.90).aspx">here</a>.</p></li> <li><p>Go to the Solutions Explorer on the top right of your VC setup. Right click references and select "Add Reference". Go to the ".NET" tab and find the entry named "System.Data.SQLite". Not "System.Data.Sql", not "System.Data.SqlXml", NOT "MySql.Data". Just find "System.Data.SQLite". If you can't find it, sort the list by name. If you still can't find it, restart VC and try this process again. Still can't find it? Run the installer and do it all over again. Still not there? Well I can't really help you, hand in your programming badge on the way out.</p></li> <li><p>Once you added "System.Data.SQLite", right click it and select properties. Set "Copy Local" to true.</p></li> <li><p>Ok type at the top "using "using System.Data.SQLite;" without the quotes.</p></li> <li><p>Go back to the form designer. Add a listview component. In the properties window (bottom right) make sure the property view is set to "Details". Then right click on the listview and add columns. For this example I added two called "First Name" and "Last Name"</p></li> </ol> <p>8.Ok now for some copy and paste coding (my favorite): Double click the form to make a "Form1_Load" function appear and paste the following in it:</p> Artisan Greens with Lemon-Thyme Dressing (Text) 2009-12-02T23:40:07-08:00Kyle Gibbardhttp://code.activestate.com/recipes/users/4172509/http://code.activestate.com/recipes/576975-artisan-greens-with-lemon-thyme-dressing/ <p style="color: grey"> Text recipe 576975 by <a href="/recipes/users/4172509/">Kyle Gibbard</a> (<a href="/recipes/tags/cranberries/">cranberries</a>, <a href="/recipes/tags/goat_s_cheese/">goat_s_cheese</a>, <a href="/recipes/tags/lemon_thyme/">lemon_thyme</a>, <a href="/recipes/tags/pistachios/">pistachios</a>, <a href="/recipes/tags/salad/">salad</a>). Revision 6. </p> <p>Artisan mixed greens with cranberries, pistachios, chevre(goats cheese) finished with lemon thyme dressing</p> Coldfusion 8 + TSQL SQL Server 2005 > backup database (Text) 2009-05-06T02:38:40-07:00dimitris siskopouloshttp://code.activestate.com/recipes/users/4170125/http://code.activestate.com/recipes/576740-coldfusion-8-tsql-sql-server-2005-backup-database/ <p style="color: grey"> Text recipe 576740 by <a href="/recipes/users/4170125/">dimitris siskopoulos</a> (<a href="/recipes/tags/coldfusion/">coldfusion</a>, <a href="/recipes/tags/sql_server_2005/">sql_server_2005</a>). </p> <p>Code and Stored Procedure for database backup, zip and links to download and delete backup files.</p>