Bugzooka – The answer to your stink bug woes

Stink BugLike most folks in the Mid-Atlantic states, our house has been infested with Stink Bugs. They first invade the home in early Fall, looking to find a warm place to hibernate through the Winter. Whenever a warm day appears, some will awaken, and crawl through your house looking to get back outdoors. These pests first arrived from Asia several years ago, and have quickly become a major nuisance. Our home is surrounded by Soybean fields, which is where the Stink Bugs love to spend their Summers.

Because there are so many of them. catching them is a very tedious process. To make matters worse, if they are scared, or you crush them when removing, you will get stunk! You can try to use a vacuum cleaner, however this quickly causes an unpleasant odor throughout your house. We resorted to catching in tissue and releasing outside still alive. This reduced the smell, but was time consuming and still resulted in stinky fingers.

I finally found the solution, the Bugzooka! I had tried several battery powered bug catchers, however they did not have a strong enough suction to reliably catch the tenacious stink bug. The Bugzooka is manually powered by large set of bellows at the end of the unit. You simply press them in until cocked. With a push of a button, the bellows expands and creates a strong vacuum that will catch almost an bug almost 100% of the time. The great thing about the Bugzooka is that it requires NO batteries, with a simply cocking of the device, you are ready to catch more bugs. The telescoping tube will allow you to reach stink bugs on the ceiling, top of walls, etc. No more mess, and also works on all other types of crawling insects as well.

In the first three minutes of using the Bugzooka, I caught over a dozen stink bugs. After turning it over to my kids, the rest of the house was de-stink-bugged within another 20 minutes. There was little odor, probably because th bugs are not actually killed. Simply unscrew the top, and dump the stink bugs outdoors.
Bugzooka Stink Bug Catcher

If you are faced with a Stink Bug infestation, don’t wait, buy a Bugzooka today. You can click on the handy link below, and Amazon will have it to your door in just a few days.

BugZooka Bug Catcher: Get Stink bugs fast without all the mess!


Count number of tables in the database – MySQL

mysql girl in black halter top

Determining the number of tables that are contained in a MySQL database is very straight-forward, although it is an often asked question. The simplest way to accomplish this is using the following SQL query. In this query, you will provide the database, and the SQL will access MySQL’s internal data scheme (information_schema).

SELECT count(*) as ‘Tables’, table_schema as ‘Database’
FROM information_schema.TABLES
WHERE table_schema= ‘The Database Name’
GROUP BY table_schema

If you need to retrieve this information using PHP, use can use the following code. It creates a connection, runs the query, and returns the number of rows retrieved. This query you notice is slightly different than the one above, often there are multiple ways to get the same result!

$conn = mysql_connect(‘localhost’, ‘USERNAME’, ‘PASSWORD’, 1, 65536);
$res = mysql_query( “select table_name from information_schema.tables where table_schema=’test'”, $conn );
echo mysql_num_rows( $res );

And lastly, there is one more way that you can retrieve the number of tables in a database using PHP and the Show Tables command. In this example, you will need to be connected to a server, and have the database set to the one you are querying against.

echo “<pre>”;
$tbl_List = mysql_query(“SHOW TABLES”);
$i=0;
while($tables = mysql_tablename($tbl_List,$i))
{

echo $tables;

$i++;
}
echo “<br />Table count = $i”;
echo “</pre>”;


What database does Facebook use?

redhead girl using computer

What database does Facebook use is one of the most common questions asked when folks start taking about what database is the most scalable for large scale web applications.   In fact, it is usually a person who is an open source proponent, and knows very well that Facebook uses MySQL as their core database engine.  Because of this fact, this is often the single biggest reason that developers use to push to get MySQL used in their company.  I would imagine that is why it is a very popular Google query.

While Facebook uses MySQL, they do not use it as-is out of the box.  In fact, their team has submitted numerous high-performance enhancements to the MySQL core and Innodb plug-in.  Their main focus has been on adding performance counters to Innodb.  Other changes focused on the IO sub-system, including the following new features :

  • innodb_io_capacity – sets the IO capacity of the server to determine rate limits for background IO
  • innodb_read_io_threads, innodb_write_io_threads – set the number of background IO threads
  • innodb_max_merged_io – sets the maximum number of adjacent IO requests that may be merged into a large IO request

Facebook uses MySQL as a key-value store in which data is randomly distributed across a large set of logical instances. These logical instances are spread out across physical nodes and load balancing is done at the physical node level.  Facebook has developed a partitioning scheme in which a global ID is assigned to all user data. They also have a custom archiving scheme that is based on how frequent and recent data is on a per-user basis. Most data is distributed randomly.  Amazingly, it has been rumored that Facebook has 1800 MySQL servers, but only 3 full-time DBAs.

Facebook primarily uses MySQL for structured data storage such as wall posts, user information, etc. This data is replicated between their various data centers. For blob storage (photos, video, etc.), Facebook makes use of a custom solution that involves a CDN externally and NFS internally.

It is also important to note that Facebook makes heavy use of Memcache,  a memory caching system that is used to speed up dynamic database-driven websites by caching data and objects in RAM to reduce reading time. Memcache is Facebook’s primary form of caching and greatly reduces the database load. Having a caching system allows Facebook to be as fast as it is at recalling your data. If it doesn’t have to go to the database it will just fetch your data from the cache based on your user ID.

So, while “What database does Facebook use?” seems like a simple question, you can see that they have added a variety of other systems to make it truly web scalable.  But, still feel free to use the argument, “MySQL is as good or better than Oracle or MS SQL Server, heck, even Facebook uses it, and they have 500 Million users!”.


The Rolls-Royce Merlin – Could it be the best piston engine ever?

The RAF fighters which resisted the German invasion in 1940 during the Battle of Britain, were all equipped with the same engine, the Rolls-Royce Merlin.  This same engine also powered the majority of the bombers of RAF Bomber Command, and some of the best fighters of the 8th USAAF.   Named after a bird of prey, like all piston engines that Rolls-Royce produced, the Merlin is a unique engine for several reasons.

  • Unlike other engines, which changed relatively little during the war, between 1939 and 1945, no fewer than 52 different versions of the Merlin were produced
  • Powered a wide variety of aircraft, including both fighters and bombers.  These included the Spitfire, Hurricane, Boulton Paul Defiant, Avro Lancaster, De Havilland Mosquito, Handley Page Halifax, Armstrong-Whitworth Whitley, and the P-51 Mustang.  The Merlin even replaced the Hercules II version of the Bristol Beaufighter and the Pegasus in version II of Wellington.
  • The Merlin transforms two of the most important aircraft of World War II.  From the poor performing Manchester was born the transformed Merlin powered Lancaster, the legendary aircraft of Bomber Command.  The P-51 Mustang became one of the best fighters in WWII once the under-powered Allison’s were replaced with the Merlin.  With the new found extended range, it became the only fighter to effectively protect the 8th USAF B-17 deep into enemy territory.
  • Finally, it is the only engine to be built in large numbers simultaneously on both sides of the Atlantic during WWII.

The Birth of the Merlin

The Merlin is a conventional engine, derived from relatively older power trains, as engineers and technicians at Rolls-Royce simply evolved the Merlin from existing proven designs. The Merlin was born into a family of  V12 engines whose origin dates back at Rolls-Royce to the First World War.  As mentioned, they all  bear the names of birds of prey, when studying reciprocating engines from Rolls Royce, you also get a lesson in  ornithology.   Rolls entry into aeronautical engines begins with the Eagle in 1915.  The V-12 Eagle propels the Short Bomber (1916), the Vickers Vimy (1917), the Handley Page O/100 (1916), the Handley Page V/1500 (1918), and fighters like the AIRCO DH.4 (1917).  The Eagle is also mounted in the U.S. aircraft (Fairey F.17).  The Eagle was rated between  250 and 375 hp in its various versions, which for the time was a considerable amount of power, and advantage that the water-cooled engines had over the air-cooled engines of the day.   During this time period the Americans, British and French prefer the V-12 engines from  Rolls Royce, Hispano-Suiza, Renault, and Liberty.  The Germans and Italians are loyal to the 6-cylinder Mercedes, Fiat and Isotta-Fraschini.

After the war, Rolls-Royce began, like all its competitors, the race for power, while remaining faithful to the formula of V-12 liquid cooling.  Advances in design, metallurgy, and fuel allow for an increase in the speed (RPM) and compression ratio of the engine.  In 10 years, the compression ratio increases by 50% (it goes from 4: 1-6: 1) and the rotational speed from approximately 1800 to 2400 rpm. In 1927, the Kestrel 21.25 liter engine is released, which soon powers the Hawker biplanes (Audax, Fury, Hart) in the early 1930s.  The Kestrel develops 745 hp, double the power of the engines produced at the end of WWI.  In order to compensate for lower density air at higher altitudes, the Kestrel gets a mechanical compressor, the super-charger, the first turbocharged engine Rolls-Royce produces.  With the gasoline at that time rated at 87 octane, it allowed for a boost pressure of 5.6PSI.

The Kestrel turns out to be a great engine, with innovations such as the use of ethylene glycol for cooling which reduces the size of the radiators.  Interestingly, Messerschmidt, which still awaits the Daimler-Benz V12 engine, will acquire a Kestrel to test the first version of the BF 109 in 1935.  However, the displacement of the Kestrel is a bit inadequate for the next generation of fighters will require, such as Britain’s future Spitfire.

The Kestrel was followed in 1929 by the Buzzard (36.7 liters), which was named Type R in its competition form. It is with the 2300 hp R-type aircraft that race Supermarine S6 allows England to win for the third consecutive time in the 1931 Schneider Cup and beat the world speed record at 407MPH.  However, the Type R is a racing engine, whose performance can only be sustained for a short period of time.

To fill the existing hole in the range between Kestrel and Buzzard, Rolls began to privately develop a new V12 called the PV 12 (Private Venture 12).  In October 1934, the Air Ministry officially orders the PV12 into production and it is given the name Merlin.  For the next 10 years, Rolls-Royce will continue to develop the Merlin, to make it ever more powerful and versatile.

The Merlin I and II : In July 1934, Rolls releases the first pre-production Merlin A, which like many motors, has a bore (137 mm) which is slightly less compared to the stroke (152 mm), a feature that promotes low-end torque. The Merlin is estimated at 790 hp at 2500 rpm at an altitude of 12,000 feet, already outstanding performance for a block that weighs less than 1322 pounds dry (no oil or coolant).  At the same time (Feb 1935), another version (Merlin B) is produced with a redesigned combustion chamber and 4 valves per cylinder, it reached 960 hp at 11,000 feet. The changes follow through F, to be released in small numbers with the name of Merlin I. The Merlin G (called Merlin II production) is the first type for mass production, it reached 1030 hp at 3000 rpm and 16,250 feet. Compared to the type A, the Merlin type G has gained 30% in power, while the weight has increased by 220 pounds. The Merlin II has a single-speed super-charger, and with 87-octane fuel limit has a boost pressure up to 5.6PSI, and in 1939 with the introduction of 100 octane fuel, this was increased to 11.2PSI, improving power at high-altitude.

The X Merlin : The Merlin X represented a milestone in the evolution of Merlin with the introduction of a two-speed compressor.  Driven by the engine, the supercharger requires power to compress the incoming air.  Therefore, it is important that the power required to compress the air does not exceed the power gained.  The two-speed compressor would allow a lower pressure when the engine was at low to medium altitude, and only use maximum pressure at high altitude.  With the adoption of this compressor Rolls-Royce significantly improves the performance of the Merlin.

Series 60 and Beyond : For the 60 series, the Merlin receives a two-stage compressor. Rather than resorting to turbocharging, which Rolls Royce has no experience, and requires special alloys, Sir Stanley Hooker (Merlin Head Engineer) prefers to mount a two-stage compressor.  This again allows efficient low altitude performance, while increasing high altitude performance.  The ultimate development of this technology will lead to the series 100, which develops over 2000 hp at sea level, and retains a power of 1000 hp at 12,000 ft, with a boost pressure of  2.8PSI.  With the two-stage compressor, Rolls-Royce has the Merlin which is the envy of American turbocharged engines.

The Merlin in Action

Almost all British aircraft, fighters or bombers, were, during the war, equipped with the Merlin. With its V configuration, Merlin offered a reduced frontal area, which was perfect for swift fighters.  Two of these mythical Battle of Britain fighters were the Spitfire and Hurricane. The first Spitfire and Hurricane used the Merlin II. Although designed for fighters, the Merlin also powers almost all British bombers, first the twin-engine bombers (Stirling, Whitley, Mosquito) and then the four-engined Lancaster and Halifax.  The Merlin power plant is also installed in two American fighters, the Curtis P-40 in limited numbers, and the P-51 Mustang almost excusively.


MySQL – ORDER BY does not sort data properly…

sql girl in halter top

Imagine a developer working late at night trying to complete some simple queries for a report due the next day.  No matter what she does, the resulting query will just not sort properly. Is this some undiscovered MySQL bug?  No wonder this software is free, MySQL is broke and can’t even perform a basic sort.  It looks simple, sort the data in a table:

mysql> SELECT id, technology from Enigma;
+——+————-+
| Id | technology |
+——+————-+
| 1 | PHP |
| 2 | LINUX |
| 3 | MySQL |
+——+————-+

To sort the records based on the technology, do an ORDER BY on column Technology:

mysql> SELECT id, technology from Enigma ORDER BY Technology;
+——+————-+
| Id | technology |
+——+————-+
| 1 | PHP |
| 2 | LINUX |
| 3 | MySQL |
+——+————-+

It seems that the server does not understand what I have asked, or I have not mastered the entire alphabet …
Let’s add the clause CSA (just in case!)

mysql> SELECT id, technology from Enigma ORDER BY ASC Technology;
+——+————-+
| Id | technology |
+——+————-+
| 1 | PHP |
| 2 | LINUX |
| 3 | MySQL |
+——+————-+

That does not seem to be any better!  MySQL does not sort the data as I wish, am I going crazy? Should I change my RDBMS?
Don’t worry, a careful look at the table structure allows us to see things clearly.

mysql> SHOW CREATE TABLE enigma;

Table: enigma
Create Table: CREATE TABLE `Enigma` (
`Id` int (11) DEFAULT NULL,
`Technology` enum (‘PHP’, ‘Linux’, ‘MySQL’) DEFAULT NULL
) ENGINE = MyISAM DEFAULT CHARSET = latin1

The column technology is of a type ENUM.  The Enum field is stored as an integer, and that is the index that MySQL uses for sorting.  In other words, 1 is PHP, 3 is MySQL, and 2 is Linux, so sorting does works properly, just not as expected when the Enum data field is storing character data.  So how do you get the desired result?  Simply force MySQL to use the value string and not index when sorting.   This can be done by using either the Concat() or Cast() functions, as follows:

function concat ()
mysql> SELECT id, technology from Enigma ORDER BY concat (technology);
+——+————-+
| Id | technology |
+——+————-+
| 2 | LINUX |
| 3 | MySQL |
| 1 | PHP |
+——+————-+
function cast ()
mysql> SELECT id, technology from Enigma ORDER BY cast (technology as char);
+——+————-+
| id | Technology |
+—– -+————-+
| 2 | LINUX |
| 3 | MySQL |
| 1 | PHP |
+——+———– – +


B-17 E-Z Goin’ and the Sonderkommando Elbe – Buchen Raid

Laurence J. Lazzari Crew
Kneeling L to R: Sgt. Laurence W. Donnelly (BTG), T/Sgt. Robert J. Steele (ROG), 2nd Lt. Charles W. Staiger (NAV)Sgt. Joseph G. Allen.  Standing L to R: Sgt. Richard H. Heritage (NG/TOG), T/Sgt. Charles A. Weiss (TTE), 2nd Lt. Laurence J. Lazzari (P),
2nd Lt. Guiher G. Greenwood (CP), 2nd Lt. Daniel J. O’Connell, Jr. (TG).
100th BG Photo Archives

This website recently received a comment from USAF Colonel Guiher G. Greenwood (retired) who served with the 351st Bomb Squadron, 100th Bomb Group, regarding a picture posted in our gallery. He identified the plane pictured as that of the B-17 E-Z Goin’ piloted by Joe Martin with co-pilot Henry Cervante on the Buchen raid of April 7, 1945. Interestingly, Col Greenwood and Joe Martin lived through one of the more infamous “suicide” attacks by the Germans in their last desperate days of the war.

The Sonderkommando Elbe was a special squadron of the German Luftwaffe, a Luftwaffe task force assigned to bring down Allied bombers by ramming German aircraft into the Allied bombers. Sonderkommando means special command, and Elbe is a river that runs through Germany to the North Sea. The Sonderkommando Elbe was formed at Reichmarschall Hermann Goering’s insistence that the Reich’s defense units should start ramming bombers as a last resort. This group of fighters was not solely tasked with ramming bombers, but that was their last ditch option. In theory this was not a suicide mission, they were only supposed to ram an Allied bomber if there was a chance to bail out alive. Unlike the Japanese kamikaze pilots, the inexperienced German pilots brought a parachute with them while flying their striped-down Messerschmitt Bf 109’s, if the pilot survived the collision, he could use the parachute.

The only documented mission, often called Rammkommando Elbe (ramming) or Werewolf, was on April 7, 1945 when a total of 120 pilots took off in their fighters and attacked several formations of U.S. bombers heading towards the Germany heartland. These young German pilots were motivated to destroy Allied bombers by any means necessary, they had seen their country decimated by the relentless Allied bombing campaign. Although the Luftwaffe had an amply supply of airplanes, even in April 1945, they lacked trained pilots and aviation fuel. Many of the Sonderkommando pilots had only 50 hours of training, and their lack of experience was as likely to get them killed as the P-51 Mustangs that protected the Bomber Armada.

This last ditch effort of the mighty Luftwaffe resulted in only 15 Allied bombers attacked with eight successfully destroyed. Several planes barely limped back to base, these included the E-Z Goin’ flown by Joe Martin’s crew. Their left stabilizer was ripped off, and the rudder substantially damaged. In addition to having little control of the plane, they also lost engine #1. Somehow the crew was able to return to England, and landed successfully.