The Super Capacitor


A team of international researchers have created graphene supercapacitors using a LightScribe DVD burner. These capacitors are both highly flexible (pictured left) and have energy and power densities far beyond existing electrochemical capacitors, possibly within reach of conventional lithium-ion and nickel metal hydride batteries.

Assorted capacitors

The team, which was led by Richard Kaner of UCLA, started by smearing graphite oxide — a cheap and very easily produced material — films on blank DVDs. These discs are then placed in a LightScribe drive (a consumer-oriented piece of gear that costs less than $50), where a 780nm infrared laser reduces the graphite oxide to pure graphene. The laser-scribed graphene (LSG) is peeled off and placed on a flexible substrate, and then cut into slices to become the electrodes. Two electrodes are sandwiched together with a layer of electrolyte in the middle — and voila, a high-density electrochemical capacitor, or supercapacitor as they’re more popularly known.

Now, beyond the novel manufacturing process — the scientists are confident it can be scaled for commercial applications, incidentally — the main thing about LSG capacitors is that they have very desirable energy and power characteristics. Power-wise, LSG supercapacitors are capable of discharging at 20 watts per cm3, some 20 times higher than standard activated carbon capacitors, and three orders of magnitude higher than lithium-ion batteries. Energy-wise, we’re talking about 1.36 milliwatt-hours per cm3, about twice the density of activated carbon, and comparable to a high-power lithium-ion battery.


These characteristics stem from the fact that graphene is the most conductive material known to man — the LSG produced by the scientists showed a conductivity of 1738 siemens per meter, compared to just 100 siemens for activated carbon. The performance of capacitors is almost entirely reliant on the surface area of the electrodes, so it’s massively helpful that one gram of LSG has a surface area of 1520 square meters (a third of an acre). As previously mentioned, LSG capacitors are highly flexible, too, with no effect on its performance (pictured right).

These graphene supercapacitors could really change the technology landscape. While computing power roughly doubles every 18 months, battery technology is almost at a standstill. Supercapacitors, which suffer virtually zero degradation over 10,000 cycles or more, have been cited as a possible replacement for low-energy devices, such as smartphones. With their huge power density, supercapacitors could also revolutionize electric vehicles, where huge lithium-ion batteries really struggle to strike a balance between mileage, acceleration, and longevity. It’s also worth noting, however, that lithium-ion batteries themselves have had their capacity increased by 10 times thanks to the addition of graphene. Either way, then, graphene seems like it will play a major role in the future of electronics.

The Super Supercapacitor | Brian Golden Davis from Focus Forward Films on Vimeo.

Source: ExtremeTech

Magento Collection addFieldToFilter

Someone asked a question on StackOverflow today that I thought was interesting (at  If there are any other Magento people who happen to read this then I’d like your input on it.

Here is the question:

How can achieve the following with collection filters?

SELECT * FROM products WHERE (name like ‘%blah%’ and name like
‘%yes%’) or (description like ‘%blah%’ and description like ‘%yes%’);
Or is this a bad practice for some reason?

addFieldToFilter’s applied to a collection do AND and within each you can achieve OR, but this only allows:

(x OR y) AND (w OR z)
but not

(x AND y) OR (w AND z)
Am I missing something?


After some experimentation, this was my answer to them:


No I don’t believe you’re missing anything. I ran into a similar issue a while back and used getSelect()->where() to work around it.

Starting with your query:

SELECT * FROM products WHERE (name like ‘%blah%’ and name like
‘%yes%’) or (description like ‘%blah%’ and description like ‘%yes%’);

First, I created a collection and used the OR array method to get the query.

$collection = Mage::getModel('catalog/product')->getCollection();
array('attribute' => 'name', 'like' => '%blah%'),
array('attribute' => 'name', 'like' => '%yes%')
array('attribute' => 'description', 'like' => '%blah%'),
array('attribute' => 'description', 'like' => '%yes%')
$collection->load(true); // To dump the sql as text

This resulted in the following output:

SELECT `e`.*, IF(at_name.value_id > 0, at_name.value, at_name_default.value) AS `name`, IF(at_description.value_id > 0, at_description.value, at_description_default.value) AS `description` FROM `catalog_product_entity` AS `e` INNER JOIN `catalog_product_entity_varchar` AS `at_name_default` ON (`at_name_default`.`entity_id` = `e`.`entity_id`) AND (`at_name_default`.`attribute_id` = ’96’) AND `at_name_default`.`store_id` = 0 LEFT JOIN `catalog_product_entity_varchar` AS `at_name` ON (`at_name`.`entity_id` = `e`.`entity_id`) AND (`at_name`.`attribute_id` = ’96’) AND (`at_name`.`store_id` = 1) INNER JOIN `catalog_product_entity_text` AS `at_description_default` ON (`at_description_default`.`entity_id` = `e`.`entity_id`) AND (`at_description_default`.`attribute_id` = ’97’) AND `at_description_default`.`store_id` = 0 LEFT JOIN `catalog_product_entity_text` AS `at_description` ON (`at_description`.`entity_id` = `e`.`entity_id`) AND (`at_description`.`attribute_id` = ’97’) AND (`at_description`.`store_id` = 1)
WHERE ((IF(at_name.value_id > 0, at_name.value, at_name_default.value) LIKE ‘%blah%’) OR (IF(at_name.value_id > 0, at_name.value, at_name_default.value) LIKE ‘%yes%’)) AND ((IF(at_description.value_id > 0, at_description.value, at_description_default.value) LIKE ‘%blah%’) OR (IF(at_description.value_id > 0, at_description.value, at_description_default.value) LIKE ‘%yes%’))

You’ll notice that the WHERE statement is almost where you described it except the OR and AND are reversed.

I copied the WHERE portion of the query and added an extra getSelect()->where() line to the collection like this:

$collection = Mage::getModel('catalog/product')->getCollection();

// I added these lines to ensure that the collection would load
// the fields and do the necessary joins to pull the data

// I'm using the same WHERE statement but I have set the ANDs and ORs
// to match your requirements

$collection->getSelect()->where(" (IF(at_name.value_id > 0, at_name.value, at_name_default.value) LIKE '%blah%') AND (IF(at_name.value_id > 0, at_name.value, at_name_default.value) LIKE '%yes%')) OR ((IF(at_description.value_id > 0, at_description.value, at_description_default.value) LIKE '%blah%') AND (IF(at_description.value_id > 0, at_description.value, at_description_default.value) LIKE '%yes%')");

$collection->load(true); // To dump the sql as text again

The resulting output is:

SELECT `e`.*, IF(at_name.value_id > 0, at_name.value, at_name_default.value) AS `name`, IF(at_description.value_id > 0, at_description.value, at_description_default.value) AS `description` FROM `catalog_product_entity` AS `e` INNER JOIN `catalog_product_entity_varchar` AS `at_name_default` ON (`at_name_default`.`entity_id` = `e`.`entity_id`) AND (`at_name_default`.`attribute_id` = ’96’) AND `at_name_default`.`store_id` = 0 LEFT JOIN `catalog_product_entity_varchar` AS `at_name` ON (`at_name`.`entity_id` = `e`.`entity_id`) AND (`at_name`.`attribute_id` = ’96’) AND (`at_name`.`store_id` = 1) INNER JOIN `catalog_product_entity_text` AS `at_description_default` ON (`at_description_default`.`entity_id` = `e`.`entity_id`) AND (`at_description_default`.`attribute_id` = ’97’) AND `at_description_default`.`store_id` = 0 LEFT JOIN `catalog_product_entity_text` AS `at_description` ON (`at_description`.`entity_id` = `e`.`entity_id`) AND (`at_description`.`attribute_id` = ’97’) AND (`at_description`.`store_id` = 1)
WHERE (IF(at_name.value_id > 0, at_name.value, at_name_default.value) = ”) AND (IF(at_description.value_id > 0, at_description.value, at_description_default.value) = ”) AND ( (IF(at_name.value_id > 0, at_name.value, at_name_default.value) LIKE ‘%blah%’) AND (IF(at_name.value_id > 0, at_name.value, at_name_default.value) LIKE ‘%yes%’)) OR ((IF(at_description.value_id > 0, at_description.value, at_description_default.value) LIKE ‘%blah%’) AND (IF(at_description.value_id > 0, at_description.value, at_description_default.value) LIKE ‘%yes%’))

The where() in the getSelect() could be shortened to:
(`name` like ‘%blah%’ and `name` like ‘%yes%’) or (`description` like ‘%blah%’ and `description` like ‘%yes%’);

Any other Magento people out there please feel free to correct me if I’m too far off-base with this or if you know of a way to accomplish the same goal without using this method.




Truncate logs in Magento

There are some log file entries in the Magento database that constantly increase in size.  There is a setting in System > Configuration > Advanced > System > Log Cleaning that will prune the logs for you, but if you’re in a hurry you can do it directly in mySQL with the following commands:

TRUNCATE dataflow_batch_export;
TRUNCATE dataflow_batch_import;
TRUNCATE log_customer;
TRUNCATE log_quote;
TRUNCATE log_summary;
TRUNCATE log_summary_type;
TRUNCATE log_url;
TRUNCATE log_url_info;
TRUNCATE log_visitor;
TRUNCATE log_visitor_info;
TRUNCATE log_visitor_online;
TRUNCATE report_viewed_product_index;
TRUNCATE report_compared_product_index;
TRUNCATE report_event;
TRUNCATE index_event;




The two US lawmakers responsible for last year’s failed cybersecurity bill known as CISPA are reintroducing the act, and renewed interest from Washington means it might have a fighting chance this time at being signed into law.

Less than ten months after the Cyber Intelligence Sharing and Protection Act stalled on Capitol Hill after being overwhelmingly approved in the House of Representatives, the architects of bill that’s been called “Worse than SOPA” are once more pitching their effort to politicians.

If approved, CISPA could reshape the way American businesses interact with the federal government by setting up a system for private sector entities to share cyberthreat information with any agency administered by Uncle Sam, a notion being called a national security necessity by an increasing number of figures in Washington. Critics of the act condemn the bill’s vague verbiage, though, and less than one year ago orchestrated an online opposition movement with hopes of snuffing CISPA for good. But while the bill — the brainchild of Rep. Mike Rogers (R-Mich.) and Sen. Dutch Ruppersberger (D-Calif.) — failed to garner the support needed within Washington to make it become a law last year, urging from both Congress and the commander-in-chief — and coupled with a new slew of alleged cyber intrusions — could help CISPA be added to the books in no time.

CISPA, a bill “to provide for the sharing of certain cyber threat intelligence and cyber threat information between the intelligence community and cybersecurity entities,” was approved by the House by a 248-168 vote last April, but ended in political purgatory after lawmakers in the Senate failed to see eye-to-eye with their congressional counterparts. Even had CISPA made it that far, though, aides for US President Barack Obama insisted problems with the bill would make it the subject of an executive veto. During just a few short months, however, the White House has rallied support for cybersecurity legislation, and just this week Pres. Obama signed an executive order to establish the framework needed to protect the country’s critical and wired infrastructure in lieu of Congress’ inability to do so on their own part, whether through CISPA or by other means. Pres. Obama announced the order during his State of the Union address Tuesday evening, and added a plea to the politicians in his audience to work towards a Legislative Branch solution.

“Earlier today, I signed a new executive order that will strengthen our cyber defenses by increasing information sharing, and developing standards to protect our national security, our jobs and our privacy. Now, Congress must act as well, by passing legislation to give our government a greater capacity to secure our networks and deter attacks,” Pres. Obama said.

An executive order from Pres. Obama isn’t exactly a rare occurrence, and a laundry list of directives signed in the wake of last year’s Sandy Hook massacre aimed to establish gun reform was faced with furious opposition on the Hill. Either way, though, the orders he’s made from the Oval Office have led some lawmakers to suggest that the commander-in-chief is bypassing both Congress and the Constitution.

“Obama’s increasing reliance on executive orders to push policy and skirt congressional deliberation is worrisome,” Sen. Ted Cruz (R-Texas) tweeted this week.

But in a joint statement issued by the officers of Rep. Rogers and Sen. Ruppersberger on the day of the annual address, the CISPA co-authors said they were “pleased” with the president’s remarks and agreed that “our biggest barriers to bolster our cyber defenses can be fixed only with legislation.” CISPA, said the lawmakers, will “help US companies better protect themselves and the privacy and civil liberties of their customers” from international hackers per the president’s request.

“This is clearly not a theoretical threat – the recent spike in advanced cyberattacks against the banks and newspapers makes that crystal clear: American businesses are under siege,” Rep. Rogers said. He added that American companies need to have their networks better protected because, as he explains in an op-ed published last week in The Detroit News, “thousands of highly-trained computer engineers wake up” every morning in China with the mission to “Steal American intellectual property that the Chinese can in turn use to compete against us in the international market.”

“It is time to stop admiring this problem and deal with it immediately,” Rogers added this week. “Congress urgently needs to pass our cyber threat information sharing bill to protect our national security, our economy and US jobs.”

To CISPA’s critics, though, one very important item isn’t taken into consideration when it comes to offering protection. Opponents of the bill insist that approving CISPA could have damning repercussions for personal privacy and would put off-the-record conversations online and in the hands of any government investigator who can call that data relevant to a case. For that reason, it’s been opposed by the Electronic Frontier Foundation, the American Civil Liberties Union, the Center for Democracy and Technology and others. Even Mozilla, a leading Silicon Valley software maker, strayed from the pack last year and said, “While we wholeheartedly support a more secure Internet, CISPA has a broad and alarming reach that goes far beyond Internet security,”

“The bill infringes on our privacy,” Mozilla’s privacy and public policy official said in a statement to Forbes last year.

Even still, others say the overly vague language of the bill itself could lead to broad interpretation.

Speaking to RT when CISPA was last up for vote in April 2012, Demand Progress co-founder Aaron Swartz said the act has “all the censorship problems” of other cyber legislation that’s been proposed in under the Obama administration such as SOPA and PIPA — the Stop Online Piracy Act and Protect IP Act, respectively — but warned that CISPA is “incredibly broad and dangerous” since “it also goes much further and allows them to spy on people using the Internet, to get their personal data and e-mails.” All, of course, in the name of cybersecurity. But as Congress is still only in its infancy in terms of understanding computers, that ill-defined term can allow for Washington to interpret CISPA in a variety of ways.

“CISPA is essentially an Internet monitoring bill that permits both the federal government and private companies to view your private online communications with no judicial oversight, provided, of course, that they do so in the name of cyber security,” former presidential hopeful and congeressman Ron Paul said on the campaign trail last year.

Since CISPA was first introduced in November 2011, it’s undergone a handful of revisions and has received a number of amendments. But while those changes have been touted as the installation of privacy safeguards for the public by some, others say some of CISPA’s edits have made it an even worse act. One amendment, approved in April’s House vote, was celebrate by some CISPA supporters because it refined the government’s use of shared cyber threat information under the bill to five specifics purposes: cybersecurity; investigation and prosecution of cybersecurity crimes; protection of individuals from the danger of death or physical injury; protection of minors from physical or psychological harm; and protection of the national security of the United States. When that amendment made it to blogger Leigh Beadon last year, she said it was “absolutely terrible” because, instead of limiting the government’s power, it really only expanded the scope of “cybersecurity” in terms of what the feds can and can’t do with private data.

“Basically it says the Fourth Amendment does not apply online, at all,” Beadon wrote. “Basically this means CISPA can no longer be called a cybersecurity bill at all. The government would be able to search information it collects under CISPA for the purposes of investigating American citizens with complete immunity from all privacy protections as long as they can claim someone committed a ‘cybersecurity crime.’”

During Pres. Obama’s Tuesday evening address, members of the international hacktivist movement Anonymous launched an unsuccessful cyber battle against the White House in protest of the administration’s relentless war on the Internet. “We reject the State of the Union. We reject the authority of the President to sign arbitrary orders and bring irresponsible and damaging controls to the Internet,” read a statement made by the group that morning, which included a call to arms for Anons to disrupt that evening’s SOTU broadcast.

Now with CISPA about to be formally reintroduced, they face one more cyber hurdle. If they want to fight back, though, this time they’ll likely face an uphill battle unheard of since last year’s protests.


Magento Certified Developer Study Materials

Interested in taking the Magento Certified Developer certification test?  Then you’ll need to study a lot.  There are more resources coming online to assist you with this.  Here is a short list:

In my opinion, one of the best resources out there is Alan Storm’s website:

Don’t forget that you can still sign up for the Fundamentals of Magento Development on-demand videos free (a $3,850 value)!