Site Map - skip to main content - dyslexic font - mobile - text - print

Hacker Public Radio

Your ideas, projects, opinions - podcasted.

New episodes Monday through Friday.



Welcome to HPR the Community Podcast Network

We started producing shows as Today with a Techie 10 years, 10 months, 24 days ago. Our shows are produced by listeners like you and can be on any topic that "are of interest to Hackers". If you listen to HPR then please consider contributing one show a year. If you record your show now it could be released in 16 days.


Latest Shows


hpr2105 :: 24 - SSL Certificates - Problems

A discussion of the problems with SSL certificates, and some solutions


Hosted by Ahuka on 2016-08-26 and released under a CC-BY-SA license.
Listen in ogg, spx, or mp3 format. Series: Privacy and Security | Comments (0)

I had the opportunity to present a talk on SSL Certificates at our local LUG, the Washtenaw Linux Users Group, which uses some material from a previous HPR episode, but may be of interest to our listeners nonetheless. Because this was a lengthy presentation I have divided it into sections. This is the second section which will explore some of the problems that we have with SSL Certificates, and how we might address those problems. The first section contains our description of how SSL Certificates work.

For more go to http://www.zwilnik.com/?page_id=686


hpr2104 :: Basic Audio Production: Reverb

A very basic description of the reverb effect

Hosted by Nacho Jordi on 2016-08-25 and released under a CC-BY-SA license.
Listen in ogg, spx, or mp3 format. Comments (0)

Here is the calf reverb plugin, neat and with a nice graphic interface (it contains a few parameters that I don’t cover in the podcast, thought).

http://www.audiopluginsforfree.com/calf-reverb/

You can probably download it too directly from your Package Manager


hpr2103 :: DIY Book Binding

With no shows in the queue, Ken rushes in a show on his latest hacks


Hosted by Ken Fallon on 2016-08-24 and released under a CC-BY-SA license.
Listen in ogg, spx, or mp3 format. Comments (0)

I love books, dislike technology when reading about technology, so what to do when the only available option is a pdf or ebook format ?

With a hpr1480 :: Continuous Ink Supply System and 500 pages of A4 paper costing just €3, the option to print out books at home is not only possible but down right affordable. Even more so when when printing booklet format of 4 pages per physical sheet of paper.

Small books of around 100 pages/25 sheets and a long arm stapler works fine, of larger sizes you can get a Comb binding machine but I dislike the sound and feel of these solutions

My solution, a Jig Saw, some wood clamps, PVC Plummers Glue, and some drywall/plaster board tape (pdf)

Clamping the book and cut in half with a Jig Saw
Clamping the book and cut in half with a Jig Saw.

Clamp both halves together, aligning them together on their uncut edge, and trim the cut edges to give a clean cut
Clamp both halves together, aligning them together on their uncut edge, and trim the cut edges to give a clean cut.

Builders supply stores and DIY shops carry the tape and glue
Builders supply stores and DIY shops carry the tape and glue.

Glue and tape repeatedly and allow to dry
Now apply a liberal amount of glue to the cut edge, apply the tape and let it dry for 30 minutes. Then apply another layer of glue and fold down the excess tape. Apply at least two more applications of glue.


hpr2102 :: AngularJS's ng-repeat, and the browser that shall not be named

A method for optimizing the rendering of items when using AngularJS's ng-repeat directive.


Hosted by Rho`n on 2016-08-23 and released under a CC-BY-SA license.
Listen in ogg, spx, or mp3 format. Comments (0)

Introduction

At my work, we are in the process of revamping our internal call logging system. Moving from .NET and Microsoft’s ASPX pages for both the client side and back end processing, to an HTML5 based Single Page Application (SPA) using AngularJS for the client side interface with a .NET WebAPI service for the back end processing. The main page for both versions contains a list of the current days calls laid out in a table with 9 columns. Users are able to switch to a specific day’s calls by selecting a date via a calendar widget, or by moving one day at a time via previous and next day buttons. By the end of a typical day, the page will contain between 40 and 50 calls.

During recent testing of the SPA client on the proprietary browser we all love to hate, or at least have a love/hate relationship with if you have to support it, I noticed that rendering of a whole days worth of calls would take seconds, freezing the UI completely. This made changing dates painful. As we reload the data any time you re-enter that page (a manual way to poll for new data until we implement either timer based polling or a push service through websockets), the page was almost unusable. The page rendered fine in both Mozilla and webkit based javascript JIT engines, but Microsoft’s engine would choke on it.

After a bit of searching on “AngularJS slow rendering” and “AngularJS optimize”, I found many references about using Angular’s ng-repeat directive when rendering long lists of data (see references below for the main pages I read). I tried a couple of the methods mentioned to optimize the ng-repeat directive. I used the “track by” feature of ng-repeat to use the call’s id as the internal id of the row, so ng-repeat didn’t have to generate a hashed id for each row. I implemented Angular’s one-time binding feature to reduce the number of watches being created (reducing the test day’s number of watches from 1120 to 596), but even these two combined optimizations didn’t have enough effect to render the page in an acceptable amount of time. The next optimization I played with was using ng-repeat with the limitTo filter. This limits the number of items rendered in the list that ng-repeat is looping through. This is particularly useful combined with paging of the data. I set the limitTo option to different values to see how it affected the rendering time. I found that rendering 5 rows was fast and consistent for every day’s worth of data I viewed. From my reading, I knew if I updated the limitTo amount while keeping the array of items the same, ng-repeat would only render any un-rendered items, and not redo the whole limited list.

The Code

<tr ng-repeat="c in results | limitTo:displayRenderSize">

Inside your directive, set an angular.$watch on the list of items to be rendered by ng-repeat. In this example the list is stored in the variable results.

return {
        scope: {
            results: "=",
    },
        link: function (scope, element, attrs) {
            scope.renderSizeIncrement = 5;
            scope.displayRenderSize = scope.renderSizeIncrement;

            scope.$watch('results', function () {
                if (scope.results) {
                    scope.displayRenderSize = scope.renderSizeIncrement;
                    scope.updateDisplayRenderSize();
                }
            });
            scope.updateDisplayRenderSize = function () {
                if (scope.displayRenderSize < scope.results.length) {
                    scope.displayRenderSize += scope.renderSizeIncrement;
                    $timeout(scope.updateDisplayRenderSize, 0);
                }
            }
        }
    }
}

Any time the results are updated. The displayRenderSize variable is reset to render the default number of items, and the updateDisplayRenderSize function is called. This function calls itself repeatedly via angular’s $timeout service ($timeout is a wrapper for javascript’s setTimeout function). It increments the displayRenderSize variable which is being watched by the limitTo filter of the main ng-repeat. Each time the displayRenderSize variable is incremented, the ng-repeat renders the next set of items. This is repeated until all the items in the list are rendered.

The magic happens because ng-repeat blocks any other javascript, which does not effect angular’s digest path, until it is finished rendering. By calling the updateDisplayRenderSize with a timeout, the function doesn’t get called again until after the next set of items is rendered. Making the $timeout delay 0, sets the function to be called as soon as possible after the ng-repeat digest cycle stops blocking. In this instance, the sum of the rendering time for parts of the list is shorter than the sum of the rendering time for all of the list at one time.

Conclusion

There are a couple small glitches with this solution. Scrolling can be a bit jerky as the chunk sized renders cause a series of micro UI freezes, instead of one big long one. Also, if you don’t have a fixed or 100% percent wide table layout, and you don’t have fixed column sizes, the table layout will dance a little on the screen until the columns have been filled with their largest amounts of data. This is the result of the table layout being re-calculated as more data fills it. That being said, overall, this solution works great. It moved the pause from seconds to under half a second or less—making the page go from unbearable to usable on Microsoft’s latest browser offerings.

References

[1] AngularJS Performance Tuning for Long Lists; Small Improvements; Tech blog; blog; viewed: 2016-08-09

[2] Optimizing ng-repeat in AngularJS; Fundoo Solutions; blog; viewed: 2016-08-09

[3] AngularJS: My solution to the ng-repeat performance problem; thierry nicola; blog; published: July 24, 2013; viewed: 2016-0809


hpr2101 :: What's on my podcatcher

Some of the podcasts I listen to

Hosted by Tony Hughes AKA TonyH1212 on 2016-08-22 and released under a CC-BY-SA license.
Listen in ogg, spx, or mp3 format. Series: Podcast recommendations | Comments (0)

A short show about the podcasts I like to listen to.


hpr2100 :: Re-Enable Copy and Paste in Browsers

How to bypass the roadblocks implemented by JavaScript


Hosted by Ken Fallon on 2016-08-19 and released under a CC-BY-SA license.
Listen in ogg, spx, or mp3 format. Comments (0)

This episode deals with the annoying, and frustrating practice of disabling copy and paste on websites through the use of javascript.

For a detailed explanation of the why please read this excellent article by Nicholas Miller Re-Enable Copy & Paste on Annoying Sites That Block It. In this article Nicholas explains that you can set dom.event.clipboardevents.enabled in Firefox to prevent this.

In Chrome, you are going to need to install extensions to get the same functionality. The following ones worked for me:

https://www.troyhunt.com/the-cobra-effect-that-is-disabling/


hpr2099 :: Dat Muzak Showz

Lyle (x1101) and Thaj talk about making music on Linux

Hosted by x1101 on 2016-08-18 and released under a CC-BY-SA license.
Listen in ogg, spx, or mp3 format. Comments (0)

Note, starting any of while doing anything else with audio is probably a poor choice. At least in Linux. Because Linux audio is still slightly Lovecraftian.

Tools Thaj suggested:

  • LMMS,
  • Ardour,
  • Qtractor,
  • Fluidsynth,
  • Hydrogen,
  • Luppp,
  • Guitarix,
  • Rackarack

https://www.youtube.com/watch?v=MPmkd0fgiLU


hpr2098 :: Minimal Music Site?

Matt King discussing the availability of an open source multimedia focused website.

Hosted by mattkingusa on 2016-08-17 and released under a CC-BY-SA license.
Listen in ogg, spx, or mp3 format. Comments (0)

Project available https://sourceforge.net/p/minimal-music-site

A very small responsive website for uploading content. Originally designed primarily for musicians needing an easy interface to share content. Upload files in the admin pages. Automatically saves files in directories and lists content on main pages by date. I'm sure there are many improvements that could be made.


hpr2097 :: New Toys

Story of my PC hardware journey in last 20 years

Hosted by Tony Hughes AKA TonyH1212 on 2016-08-16 and released under a CC-BY-SA license.
Listen in ogg, spx, or mp3 format. Series: Hardware upgrades | Comments (2)

Hi HPR listeners this is Tony Hughes talking from Blackpool UK

I did a show a few weeks ago about my Geek Bags but didn’t talk about the Desktop PC I use and as I’ve just upgraded to a new (used) PC I thought I would tell the story of my Desktop PC’s over the years.

I was a latecomer to the world of personal computing having been at school in the Late 60’s and early 70’s when we hadn’t even got calculators, if you were lucky to be able to work out the intricacy of it you may have had use of a slide rule. Even after calculators started to be more widely used I had a lecturer at college while studying marine engineering, that was so good with his slide rule and mental calculation, he could, and would often work out equations far faster than those of us using a calculator.

I first came across my first IBM clone PC back at college in 1987 while studying a control systems course this was a Intel 286 PC which the college ran CAD/CAM software on and we used it to learn how to create engineering drawings electronically. This would be the last time I used a computer until the early 1990’s when by then I had changed career and become a Registered Nurse. I was working in a residential nursing home and we had access to a Windows 3.xx PC which I would use to create templates of the clinical paperwork we used for record keeping.

Around this time I met my then wife to be and she needed a PC for the University Course she was on so we obtained a used Intel 386 PC from a Friend and upgraded the Ram from 1Mb to 4Mb which cost nearly half the price we paid for the PC £120, which in 1993 was a good chunk of cash. It was a time when there was a world shortage of Ram and offices were getting burgled just for the memory in the office PC’s.

While we had this PC in the house it didn’t much interest me at the time, this was pre internet days for the average user, we weren’t on line at work and the Word processing software was Dos based and I hated using it, so would do the odd things I needed to at work during my break.

Move forward 5 years and Windows 95 had taken over the world and there was this wonderful new OS called Windows 98 starting to appear in the shops. In September 1998 I went back to do a Nursing Degree in my specialist area of practice and found that we were required to submit all our course work in word processed format, no long hand written assignments this time around. So I decided that I would invest in a new home PC.

There were a couple of Big Box PC retailers in the UK at the time that advertised heavily in the press and on TV and I chose to go to one of these and bought a PC with the following specs:   

Pentium 2 350 CPU, 128Mb Ram, 6Gig HDD, 56k modem and a DVD Rom. It also came bundled with a Scanner, Inkjet printer and software including MS Office for small Business. All for the grand total of £1400 which at the time was about a month’s take home pay so I had to pay for it with the flexible friend (my Credit Card for those of you too young to remember the ad’s)

I also signed up for an AOL account to access the internet over the 56k modem, dog slow now but at the time was the only affordable way us mere mortals could afford home internet access. I remember it could take a minute or 2 to render my Bank’s web site when I started online banking in 2001 and that was using compression software to reduce the bandwidth.

I used that PC to write all my college work and with the help of a couple of friends started to tinker with the PC, getting a 120 ZIP drive for it, and later adding a CD RW drive for storing documents and Photos that I’d scanned and later taken with my first digital Camera.

By 2002 the PC was starting to get a bit long in the tooth and I decided it was time for an upgrade and I had a PC built for me by a local shop with P4 2.5Ghz CPU 40Gig HDD and 512Mb Ram (later upgraded to 2Gig) and a CD RW drive again later upgraded to DVD RW drive. This PC cost me half of what I paid for the P2 four years previously and was to be the last PC I bought new, all the PC’s including laptops I’ve owned since this PC have been second hand. Some given by family or friends, some built from parts of Freecycle/Freegle, and lately PC’s I’ve bought at a local computer auction in the north west of the UK.

The title of this podcast is “New Toys” and so to the juicy bit, my Desktop for the last 6 years has been a Lenovo ThinkCentre 7373 Core 2 Duo PC with a 2.6Ghz CPU, 250Gig SSD, an upgrade from the 160Gig HDD it came with and 12Gig Ram also upgraded from the 4Gig it came with and requiring a bios flash to get the MB to support 16Gig. This rig has served me well but lately I have found it starting to feel its age and taking a long time to do things I now do regularly such as video and photo editing, Audio editing and virtual PC’s in virtualBox. So I decided it was time I looked around for an upgrade. As usual I was not in the market for a new PC, I could afford one but I don’t like splashing the cash unnecessarily. As luck would have it the monthly Auction catalog included a HP Compaq Elite 8300 i7 Micro Tower. I checked out the specs and liked what I read. So Monday 1st of August I took a trip to the auction and as luck would have it I became the proud owner of said PC for the princely sum of £212.80, hammer price of £190 plus commission.

The full spec of the PC is: i7 3.4Ghz CPU (22nm architecture) 4 cores and 8 threads, 8Gig Ram Supports 32Gig 500Gig HDD, DVD RW drive and a card reader. Also came with a Win7 pro CoA but no installed OS.

So it took me 10 minutes to install Linux Mint 18 and another 30 to complete the updates and install my software over and above the base install. It boots in just over a minute, which is only slightly slower than the old PC with an SSD, so I guess it will boot mega fast with an SSD upgrade, which is on the cards after I return from Holiday as may an upgrade to the Ram. I’ve already used some Ram from the old PC to increase to 12Gig but I need some matching 8Gig Ram to go to 16 or higher.

Well that charts my PC hardware journey over the last 20 odd years it’s amazing to think that one of the Raspberry Pi 3’s I own has more processing power than most of the hardware I’ve had up to the Core 2 Duo in 2010.


hpr2096 :: Useful Bash functions - part 2

The further development of a Bash function that may be of use in your scripts


Hosted by Dave Morriss on 2016-08-15 and released under a CC-BY-SA license.
Listen in ogg, spx, or mp3 format. Series: Bash Scripting | Comments (2)

Useful Bash functions - part 2

Overview

This is the second show about Bash functions. In this one I revisit the yes_no function from the last episode and deal with some of the deficiencies of that version.

As before it would be interesting to receive feedback on these versions of the function and would be great if other Bash users contributed ideas of their own.

Full Notes

Since the notes explaining this subject are long, they have been placed here.