Index :: FAQ :: Contact

Featured Media: Basenet Radio

The show has been dormant for some time (years) but its back.

Latest HackerMedia:

April 28, 2016

Hacker Public Radio
HPR2020: Automotive Billing
I get a call to look at my friend's broke down car.

Phone Losers
Lube Job Customers Still Aren't Angry
Today is yet another episode of car dealership prank calls where nobody gets very angry or confused about our calls to them. You can thanks Ty A. for that, who is the sponsor of today's show.

April 27, 2016

Hacker Public Radio
HPR2019: a pi project and an owncloud project
HPR - A couple of Projects I've been working on Intro Please record a show!!!!! Couple of Projects Pi Project Love of Music Digital, of course and webradio Sonos, other proprietary solutions Got a Pi2 for XMas Pi Music Box RuneAudio Arch Based underlying tech is MPD flash SD Card boot with network cable attached add music and webradios to library .pls and .m3u files PhotoFrame Project proprietary items tablet/smart phone lying around ownCloud update for my parents on the road Links and other Goodies Pi Project SomaFM Capital Public Radio Sonos Samsung Shape PiMusicBox Rune Audio Music Player Daemon USB Audio Dongle (amazon link... NOT an affiliate link) PicFrame Project ownCloud Kindle Fire HD 6 PicFrame PicFrame Android App Contact Info Matt McGraw - matty at the strangeland dot net Stay-At-Home G33k Dad ~ Fatherhood in the digital age @sahg33kdad Google+ www.google.com/+MattMcGraw The following link includes a photo of the RPi in the bookshelf with the stereo as well as a screenshot of the Rune Audio app running on my Android phone. https://cloud.thestrangeland.net/index.php/s/CdbU1povrcproZQ

Off the Hook
Off The Hook - Apr 27, 2016


The Linux Link Tech Show
The Linux Link Tech Show Episode 656
joels review of the remix jide tablet, good stuff.

April 26, 2016

Hacker Public Radio
HPR2018: How to make Komboucha Tea
How to Make Kamboucha Tea Makes about 1 gallon Ingredients Ingredient US Metric water 3 1/2 quarts ?? white sugar 1 cup ?? black tea 8 bags (or 2 tablespoons loose tea) ?? starter tea from last batch of kombucha or store-bought 2 cups ?? scoby 1 per fermentation jar N/A Optional flavoring extras for bottling: 1 to 2 cups chopped fruit, 2 to 3 cups fruit juice, 1 to 2 tablespoons flavored tea (like hibiscus or Earl Grey), 1/4 cup honey, 2 to 4 tablespoons fresh herbs or spices Equipment Stock pot 1-gallon glass jar or two 2-quart glass jars Bottles: Six 16-oz glass bottles with plastic lids, 6 swing-top bottles, or clean soda bottles Instructions Note: Avoid prolonged contact between the kombucha and metal both during and after brewing. This can affect the flavor of your kombucha and weaken the scoby over time. 1. Make the Tea Base: Bring the water to a boil. Remove from heat and stir in the sugar to dissolve. Drop in the tea and allow it to steep until the water has cooled. Depending on the size of your pot, this will take a few hours. You can speed up the cooling process by placing the pot in an ice bath. 2. Add the Starter Tea: Once the tea is cool, remove the tea bags or strain out the loose tea. Stir in the starter tea. (The starter tea makes the liquid acidic, which prevents unfriendly bacteria from taking up residence in the first few days of fermentation.) 3. Transfer to Jars and Add the Scoby: Pour the mixture into a 1-gallon glass jar (or divide between two 2-quart jars, in which case you'll need 2 scobys) and gently slide the scoby into the jar with clean hands. Cover the mouth of the jar with a few layers of cheesecloth or paper towels secured with a rubber band. 4. Ferment for 7 to 10 Days: Keep the jar at room temperature, out of direct sunlight, and where it won't get jostled. Ferment for 7 to 10 days, checking the kombucha and the scoby periodically. It's not unusual for the scoby to float at the top, bottom, or even sideways. A new cream-colored layer of scoby should start forming on the surface of the kombucha within a few days. It usually attaches to the old scoby, but it's ok if they separate. You may also see brown stringy bits floating beneath the scoby, sediment collecting at the bottom, and bubbles collecting around the scoby. This is all normal and signs of healthy fermentation. After seven days, begin tasting the kombucha daily by pouring a little out of the jar and into a cup. When it reaches a balance of sweetness and tartness that is pleasant to you, the kombucha is ready to bottle. 5. Remove the Scoby: Before proceeding, prepare and cool another pot of strong tea for your next batch of kombucha, as outlined above. With clean hands, gently lift the scoby out of the kombucha and set it on a clean plate. As you do, check it over and remove the bottom layer if the scoby is getting very thick. 6. Bottle the Finished Kombucha: Measure out your starter tea from this batch of kombucha and set it aside for the next batch. Pour the fermented kombucha (straining, if desired) into bottles, along with any juice, herbs, or fruit you may want to use as flavoring. Leave about a half inch of head room in each bottle. (Alternatively, infuse the kombucha with flavorings for a day or two in another jar covered with cheesecloth, strain, and then bottle. This makes a cleaner kombucha without "stuff" in it.) 7. Carbonate and Refrigerate the Finished Kombucha: Store the bottled kombucha at room-temperature out of direct sunlight and allow 1 to 3 days for the kombucha to carbonate. Until you get a feel for how quickly your kombucha carbonates, it's helpful to keep it in plastic bottles; the kombucha is carbonated when the bottles feel rock solid. Refrigerate to stop fermentation and carbonation, and then consume your kombucha within a month. 8. Make a Fresh Batch of Kombucha: Clean the jar being used for kombucha fermentation. Combine the starter tea from your last batch of kombucha with the fresh batch of sugary tea, and pour it into the fermentation jar. Slide the scoby on top, cover, and ferment for 7 to 10 days. Additional Notes: • Batch Size: To increase or decrease the amount of kombucha you make, maintain the basic ratio of 1 cup of sugar, 8 bags of tea, and 2 cups starter tea per gallon batch. One scoby will ferment any size batch, though larger batches may take longer. • Putting Kombucha on Pause: If you'll be away for 3 weeks or less, just make a fresh batch and leave it on your counter. It will likely be too vinegary to drink by the time you get back, but the scoby will be fine. For longer breaks, store the scoby in a fresh batch of the tea base with starter tea in the fridge. Change out the tea for a fresh batch every 4 to 6 weeks. • Other Tea Options: Black tea tends to be the easiest and most reliable for the scoby to ferment into kombucha, but once your scoby is going strong, you can try branching out into other kinds. Green tea, white tea, oolong tea, or a even mix of these make especially good kombucha. Herbal teas are ok, but be sure to use at least a few bags of black tea in the mix to make sure the scoby is getting all the nutrients it needs. Avoid any teas that contain oils, like earl grey or flavored teas. • Avoid Prolonged Contact with Metal: Using metal utensils is generally fine, but avoid fermenting or bottling the kombucha in anything that brings them into contact with metal. Metals, especially reactive metals like aluminum, can give the kombucha a metallic flavor and weaken the scoby over time. Troubleshooting Kombucha • It is normal for the scoby to float on the top, bottom, or sideways in the jar. It is also normal for brown strings to form below the scoby or to collect on the bottom. If your scoby develops a hole, bumps, dried patches, darker brown patches, or clear jelly-like patches, it is still fine to use. Usually these are all indicative of changes in the environment of your kitchen and not a problem with the scoby itself. • Kombucha will start off with a neutral aroma and then smell progressively more vinegary as brewing progresses. If it starts to smell cheesy, rotten, or otherwise unpleasant, this is a sign that something has gone wrong. If you see no signs of mold on the scoby, discard the liquid and begin again with fresh tea. If you do see signs of mold, discard both the scoby and the liquid and begin again with new ingredients. • A scoby will last a very long time, but it's not indestructible. If the scoby becomes black, that is a sign that it has passed its lifespan. If it develops green or black mold, it is has become infected. In both of these cases, throw away the scoby and begin again. • To prolong the life and maintain the health of your scoby, stick to the ratio of sugar, tea, starter tea, and water outlined in the recipe. You should also peel off the bottom (oldest) layer every few batches. This can be discarded, composted, used to start a new batch of kombucha, or given to a friend to start their own. • If you're ever in doubt about whether there is a problem with your scoby, just continue brewing batches but discard the kombucha they make. If there's a problem, it will get worse over time and become very apparent. If it's just a natural aspect of the scoby, then it will stay consistent from batch to batch and the kombucha is fine for drinking.

April 25, 2016

Hacker Public Radio
HPR2017: Here are my thoughts on a 3D printer Kit.
I purchased a 3D printer kit from AliExpress. http://www.aliexpress.com/item/Free-shipping-High-Quality-Precision-Reprap-Prusa-i3-DIY-3d-Printer-kit-with-2-Roll-Filament/32424257787.html Here are some after thoughts on how I liked it, a little overview of 3D printers and why I bought this one. Pictures of the printer as assembled, and a few items I printed http://www.travestylabs.com/3Dprinter/ I hope to make this into a series about software, tips and modifications, and other thoughts I have to share about it. Links http://www.aliexpress.com/item/Free-shipping-High-Quality-Precision-Reprap-Prusa-i3-DIY-3d-Printer-kit-with-2-Roll-Filament/32424257787.html http://www.travestylabs.com/3Dprinter/

April 24, 2016

Hacker Public Radio
HPR2016: Echoprint
Ken's message asking about programmatically checking for the intro and outro: http://thread.gmane.org/gmane.network.syndication.podcast.hacker-public-radio/1039 The Echoprint website: http://echoprint.me Codegen source code: https://github.com/echonest/echoprint-codegen Echoprint - An Open Music Identification Service: https://www.ee.columbia.edu/~dpwe/pubs/EllisWP11-echoprint.pdf Server source codehttps://github.com/echonest/echoprint-server

Phone Losers
Falling Off The Potato Wagon
UtahKurt is responsible for RBCP falling off the potato wagon today and calling up a bunch of lube job customers who refused to get angry about the horrible things I did inside their cars.

April 21, 2016

Hacker Public Radio
HPR2015: Linux in the Church
Linux has been my exclusive OS for many years. When I became the tech director at my church I wanted to utilize the power and freedom of Open Source so I'm gradually implementing it on many of my project.

April 20, 2016

Hacker Public Radio
HPR2014: A first look at the Owon B35T Part 2
In this episode of HPR you get to hear more of the things on NYbill's electronics bench that make clicking noises. The review of the Owon B35T's continues. Bluetooth is now working. And we get an inside look at the meter. The Owon B35T: http://tinyurl.com/glgpe2f Pics for the episode: http://tinyurl.com/glf3hqb

Off the Hook
Off The Hook - Apr 20, 2016


Phone Losers
Microwave Beam Experiments For Science
Jeff sponsors today's educational edition of The Snow Plow Show. Thanks, Jeff! In this episode we notify members of a homeowner's association that we're beaming microwaves at their house and there's nothing they can do about it.

The Linux Link Tech Show
The Linux Link Tech Show Episode 655
reactions to intel insecurity, rich and his apple woes

April 19, 2016

Hacker Public Radio
HPR2013: Parsing XML in Python with Xmltodict
If Untangle is too simple for your XML parsing needs, check out xmltodict. Like untangle, xmltodict is simpler than the usual suspects (lxml, beautiful soup), but it's got some advanced features as well. If you're reading this article, I assume you've read at least the introduction to my article about Untangle, and you should probably also read, at some point, my article on using JSON just so you know your options. Quick re-cap about XML: XML is a way of storing data in a hierarchical arrangement so that the data can be parsed later. It's explicit and strictly structured, so one of its benefits is that it paints a fairly verbose definition of data. Here's an example of some simple XML: <?xml version="1.0"?> <book> <chapter id="prologue"> <title> The Beginning </title> <para> This is the first paragraph. </para> </chapter> <chapter id="end"> <title> The Ending </title> <para> Last para of last chapter. </para> </chapter> </book> And here's some info about the xmltodict library that makes parsing that a lot easier than the built-in Python tools: Install Install xmltodict manually, or from your repository, or using pip: $ pip install xmltodict or if you need to install it locally: $ pip install --user xmltodict Xmltodict With xmltodict, each element in an XML document gets converted into a dictionary (specifically an OrderedDictionary), which you then treat basically the same as you would JSON (or any Python OrderedDict). First, ingest the XML document. Assuming it's called sample.xml and is located in the current directory: >>> import xmltodict >>> with open('sample.xml') as f: ... data = xmltodict.parse(f.read()) If you're a visual thinker, you might want or need to see the data. You can look at it just by dumping data: >>> data OrderedDict([('book', OrderedDict([('chapter', [OrderedDict([('@id', 'prologue'), ('title', 'The Beginning'), ...and so on... Not terribly pretty to look at. Slightly less ugly is your data set piped through json.dumps: >>> import json >>> json.dumps(data) '{"book": {"chapter": [{"@id": "prologue", "title": "The Beginning", "para": "This is the first paragraph."}, {"@id": "end", "title": "The Ending", "para": "This is the last paragraph of the last chapter."}] }}' You can try other feats of pretty printing, if they help: >>> pp = pprint.PrettyPrinter(indent=4) >>> pp.pprint(data) { 'book': { 'chapter': [{'@id': 'prologue', 'title': 'The Beginning', 'para': 'This is the ... ...and so on... More often than not, though, you're going to be "walking" the XML tree, looking for specific points of interest. This is fairly easy to do, as long as you remember that syntactically you're dealing with a Python dict, while structurally, inheritance matters. Elements (Tags) Exploring the data element-by-element is very easy. Calling your data set by its root element (in our current example, that would be data['book']) would return the entire data set under the book tag. We'll skip that and drill down to the chapter level: >>> data['book']['chapter'] [OrderedDict([('@id', 'prologue'), ('title', 'The Beginning'), ('para', 'This is the first paragraph.')]), OrderedDict([('@id', 'end'), ('title', 'The Ending'), ('para', 'Last paragraph of last chapter.')])] Admittedly, it's still a lot of data to look at, but you can see the structure. Since we have two chapters, we can enumerate which chapter to select, if we want. To see the zeroeth chapter: >>> data['book']['chapter'][0] OrderedDict([('@id', 'prologue'), ('title', 'The Beginning'), ('para', 'This is the first paragraph.')]) Or the first chapter: >>> data['book']['chapter'][1] OrderedDict([('@id', 'end'), ('title', 'The Ending'), ('para', 'Last paragraph of last chapter.')]) And of course, you can continue narrowing your focus: >>> data["book"]["chapter"][0]['para'] 'This is the first paragraph.' It's sort of like Xpath for toddlers. Having had to work with Xpath, I'm happy to have this option. Attributes You may have already noticed that in the dict containing our data, there is some special notation happening. For instance, there is no @id element in our XML, and yet that appears in the dict. Xmltodict uses the @ symbol to signify an attribute of an element. So to look at the attribute of an element: >>> data['book']['chapter'][0]['@id'] 'prologue' If you need to see each attribute of each chapter tag, just iterate over the dict. A simple example: >>> for c in range(0,2): ... data['book']['chapter'][c]['@id'] ... 'prologue' 'end' Contents In addition to special notation for attributes, xmltodict uses the # prefix to denote contents of complex elements. To show this example, I'll make a minor modification to sample.xml: <?xml version="1.0"?> <book> <chapter id="prologue"> <title> The Beginning </title> <para class="linux"> This is the first paragraph. </para> </chapter> <chapter id="end"> <title> The Ending </title> <para class="linux"> Last para of last chapter. </para> </chapter> </book> Notice that the <para> elements now have a linux attribute, and also contain text content (unlike <chapter> elements, which have attributes but only contain other elements). Look at this data structure: >>> import xmltodict >>> with open('sample.xml') as g: ... data = xmltodict.parse(g.read()) >>> data['book']['chapter'][0] OrderedDict([('@id', 'prologue'), ('title', 'The Beginning'), ('para', OrderedDict([('@class', 'linux'), ('#text', 'This is the first paragraph.')]))]) There is a new entry in the dictionary: #text. It contains the text content of the <para> tag and is accessible in the same way that an attribute is: >>> data['book']['chapter'][0]['para']['#text'] 'This is the first paragraph.' Advanced The xmltodict module supports XML namespaces and can also dump your data back into XML. For more documentation on this, have a look at the module on github.com/martinblech/xmltodict. What to Use? Between untangle, xmltodict, and JSON, you have pretty good set of options for data parsing. There really are diferent uses for each one, so there's not necessarily a "right" or "wrong" answer. Try them out, see what you prefer, and use what is best. If you don't know what's best, use what you're most comfortable with; you can always improve it later. [EOF] Made on Free Software.

April 18, 2016

Hacker Public Radio
HPR2012: Parsing XML in Python with Untangle
XML is a popular way of storing data in a hierarchical arrangement so that the data can be parsed later. For instance, here is a simple XML snippet: <?xml version="1.0"?> <book> <chapter id="prologue"> <title> The Beginning </title> </chapter> </book> The nice thing about XML is that it is explicit and strictly structured. The trade-off is that it's pretty verbose, and getting to where you want to go often requires fairly complex navigation. If you do a quick search online for XML parsing in Python, your two most common results are lxml and beautifulsoup. These both work, but using them feels less like opening a dictionary (as with JSON) to look up a definition and more like wandering through a library to gather up all the dictionaries you can possibly find. In JSON, the thought process might be something like: "Go to the first chapter's title and print the contents." With traditional XML tools, it's more like: "Open the book element and gather all instances of titles that fall within those chapters. Then, look into the resulting object and print the contents of the first occurrence." There are at least two libaries that you can install and use to bring some sanity to complex XML structures, one of which is untangle. Untangle With untangle, each element in an XML document gets converted into a class, which you can then probe for information. Makes no sense? well, follow along and it will become clear: First, ingest the XML document. Assuming it's called sample.xml and is located in the current directory: >>> import untangled >>> data = untangle.parse('sample.xml') Now our simple XML sample is sitting in RAM, as a Python class. The first element is <book> and all it contains is more elements, so its results are not terribly exciting: >>> data.book Element(name = book, attributes = {}, cdata = ) As you can see, it does identify itself as "book" (under the name listing) but otherwise, not much to look at. That's OK, we can keep drilling down: >>> data.book.chapter Element(name = chapter, attributes = {'id': 'prologue'}, cdata = ) Now things get more interesting. The next element identifies itself as "chapter", and reveals that it has an attribute "id" which has a value of "prologue". To continue down this path: >>> data.book.chapter.title Element(name = title, attributes = {}, cdata = The Beginning ) And now we have a pretty complete picture of our little XML document. We have a breadcrumb trail of where we are in the form of the class we are invoking (data.book.chapter.title) and we have the contents of our current position. Sniping That's very linear; if you know your XML schema (and you usually do, since XML is quite strict) then you can grab values without all the walking. For instance, we know that our chapters have 'id' attributes, so we can ask for exactly that: >>> data.book.chapter['id'] 'prologue' You can also get the contents of elements by looking at the cdata component of the class. Depending on the formatting of your document, untangle may be a little too literal with how it stores contents of elements, so you may want to use .strip() to prettify it: >>> data.book.chapter.title.cdata.strip() 'The Beginning' Dealing with More Than One Element My example so far is nice and tidy, with only one chapter in the book. Generally you'll be dealing with more data than that. Let's add another chapter to our sample file, and some content to each: <?xml version="1.0"?> <book> <chapter id="prologue"> <title> The Beginning </title> <para> This is the first paragraph. </para> </chapter> <chapter id="end"> <title> The Ending </title> <para> Last para of last chapter. </para> </chapter> </book> Accessing each chapter is done with index designations, just like with a dict: >>> data.book.chapter[0] Element(name = chapter, attributes = {'id': 'prologue'}, cdata = ) >>> data.book.chapter[1] Element(name = chapter, attributes = {'id': 'end'}, cdata = ) If there is more than one instance of a tag, you must use a designator or else untangle won't know what to return. For example, if we want to access either the title or para elements within a chapter: >>> data.book.chapter.title Traceback (most recent call last): File "<stdin>", line 1, in <module> AttributeError: 'list' object has no attribute 'title' Oops. But if we tell it which one to look at: >>> data.book.chapter[0].title.cdata.strip() 'The Beginning' >>> data.book.chapter[1].title.cdata.strip() 'The Ending' Or you can look at the paragraph instead of the title. The lineage is the same, only instead of looking at the title child, you look at the para child: >>> data.book.chapter[0].para.cdata.strip() 'This is the first paragraph.' >>> data.book.chapter[1].para.cdata.strip() 'Last para of last chapter.' You can also iterate over items: >>> COUNT = [0,1] >>> for TICK in COUNT: ... print(data.book.chapter[TICK]) Element <chapter> with attributes {'id': 'prologue'} and children [Element(name = title, attributes = {}, cdata = The Beginning ), Element(name = para, attributes = {}, cdata = This is the first paragraph.)] Element <chapter> with attributes {'id': 'end'} and children [Element(name = title, attributes = {}, cdata = The Ending ), Element(name = para, attributes = {}, cdata = Last para of last chapter.)] And so on. Easy and Fast I'll admit the data structure of the classes does look odd, and you could probably argue it's not the cleanest and most elegant of all output; it's unnerving to see empty cdata fields or to constantly run into the need to strip() whitespace. However, the ease and speed and intuitiveness of parsing XML with untangle is usually well worth any trade-offs. [EOF] Made on Free Software.

Phone Losers
987214-A
Milkbrain sponsors today's show where we talk to homeowners about their roofs and their front yard in ground pools.

April 17, 2016

Hacker Public Radio
HPR2011: Introduction to sed - part 4
Introduction to sed - part 4 In the last episode we looked at some of the more frequently used sed commands, having spent previous episodes looking at the s command, and we also covered the concept of line addressing. In this episode we will look at how sed really works in all the gory details, examine some of the remaining sed commands and begin to build useful sed programs. To read the rest of the notes for this episode follow this link: http://hackerpublicradio.org/eps/hpr2011/full_shownotes.html Links Introduction to sed - part 1: http://hackerpublicradio.org/eps.php?id=1976 Introduction to sed - part 2: http://hackerpublicradio.org/eps.php?id=1986 Introduction to sed - part 3: http://hackerpublicradio.org/eps.php?id=1997 Some further Bash tips: http://hackerpublicradio.org/eps.php?id=1903 GNU sed manual: https://www.gnu.org/software/sed/manual/sed.html Wikipedia entry for sed: https://en.wikipedia.org/wiki/Sed "Sed - An Introduction and Tutorial" by Bruce Barnett: http://www.grymoire.com/Unix/Sed.html Wikibooks sed wiki: https://en.wikibooks.org/wiki/Sed Example files: Demonstration Bash script: http://hackerpublicradio.org/eps/hpr2011/demo3.sh Demonstration of 'M' modifier: http://hackerpublicradio.org/eps/hpr2011/demo4.sed Wikipedia entry for "Pig Latin": https://en.wikipedia.org/wiki/Pig_Latin

April 14, 2016

Hacker Public Radio
HPR2010: Parsing JSON with Python
JSON is a popular way of storing data in a key/value type arrangement so that the data can be parsed easily later. For instance, here is a very simple JSON snippet: { "name":"tux", "health":"23", "level":"4" } If you are like me, three questions probably spring to your mind: That looks an awful lot like a Python dictionary. Yes, it looks exactly like a Python dictionary. They are shockingly similar. If you are comfortable with Python lists and dictionaries, you will feel right at home with JSON. I don't feel comfortable with dictionaries, can't I just use a delimited text file? You can, but you will have to write parsers for it yourself. If your data gets very complex, the parsing can get pretty ugly. That is not to say that you should not use a simple delimited text file if that is all that your programme needs. For example, I would not want to open a config file as a user and find that I have to format all my options as valid JSON. Just know that JSON is out there and available, and that the JSON Python module has some little features that make your life easier when dealing with sets of data. Why not use XML instead? You can. Mostly one should use the most appropriate format for one's project. I'm a big fan of XML, but sometimes JSON makes more sense. I am not going to make this post about teaching the JSON format. If you need clarification on how to structure data into JSON, go through a tutorial on it somewhere; there are several good ones online. Honestly, it's not that complex; you can think of JSON as nested dictionaries. Starting from scratch, let's say that you write a programme that by nature gathers data as it runs. When the user quits, you want to save the data to a file so that when the user resumes the app later, they can load the file back in and pick up where they left off. Storing Data as JSON At its most basic, the JSON data structure is basically the same as a Python dictionary, and in fact the nice thing about JSON is that it can be directly imported into a Python dictionary. Usually, however, you are resorting to JSON because you have somewhat complex data, so in the sample code we will use a dictionary-within-a-dictionary: #!/usr/bin/env python game = {'tux': {'health': 23, 'level': 4}, 'beastie': {'health': 13, 'level': 6}} # you can always add more to your dictionary game['konqi'] = {'health': 18, 'level': 7} That code creates a ditionary called game which stores the player name and a corresponding dictionary of attributes about how the player is doing in the progress of the game. As you can see after the comment, adding new players is simple. Now let's see how to save that data to a save file. ## continued... import json with open('dosiero.json', 'w') as outfile: json.dump(game, outfile) That would be your save command. Simple as that, all the structured content of your game dictionary is committed to a file on your hard drive. Reading Data from a JSON File If you are saving data to JSON, you probably will evenually want to read the data back into Python. For this, Python features the function json.load import json dosiero = open('dosiero.json') game = json.load(dosiero) print game['tux'] # prints {'health': 23, 'level': 4} print game['tux']['health'] # prints 23 print game['tux']['level'] # prints 4 # when finished, close the file json_data.close() As you can see, JSON integrates surprisingly well with Python, so it's a great format when your data fits in with its model. Have fun! [EOF] Made with Free Software.

April 13, 2016

Hacker Public Radio
HPR2009: Understanding the GNU/Screen Hardstatus line
Links https://github.com/CPrompt/configs/blob/master/.screenrc (CPrompt's .screenrc file) https://www.gnu.org/software/screen/manual/html_node/String-Escapes.html (GNU Man page on String Escapes)

Off the Hook
Off The Hook - Apr 13, 2016


The Linux Link Tech Show
The Linux Link Tech Show Episode 654
stuff

April 12, 2016

Hacker Public Radio
HPR2008: HPR needs shows to survive.
You can help out the Hacker Public Radio project by recording a show today. See http://hackerpublicradio.org/contribute.php for more information.

April 11, 2016

Hacker Public Radio
HPR2007: My new laptop
My new laptop I attended OggCamp15 in Liverpool at the end of October 2015. As usual I bought some raffle tickets as a contribution to the expenses of the (un-)conference, not paying much attention to the prizes. Actually, the star prize was a laptop donated by Entroware, a significant sponsor of the event, one of the most impressive prizes ever offered at OggCamp. There was quite a lot of excitement about this prize. I attended the drawing of the raffle at the end of proceedings on the Sunday. Dan Lynch (of Linux Outlaws, and a frequent organiser of OggCamp) was in attendance overseeing the selection of the raffle tickets. Various smaller prizes were won and the tension built up as the final drawing approached. Things got very tense when the first number drawn for the laptop was called and nobody responded. Then another draw was made. Imagine my shock and surprise when I realised I had the winning ticket! I had won the star prize in the OggCamp raffle! See the full show notes here http://hackerpublicradio.org/eps/hpr2007/full_shownotes.html for the details of the laptop. Links OggCamp15: http://oggcamp.org/ Entroware Ltd.: http://entroware.com/ Wikipedia article on "Ubuntu Netbook Edition": https://en.wikipedia.org/wiki/Ubuntu_Netbook_Edition Wikipedia article on "CrunchBang Linux": https://en.wikipedia.org/wiki/CrunchBang_Linux TuxJam: http://unseenstudio.co.uk/category/tuxjam-ogg/

April 10, 2016

Hacker Public Radio
HPR2006: Basic Audio Production - Compression
This tutorial that does a much better work than me: http://www.dnbscene.com/article/1474-compress-to-impress-a-complete-compression-tutorial


[more]
Link to us!

Hackermedia.org is provided by:
Binary Revolution | Infonomicon Computer Club