Monday, August 26, 2013

An analysis of radio song play frequency for 102.9 WMGK

Update: I've looked at this again in 2023.  The original post is below.


Recently I had to drive a car with only a radio for music.  After just a few days I was annoyed at the variety, or lack thereof.  I decided to scrape the station's web site for recently played data and see what the long term trends were.

The local classic rock station is 102.9 WMGK.  They have a recently played page which is easily scrapable.  This is contrasted to other classic rock stations that I wanted to scrape for a comparison that only listed the last few songs, or embedded it in flash.

I began scraping on June 26th and August 24th makes 60 days worth of data.

Thanks to my recent post, we know classic rock songs average 4:48 in length.  There are 86,400 minutes in 60 days.  That would be enough time for 18,000 songs.  If we assume only 75% of the time is actually music that's 13,500 songs.  During these 60 days WMGK played 14,286 songs.

I won't speculate about what this means about the actual percentage of music on the air.  Slight changes in average song length have a big effect on numbers.

So, now it is time for the interesting questions.  How many of those were unique songs?  How many songs would be needed to represent 25% or 75% coverage?

In case it isn't clear what I mean by coverage, I mean how many songs represent 10% (or whatever) of the total songs played.  For example, if a station played 1 song 10 times, and then 10 other songs 1 time each, for a total of 20 plays, that 1 top song would give 50% coverage.

So, without further ado here are the stats:

CoverageSongs
10.04%28
25.27%77
50.23%172
75.13%279
90.03%373
100.00%924

924 unique plays out of 14,286 means about 6.5% of songs were being played for the first time in 60 days.  Honestly, that's not bad.  However, the 50% and 75% coverages are awful.  I have 30k unique songs in my playlist, and that's not even particularly impressive.  Admittedly, they aren't all one genre, but Led Zeppelin has 86 studio songs, all of which would be suitable for a classic rock station.

The key take away is that there are about 300 to 350 songs that get played at least every other day.  Then, they occasionally toss in a deep cut.  There is no middle ground; either a song is played every other day, or once every few months.  I made some (read: over 100) graphs that illustrate this, but for now let's stick to tables.

Want to guess what the most popular bands or songs are?

Top songs:
Plays per 30 daysBandSong
27.5Warren ZevonWerewolves Of London
27CarsJust What I Needed
27Blue Oyster CultBurnin' For You
27Steve Miller BandRock 'n Me
26.5SupertrampThe Logical Song
26.5David BowieChanges
26.5Pink FloydAnother Brick In The Wall
26.5Electric Light OrchestraDo Ya
26J. Geils BandCenterfold
26WarLow Rider

Top Bands:
Plays per 30 daysBand
356.5Rolling Stones
334.5Led Zeppelin
283Beatles
183Pink Floyd
177.5Who
169.5Van Halen
164Queen
154.5Journey
143Cars
138.5Billy Joel
135.5Tom Petty And The Heartbreaker
135.5Steve Miller Band
135Electric Light Orchestra
132.5Foreigner
112Supertramp
107.5Boston
107.5Bad Company
105.5Aerosmith
105.5Creedence Clearwater Revival
105Elton John


I would not have guessed most of those top songs.  Note how much higher the top three bands are than the rest; there is a second smaller drop off after Foreigner.  Also interesting is that none of the top three bands have a top 10 song.  I would have also guessed Beatles to be the top band.

Let's start looking at the graphs.


Here we have two graphs of bands.  The first is limited to the top 50 and has labels.  The second is all bands, and without labels, just showing the general trend.





These next two graphs really show the tendency to play the same songs.  The first shows how many songs were played various number of times in 60 days.  There are three clusters.  First, songs that were played once or twice.  Then there is a wasteland from 11 to 26 plays in 60 days.  After that, there is the main group of songs that are played every other day.  That tapers off, and leads to the last group of songs which are played almost every day.  Keep in mind that the number of plays compounds the number of songs in that group.  20 songs each played 35 times is a lot more plays than 200 songs played once.
The second graph that illustrates this point is this one of every single song.  It is a bit confusing as there are way too many songs to see individual bars, but you can look at the slopes to see the same three groups as before.  The top songs as the peak on the left.  Then the plateau of the normal roster, followed by a steep drop off to the songs played a few times.  The steep drop off illustrates the lack of a middle ground.

The last general WMGK graph is this one that shows the average daily plays in a given hour of the day.  It shows there is a drop off in the morning hours from 5am - 8am.  The night hours of 12am - 4am are the highest.  It's interesting that there is a clear rise at midnight.  I don't think WMGK has a morning show, so I'm not sure why there is the drop off.  At first I thought they increased ads during peak commuting hours, but there is no drop off in the evening.  My guess is they must provide short news and traffic conditions during those hours.



I made that graph so that I could compare individual bands to see if different bands were being played more at certain times (eg longer songs being relegated to the middle of the night).  Unfortunately, I don't have enough data to really answer this.  A typical band might have a few plays in a given hour for the entire 60 day period.  I suppose I could have increased the buckets to 6 hour windows, but was too lazy to code this.


The rest of the graphs compare WMGK plays to last.fm plays for a given band.  I'll post a few here.  All of the graphs are in this gallery on my site.

I had a hard time with the comparisons.  First, there was the fact that some of the titles had subtle differences.  This meant I had to hard code the differences in a hash.  There is also the problem of songs with multiple versions on last.fm, this will tend to change the order slightly.  Also, the last.fm api only gives play data from the last 6 months.  For most classic rock this doesn't matter, but, eg, David Bowie had a recent album, and thus his graphs are hugely skewed towards it.

Then I couldn't decide which songs to show.  I ended up making two graphs for each band.  One shows all the WMGK plays and the other shows the top 20 last.fm songs.  Each has the other's plays on them, but are sorted differently.  I think the last.fm graph is more interesting, as it shows which popular songs WMGK doesn't play.  In their defense, some songs simply aren't classic rock.  On the other hand, the WMGK sorted graph shows the sharp drop off when you go from the frequently played songs down to the deep cuts (that aren't that deep).

For example, here are the two Billy Joel graphs:

I think they both show the vast difference of opinion of what good Billy Joel songs are.


Cars:


A very different Genesis:


Led Zeppelin, showing the drop off:


A not-that-surprising Pink Floyd.  Except, why does WMGK love Young Lust?


Not big Rush fans:


WMGK doesn't seem to know where the Styx CD gets good:


A crime against humanity:


Finally, I used this as an excuse to learn some git and github use.  All the code, text files, and graphs are available there. Here are some files of interest:

Text file of all plays

Text file of all songs, with play counts

Text file of all bands, with play counts

Perl script to scrape WMGK site

Perl script which provides general stats and graphs for all WMGK

Perl script which provides specific stats from one band passed to it on command line

Wednesday, August 21, 2013

Genre Average Song Lengths

I was working on a different post and had to write a script to get the average song length of a genre from last.fm. I wrote a quick perl script and figured I'd get some other genres to compare. I grabbed the 250 top tags, and then grabbed the 50 top tracks for each tag.

I didn't really expect anything revolutionary.  Prog has longer songs than punk.  Some of the tags don't represent genres (eg Live), but I didn't remove them, both because they are interesting too, and I'm lazy.  Here are the results.

There's a slight positive correlation (0.23) between song length and ranking.  That is, longer genres are generally less popular.  Mean and median length across all genres are quite close at 4:20, and 4:14 respectively.

A graph and table of the top 50 most popular:





RankGenreAverage Length
48progressive metal6:40
26progressive rock6:02
15ambient5:45
24black metal5:38
42trance5:29
36classical5:24
29heavy metal5:14
40thrash metal5:14
49trip-hop5:08
19hard rock4:51
9classic rock4:48
44favorites4:47
11jazz4:38
27death metal4:34
25chillout4:33
17experimental4:32
50hip hop4:31
7metal4:30
45reggae4:29
33industrial4:28
10alternative rock4:25
38rap4:18
18electronica4:16
43japanese4:16
41metalcore4:14
1rock4:13
3alternative4:11
16singer-songwriter4:08
28instrumental4:06
5electronic4:04
14folk4:04
3990s4:02
2180s4:00
8female vocalists3:58
22dance3:55
20hip-hop3:54
30british3:52
46acoustic3:50
4indie3:46
6pop3:45
2seen live3:41
37emo3:41
34soul3:40
13indie rock3:39
47country3:38
35blues3:28
31punk rock3:26
32soundtrack3:16
23hardcore3:09
12punk2:58

Sunday, August 18, 2013

A Comparison of PNG Compression Methods

You may remember my past post about which image format you should be using.  The summary was use PNG for computer generated graphics.  I briefly touched on the fact that PNG allows you to use 24 bit or 8 bit colors.  It is, however, much more complicated than that.


Intro

There are three color modes available in PNG.  The mode with the fullest color space is RGB 24 bit.  The second mode is indexed.  It allows you to use 8 bits or less for up to 256 colors.  Additionally, it allows you to choose the palette.  The last mode is grayscale.  As the name implies it's black and white, but allows a gradient of grays.  By comparison, a 1 bit indexed mode would only allow full black or full white, no grays.

Generally, switching to indexed offers a pretty big savings in file size.  However, you can often get even greater savings by going to less than 8 bit color.  Doing so will generally require generating a custom palette to take full advantage of the reduced color space.  If the file is black and white, it can sometimes be worth it to switch to grayscale or to 1 bit indexed.

There really is no simple way to know which will be best, besides trial and error.  Doing this for one file is a bit annoying, but doing it for many files is pretty unreasonable.  As such, many PNG compressors have popped up to help automate this process.

It turns out that the compression process is not so clean cut, and thus many of the various programs perform differently on various files.  I decided to look into if my current program was a good choice.  I found a few old comparisons, but not any from the last few years.  I decided to just download a bunch of programs and try them out.

I didn't download too many, preferring those that either had recent development, or were spoken highly of somewhere.


Programs Tested

So without further ado, here are the candidates:

TinyPNG - Has been my go to.  It's the only web based option here.  It's quite fast and has a great interface.

pngquant v1.8.3 - Some research showed that pngquant was the library being used at TinyPNG.  I figured if I could have the same compression as TinyPNG as a command line tool, that would be ideal.

pngcrush v1.7.9 - This is the standard PNG compression utility.

optipng v0.7.4 - Another standard utility, based on pngcrush.

pngout 20130221 - Based largely on the recommendation of this 6 year old Jeff Atwood post.  It is still being developed though.

Before I get into the results I should note the command line switches used.  In all cases its none.  Some of the utilities are geared more towards automatic use than others.  There is no doubt you could achieve much better results if you were willing to experiment with the options.  However, that wasn't the use case I was testing here.  I was concerned with processing dozens or more files quickly and easily.

If you want to see the images used I uploaded them to imgur here.  Unfortunately, imgur is no dummy, they compressed the files themselves.  They also resized the largest ones and converted some to jpg when that made sense.  If you want all the files, both the original and the results, I uploaded them as a zip to mediafire.

Results

Filesizes in KB:
NameOriginaloptipngpngcrushpngoutquantpngtinypngt2osmallest
a.png885765879769335329328328
b.png5.743.225.052.773.363.273.272.77
c.png27272723272025822725258725832582
e.png84.632.484.637.233.232.432.432.4
f.png22.919.720.916.419.618.116.616.4
g.png44.217.623.631.315.014.013.513.5
i.png717550616529189181181181
m.png30.729.129.126.829.427.927.126.8
n.png48.047.948.042.526.625.624.024.0
o.png22.222.222.219.122.222.219.119.1
p.png104410191019973288281281281
r.png545188243174188174174174
s.png476311316352156147146146
t.png11.611.611.611.612.612.011.611.6
w.png79.458.759.973.739.836.536.136.1
x.png60.760.760.760.261.958.658.658.6
y.png90.078.990.070.848.045.142.242.2
z.png104.6104.6104.6102.152.650.850.050.0
sum70006043635458734246404540274025


Ratio to the best compression method:
Originaloptipngpngcrushpngoutquantpngtinypngt2o
a.png270%233%268%234%102%100%100%
b.png207%116%182%100%121%118%118%
c.png106%105%105%100%106%100%100%
e.png261%100%261%115%102%100%100%
f.png140%120%127%100%120%111%101%
g.png326%130%174%231%111%103%100%
i.png397%304%340%292%105%100%100%
m.png114%108%108%100%109%104%101%
n.png200%200%200%177%111%107%100%
o.png116%116%116%100%117%117%100%
p.png372%363%363%347%102%100%100%
r.png314%108%140%100%108%100%100%
s.png326%213%217%241%107%101%100%
t.png100%100%100%100%108%103%100%
w.png220%162%166%204%110%101%100%
x.png104%104%104%103%106%100%100%
y.png213%187%213%168%114%107%100%
z.png209%209%209%204%105%102%100%
sum174%150%158%146%105%100%100%
geo201.0%152.0%174.1%152.2%109.0%103.9%101.1%

In the first table sum for all columns is just the sum of the column.  In the second table sum is the ratio of sum to the smallest sum.  In other words, a sum ratio of 100% should indicate a perfect score, but it's skewed by the large file sizes.  The geometric mean solves this for the normalized ratios.  Or does itYeah, probably.


Analysis

I think the take away here is that TinyPNG is the winner.  That being said, you'll note there were three cases where it did significantly worse than pngout.  Images b and o were both black and white, and pngout turned b into grayscale, but both left o as indexed.  What's more, e was grayscaled by pngout for worse size than the indexed tinyPNG version.  Pretty clear evidence that grayscale vs indexed  isn't clear cut.

quantpng is consistently a few percent higher than TinyPNG, lending credence to the idea that TinyPNG is using quantpng, but then also doing something else to squeeze a bit of filesize out.  On the other hand, quantpng actually made a few files worse, so maybe there is some overhead on its end.

The alert reader will have noticed there is a seventh algorithm listed which wasn't defined above.  t2o is a response to the fact that either TinyPNG or pngout was the optimal algorithm.  It is the TinyPNG files ran through pngout.

While it almost always does better than TinyPNG or pngout alone, you'll note the one case where it failed to return to the level pngout had achieved on the raw file.

I suppose my strategy will be to continue to use TinyPNG, and if I really need to minimize a file, run it through pngout independently, and compare the results.

Tuesday, July 30, 2013

Ohm's Circle

There are four common variables in circuits.  P = Power, V = Voltage, I = Current, and R = Resistance.  Knowing any two of those you can find the other two.  To do this you must derive the right formula though.  I always remember that V = IR, and P = IV.  From that you can find these:
`V = IR = sqrt(PR) = P / I`
`P = VI = V^2 / R = I^2 R`
`I = P/V = V/R = sqrt(P / R)`
`R = V/I = V^2 / P = P/I^2`

I discovered something called Ohm's Circle which presents those formulas quite nicely.  However, I always just search for it and have never found a particularly well executed one.  Two of the top google image results have mistakes.  So, I decided to make my own version.  I derived the above formulas by hand to double check it was all correct.


Friday, July 26, 2013

8 horrible courtroom jokes and their ensuing legal calamities

http://www.salon.com/2013/07/26/8_horrible_courtroom_jokes_and_their_ensuing_legal_calamity/
Defending Texas’s abortion restrictions before the Supreme Court, attorney Mr. Jay Floyd decided to open oral argument with a sexist joke. Arguing against two female attorneys, Floyd begins: “It’s an old joke, but when a man argues against two beautiful ladies like this, they are going to have the last word.” The joke is demeaning and (as Floyd himself admits) unoriginal, but it also lacks the saving grace of at least being funny. A recording of the oral argument, which can be listened to here, demonstrates just how badly the joke bombed with the Supreme Court. Painful silence endures for just over three seconds.

Bear Party




Saturday, July 20, 2013

The story behind football's innovative yellow first down line

http://sportsillustrated.cnn.com/nfl/news/20130718/nfl-birth-of-the-yellow-line/#all
While the line looks simple on TV, the technology behind it is very complex. Sensors were placed on the three main game cameras (at midfield and the two 20 yard lines), capturing the pan, tilt and zoom movements of those cameras 30 times a second. A three-dimensional, virtual model of each field had to be constructed, with the exact measurements of the crown of the field (the center of the field is always higher, for drainage, than the sides and ends, but the precise levels vary in each venue). An exhaustive color palette had to be produced on the fly as the game progressed, so that the green pixels of grass the yellow line replaced would be exactly the "right greens" even as shadows crossed the field and changed the grass hues -- an essential feature to assure replacing only the green blades of grass and not the green threads of a Packers or Eagles jersey.

Wednesday, July 17, 2013

Overriding BIOS limited CPU speed while running on battery

The Wrath of Dell

As it turns out, my work at salvaging a power adapter for my Dell Inspiron 6000 was not as much of a smashing success as I had initially thought.  I noticed that the battery charging tray indicator wasn't going away.  This happened sometimes, and required me to unplug the cord a few times.  However, I had duct taped the cord in place to prevent it from falling out, and didn't care to fix it.

Eventually I noticed that the power level was only going down.  I also noticed that I had suddenly lost the ability to watch .mp4, or just about any video over 480p.  The internet seemed even slower than usual, and I started noticing my cronjobs running even with their low nice levels.

I had a suspicion, but didn't want to look into it for fear of confirmation.  I eventually caved and discovered my battery was not charging.  The BIOS listed the AC adapter as an unknown device, and thus refused to charge.

I deduced that when I shorted the unknown-at-the-time third wire to the +19.5V wire I must have fried the chip on the motherboard that looked for other Dell products.

Further research confirmed my deepest fear: In addition to refusing to charge the battery, Dell forced the laptop to run at half speed if it didn't detect a Dell adapter.  I could certainly live with the battery not charging, as my laptop had long ago become a desktop, but an 800 MHz CPU was pushing it.


The Search for a Fix

I began looking for a hacked BIOS to undo all the Dell nonsense with renewed gusto.  Unfortunately, while it seemed possible, it didn't seem anyone had published anything.  I briefly considered hacking the BIOS myself, as my previous BIOS messing withs have gone well.

Eventually, I discovered that while the battery charging was controlled by the BIOS, the CPU speed was controlled by the OS, with the BIOS only able to suggest speeds.

I learned of CPU governors which were profiles that controlled the speed.  By running the command cpufreq-info I found my current governor was ondemand, and I had the common performance governor available.  I could update the governor with:
sudo echo performance > /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor

I confirmed this with cpufreq-info, but it also showed my speed still at 800MHz.  The policy said that the speed had to be between 800MHz and 800MHz and that the governor could decide which speed to use between those limits.  This made me suspect that perhaps the BIOS had more control over the speed than I had hoped.  Still, I persevered as it seemed other Dell users had fixed this, although they were being coy about exactly how.


The Voyage to 1.6 GHz

The breakthrough came from this site and its comments, which revealed there was a seperate BIOS limit that I was missing.

For me, the key file was at: /sys/devices/system/cpu/cpu0/cpufreq/bios_limit  You can edit this file similar to the above command, but I recommend opening it with a text editor to see its current setting.  For me, it was at 800000, and needed to be changed to 1600000, evidently in KHz.

This is all well and good, but it will be overwritten by the BIOS on each boot.  To prevent that you can edit your GRUB file at: /etc/default/grub to contain this magic line: GRUB_CMDLINE_LINUX="processor.ignore_ppc=1"  Follow that by running update-grub to, as the name implies, update grub, and reboot.

Now, cpufreq-info revealed that the policy could pick speeds from 800MHz to 1.6GHz, and what's more it was picking 1.6GHz.  I left the governor at ondemand since it was successfully raising the speed as needed.

PS
On a page full of technical Linux commands I found the most recent comment good:
"You all sound mega tech savvy so this might be a stupid answer but i fixed mine by blowing down the end of the cable….."

Friday, July 5, 2013

Why the McWrap Is So Important to McDonald's

http://www.businessweek.com/printer/articles/132030-why-the-mcwrap-is-so-important-to-mcdonalds
After lengthy discussions with produce suppliers around the country, Coudreaut managed to add one new ingredient to the McDonald’s arsenal: the English cucumber. That might not seem like a big change, but when the chain added sliced apples to its menu, it immediately became one of the largest buyers of apples in the country. The company had to build up reserves of edamame before it introduced its Asian salad. Coudreaut would like to add guacamole one day. Who knows what that would do to the avocado supply?

For cucumbers, McDonald’s went to Taylor Farms and Fresh Express, a producer and distributor owned by Chiquita. Then it had to figure out how the vegetable could be sliced, evenly, before it reached the restaurants. The chain expects to use about 6 million pounds this year. McDonald’s also tested the size of the chicken breast and the amount of lettuce. Initially, the sandwich was made with a half-breast of chicken and loads of produce. “We talked a lot about the veggies,” says Leslie Truelove, director of marketing in the U.S. “But we went too far. People thought it was a salad.” People wanted more meat. Now the wrap has a full breast of chicken, a handful of shredded lettuce, 10 leaves of spring mix, two cucumber slices, and two tomato slices—no more, no less.

Thursday, June 20, 2013

Dell AC Adapter

I bring you today another chapter in my ongoing saga to squeeze every last minute of life out of my laptop.  About a month ago, my laptop randomly shut off.  Investigation revealed that I had managed to rip open the power cord by getting it caught between a table and the concrete floor.  I noticed that only bending the cable certain ways would cause the short.  So, I did the logical thing and wrapped the cord in duct tape and forgot about it.

Fast forward to last night, and the power indicator tells me I'm running on battery power; the led on the power brick is off.  I attempted to coax the cable into working, but to no avail.  I shut my laptop off to preserve potentially precious battery and went to sleep.

Attempt 1

This morning I removed the duct tape bandage and began to examine the tear in the cable.  The cable is similar to stereo cable from my last adventure, except (unbeknownst to me at this point) there is another layer of wire under the first.

I'll explain here that standard DC barrel connector have a ground and a positive voltage.  The ground is the outside of the plug, and the positive is the inside.  Similarly, in the cable, the ground is the outer wire, and then under an insulator there is the positive wire.  These are both wound around a common axis (ie coaxial).

The outer wire was almost completely broken, so I cut it and attempted to splice it back together.  The inner wire was in much better shape, with only a few broken strands.  I at first attempted to just wrap that up, but ended up cutting it and splicing as well.  I soldered these two up and used a multimeter to search for shorts between ground a positive.  I powered it up and detected 19.5 V between the ground and positive.

However, booting up my laptop with it confirmed my suspicion that there was indeed a third inner wire.  Dell conveniently adds their own third wire to standard DC cables for making more money through proprietary power adapter sales safety.  This third wire was shorted to the positive and I figured whatever it was connected to in the power brick was now destroyed.

The third wire is a data wire.  It sends a signal from the laptop to the adapter to make sure you are using an official dell adapter.  If not it complains, but still powers the laptop.  However, it does not charge the battery.  There was some debate online about if the battery would indeed charge, just a slower rate, but I did not get any charge over the few hours I had it hooked up like this.

Attempt 2

It just so happens that I had procured a second power adapter long ago.  In fact, this adapter was the second one.  The first had failed a few years ago.  It developed a noticeable kink near the power brick, and with that, presumably a short. 

I decided to open it up and have a look.  This video purports to show the adapter being opened.  Note the comments accusing him of faking the opening.  I'll agree that there is no way that was the first time he was opening the brick.  It took me about an hour to get mine open, and I had to use just about every method I read online or could think of.  I started with just a screwdriver, but that did nothing but tear up the plastic.  I put some alcohol, and then acetone in the seam, which also did nothing but begin to dissolve the outer plastic.  I hit it with a hammer on the corners, which along with constant attacks with the screwdriver did begin to weaken the adapters defenses.  I only stabbed myself with the screwdriver three times before I put on a glove.

While the adapter was weakened, there were some parts that were clearly intent on making a valiant last stand.  I ended up using a clamp to squeeze the bottom piece away from the top piece.  This still required a constant attack with the screw driver.  When it finally came apart, both parts of the plastic case looked like they had been gnawed on by a honey badger.

Now I pulled back the insulation to reveal the wire below.  While this wire was about half broken it didn't seem like the second layer of insulation had any holes.  It didn't seem like there was any short here.

I tested this with the multimeter and it confirmed the positive was separate from the ground.  However, moving the cable around created a short.  Further investigation revealed that the short was actually way up by the plug.  This was rather annoying as I had hoped to use this better plug.

Attempt 3

I began to rip apart the plug to determine what was wrong with it.  The rubber came off easily with a razor blade.  Once off, it was clear that the insulation between the two wires stopped early and there was a short.  I don't really know how this design could possibly work.  It seems to be just begging for the insulation the wiggle its way down a mm and create a short.

The two wires were shrink tubed and soldered on to opposite sides of the plug.  I had to get at least the ground wire free so that I could wrap the inner wire up to keep them separated.  The problem was the wires were encased in something similar to hot glue, but much more rugged.  I suspect it was just liquid plastic poured in.

It was quite strongly bonded to the shrink tubing.  I tried acetone, which seemed to help, but I still had to chip away with screwdrivers and wire cutters little by little until the wire was free.

I wrapped the inner positive wire up in some electrical tape, and then wrapped the outer wire as well.  I added several layers of duct tape around the whole thing for good measure.

Now I revisited the kink by the power brick.  Here I decided to use a bit of solder to keep the broken half of the wire together.  I did this and applied a generous amount of electrical tape.

I was pretty incredulous that this would produce a working cord.  I did a lot of testing with the multimeter looking for shorts.  Then I left it powered and did a thorough wiggle test.  It passed both of those, so I plugged it into the laptop.  The laptop recognized it as a fellow dell product and graced me by charging the battery.