On one of the computers I was using, I started noticing a high pitched noise after I moved into a quieter room. At first, I thought I heard it after I turned off the computer. It must have been one of those ghosts. I haven’t bothered with it until today because I rarely turn off my computer. Also, it didn’t have support for suspend compiled into the kernel, which often requires a lot of modules to be built. I am using a minimal kernel seed from http://kernel-seeds.org/, so I didn’t bother adding those modules.
You can tell the high pitched noise is coming from your CPU if running a computationally intensive process suddenly silences it. First, I tried adding more CPU power management and adjusting fan speeds in the BIOS. They are related. If the CPU is using less power and running cooler, the fan also spins slower with less noise. I didn’t expect Intel’s market dominating CPU to be producing the noise. However, just like Windows or any market leader, there’s not enough competition for such things to be a threat. Next, typing a simple search query for “linux kernel config high pitch” lead me to http://www.thinkwiki.org/wiki/Problem_with_high_pitch_noises, and I tried the first solution by recompiling my kernel. I had a similar problem with my old Dell laptop when it went to sleep. I ended up never using sleep so that I could sleep at night.
The solution is to set CONFIG_ACPI_PROCESSOR=n under ACPI options. If you’re new to compiling a kernel, a good guide is Linux Sea.
— ACPI (Advanced Configuration and Power Interface Support)
[*] Deprecated /proc/acpi files
[*] Deprecated power /proc/acpi directories
< > ACPI 4.0 power meter
[*] Future power /sys interface
[*] Deprecated /proc/acpi/event support
<*> AC Adapter
< > Processor
<*> Thermal Zone
[ ] Debug Statements
< > PCI slot detection driver
< > Smart Battery System
Angular JS is a popular MVC framework by Google, and I received a bug report that Fiddle Salad wouldn’t reload the preview as it does in all other cases. This problem was noticed before, but it wasn’t a priority since pressing the refresh button as required in all other web development methods solves the problem. However, this was because I was attempting to solve it at the wrong level by modifying a method. As I’ve learned, there are dependencies between the execute, reset, and initiation of the class involved.
Fiddle Salad’s CodeRunner class has just 5 public methods. They are
as in the class diagram on the wiki at https://github.com/yuguang/fiddlesalad/wiki/2.-Classes. Therefore, any implementation of a CodeRunner just needs to support these 5 methods. The debug method could be refactored into a super class because it would generate the template for the new execute() method.
Debug opens a new window with the code loaded in the page. External CSS and JS files are loaded through head tags.
It assumes all external resources are stored in the view model.
css: _.template '<link rel="stylesheet" type="text/css" href="<%= source %>" />'
html: _.template """
<title>Fiddle Salad Debug View</title>
<%= css %>
<%= body %>
<%= headtags %>
# initialize array of head tags
headTags = new Array
# for each external resource in view model
_.each viewModel.resources(), (resource) =>
# get the file type of the resource, call mapped template with resource, and append generated HTML to head tags
headTags.push template[@filetype resource.source()](source: resource.source())
headtags = headTags.join('')
body = engine.get_code LANGUAGE_TYPE.COMPILED_DOCUMENT
css = engine.get_code LANGUAGE_TYPE.COMPILED_STYLE
# call the template for the window with the head tags and code
# open window with generated HTML
window.open = 'data:text/html;charset=utf-8,' + encodeURIComponent(html)
If I just change the last line, the debug method turns into a reset method.
@window.location = 'data:text/html;charset=utf-8,' + encodeURIComponent(html)
The rest of the class still needs to be completed, but they are as obvious as appending to an array when adding JS/CSS files.