Monday, September 12, 2011

Google-like Filtering with RadGrid and Separate Data Class


I needed to create a Google Suggest style search interface for an ASP.NET page.

Our site recently obtained licenses to the Telerik control suite, and the powerful RadGrid control looked like it was just what I needed. I found this example on the Telerik site.

Key to this setup is having a textbox for the user to input filter criteria, which is then from the user's perspective transformed into a RadComboBox object to house matching results; then once the user selects an item from the dropdown, the RadGrid is bound and displays any matching results.

I encountered a problem because our site uses a centralized class library for CRUD outside of this particular page’s code class, meaning I could not access my application’s data context from within the GridBoundColumn class definition. The Telerik example (specifically in the MyCustomFilteringColumnCS.cs file) performs its own queries as needed using a SqlDataAdapter with a ConnectionString obtained from the application configuration. A simple SELECT statement is executed which returns matching results.

When I tried to reference my centralized data class from within the GridBoundColumn class definition, I got the following error:

Cannot access non-static property … in static context.


Below is the problem code, revealing that the property CurrentUser is inaccessible to the class.

       protected void list_ItemsRequested(object o, RadComboBoxItemsRequestedEventArgs e)
     {
        // Cannot access non-static property 'CurrentUser' in static context.
        using (MyCRUD mc = new MyCRUD(CurrentUser) )
     
  {
              ((RadComboBox)o).DataTextField = DataField;
              ((RadComboBox)o).DataValueField = DataField;
              ((RadComboBox)o).DataSource = mc.GetMatchingAddresses(e.Text);
              ((RadComboBox)o).DataBind();
        }
     }


My GridBoundColumn class does not exist until my application instantiates it with its parent RadGrid object, so I cannot directly assign a property to it. However, I stumbled upon this post which made me realize I could, in the GridBoundColumn class definition, make several changes.

  1. Define a constructor for the class which takes an existing instance of the MyCRUD class as input.
  1. Create a public property in the class definition which can be assigned the MyCRUD object.
  1. Create a private field in the class definition to contain the instance of the MyCRUD object to be utilized by the GridBoundColumn class.
 
Below is the modified class, with additions (*) indicated below.

       public class rgcFilterColumn : GridBoundColumn
      {   
            // * I added a constructor with an input parameter of the type 
            // * corresponding to my app’s CRUD object.       
            public rgcFilterColumn(MyCRUD mycrud)
            {
                TheDataContext = mycrud;
            }

            // * This field provides an instance of the rgcFilterColumn class 
            // * with the corresponding value set for the data context object.
            private readonly MyCRUD TheDataContext;

            // * This property enables the process which instantiates this 
            // * class to assign the MyCRUD object to TheDataContext.
            public MyCRUD thedatacontext
            {
                get { return TheDataContext; }
            }


     // RadGrid will call this method when it initializes
     // the controls inside the filtering item cells
            protected override void SetupFilterControls(TableCell cell)
            {
                base.SetupFilterControls(cell);
                cell.Controls.RemoveAt(0);
                RadComboBox combo = new RadComboBox
                {
                    ID = ("RadComboBox1" + UniqueName),
                    ShowToggleImage = false,
                    Skin = "Office2007",
                    EnableLoadOnDemand = true,
                    AutoPostBack = true,
                    MarkFirstMatch = true,
                    Height = Unit.Pixel(100)
                };
                combo.ItemsRequested += list_ItemsRequested;
                combo.SelectedIndexChanged += list_SelectedIndexChanged;
                cell.Controls.AddAt(0, combo);
                cell.Controls.RemoveAt(1);
            }

   // RadGrid will call this method when the value should
   // be set to the filtering input control(s)
           protected override void SetCurrentFilterValueToControl(TableCell cell)
           {
                base.SetCurrentFilterValueToControl(cell);
                RadComboBox combo = (RadComboBox)cell.Controls[0];
                if ((CurrentFilterValue != string.Empty))
                {
      combo.Text = CurrentFilterValue;
        }
     }

   //
RadGrid will call this method when the filtering value
   // should be extracted from the filtering input control(s)
           protected override string GetCurrentFilterValueFromControl(TableCell cell)
           {
                RadComboBox combo = (RadComboBox)cell.Controls[0];
                return combo.Text;
           }


           protected void list_ItemsRequested(object o, RadComboBoxItemsRequestedEventArgs e)
           {
                // * Below we use the value of field TheDataContext to execute 
                // * a method accesible via the MyCRUD data context for the application.
                using (MyCRUD mc = TheDataContext)         
                {
                     ((RadComboBox)o).DataTextField = DataField;
                     ((RadComboBox)o).DataValueField = DataField;
                     ((RadComboBox)o).DataSource = mc.GetMatchingAddresses(e.Text);
                     ((RadComboBox)o).DataBind();
                }
           }

           private void list_SelectedIndexChanged(object o, RadComboBoxSelectedIndexChangedEventArgs e)
           {
                GridFilteringItem filterItem = (GridFilteringItem)((RadComboBox)o).NamingContainer;
                if ((UniqueName == "Index"))
                {
                    // this is filtering for integer column type
                    filterItem.FireCommandEvent("Filter", new Pair("EqualTo", UniqueName));
                }
                // filtering for string column type
                filterItem.FireCommandEvent("Filter", new Pair("Contains", UniqueName));
           }

      }



Now an instance of the GridBoundColumn class can happily utilize my application's central CRUD class for all its data retrieval operations.


Thursday, July 28, 2011

Google+: Why... So... Serious??

I just tried to use Google's +1 feature, but inexplicably saw red, an exclamation point icon appeared instead of the usual cheerful blue +1. Upon clicking this, I was greeted with the following:
Your profile is currently suspended
Until your profile is unsuspended, you will be unable to create +1's.

Wat??

Initially this smacked of the kind of shit I've experienced on Yahoo Answers, where a profile you might invest a lot of time and effort in gets suspended because you post a controversial answer that a bunch of people dislike and report to indulge their passive aggressive tendencies. A closer look at my profile revealed this additional clarification.
Your profile is suspended

After reviewing your profile, we determined that the name you provided violates our Community Standards.

If you believe that your profile has been suspended in error, please provide us with additional information via this form, and we will review your profile again.

Google's rules provided this additional tidbit:
Display Name
To help fight spam and prevent fake profiles, use the name your friends, family, or co-workers usually call you. For example, if your full legal name is Charles Jones Jr. but you normally use Chuck Jones or Junior Jones, either of these would be acceptable.

Google+ is still being tested so to me this is no biggie, but it is an annoyance. Some people might not want to use their real name, some might want to create a profile with a fake name for their cat, dog, business, narwhal, whatever.

They have provided the option to provide optional verification in the form of a photo ID...

Additional Verification Information (Optional Section)

Attach a copy of your ID with your name and photo clearly visible. You can block out other personal information. Your ID will only be used to verify your name and will be deleted after review.

I chose not to pursue this option, since I know who I am and I feel Google needn't know more than whom I've presented through my online persona. Facebook, certainly, doesn't mind...

Hopefully Google will unclench their social networking buttcheeks and let people have some latitude in terms of naming their profiles.




Tuesday, July 26, 2011

Explorer.EXE Crashes and Restarts Constantly

After a reboot, Windows Explorer began to crash and restart constantly with an Event ID 1000 error. Windows Help was useless, so I opened Event Viewer and saw the following:



It's curious that a file which is part of the third-party Windows 7 Codec pack seems to be responsible:
Faulting module path: C:\Program Files\Win7codecs\filters\DivXMFSource.DLL

Fortunately, I got around this issue by simply uninstalling the codec pack as described here, by executing the file Win7codecs.msi in a subfolder contained immediately under C:\ProgramData\Win7codecs\, and then choosing Remove (the only option available via Control Panel \ Programs \ Programs and Features is to perform a "Repair", which didn't help in my case).



Saturday, July 9, 2011

Create Shortcut to Executable using C#

I needed a C# method to create a shortcut to an executable and place it on the user's desktop in Windows.

I found a method to actually create the shortcut which utilizes the Windows Scripting Host object model. Most examples I found used a separate icon file for the shortcut, whereas I wanted to have the shortcut icon by default be the same one used by the executable itself.

First you must create a reference in Visual Studio to the Windows Script Host Object Model COM object as shown here:



Below is the modified method, where sLinkPathName is the path to the executable.

using IWshRuntimeLibrary

...

private void appShortcutToDesktop(string sLinkPathName)
{
     try
     {
          WshShellClass wsh = new WshShellClass();
          IWshRuntimeLibrary.IWshShortcut scShortcut;

          // Choose the path for the shortcut
          scShortcut = wsh.CreateShortcut(Environment.GetFolderPath(Environment.SpecialFolder.Desktop) + "\\shorcut.lnk") as IWshRuntimeLibrary.IWshShortcut;

          // Where the shortcut should point to
          scShortcut.TargetPath = txtFile.Text;

          // Description for the shortcut
          scShortcut.Description = "This is a shortcut.";

          // Location for the shortcut's icon
          scShortcut.IconLocation = sLinkPathName + ", 0";

          // Create the shortcut at the given path
          scShortcut.Save();
     }
     catch (Exception ex)
     {
          MessageBox.Show(ex.Message);
     }
} 

Line 22 sets the shortcut's IconLocation property such that it grabs the default icon for the executable, the same one that you'd expect to see if you created the shortcut manually.



Saturday, July 2, 2011

Google +1 Button: Instant SEO

Google's new +1 button is the information innovator's response to the fairly ubiquitous Facebook, StumbleUpon, and other icons that let you promote content you find useful. I noticed that Google incorporated this feature into my search results as well, so I decided to experiment.

A popular blog post of mine describing a DIY screen protector for the Viewsonic G Tablet appears at spot #9 among my Google search results as shown below:



Note the greyed out +1 button just to the right of the link title, which animates tantalizingly as you hover over the search result. I went ahead and clicked it, essentially voting my link up in the rankings. Here's the result:





From the #9 to the #5 spot with one click?? I'll take it! You also receive a notification just below and to the left indicating that you've +1'd a given link.

I don't know whether "+1'd" has as catchy a ring to it as "Liked", but if it brings more traffic to my site, then I'm all for it!


Tuesday, June 7, 2011

Viewsonic G Tablet DIY Screen Protector

I recently purchased the Viewsonic G Tablet. Once you dump the factory ROM, it's great, but unfortunately its glossy surface is a fingerprint magnet and the glare can be pretty bad in bright light.


  
There are some commercially available, custom fit, and relatively expensive screen protectors out there, but paying upwards of $20 for a transparent piece of floppy plastic is a bit overkill in my mind. Another quite effective and relatively inexpensive solution to protect the screen involves using frisket film, a clear, nearly transparent adhesive film used for tracing, stencils, and related tasks.

I opted for the cheaper route. Care to try it? 

Here's how.

First get some matte frisket film. The "low tack" variety works just fine; it adheres snugly, yet can be easily peeled away without leaving residue. You can print out this template as a guide. Use some paper clips to secure the roughly 9 x 12" frisket film to the template. Then, using a sharp razor or knife, carefully cut along the whitespace between the inner and outer black borders. After cutting, you can trim the corners of the film to accommodate the curves of the tablet, and also cut out a notch for its built-in camera.

Thoroughly clean the surface of the tablet with a damp, lint-free cloth to remove dust and hair. Then, put on a pair of powder-free surgical gloves (latex or non depending on whether you're allergic or not), remove the backing from the frisket film.

Carefully apply the film onto the tablet surface. It helps to have a straightedge handy for this process. Begin with one edge and even up the border of the film with that of the tablet, then carefully smooth the film onto the surface of the tablet, and with a very careful scraping action use the straightedge to apply the film.

Bubbles may form, but some of these you'll be able to work out by carefully "massaging" the film's surface. Over time, any remaining bubbles that are tiny (roughly the size of pinholes) should gradually fade away.

I did notice that the translucence of the film did detract, but only slightly, from the sharpness of the text, but the photo below doesn't do the film justice. The touch sensitivity is just as good as it was prior to applying the film, and over time I'm guessing the minute bubbles will fade away.



Given that each sheet of frisket film in a 12 pack ends up costing around $1.25 apiece, the future prospect of replacing a worn film is far better than the initial cost of an expensive precut film. In this case, a little work means a lot of savings, as well as reducing glare without compromising the sensitivity of the Viewsonic G Tablet touch screen.


Tuesday, May 31, 2011

Perfection vs Excellence

The love of my life once told me, strive for excellence, not perfection.

Why?

Perfection is unattainable, whereas excellence is achievable.

Oxford’s defines perfection as the condition, state, or quality of being free or as free as possible from all flaws or defects” while excellence is defined as “the quality of being outstanding or extremely good”.

Perfection and excellence both are human concepts, so naturally we use these as tools in our interface with the universe. Myriad examples of the application of either concept abound, so to narrow the focus to one, consider a sword made of diamond versus a sword made of Damascus steel.

The hypothetical diamond sword.
The diamond sword is perfect. It’s been crafted out of pure diamond, one of the hardest known substances on earth consisting of a crystal lattice of tetrahedrally bonded carbon atoms, and has a razor-sharp edge that can slice a piece of tissue paper falling across its blade cleanly in two with the help of gravity alone. Against an unarmored opponent, this sword would likely slice their flesh to ribbons in the hands of an adept duelist.

However, lurking within this flawless weapon is a fatal shortcoming. The carbon atoms of a diamond are bound in a relatively brittle lattice configuration, which many practitioners of diamond cutting will attest is easily fractured. Indeed, transforming uncut diamond into precious jewel-quality stones relies on this inherent crystalline structure.




In contrast, there is the sword crafted of fine Damascus steel. Although the physical shape of this sword is the same as its crystalline counterpart, its molecular structure is vastly more complex and variable.

Closeup of a Damascus steel blade.


Research on Damascus swords crafted in ancient times has revealed that impurities in the steel ingots used to craft these swords led to the formation of what we describe today as nanowires and carbon nanotubes, structures which lend unique variability and resilience to the metal at the molecular level. In addition, Damascus steel blades have been found to contain a variety of elements as impurities, including carbon, manganese, vanadium, calcium, lead, and others.

Now envision these two blades, each executing two basic techniques of sword combat, the slash, and the parry.

The slash involves using the sharpened edge of the blade to slice the flesh of an opponent.

Slash.

Given the sharpness of the flawless diamond sword’s blade in this example, as well as that of the Damascus steel blade, and the target, say a pork belly, it seems clear that both blades will perform this straightforward task well. Indeed, perhaps the diamond will edge out the Damascus steel to some extent, similar to the way obsidian, a similarly brittle but remarkably sharp material exceeds the sharpness of surgical steel, reducing the extent of scar tissue in flesh.

The parry, however, is a bit more interactive. Rather than simply connecting the leading edge of a blade against flesh, a parry may involve blocking or deflecting a strike using the flat of the blade.

Parry.

Whether the diamond blade is giving or receiving the parry, it’s highly likely that the blade will break. Given diamond’s relatively inflexible crystal lattice, the odds are very much in favor of any impact fracturing that lattice and causing the blade at best to crack in two, at worst to shatter into the proverbial million pieces.

What does this say about the efficacy of striving for excellence in favor of perfection?

Perfection has honed the diamond blade to razor sharpness, given it crystal clarity, and made it capable of slicing flesh with the greatest of ease. The focus, and utility, of the blade are as uniform as the pure carbon it’s composed of. For the specialized task of slashing, it is masterfully suited to this role.

Excellence has granted unique characteristics to the Damascus steel by virtue of the impurities infusing its molecular structure. It may result in an incision which under a microscope appears more jagged, but the relatively flexibility and resilience of the blade enable it more likely to withstand a powerful blow.

The diamond blade illustrates simultaneously the appeal and the danger of embracing perfection. Perfection is flawless, sublime, but inherently fragile, whereas excellence, though not flawless, may better endure the onslaughts of the unexpected by virtue of the very imperfections which define it.


Thursday, May 26, 2011

Windows Wallpaper Woes

After installing Windows 7 service pack 1 (build 7061), I inexplicably was unable to change the wallpaper, it allowed me to only change from one solid color to another.

I found a fix that worked for me, it involved simply opening the following folder and deleting the TranscodedWallpaper.jpg file contained within. 
%USERPROFILE%\AppData\Roaming\Microsoft\Windows\Themes\

Once I did this, I closed the Personalize screen and reopened it, and then I was able to once again change wallpaper to something considerably less drab than one of the various solid colors.

Friday, May 20, 2011

"Unknown Hard Error" BSOD and CI.DLL

My Windows 7 64-bit laptop suffered a BSOD with "Unknown hard error". A reboot resulted in Windows immediately going into Startup Repair mode, and the log showed that the file ci.dll had been corrupted.

I tried booting into Safe Mode, tried a Last Known Good boot, neither option worked, each time the system jumped back into Startup Repair. Finally, I chose the option Disable Driver Signature Enforcement, and was able to successfully boot into normal mode. This option bypasses the functionality in Windows which checks for system or driver file corruption and thus far it seemed like perhaps some software or driver I'd recently installed or updated might've led to this boot issue.

Days prior I'd been noticing some strange behavior in Windows. I had been unable to access my GMail and Live accounts. GMail would forever remain at the initial progress bar, eventually timing out and asking if I wanted to use basic HTML mode; Live would load the initial screen showing my email but just sit there, any clicks on my Inbox or Sent Items or other folders did nothing. Once I booted in this Disable Driver Signature Enforcement mode though, a new twist; it appeared my Google search results were now occasionally being redirected to advertising sites.

It turned out to be malware, a rootkit to be specific.

I ran a full scan with the latest SpyBot as well as Symantec Endpoint Protection, installed on all our workplace PCs, but these found nothing.

However, in tracking down other reports of apparent ci.dll file corruption, I discovered Kaspersky's TDSSKiller tool. I downloaded and ran the tool, which performed a concise scan that took roughly a minute to complete. Lo and behold, a rootkit, a member of the notorious TDSS family.

Rootkit.Win32.TDSS.tdl4


I ensured the Cure option was selected, then clicked Continue, and allowed the tool to initiate a reboot and hopefully clean out the rootkit.



Following the removal, I could once again boot into Windows normally, and the anomalous behaviors described above no longer occurred.


Friday, May 13, 2011

Vaccines: Unnatural Selection

Whether or not to vaccinate children from infectious disease is a hotly debated topic.

Bordetella pertussis, the bacteria responsible for whooping cough.


I encountered a discussion where some parents discuss their choice not to vaccinate their kids. The author cites various factors justifying this choice; that vaccines may compromise the body's ability to fight infection, may cause an allergic reaction, or hinder the healthy development of the immune system; that the ingredients of many vaccines, among which may be chicken, monkey, and aborted human fetal cells, aluminum, and various others, are undesirable to have injected into the body; that there is insufficient research to justify the use of vaccines to prevent disease.


Child receiving an oral vaccine for polio.


Evolution is an ongoing process, and the evolution of the human race is in many ways insulated from the process of natural selection. Medical science has insulated sufferers of type 1 diabetes like myself from being selected out of the population by providing synthetic insulin, an artificial means to adapt to a challenge thrust onto me by circumstance. Without this development, I would be dead, and my unique genetic heritage obliterated.

Similarly, vaccines enable the human body to compensate for many an infectious disease. No longer for a disease such as polio or measles or whooping cough need the body be completely unprepared for the onslaught; rather, a vaccine enables the unique signature of these and other contagions to be recognized by the body as pathogens, and enable it to produce an army of antibodies and other agents to systematically eradicate it.


Collection of poliovirus.

What if the entire human race stopped using vaccines altogether?

Many people would die. The science that goes into creating and refining vaccines would be absent, leaving the body to fend for itself against the elements, taking on from the environment whatever pathogens stray into its path.

However, many others would live. Sexual reproduction shuffles the cards of our genes between individuals, resulting in novel combinations of genetic traits, some of which will open the door to certain pathogens and slam them shut to others. For those who would survive, over long spans of time across many generations of human beings, the survivors would conceivably refine their immune systems to compensate for whatever pathogens their environment presents.

Of course, microbes also evolve, as evidenced by the emergence of MRSA; an antibiotic which is highly effective against one species of bacteria may prove ineffective against another, enabling the latter to thrive in spite of our best efforts to eliminate it. In the short term, it would seem that ideally vaccines provide relief from suffering by "tuning" the immune system to respond to pathogens. In the long term, however, the utility of vaccines is in my mind questionable.

Let's say we have a bacteria that causes the flesh to rapidly waste away and die, an uncompromisingly lethal, supercharged form of leprosy

Man aged 24 suffering from leprosy.

Science develops a vaccine which tunes the immune system to recognize and destroy this bacteria before it can take hold. Irrespective of whether your DNA already imparts a natural resistance to this bacteria or not, without fail a person who takes the vaccine will resist and survive. 



Now, remove the vaccine from the equation. Current and future generations must fend for themselves, and some will inevitably die, while others will suffer no consequences, having survived the bacteria by virtue of their natural immunity.

In the short term, we can dispense with vaccines and let children and adults contract diseases, suffer, and die. In the long term, diseases we fear today might be silently eradicated by our immune systems such that they no longer pose a threat. Vaccines today may indeed insulate us from suffering, and keep natural selection at bay by allowing those with insufficient immunity to withstand disease that might otherwise kill them.

"River of Time 2" by Scott Boden.

Question is, do we choose to take on nature without the benefit of safe, effective, rigorously-researched vaccines that do as they claim and prevent disease, or shrug our shoulders and keep a stiff upper lip as time marches on, serving as the ancestors of people in the far future who will benefit from our suffering in the form of immune systems tuned through the generations? 

I'm in favor of vaccines, provided that they are researched extensively so that they enable us to safely, effectively augment our ability to combat infectious disease. No offense to any of my future relatives, but if we can combat human suffering in the here and now, we should.



Tuesday, May 10, 2011

Solar Pool Heater DIY Leak Repair

Mighty Putty is one of the last products sponsored in part by the late Billy Mays.



Boasting the ability to bond numerous materials with the holding power of epoxy, including water pipes, I wondered whether this stuff could tackle a problem with some leaking HiTec solar pool heating panels.

Some years ago, I had a HiTec solar system installed to heat my swimming pool with solar energy. Consisting of a series of black panels of tubes which convey pool water up and onto the roof, given enough sunlight the system makes an otherwise chilly pool very swimmable.

Made of a rigid, ultraviolet-resistant plastic, the panels can be damaged by, say, falling tree branches or, as my contractor claimed, squirrels. The contractor who installed the system claimed that leaks that had developed in a couple of the panels recently were attributable to "squirrel damage" which conveniently for them is one type not covered by the manufacturer's limited warranty. 

Aside from the fact that no plastic-hungry squirrels nor squirrel spoor laden with plastic shavings had been discovered on my property, making determining the actual cause of the damage a difficult enterprise to say the least, this also meant that the contractor would be able to collect a roughly $135 service call fee to service the system for an out-of-warranty repair. How convenient that the contractor could fall back on these dastardly, elusive squirrels as the cause and not something actually covered by the warranty!


Commonly found, uncommonly evil, or so the contractor claims...



I wondered whether Mighty Putty might be able to save me some money.

I had basically two types of defects that had arisen in one of the panel arrays. One was a section of one of the tubes that appeared to have cracked off, a structural defect about 2" long.


Before application... a huge chunk of tube is missing.


Another consisted of pinhole leaks caused by abrasions to the plastic tubing, whether by falling tree branches impacting the panels, or the aforementioned scrabbling squirrels. Generally, since a solar system benefits from as much sun exposure as possible, installation under trees is inadvisable, but sometimes unavoidable. Unfortunately, a pine tree, a few of whose branches overhang the roof, probably were the culprit, both as a result of falling debris and as a squirrel habitat.

Following the instructions, I sliced about a 1" wide section of Mighty Putty, and kneaded it thoroughly for several minutes until it became a uniform, grayish consistency indicating that it's ready for use.

I roughened the area around the breach with some sandpaper and blew the resulting dust away. Then, I molded the putty into roughly the shape of a drinking straw cut in half lengthwise, large enough to encompass the hole and replace the missing plastic. Finally, I molded the putty patch onto the empty area and took care to apply even pressure all along the seam to ensure maximum contact with the plastic.

After application, covering the gap.


The pinhole leaks required slightly less putty to fix, but a similar process. To these I applied small dabs of putty sufficient to completely cover the holes.

For plumbing repairs, the makers of Mighty Putty boast a cure time of as little as 30 minutes before pressure is restored. HiTec states that their panels are pressure tested up to 90 psi, but that typically a swimming pool solar heating system will hover around 20 to 40 psi. I figured that this pressure is probably less than that of household plumbing. I would soon find out for sure. I climbed the roof, applied the putty, and allowed it to set for a full 24 hours just to be safe. The result? 

Success! The putty stopped the leaks in their tracks. 

It remains to be seen whether the putty will stand up to daily exposure to sun and chlorinated, pressurized pool water, but for now, the putty fully filled my expectations for far less than the cost of a service call, as well as saving me the time and trouble that would necessitate getting the perforated panel replaced outright.




Well done, Billy Mays. R.I.P.

Wednesday, April 27, 2011

Reddit-Headed Step Child?

Once again, Reddit has suffered a temporary meltdown.

CAPTAIN'S LOG, LAGDATE 6/24/2011... A brief emergency read-only mode last night, duplicate comments, sporadic 502 and 504 errors, and the occasional overloaded notification. Things bode ill for the weekend, but stay tuned.

Condé Nast Digital, parent company of Reddit, is one of several corporate entities owned by Advance Publications, Inc., a communications and print conglomerate.

Featuring among its ranks major sites like Wired, Vogue, Ars Technica, and others, many Reddit users, myself included, find it hard to believe that a site with upwards of one billion monthly pageviews seems to not get the creddit it deserves, in the form of infrastructure, staff, and just plain funding.

In short, why is Reddit seemingly Condé Nast Digital's red-headed step child?


Granted, since the diggsaster some months ago, Reddit has had an influx of new users which perhaps outpaced its anticipated growth. Further, Reddit recently dealt with some issues attributed to Amazon's Elastic Block Service (EBS) as well as a failure of a server which hadn't been updated to benefit from the redundancy of RAID. 

I really enjoy Reddit, it's a great site to find news, interact with people, and throw out horrible puns without threat of being stabbed with a narwhal tusk. Uptime, however, hasn't been it's strong point, so here's hoping things improve with help of some new and returning staff

Every site has issues occasionally, but given enough squeaking, the wheel gets greased...


ToCondé Nast Digital
     Advance Publications, Inc.

From: The Reddit Users

RE: Grease

Squeak!




UPDATE (5/6/2011): Another emergency downtime for most of the day, preceded by sporadic 0 / 502 / 504 errors and apparent database corruption (including misdirected comments and private messages) in addition to the usual sluggishness around midday EST. Eep!









Sunday, April 17, 2011

Motorola Razr meets PCI Simple Communications Controller

I picked up a used Alltel-branded Motorola Razr v3b for $2 at a yard sale recently. After reeling for a moment that new this phone probably ran for $150+ and now lay abandoned among pots and pans and power tools and other discarded housewares, I decided to charge it up and see whether any ringtones and other crap were on the phone.

I installed Motorola Phone Tools in an effort to transfer the data to my PC.



However, upon connecting the phone to my PC with a compatible USB data cable, one new device appeared in my system's Device Manager, a "PCI Simple Communications Controller" whose driver failed to install.

I opened the Properties of the device and selected the Hardware Ids property from the Details tab.



I searched for hits on the top entry: 

     PCI\VEN_8086&DEV_29A4&SUBSYS_514D8086&REV_02


This revealed that the device is the Intel Management Engine Interface, which lives on my Intel DP965LT motherboard. However, for whatever reason (perhaps just obsolescence) my Windows 7 Ultimate install couldn't find the appropriate drivers.

I downloaded the Intel® ME: Management Engine Driver for Intel 963/965 Chipset-Based Desktop Boards, but the installer supports XP and Vista, not 7. I found various forum posts that suggested working around this by trying to run the installer as administrator and in Vista compatibility mode, but this didn't work; the installer refused to run beyond copying the files to my PC at this location: 

     C:\Program Files\Intel Desktop Board\HECI_allOS_2.1.22.1033_PV 


I found another post that suggested attempting to update the drivers by having Windows search for drivers in the folder created above, and this did the trick. 

I right-clicked on the PCI Simple Communications Controller, clicked Update Driver Software..., then Browse my computer for driver software. I input the path to the drivers unpacked from the management engine package (C:\Program Files\Intel Desktop Board), then clicked Next:





The PCI Simple Communications Controller disappeared and in its place an Intel(R) Management Engine Interface device appeared instead under the System devices category:



When I again plugged the Motorola Razr v3b in via USB, this time the Driver Software Installation dialog reported success across the board, and Motorola Phone Tools could now properly communicate with the phone.






If nothing else, it'll serve me well as a spare digital camera, or maybe as a prop in some twisted video involving the destruction of formerly cutting edge electronics.









Wednesday, April 13, 2011

Malware Redirects Google Search Results

Encountered what appears to be malware with some javascript which caused Microsoft Security Essentials (MSE) to throw errors and almost, but not quite, infect a system.

Popup notifications appeared in the systray every few seconds, and the MSE process MsMpEng.exe was gobbling up 50%+ CPU trying to keep whatever was trying to infect this Windows XP service pack 3 PC under control.

MSE's log showed the following error at the top of the details:
Microsoft Security Essentials encountered the following error: Error code 0x800703e4. Overlapped I/O event is not in a signaled state.

It listed numerous instances of the following as the most recent triggers for the cleanup:
TrojanDownloader:Java/OpenConnection.J
TrojanDownloader:Java/OpenConnection.JJ

Interestingly, the malware kept triggering the alerts from a specific path on the system:
C:\Documents and Settings\User\Application Data\Sun\Java\Deployment\cache\6.0\14\3cb28b8e-3c71bd02->lort/cooter.class

Apparently lort/cooter.class is related to a family of malware dubbed JAVA/Exdoer, based on a log file I found posted here. The system's default browser (Firefox) was redirecting Google search results to various sites with advertising. While MSE seemed to be detecting and responding to whatever active component of this malware, freshly-updated installs of SpyBot, MalwareBytes, and PrevX did not detect it.

I decided first to try to simply close all browsers, then run a utility called GOOREDFIX.EXE as described in this forum post. It returned the following log info:
GooredFix by jpshortstuff (03.07.10.1)
Log created at 15:54 on 13/04/2011 (Jan)
Firefox version 3.6.16 (en-US)

========== GooredScan ==========

Deleting HKEY_LOCAL_MACHINE\Software\Mozilla\Firefox\Extensions\\{A1E5480F-729F-4237-AD8E-2C46BA793DFE} -> Success!
Deleting C:\Documents and Settings\User\Local Settings\Application Data\{A1E5480F-729F-4237-AD8E-2C46BA793DFE} -> Success!

========== GooredLog ==========

C:\Program Files\Mozilla Firefox\extensions\
{972ce4c6-7e08-4474-a285-3208198ce6fd} [18:53 08/03/2011]
{972ce4c6-7e08-4474-a285-3208198ce6fd}(2) [18:19 08/03/2011]
{CAFEEFAC-0016-0000-0017-ABCDEFFEDCBA} [20:30 16/01/2010]

C:\Documents and Settings\User\Application Data\Mozilla\Firefox\Profiles\c06n7342.User\extensions\
adblockpopups@jessehakanen.net [01:37 14/03/2011]
{20a82645-c095-46ed-80e3-08825760534b} [01:08 27/12/2010]
{7b13ec3e-999a-4b70-b9cb-2617b8323822} [19:18 12/04/2011]
{d10d0bf8-f5b5-c8b4-a8b2-2b9879e08c5d} [16:22 27/03/2011]

[HKEY_LOCAL_MACHINE\Software\Mozilla\Firefox\Extensions]
"{20a82645-c095-46ed-80e3-08825760534b}"="C:\WINDOWS\Microsoft.NET\Framework\v3.5\Windows Presentation Foundation\DotNetAssistantExtension\" [20:46 30/09/2009]
"jqs@sun.com"="C:\Program Files\Java\jre6\lib\deploy\jqs\ff" [20:30 16/01/2010]

-=E.O.F=-


However, something seemed to reactivate the malware upon reopening Firefox, and the MSE systray popups began again.

I closed the browser, ensured that neither firefox.exe nor any other suspicious executables were present among the running processes, reran GOOREDFIX.EXE, then simply deleted the following folder:
C:\Documents and Settings\User\Application Data\Sun\Java\Deployment\cache\

Upon reopening Firefox, no further MSE notification popups appeared, and after running a full scan with MSE, no threats in memory nor in the file system were reported. So far, at least, it looks like whatever this malware was has been eliminated, but we shall see!





Wednesday, March 23, 2011

Manage Blocked Sites? Thanks, Google!

Google recently unveiled a tremendous new feature which allows you to block sites from their search results.

A feature previously only available as an extension for Chrome, users with a Google Account can now maintain their own, personal blacklist of sites whose search results aren't useful.

The original entry about this release on the Google blog tells the story, and you can click the following link to actually access your very own Manage Blocked Sites screen (assuming you're signed in to your Google account).

I mainly use Google, Bing, and Ask for my searches, but now Google is in my top spot solely for this feature. Too often I've submitted a query to a search engine only to be bombarded by useless results consisting of anything from advertising to porn to advertising about porn to malware, and habitually I'd just click the third or fourth page of results in the hope that I'd find some worthwhile content. Now I can shape my search results by eliminating much of the fluff, which translates into much more productive searches.

Creators of fluff are on notice:
"Sites will be blocked only for you, but Google may use everyone's blocking information to improve the ranking of search results overall."

Content is king, as the saying goes, and this is one big step in helping us mere users leverage the system by enabling us to trim away the fluff as we find it.

Well played, Google!


Tuesday, March 22, 2011

Process Lasso

I recently installed Process Lasso, a process management and optimization utility. 

Thus far it seems to be a highly effective and versatile tool for managing CPU. Using a proprietary algorithm dubbed ProBalance™, It strives to maximize your computer's responsiveness in spite of the demands placed upon the CPU by myriad running processes. Runaway processes that might ordinarily eat 99% or more CPU can be dynamically adjusted by Process Lasso so that lag is minimized.

Particularly useful is the ability to tag running processes in the GUI and assign them properties in the context menu, including process priority (to determine how valuable a process is and how much time the CPU devotes to it),  processor affinity (assigning the use of one or more CPU cores in a multi-core processor to a given process), gaming mode (favors a process when it's running so that the CPU dedicated to its function is maximized), and terminate always (very handy if malware with a specific filename keeps trying to execute and hang out in memory), as well as lots of other options that extend Windows' built-in Task Manager by leaps and bounds.

One example of Process Lasso's usefulness arose when I noticed today that a particular process was very frequently being restrained by Process Lasso for trying to monopolize CPU. According to this note about the graph portion of the GUI, bars in red denote CPU spikes, and if you hover over these, the process name is displayed (in this case, a process called smc.exe, or Symantec Mangement Client, part of Symantec Antivirus).
 


This particular process had, in the few weeks I've had Process Lasso installed, been restrained over 900 times, and each of the red vertical bars above denoting CPU spikes revealed smc.exe as the culprit.

I decided to right-click on the smc.exe entry from the list and modify its Default Priority Class from its previous Below Normal setting to Idle. At this point I'm unclear about whether I may be compromising Process Lasso's ability to do its job by dictating to it how to treat a particular process on my system; much of the documentation recommends allowing the ProBalance algorithm to do it's thing. 

However, given that I've already configured Symantec Antivirus to exclude from scanning the applications and folders which I most commonly use, I'm hoping that this step will restrict it from eating more CPU than it should; the graph after the change, at least, seems to indicate that Process Lasso is not having to restrain smc.exe nearly as much as before.




In general, seeing red can incite violence in human beings as well as bulls, so at least for my purposes, as far as Process Lasso is concerned, less red is a favorable outcome.