<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>avp-blogs.com</title>
	<atom:link href="https://avp-blogs.com/feed/" rel="self" type="application/rss+xml" />
	<link>https://avp-blogs.com</link>
	<description>No System Is An Island</description>
	<lastBuildDate>Sun, 11 Feb 2018 15:02:45 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	

<image>
	<url>https://avp-blogs.com/wp-content/uploads/2018/05/cropped-sitelogo-32x32.png</url>
	<title>avp-blogs.com</title>
	<link>https://avp-blogs.com</link>
	<width>32</width>
	<height>32</height>
</image> 
	<item>
		<title>Cold War Technology : It Is Still Here</title>
		<link>https://avp-blogs.com/2017/03/cold-war-technology-still/</link>
					<comments>https://avp-blogs.com/2017/03/cold-war-technology-still/#comments</comments>
		
		<dc:creator><![CDATA[avp]]></dc:creator>
		<pubDate>Wed, 15 Mar 2017 08:23:19 +0000</pubDate>
				<category><![CDATA[Tech]]></category>
		<category><![CDATA[cold war technology]]></category>
		<guid isPermaLink="false">http://avp-blogs.com/?p=1250</guid>

					<description><![CDATA[[ Cold war technology is alive and kicking. The below article which appeared on TopTal and is reproduced in it&#8217;s entirety explains it in detail. ] I’m a Cold War kid. I grew up watching news of Pershing II and SS-20 deployments in Europe, the Soviet war in Afghanistan, with some Terminator and Top Gun ...]]></description>
										<content:encoded><![CDATA[<p><em>[ Cold war technology is alive and kicking. The below article which appeared on TopTal and is reproduced in it&#8217;s entirety explains it in detail. ]</em></p>
<p>I’m a Cold War kid. I grew up watching news of Pershing II and SS-20 deployments in Europe, the Soviet war in Afghanistan, with some Terminator and Top Gun VHS action on the side. Yugoslavia was trying to play both sides, and for a while it worked like a charm. It all crashed a couple of years after the Berlin Wall came tumbling down, rendering our unaligned prowess pointless.<br />
I admit this is an odd intro for a tech blog, but bear with me; it will start to make sense. Unlike most Europeans, we had good relations with both blocs. We sold tanks to Kuwait and rocket artillery to Saddam, we bought cheap fuel and MiGs from the Soviets, and in return we exported some stuff they couldn’t get directly from the West. I know people who would stay in East Berlin hotels because they were cheaper, then cross the border into West Berlin to work, play and shop, only to cross back via virtually unused border crossings like Checkpoint Charlie, all in a matter of hours.</p>
<p>On one such trip, my dad got me a Commodore C64, which was pressed into service as our Cold War gaming machine. Most 80s video games, and indeed a lot of music and films, were inspired by countless proxy wars and the threat of a nuclear apocalypse. As the Wall came down, a lot of people assumed that would be the end of runaway defence spending and that the world would be a safer place. It didn’t exactly work out that way, did it?</p>
<p>However, the long-term effect of the Cold War on science and technology is more profound than Nena’s 99 Luftbalons, or any Oliver Stone Vietnam flick.</p>
<h2>Minuteman: A Cold War Tech Case Study</h2>
<p>If you are reading this, you’re already using a technology developed for cold warriors; The Internet. That’s not all. A lot of tech and infrastructure we take for granted was developed, or at least conceived, during these tumultuous decades.</p>
<p>That constellation of GPS satellites orbiting Earth? It wasn’t put up there to geotag selfies or get an Uber ride; it was designed to help the US Strategic Air Command deliver hundreds of megatons worth of instant sunshine on Soviet targets with pinpoint accuracy. Integrated circuits, transistors, solid-state computing? Yep, all developed for the armed forces and paid for by the US taxpayer.</p>
<p>Here is just one example: the sleek and unfathomably deadly LGM-30 Minuteman intercontinental ballistic missile (ICBM). It wasn’t the first ICBM out there, but when it appeared, it was revolutionary. It was a solid fuel missile, which meant it could respond to a threat and launch in a minute without having to be fuelled, hence the name. But solid fuel was only part of the story: Solid-state was a lot more interesting from a geek perspective. Prior to Minuteman, ICBMs relied on analogue computers with mechanical gyros and primitive sensors. Since they were wired to a specific target, the target package could not be changed easily. Minuteman was the first mass implementation of a general purpose digital computer; it integrated an autopilot and missile guidance system in one package, with reliable storage that could take the stress of a silo launch. The computer was also capable of storing multiple targets, and was reprogrammable.</p>
<p>Transistors were nothing new at that point; they were developed years before by Bell Labs. Yes, these primitive transistors were almost exclusively reserved for the military-industrial complex. Uncle Sam was the sole customer for virtually all early computers and chips, burning heaps of money. These early transistors offered a quantum leap over vacuum tubes, but they weren’t perfect. By today’s standards, they were rubbish. The reliability simply wasn’t there, and if you needed to launch a few hundred thermonuclear warheads halfway across the planet, you sort of needed a guidance system that wouldn’t fail as soon as the candle was lit.</p>
<p>So what do you do when you come across a technical problem you can’t solve with money? Simple: You throw more money at it, and that’s exactly what the US Air Force did. They burned millions to make the damn things reliable enough to be used in harsh environments and survive the stress of a high-G ascent to space. This was known as the Minuteman High Reliability (Hi-Rel) programme.</p>
<p><a href="https://avp-blogs.com/wp-content/uploads/2017/03/toptal-blog-image-1449827265608-0461fcd5317d82474d888fa88614c438.jpg"><img fetchpriority="high" decoding="async" class="aligncenter  wp-image-1255" src="https://avp-blogs.com/wp-content/uploads/2017/03/toptal-blog-image-1449827265608-0461fcd5317d82474d888fa88614c438.jpg" alt="" width="532" height="532" srcset="https://avp-blogs.com/wp-content/uploads/2017/03/toptal-blog-image-1449827265608-0461fcd5317d82474d888fa88614c438.jpg 641w, https://avp-blogs.com/wp-content/uploads/2017/03/toptal-blog-image-1449827265608-0461fcd5317d82474d888fa88614c438-150x150.jpg 150w, https://avp-blogs.com/wp-content/uploads/2017/03/toptal-blog-image-1449827265608-0461fcd5317d82474d888fa88614c438-300x300.jpg 300w, https://avp-blogs.com/wp-content/uploads/2017/03/toptal-blog-image-1449827265608-0461fcd5317d82474d888fa88614c438-56x56.jpg 56w" sizes="(max-width: 532px) 100vw, 532px" /></a></p>
<p>The first truly mobile digital computer was somewhat deadlier than your notebook and iPhone.</p>
<p>It worked, but the USAF got a bit more than they bargained for. In trying to improve a single weapons system, the USAF ended up giving a huge boost to the tech industry in general. Eventually, the Minuteman was upgraded to include a new microchip-based guidance system, with a primitive form of solid-state storage. This Cold War relic has been in service since the Kennedy administration, and the current incarnation has been around for 45 years, receiving multiple hardware and software updates over the years.</p>
<p>So, in outlining the development and evolution of a single strategic weapon delivery system, I have touched on a number of vital technologies we take for granted: reliable transistors, chips, solid-state storage, mass-produced programmable computers and so on. The Minuteman was also the <a href="http://www.theregister.co.uk/2009/06/05/tob_minuteman_1/?page=1">first mobile digital computer</a>.</p>
<p>Some may argue that the legacy of such weapons is that Mutually Assured Destruction (MAD), guaranteed by the nuclear triad, kept superpowers from going to all-out war. It probably did, but in doing so, it also allowed engineers around the world to develop technologies and concepts applicable in various industries and fields of study.<br />
Their real legacy lies in every integrated circuit on the planet.</p>
<h2>Capitalist Pioneers Try To Cash In</h2>
<p>What could be more capitalist than monetizing instruments of mass murder? The taxpayers paid for their development, not venture capitalists!<br />
Joking aside, it can be argued that the Red Scare of the fifties created Silicon Valley. Most of the money really did come from taxpayers, and most companies that got lucrative defence contracts were quick to make a buck on dual-use technology developed for the military. Remember Bell Labs? A few of their brightest people went on to co-found Fairchild Semiconductor, and eventually created Intel a decade later. The updated Minuteman guidance computer was based on chips from another semiconductor giant: Texas Instruments.</p>
<p>I am not disputing the brilliance of people like Intel co-founders Robert Noyce and Gordon Moore. I have no doubt they would have made their mark on the tech industry even without the biggest arms race in history, but it’s also hard to dispute that the tech industry wouldn’t have developed at nearly the same pace had there been no government funding. Yes, the taxpayers effectively subsidised the tech industry for decades, but in the long run, they’re probably better off. Westinghouse did not need subsidies to develop washing machines and refrigerators, because consumer demand was strong, but in the early days of computing, there was virtually no consumer demand. That’s why governments had to step in.<br />
But what did the taxpayer get?</p>
<p><a href="https://avp-blogs.com/wp-content/uploads/2017/03/toptal-blog-image-1449827375308-c6379065a295c6186adf22bd0299deb9.jpg"><img decoding="async" class="aligncenter  wp-image-1254" src="https://avp-blogs.com/wp-content/uploads/2017/03/toptal-blog-image-1449827375308-c6379065a295c6186adf22bd0299deb9.jpg" alt="" width="588" height="588" srcset="https://avp-blogs.com/wp-content/uploads/2017/03/toptal-blog-image-1449827375308-c6379065a295c6186adf22bd0299deb9.jpg 641w, https://avp-blogs.com/wp-content/uploads/2017/03/toptal-blog-image-1449827375308-c6379065a295c6186adf22bd0299deb9-150x150.jpg 150w, https://avp-blogs.com/wp-content/uploads/2017/03/toptal-blog-image-1449827375308-c6379065a295c6186adf22bd0299deb9-300x300.jpg 300w, https://avp-blogs.com/wp-content/uploads/2017/03/toptal-blog-image-1449827375308-c6379065a295c6186adf22bd0299deb9-56x56.jpg 56w" sizes="(max-width: 588px) 100vw, 588px" /></a></p>
<p>The Internet, GPS, reliable transistors and chips: Cold War tech made possible by runaway defence spending.</p>
<p>The space and arms race spawned a number of technologies that in turn created countless business opportunities. Even primitive computers had a profound impact on industry. They made energy grids and transportation infrastructure more efficient, helped improve safety in industrial facilities, including sensitive chemical and nuclear facilities, they changed the face of banking, communications, entertainment and so on.<br />
Best of all, we somehow managed not to blow ourselves up with the weapons these technologies made possible, yet at the same time, we turned swords into ploughshares. Back in the fifties, the US and USSR launched initiatives designed to examine civilian uses of nuclear power (including civil engineering nuclear explosives schemes, which went terribly wrong), but they amounted to nothing. It wasn’t the might of the atom that changed the world, it was the humble microchip and ancillary technologies developed for countless defence programmes.</p>
<p>Before they made their mark in science and beat Gary Kasparov at the chess table, supercomputers and their analogue predecessors were used to simulate physical processes vital in the development of thermonuclear weapons. An advantage in sheer computing power could yield advances in countless fields. Computer simulations allowed western navies to develop quieter submarines with new screws, digitally optimised to avoid cavitation. Digital signal processors (DSPs) made sonars far more sensitive, and a couple of decades later, advanced DSPs made music sound better. Computer aided design wasn’t just used to reduce the radar cross-section of airplanes, it also made our buildings and cars cheaper, safer and more energy efficient.</p>
<p>Some of these efforts resulted in a technological dead-end, but most did not. One of my favourite tech duds was Blue Peacock, a British nuclear landmine (yes, landmine, not bomb), weighing in at 7.2 tons. Since it relied on early 50s technology and had to be buried in the German countryside, the engineers quickly realised the cold could kill the electronics inside, so they tried to figure out how to keep circuits warm. Their solution was so outlandish that it was mistaken for an April Fool’s Day joke when the design was declassified on April 1, 2004.</p>
<p><a href="https://avp-blogs.com/wp-content/uploads/2017/03/toptal-blog-image-1449827348660-d615076915c717331fbfbb734c9bd3b2.jpg"><img decoding="async" class="aligncenter  wp-image-1253" src="https://avp-blogs.com/wp-content/uploads/2017/03/toptal-blog-image-1449827348660-d615076915c717331fbfbb734c9bd3b2.jpg" alt="" width="562" height="562" srcset="https://avp-blogs.com/wp-content/uploads/2017/03/toptal-blog-image-1449827348660-d615076915c717331fbfbb734c9bd3b2.jpg 641w, https://avp-blogs.com/wp-content/uploads/2017/03/toptal-blog-image-1449827348660-d615076915c717331fbfbb734c9bd3b2-150x150.jpg 150w, https://avp-blogs.com/wp-content/uploads/2017/03/toptal-blog-image-1449827348660-d615076915c717331fbfbb734c9bd3b2-300x300.jpg 300w, https://avp-blogs.com/wp-content/uploads/2017/03/toptal-blog-image-1449827348660-d615076915c717331fbfbb734c9bd3b2-56x56.jpg 56w" sizes="(max-width: 562px) 100vw, 562px" /></a></p>
<p>No chickens were harmed in the making of this blog post, or in the Blue Peacock nuclear landmine programme.</p>
<p>A chicken was to be sealed inside the casing, with enough food and water to stay alive for a week. Its body heat would keep the bomb’s electronics operational.<br />
As civilian industries started implementing these cutting edge technologies en masse, our quality of life and productivity shot up exponentially. Our TVs, cars, phones, the clothes we wear, and just about any consumer product we buy: They’re all better thanks to the biggest waste of money in history. Granted, we all have trace amounts of Strontium 90 in our bones, but in the big scheme of things, it’s a small price to pay for the high-tech world we enjoy so much.<br />
Oh yes, we also got video games out of it. Loads and loads of video games.</p>
<p>&nbsp;</p>
<h2>Kickstarting Game Development</h2>
<p>Video games were pioneered on the earliest digital computers (and some analogue ones as well). In fact, Tennis for Two, arguably the first game to use a graphical display, was developed for an analogue computer in 1958. However, not even Bond villains had computers at that point, so the rise of the video game industry had to wait for hardware to mature.</p>
<p>By the mid to late seventies, microchips became cheap enough for mass market applications. Now that we had the hardware, we just needed some software developers and a use-case for cheap chips. Since the average consumer was not interested in expensive and complicated computers that were designed for big business, attention shifted to gaming; arcades, game consoles and inexpensive computers like the ZX and C64.</p>
<p>These humble machines brought programmable computers to millions of households, hooking a generation of kids on digital entertainment, and creating opportunities for <a href="https://www.toptal.com/game">game developers</a>. Consoles and cheap computers brought the arcade to the living room, ushering in a new era of video gaming, and creating countless jobs in the industry. Even the Soviets got in on it with Tetris, the first game from behind the iron curtain.</p>
<p><a href="https://avp-blogs.com/wp-content/uploads/2017/03/toptal-blog-image-1449827287601-876594e161f9af92b3364a8a66f702ba.jpg"><img loading="lazy" decoding="async" class="aligncenter  wp-image-1252" src="https://avp-blogs.com/wp-content/uploads/2017/03/toptal-blog-image-1449827287601-876594e161f9af92b3364a8a66f702ba.jpg" alt="" width="538" height="538" srcset="https://avp-blogs.com/wp-content/uploads/2017/03/toptal-blog-image-1449827287601-876594e161f9af92b3364a8a66f702ba.jpg 641w, https://avp-blogs.com/wp-content/uploads/2017/03/toptal-blog-image-1449827287601-876594e161f9af92b3364a8a66f702ba-150x150.jpg 150w, https://avp-blogs.com/wp-content/uploads/2017/03/toptal-blog-image-1449827287601-876594e161f9af92b3364a8a66f702ba-300x300.jpg 300w, https://avp-blogs.com/wp-content/uploads/2017/03/toptal-blog-image-1449827287601-876594e161f9af92b3364a8a66f702ba-56x56.jpg 56w" sizes="auto, (max-width: 538px) 100vw, 538px" /></a></p>
<p>The advent of inexpensive home computers and game consoles created a generation hooked on computing and coding.</p>
<p>It wasn’t just entertainment. Unlike consoles, the ZX and C64 were proper computers, and geeky kids quickly found new uses for them. They started making demos, they started coding. Chances are you know a lot of these kids, and if you’re reading this, you probably work with some of them.</p>
<p>If you’re interested in the development of early video games, and what the Cold War had to do with them, I suggest you check out<a href="http://topdocumentaryfilms.com/nuclear-fruit/"> Nuclear Fruit</a>; a new documentary that’s a must see for all geeks and gamers born in the 70s and early 80s.</p>
<p>These guys and gals went on to develop a new breed of video games, build successful online businesses, create new technologies and revolutionise the digital world, all in the space of a decade. A generation that grew up with the constant threat of nuclear war, enjoying dystopian science fiction, helped make the world a better place. They didn’t develop Skynet, they developed millions of mobile and web apps instead.</p>
<p>So, no Terminators. At least, not yet.</p>
<h2>Cold War 2.0 And The Emergence Of New Threats</h2>
<p>This is not a geopolitical blog, but if you happen to follow the news, you probably know the world is a messed up place. No, the end of the Cold War didn’t bring an era of peace and stability, and there’s already talk of a “Second Cold War,” or worse, a “hot” war. While most of these worries are nothing more than hype and sensationalism, a number of serious threats remain. The threat of nuclear annihilation is all but gone, but the technology we love so much has created a host of potential threats and issues, ranging from privacy and security, to ethical concerns.<br />
Thankfully, we aren’t likely to see an arms race to rival the one we witnessed in the 20th Century, but we don’t have to. The same technology that makes our lives easier and more productive can also be used against us. The digital infrastructure we rely on for work and play is fragile and can be targeted by criminals, foreign governments, non-state actors, and even lone nutjobs with a grudge.</p>
<p>These new threats include, but are not limited to:</p>
<ul>
<li>Cybercrime</li>
<li>State-sponsored cyber warfare</li>
<li>Misuse of autonomous vehicle technology</li>
<li>Privacy breaches</li>
<li>Mass surveillance abuses</li>
<li>Use of secure communications for criminal/terrorist activities</li>
</ul>
<p>All pose a serious challenge and the industry is having trouble keeping up. My argument is simple: We no longer have to develop ground-breaking technology to get an edge in geopolitical struggles, but we will continue to develop technologies and methods of tackling new threats and problems. It’s a vicious circle since these new threats are made possible by our reliance on digital communications and the wide availability of various technologies that can be employed by hostile organisations and individuals.</p>
<p><a href="https://avp-blogs.com/wp-content/uploads/2017/03/toptal-blog-image-1449827321238-bcdb76386b6f8bd02702d2cd6fbb17e7.jpg"><img loading="lazy" decoding="async" class="aligncenter  wp-image-1251" src="https://avp-blogs.com/wp-content/uploads/2017/03/toptal-blog-image-1449827321238-bcdb76386b6f8bd02702d2cd6fbb17e7.jpg" alt="" width="535" height="535" srcset="https://avp-blogs.com/wp-content/uploads/2017/03/toptal-blog-image-1449827321238-bcdb76386b6f8bd02702d2cd6fbb17e7.jpg 641w, https://avp-blogs.com/wp-content/uploads/2017/03/toptal-blog-image-1449827321238-bcdb76386b6f8bd02702d2cd6fbb17e7-150x150.jpg 150w, https://avp-blogs.com/wp-content/uploads/2017/03/toptal-blog-image-1449827321238-bcdb76386b6f8bd02702d2cd6fbb17e7-300x300.jpg 300w, https://avp-blogs.com/wp-content/uploads/2017/03/toptal-blog-image-1449827321238-bcdb76386b6f8bd02702d2cd6fbb17e7-56x56.jpg 56w" sizes="auto, (max-width: 535px) 100vw, 535px" /></a></p>
<p>A new generation of emerging threats is once again rallying industry leaders and governments around a common cause.</p>
<p>Cybercrime is usually associated with identity theft and credit card fraud, but it’s no longer limited to these fields. The advent of secure communication channels has allowed criminals to expand into new niches. The scene has come a long way since the romanticised exploits of phone phreaks like Steve Wozniak. Some offer hacking for hire, others are willing to host all sorts of illicit content, no questions asked. Some groups specialise in money laundering, darknet drug bazaars, and so on. The biggest threat with this new generation of cybercrime is that you no longer have to possess many skills to get involved. As cybercrime matures, different groups specialise in different activities, and they can be hired.</p>
<p>State-sponsored cyberwarfare poses a serious threat to infrastructure, financial systems, and national security. However, there is really not much an individual can do in the face of these threats, so there’s no point in wasting time on them in this post. Another form of economic warfare could be to deprive a nation or region of Internet access. It has happened before, sometimes by accident, sometimes by government decree and enemy action.</p>
<p>Commercial drones don’t have much in common with their military counterparts. Their range and payload are very limited, and while a military drone can usually loiter over an area for hours on end, the endurance of hobbyist drones is limited to minutes rather than hours. This does not mean they cannot be used for crime; they can still invade someone’s privacy, smuggle drugs across a border, or even carry explosives. Autonomous cars are still in their infancy, so I don’t feel the need to discuss the myriad of questions they will raise.</p>
<p>Privacy remains one of the biggest Internet-related concerns expressed by the average person. This is understandable; we have moved so much of our daily lives to the digital sphere, placing our privacy at risk. People don’t even have to be specifically targeted to have their privacy and personal integrity compromised. Most data that makes its way online is released in the form of massive dumps following a security breach affecting many, if not all, users of a particular online service. People will continue to demand more privacy, and in turn clients will demand more security from software engineers (who aren’t miracle workers and can’t guarantee absolute security and privacy).</p>
<p>Mass surveillance is usually performed by governments and should not represent a threat to the average citizen or business. However, it’s still a potential threat as it can be abused by disgruntled workers, foreign governments, or by way of data breaches. The other problem is the sheer cost to the taxpayer; mass surveillance doesn’t come cheap and we will continue to see more of it.</p>
<p>Most governments wouldn’t bother with mass surveillance and metadata programmes if they weren’t facing very real threats. The same technology developed to keep our communications and online activities private can be abused by all sorts of individuals we wouldn’t like to meet in a dark alley. The list includes multinational crime syndicates, terrorists and insurgents. However, not all of this communication needs to be encrypted and secure. The point of propaganda is to make it widely available to anyone, and the Internet has given every crackpot with a smartphone the biggest megaphone in history, with global reach, free of charge. You can use the Internet to rally a million people around a good cause in a matter of days, but the same principles can be applied to a bad cause. If the target audience is people willing to join a death cult with a penchant for black flags, you don’t need a million people; you just need a few dozen.</p>
<h2>The Difference Between Science And Science Fiction</h2>
<p>For all their brilliance, the science fiction authors who helped shape popular culture in the 20th Century didn’t see the real future coming. They didn’t exactly envision the Internet, let alone its profound impact on society.</p>
<p>Sorry to burst your bubble, but Terminators and Artificial Intelligence (AI) aren’t a threat yet, and won’t be anytime soon. The real threats are more down to earth, but that does not mean we can afford to ignore them. You don’t need a Terminator to create havoc, all you need is a few lines of really nasty code that can disrupt the infrastructure, causing all sorts of problems. You don’t need a super-intelligent automaton from the future to cause damage. Since eBay doesn’t carry Terminators, it’s a lot easier to use an off-the-shelf drone, programmed to deliver a payload to a specific target: drugs to a trafficker, or an explosive charge to a VIP.</p>
<p>But these aren’t the biggest threats, they’re just potential threats: something for a Hollywood script, not a tech blog.<br />
The real threats are criminal in nature, but they tend to stay in the cyber realm. You don’t have to physically move anything to move dirty money and information online. Law enforcement is already having a hard time keeping up with cybercrime, which seems to be getting worse. While it’s true that the crime rate in developed countries is going down, these statistics don’t paint the full picture. A few weeks ago, the British Office for National Statistics (ONS) reported a twofold increase in the crime rate for England and Wales, totalling more than 11.6 million offences. The traditional crime rate continued to fall, but the statistics included 5.1 million online fraud incidents.</p>
<p>The cost of physical crime is going down, but the cost of cybercrime is starting to catch up. I strongly believe the industry will have to do more to <a href="https://www.toptal.com/security/job-description">bolster security</a>, and governments will have to invest in online security and crime prevention as well.</p>
<p>Just in case you are into dystopian fiction and don’t find criminal threats exciting, another frightening development would be data monopolisation: A process in which industry giants would command such a competitive lead, made possible by their vast user base, as to render competition pointless, thus stifling innovation.</p>
<p>Yes, I am aware that Terminators would make for a more eventful future and interesting blog post, but we’re not there yet.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://avp-blogs.com/2017/03/cold-war-technology-still/feed/</wfw:commentRss>
			<slash:comments>1</slash:comments>
		
		
			</item>
		<item>
		<title>Domesticating Homes Using IoT</title>
		<link>https://avp-blogs.com/2017/01/domesticating-homes-using-iot/</link>
					<comments>https://avp-blogs.com/2017/01/domesticating-homes-using-iot/#respond</comments>
		
		<dc:creator><![CDATA[avp]]></dc:creator>
		<pubDate>Wed, 18 Jan 2017 15:22:22 +0000</pubDate>
				<category><![CDATA[Tech]]></category>
		<category><![CDATA[internet of things]]></category>
		<category><![CDATA[IoT]]></category>
		<category><![CDATA[sci-fi homes of the future]]></category>
		<guid isPermaLink="false">http://avp-blogs.com/?p=1243</guid>

					<description><![CDATA[The sci-fi home of the future is now possible using Internet of Things. The below article from Toptal describes the details. The smart home technology boom is upon us. Despite lucrative projections for the market, and ever increasing numbers of connected devices, we have yet to witness much social impact from consumer adoption into the ...]]></description>
										<content:encoded><![CDATA[<p><em>The sci-fi home of the future is now possible using <a href="https://en.wikipedia.org/wiki/Internet_of_things">Internet of Things</a>. The below article from <a href="https://www.toptal.com/">Toptal</a> describes the details.</em></p>
<p>The smart home technology boom is upon us. Despite lucrative projections for the market, and ever increasing numbers of connected devices, we have yet to witness much social impact from consumer adoption into the home. As a potential tipping point looms, there are several debates surrounding privacy, integration and other technical issues. Yet, there seems to be less speculation regarding why consumers still haven’t bought into the hype, nor how domestic life has improved. Considering how personal the home is, should it be concerning that those advertising these products discuss quality of life less than data, energy and ‘security’? Is the adoption of the <a href="https://www.toptal.com/it/are-we-creating-an-insecure-internet-of-things">Internet of Things</a> into our homes inevitable, or is it already here?</p>
<p><img loading="lazy" decoding="async" class="aligncenter" src="https://uploads.toptal.io/blog/image/92213/toptal-blog-image-1457422095807-10eaeaa9b63ae577a9ff3acd6c2cd683.jpg" alt="Smart Home Interface" width="574" height="574" /></p>
<h2 id="somewhere-in-the-near-future">Somewhere in the Near Future</h2>
<p>The smart person returns to their certified <strong>‘Internet &#8211; of -Things‘</strong> smart home after a long day at work. The <a href="http://august.com/" target="_blank" rel="noopener noreferrer">smart security system</a> senses that the smart person is alone and initiates the ‘Friday Night In’ sequence. Inside, an intercom with a standardized motherly voice suggests that the smart person might want to order in tonight. The smart person unloads their things in the kitchen where the <a href="http://thesmartstove.com/" target="_blank" rel="noopener noreferrer">smart stove</a> displays a selection of take out, rather than it’s default recipe guide. Following the arrival of the food, the smart person retreats to the living room to wind down, and watch some TV in their underwear. The <a href="http://internet-tvs-review.toptenreviews.com/" target="_blank" rel="noopener noreferrer">smart TV</a> prepares a selection of Netflix marathons categorized by mood. The smart person chooses: ‘Looking to be cheered up? Comedy Playlist’. Before starting the show, the smart person reviews a set of graphs that display the data from activity and diet throughout the day. A list of tips for smart living is generated at the bottom, one of which reads that based on the amount of consecutive nights that the Smart Person has had alone, they might consider investigating a selection of popular dating sites instead of watching TV tonight. At the slip of a thumb the smart person OKS the request and instantly a set of profiles are displayed, each chosen from a generated list of Smart Person’s tracked preferences. Suddenly, a flurry of pings and messages from other stay-at-home hopefuls fill the screen. The smart home intercom repeats aloud ‘You’ve got mail!’. The smart person fumbles for the remote and &#8211; oops” &#8211; the TV snaps a selfie in response to the flood of pings. Their image, sitting in their underwear eating noodles appears briefly on the screen before being whisked off into the ether. The flood of messages doubles only to freeze the system, causing the smart home to reboot. The house goes dark. In the now blank screen of the smart TV reflects the image of the smart person again, finally alone.</p>
<h2 id="home-smart-home">Home Smart Home</h2>
<p>With all the debate and headlines regarding the <a href="https://www.toptal.com/designers/ui/touch-the-world-is-our-interface">Internet of Things</a>, and amounts of devices connected and market valuations &#8211; is there anyone left to ask about what will happen to the home once Smart Homes take over? The keeping of a home is one of, if not the oldest traditions that we have as humans. Does the Smart Home mean the end of the home as we know it?</p>
<p>The home is the original place where we build our identity and mark our place in the world &#8211; the original profile. Each generation has formed its radical dwellings as their respective marks on the world. We can now look back into those past homes as windows into the past lives of those generations, their values and ambitions. What do our Smart Homes tell us about ourselves? Or perhaps instead, what is it telling everyone else?<img loading="lazy" decoding="async" class="aligncenter" src="https://uploads.toptal.io/blog/image/92214/toptal-blog-image-1457422167327-cb702f401f56cdc8f7c2decffe694a11.jpg" alt="Smart Home History" width="571" height="571" /></p>
<h2 id="a-brief-history-of-the-automated-home">A Brief History of the Automated Home</h2>
<p>The process towards the automated home began almost two centuries ago now. When we first plugged our homes in, the light bulb gave us the night. No longer was man confined to the limits of the sun. The technology offered liberation from the natural hours of the day. Later, appliances replaced tools and everything that moved, or could move, became battery powered. The first generation of the automated home advertised better performance for leisure in exchange. More time for the family, or affording the once confined housewife to pursue her career as well. The automated home liberated us from the need to maintain it.</p>
<p>Now, the technological trend continues to carry us through the next generation into a new domesticity. Although there will always be laments for what has passed, perhaps change isn’t so bad. If there is a new liberation perhaps it is the freedom to stay home. The freedom to sit and allow the world to visit us inside. Freedom from the outdoors. Freedom from each other. Yet, this time, is the freedom coming at a cost?</p>
<p>The home is the original security device &#8211; the original firewall. But now, as we allow the entire world to float through our walls and into our homes, have we deflated the entire meaning of our home that has stood for millennia? We speak of security and privacy now in the context of technical systems and hardware. But have we forgotten the origin of what privacy meant? In the spaces where we were once the most intimate, by inviting the world in we are becoming the most exposed. To adopt the Smart Home, must we forfeit the home?</p>
<p>Given the acceptance worldwide that privacy is dead, these thoughts may be obsolete falling on ears of developers and web designers. The point though is to fundamentally question what the Smart Home is offering us in exchange for what we must give it. Effectively, is the trade worth it? Will domestic life improve as it did during the first generations of automation? Or, how do we ensure, especially as the <a href="https://www.toptal.com/front-end">community</a> who may be taking part in that change, that some amount of domesticity is salvaged?</p>
<p><img loading="lazy" decoding="async" class="aligncenter" src="https://uploads.toptal.io/blog/image/92215/toptal-blog-image-1457422221361-545deb6d43874bdf6addc62aa7037dcf.jpg" alt="Home Alone With the Internet of Things" width="531" height="531" /></p>
<h2 id="the-state-of-the-internet-of-things">The State of the Internet of Things</h2>
<p>The Internet of Things is one of those monster hot topic terms that when we hear it, we know of its significance, and yet may know much less about its tangible effects. We may hear that there are estimates of 200 billion devices being connected in the near future, or that the market’s value is projected at 80 billion dollars. The numbers have similar significance as knowing that the earth is 92.2 million miles away from the sun. They’re very important numbers, yet most of us don’t understand the specifics, or address the numbers daily. All that most people want to know is most cases, is how is this thing going to change, or improve our life?</p>
<p>What is resisting smart home technology from becoming adopted with the same ubiquity as smart phones today? Consider the early phases of smartphone technology. What caused them to make the leap from a niche device, to being fastened to the hip of nearly every person and their grandparent?</p>
<p>Smart phones existed for about a decade before the market saw a significant boom. The release of the iPhone in 2007 generated a major shift as Apple was the first to design and market the device for everyday use. The elements that the iPhone introduced or improved seem to be subtle interface adjustments, and yet were able to catalyze a major shift. Thus, what might be that critical tipping point, or product for smart homes?</p>
<h2 id="the-issue-with-niche-products">The Issue With Niche Products</h2>
<p>Everyday there seems to be more smart home products to outfit your home with. Yet with each new application there is a new device, with a new remote that might connect with another new app on your smart phone. No matter how potentially helpful any of these devices might be, they appear to be novel and excessive without being associate with a greater purpose.</p>
<p>Recently, Yves Behar released the designs for a connected garden tracking system called Edyn. The system contains two products, one to monitor the soil, and another to respond to the tracked data and irrigate the garden as necessary. With the data, the app can recommend which plants might be the easiest to grow, and what the produce might need in order to flourish.</p>
<p>Seems pretty handy &#8211; but is it necessary enough to become widely adopted, or to really change the way we maintain our yards? Especially considering that for many, gardening is a pleasurable activity. People often garden as a meditative tool. In fact, there was a study recently suggesting that the happier someone is, the more they garden, and the more someone gardens, the happier they are. So, what exactly is Edyn suggesting that they can improve upon in this process that gardening was without before? If gardening becomes easier, what else is to be gained in terms of time in the day? Perhaps now the smart gardener can fit in another Netflix episode, rather than do the watering themselves. Hopefully one day they won’t even have to lift a green thumb at all! Imagine all the Netflix that could be watched.</p>
<p>Now, I don’t mean to pick on Edyn too much, but my point is that this tool is representative of most smart home technology. A lot of it would be nice to have I suppose, but it doesn’t quite seem worth the cost and the trouble.</p>
<h2 id="so-whats-next">So What’s Next</h2>
<p>The issue with the clunky interaction between multiple apps is now clear to the market, as there is a definite push towards who can develop the ‘hub’ for all smart home devices. Some of the key players so far are SmartThings, Wink, Apple is supposedly generating momentum through AppleTV, and Amazon has the device Echo.</p>
<p>However, there so far is no real front runner, nor have many homes really begun to adopt the technology. What seems to be lacking, as was the case with the iPhone, is the proper interface that can relieve the smart home technology of all of the headaches that get in the way of convenience.</p>
<p>Most of the processes that these technologies are looking to improve are not exactly major burdens &#8211; turning of lights, playing music etc. Thus, if the experience is hardly more enjoyable, the new technology won’t be adopted.</p>
<p>One product, Josh.ai, has recognized this need for cohesion between devices, and focuses its manifesto towards interfacing. Josh.ai anticipates the need for programs to develop and build over time along witht the user. Eventually, certain commands become memorized such that Josh.ai will know that every morning it should slowly raise the lights, turn on the morning news, and prepare a cup of coffee. The interface takes any work out of choosing between apps, and instead responses to voice commands to manage all connected devices. Josh.ai is advertised as your home’s best friend. You even talk to Josh.ai as if its your best friend.</p>
<p>Josh.ai bases its product around the use of voice rather than any other interface. This may be a critical move for smart home technology. Josh.ai’s platform essentially asks how can the user program their home with as little work as possible? The hope is that even complex processes like morning routines might be programmed by voice, then memorized for future instances. “Hey Josh, when I get home can you turn up the lights, set the oven to 300, and maybe put on something like Frank Sinatra? I’m bringing a friend home!”</p>
<p>If Josh.ai is one of the more optimistic potential hubs to move the Smart Home trend into the next stage, what does its manifesto tell us about the ambition of what we can expect from the technology in near future?</p>
<p>Very often does the phrase ‘make your life easier and more productive’ occur in many of these manifestos. But, most of what these hubs offer is the autonomous control of small things like lights and music, how much easier will our lives get? Can this at all compare to the transition from brooms to vacuums?</p>
<p>The three essential points of Josh.ai are: thoughtless energy saving, continuous awareness of devices, and a more networked system. How do these new values compare to past technologies that significantly liberated the average person? In the manifestos of most of these hub devices, there is hardly any language that appears human at all.</p>
<p>Although the benefits of some of the products seem underwhelming, the issue is that even the smallest thing poses a significant risk. Take Nest for example, what could be more harmless than a thermostat? Yet already in its relatively short life has Nest been now caught for the sale of information surrounding home fire history to insurance companies.</p>
<p>Even if the Smart Home Hub were your ‘best friend’, do you want your best friend to know everything about your preferences? How much do we even allow our actual best friends to know about ourselves? Do we tell them that we’re lonely? Who’s profiles we look at online? Even if our best friend were really good at keeping secrets, would we tell them? About that one time?</p>
<p>Anytime that someone cries out against the inevitable, they come across as a cranky soap boxer. But this is an odd transition where there seems to be little gained by most of these products, and yet there is such significant risk in what might be lost if the technologies are adopted. Doesn’t it feel strange that in the last century our parents and grandparents marched for privacy, and here we are eagerly handing it back?</p>
]]></content:encoded>
					
					<wfw:commentRss>https://avp-blogs.com/2017/01/domesticating-homes-using-iot/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>Essential Gadgets For Maintaining Productivity While Traveling</title>
		<link>https://avp-blogs.com/2017/01/essential-gadgets-maintaining-productivity-traveling/</link>
					<comments>https://avp-blogs.com/2017/01/essential-gadgets-maintaining-productivity-traveling/#respond</comments>
		
		<dc:creator><![CDATA[avp]]></dc:creator>
		<pubDate>Wed, 11 Jan 2017 16:17:21 +0000</pubDate>
				<category><![CDATA[Tech]]></category>
		<category><![CDATA[productivity while traveling]]></category>
		<category><![CDATA[travel gadgets]]></category>
		<guid isPermaLink="false">http://avp-blogs.com/?p=1236</guid>

					<description><![CDATA[Working while on road can be challenging without proper hardware or not knowing which type of gadgets to travel with. The below article by Toptal covers everything that is required for being productive while traveling. Nevermind Game of Thrones, winter is not coming, at least not in the northern hemisphere. It’s summertime, and here at ...]]></description>
										<content:encoded><![CDATA[<p><em>Working while on road can be challenging without proper hardware or not knowing which type of gadgets to travel with. The below article by <a href="https://www.toptal.com/">Toptal </a>covers everything that is required for being productive while traveling.</em></p>
<p>Nevermind Game of Thrones, winter is <em>not</em> coming, at least not in the northern hemisphere. It’s summertime, and here at Toptal that usually means many of our freelance developers and designers are either on the road or getting ready to hit the beach.</p>
<div class="layout_layer" data-view="layout#layout">
<section id="main_content" class="grid-row has-top_border is-transparent has-no_border" data-view="">
<div class="grid-row-inner has-medium_padding two_columns_layout is-wide">
<div class="two_columns_layout-content">
<div class="post is-full">
<div class="content_body" data-view="content#body" data-subscribe="true">
<p>When I started writing this, some of our people were in Portugal, trying to work out the math behind surfboards. Now it’s my turn, and I’m wrapping up my draft with a nice view of the Adriatic Sea, just a few miles away from the best windsurfing spot in Europe.</p>
<p>Yes, I’m a workaholic, so this might as well be a good time to cover the topic I had in mind.</p>
<p>I can probably guess what some of you are thinking:</p>
<blockquote><p>“<em>This is a lifestyle post! This guy is going to talk about surfing, healthy food and exercise.</em>”</p></blockquote>
<p>No. This is not a lifestyle post. As far as food goes, fresh fish and veggies are always a safe bet. Exercise? Well, cycling to a nearby village to try a marginally different fish dish and sample local wine counts as exercise, at least to me.</p>
<p>So, with all the lifestyle stuff out of the way, I can get back to my message and start discussing the logistics behind travel and remote work. You can buy capri pants, cheap flip-flops, and boonie hats everywhere, but beachside shops usually don’t carry quality hardware that can help you be more productive on the road, or save time and money for more enjoyable activities.</p>
<p><strong>Caveat:</strong> <em>If you’re an avid Apple user with a profound dislike of Windows, you may not like where I’m going with this. I don’t intend to bash Apple, but Cupertino simply doesn’t bother with cheap hardware that won’t be missed if it ends up in the water.</em></p>
<h2 id="travel-hardware-myths-and-moths">Travel Hardware: Myths and Moths</h2>
<p>When you hit the road, what do you stick in your carry-on? And no, I’m not talking about shorts and Toptal shirts. You pack a fair amount of hardware, and I am assuming we all have our personal preferences when it comes to our kit. This is entirely subjective, so I’m <em>not going to tell you your choice of hardware sucks</em>.</p>
<p>If it works for you, stick with it. End of story.</p>
<p>Instead, I will focus on often overlooked gadgets and accessories that can make your life easier and <em>complement</em> your existing travel hardware. I will try to stay away from <em>expensive</em> or <em>exotic</em> hardware that may be hard to come by, and focus on cheap stuff that won’t burn a hole in your pocket.</p>
<p><img loading="lazy" decoding="async" class="" src="https://uploads.toptal.io/blog/image/92747/toptal-blog-image-1468228887730-a100d912e44151a20a395c0228237e42.jpg" alt="Working on the road with spotty internet access can be a nightmare. Luckily, the hardware is evolving to keep pace." width="577" height="577" /></p>
<div class="pop_out_box is-full_width is-big">Working on the road with spotty internet access can be a nightmare. Luckily, the hardware is evolving to keep pace.</div>
<div class="tweet_this"></div>
<p>The hardware industry has been making a killing on high-end laptops and notebooks for decades. They come in all shapes and sizes, from ruggedized Toughbooks that can withstand a low-yield nuclear blast, to sleek ultraportables that sacrifice performance and value for money, but look <em>awesome</em> and turn heads wherever you go. Whether you’re in the market for a powerful, portable workstation for virtualization and design, or a featherweight ultraportable that doesn’t skimp on performance, you are likely to spend loads of money on your primary laptop. I am not suggesting high-end computers are a bad investment because they cost a lot of money to produce, and in turn, they save time and boost productivity. Magnesium alloys, high-density batteries, powerful mobile GPUs and low-voltage CPUs cost <em>a lot of money</em>, and performance rigs will never be cheap. Virtually every major component in a high-end laptop costs much more than desktop components with comparable performance, and like all things in life, you have to pay a premium to get the <em>really</em> good stuff.</p>
<p>But does this principle apply to <em>all</em> portable hardware? It does not, and this is the <strong>myth</strong> I mentioned earlier. Useful stuff doesn’t have to cost an arm and a leg.</p>
<p>The commoditization of IT has turned the market on its head. Devices that used to cost hundreds of dollars a couple of years ago are now being sold on supermarket shelves for $99, and you can get even better prices if you take your time to look for online deals.</p>
<p>As I explained earlier, these cheap gadgets won’t replace your MacBook or ThinkPad. You won’t <strong>mothball</strong> them anytime soon, but you could get some hardware that will supplant them. You won’t have your full development environment or Adobe CC suite on cheap, secondary devices. At the same time, you don’t need a $2,000 laptop to check Slack, write a few emails, or tinker with spreadsheets while you’re sipping your Mojito by the beach. A convertible or hybrid device can handle basic productivity tasks at a fraction of the cost, plus many of them offer superior battery life and can be charged by a powerbank in your backpack. Why drain the battery on your primary computer just to attend a Skype meeting and draft a few follow-up emails? It’s overkill.</p>
<p>Would you use a massive chainsaw to trim a couple of shrubs in your garden? Of course not. Well, I might, but that’s just because I dislike my neighbors.</p>
<p>To summarize, you will still have to pay loads of money to get a proper primary computer, but you can save money elsewhere, and you can get more flexibility. Luckily, mobile computing has never been cheaper, and just a couple hundred bucks can buy you a useful yet nearly disposable device.</p>
<h2 id="wait-what-the-hell-are-convertibles-and-hybrids">Wait, What The Hell Are Convertibles and Hybrids?</h2>
<p>I spent the better part of a decade covering hardware, and based on my extensive experience in the field, I can confidently say that <em>I have no idea</em>.</p>
<p>These are not technical terms, they’re marketing talk. Every few quarters, chipmakers and vendors have to come up with new buzzwords to appease pitchfork wielding activist investors and analysts, but you can only come up with so many pointless buzzwords before you blur the lines between all sorts of product categories, throwing all rules and definitions out the window.</p>
<p><img loading="lazy" decoding="async" class="" src="https://uploads.toptal.io/blog/image/92748/toptal-blog-image-1468228920416-50e6a948dffa3354dc1b7385ffd43fa6.jpg" alt="New chips and form-factors are turning inexpensive hybrid computers into useful secondary devices. Check them out." width="556" height="556" /></p>
<div class="pop_out_box is-full_width is-big">New chips and form-factors are turning inexpensive hybrid computers into useful secondary devices. Check them out.</div>
<div class="tweet_this"></div>
<p>So, convertibles, detachables, clamshells, 2-in-1s, hybrid tablets… <em>What</em> are they really?</p>
<p>They’re basically cheap computing devices, usually based on tablet hardware platforms. Their design and form-factor vary wildly. I know this is a very broad definition, but this is a broad product category.</p>
<div class="pop_out_box is-full_width is-big">Tablet hardware, Ewww! That’s not gonna work for me!</div>
<p>I agree, at least to some extent. These devices can’t and won’t replace your primary computer, but <em>they’re not supposed to</em> &#8211; that’s the point. They are secondary devices, stuff you can fall back on in case your primary fails, or if you need something lighter and more portable for menial tasks. However, if you think all these devices are underpowered and useless in a professional setting, you’re probably wrong, and once you try one of them you may be in for a pleasant surprise.</p>
<p>I had a chance to try out a few tablets, hybrids and ultraportable notebooks based on Intel’s latest 14nm Atom x5 and x7 processors (codenamed Cherry Trail). These processors are cheap and tiny, but they can still run circles around most 5-year-old laptops. Whereas a high-end mobile processor costs a few hundred dollars, the price of Atoms is measured in tens of dollars. This does not necessarily mean you end up with terrible performance. These highly integrated chips have four physical CPU cores and integrated graphics capable of handling everyday tasks, media consumption, and even running some casual games.</p>
<p>Don’t be fooled by the “quad-core” moniker. Yes, these are quad-core processors, but the architecture is different, and four Atom cores are usually much smaller than a single CPU core used in Intel’s Core-series chips. This means performance is much lower, but since these are 14nm parts, power consumption is ridiculously low. This means the processor can be cooled passively, and a vendor can get an Atom processor for the price of a beachside lunch. In fact, sometimes vendors pay next to nothing for them, because Intel <em>subsidizes</em> its platforms, although the chipmaker tends to use different nomenclature for this controversial business practice. Last time I checked, they were referring to it as “contra-revenue”, and didn’t like people using the <em>s-word</em>, which is exactly why I am using it.</p>
<p>While a thoroughbred Core i5 mobile processor requires 15W to 35W of juice when it’s running at full load, tablet Atoms can get away with just a fraction of that, on the order of 2W to 3W. This obviously has massive implications on battery life. A few years ago, I had a chance to review one of the first Atom-based hybrids, designed by Asus. One of the biggest problems I encountered during my review was battery life. I had a hard time draining the bloody thing in my everyday routine. It was like a Duracell Bunny; it offered all-day battery life and then some. Better yet, it could be topped off using a standard microUSB charger, although it took a while to fully charge. Intel was clearly onto something, and its engineers from Israel to California obviously did an exceptional job designing this new breed of Atoms.</p>
<p><img loading="lazy" decoding="async" class="" src="https://uploads.toptal.io/blog/image/92749/toptal-blog-image-1468228947506-1f05fb1f1ccca6dcaae7da96964a3127.jpg" alt="Atom processors aren't the toys they used to be. The latest generation offers sufficient performance for many applications and scenarios." width="528" height="528" /></p>
<div class="pop_out_box is-full_width is-big">Atom processors aren&#8217;t the toys they used to be. The latest generation offers sufficient performance for many applications and scenarios.</div>
<div class="tweet_this"></div>
<p>That was three years ago, and things are even better now. The latest crop of 14nm Atoms is even more efficient, so battery life should not be an issue, even if you get a dirt-cheap “whitebox” device.</p>
<p>But what about the rest of the spec?</p>
<p>This is what a typical low-end hybrid/convertible/2-in-1 tends to have under the hood today:</p>
<ul>
<li>Atom x5 or x7 series processor &#8211; usually an entry- to mid-level x5 chip</li>
<li>4GB of LPDDR3</li>
<li>32GB/64GB of eMMC storage &#8211; eMMC storage is slower than proper SSDs, but eMMC 5.0 drives can be quite fast and won’t bottleneck the system</li>
<li>microSDXC card reader</li>
<li>FullHD IPS touchscreen &#8211; usually ranging from 10.1 to 12 inches. Some devices also support stylus input, in case you need to sketch stuff or just doodle something</li>
<li>Optional 3G connectivity &#8211; 4G is still quite rare in this product category, but that’s changing fast</li>
<li>6000mAh to 12000mAh batteries &#8211; this largely depends on display size and the form factor</li>
<li>Windows 10 &#8211; Apple users probably won’t like this, and neither will the Linux crowd</li>
<li>Proper full-sized keyboard with touchpad</li>
</ul>
<p>Big brands usually market such devices at about $500+, but if you want something really cheap and expendable, you might want to consider Chinese vendors, as you can get something with this sort of spec for $200+, and you’ll usually get slightly better specs than if you go for a big brand device. Some of them use virtually the same components as big brand devices.</p>
<p>Personally, I rely on a compact 10.1-inch “detachable” based on a more powerful Core M processor, with a pretty good stylus which I use sparingly, mostly to annoy our illustrators with my half-baked ideas. Core M devices cost more than Atom-based hybrids, but they offer superior performance and can actually replace your primary computer in some situations (especially if you get a bigger device, as 10 inches isn’t going to cut it for most people).</p>
<p>Unfortunately, Apple users don’t have nearly as much choice.</p>
<p>If they insist on avoiding the traumatic transition to Windows, they’re limited to the MacBook Air series or the new iPad Pro, neither of which are cheap or expendable. Of course, you could use a standard 9.7-inch iPad for some tasks, but in my experience, the relatively small 4:3 screen and the necessity to carry around a Bluetooth keyboard leaves much to be desired. If you’re an Apple user, and if you can live with Windows from time to time, you’re probably better off getting a cheap <em>Wintel</em> hybrid with a proper, full-sized keyboard. It all depends on what you’re going to use these devices for.</p>
<p>Google apps and all sorts of web apps look and behave identically on Apple and Windows. This obviously makes a potential transition from OS X to Win a bit less inconvenient, given the secondary nature of these computers.</p>
<div class="embeddable_form-wrapper for-post" data-view="blog_subscribe#form" data-role="blog_subscribe">
<form class="embeddable_form" action="/blog/subscription" method="post" data-view="form#form" data-remote="" data-entity="blog_subscription">
<div class="embeddable_form-step is-email_form is-current">
<div class="embeddable_form-row is-label">
<h2 class="embeddable_form-label_title">4G Stands for Gotta Get Global Gear</h2>
</div>
</div>
</form>
</div>
<p>So, you packed your laptop, tablet, camera, Kindle, smartwatch, and a bunch of other devices, and hopefully, you didn’t forget the chargers. You’re good to go, but you’re traveling abroad and you’ll have to rely on wireless data when WiFi access is not available.</p>
<p>A few years ago, this was a <em>massive problem</em>, because cellular data plans were expensive and pre-3G standards did not offer a lot of bandwidth. This limited our options and forced us to be on the prowl for decent WiFi networks, or even use stone-age hotel Internet (I still have my sawed-off LAN cable somewhere).</p>
<p>Now, it’s not only possible to get relatively good cellular data abroad, it’s something that we take for granted, and the cost tends to be negligible. You’re usually just a Google search away from a cheap pre-paid SIM card that can get you online at 3G or 4G speeds, depending on where you’re traveling (4G coverage is still spotty in some regions, and may be limited to impractical or expensive post-paid mobile plans). You can also get inexpensive portable 4G routers and modems, as well as unlocked dual-SIM phones.</p>
<p><img loading="lazy" decoding="async" class="" src="https://uploads.toptal.io/blog/image/92750/toptal-blog-image-1468228966584-84c972d0fe6b5e47c6ee879c2b860631.jpg" alt="4G/LTE is the fastest mobile broadband standard. Dozens of different standards are employed around the globe, resulting in compatibility issues." width="516" height="516" /></p>
<div class="pop_out_box is-full_width is-big">4G/LTE is the fastest mobile broadband standard. Dozens of different standards are employed around the globe, resulting in compatibility issues.</div>
<div class="tweet_this"></div>
<p>However, there are still some pitfalls to avoid.</p>
<p>Just because a device is 3G or 4G compliant, that doesn’t mean it can use <em>every</em> 3G and 4G network. In fact, the vast majority of them can’t. These are very broad standards, and telcos use different frequencies and bands in different countries. Things get exponentially more complicated if you travel overseas. Instead of explaining how and why we ended up with loads of different spectrums and standards, I’ll just suggest you do some research on your own. <a href="http://www.worldtimezone.com/4g.html" target="_blank" rel="noopener noreferrer">Here’s a good place to start</a>, and you can check out <a href="https://en.wikipedia.org/wiki/LTE_frequency_bands" target="_blank" rel="noopener noreferrer">this LTE frequency bands sheet</a> on Wikipedia while you’re at it.</p>
<p>Unfortunately, I cannot help you here, because there are too many variables in play. I could write a huge essay that still wouldn’t explain it well enough. You will have to check the frequencies and bands for every device and potential destination yourself. Once you figure out where you’re likely to travel, and which standards your mobile devices need to conform to, you can start shopping.</p>
<p>The next question is whether you really need a mobile 3G/4G router. What about a cheap phone for tethering instead?</p>
<p>Hardcore geeks and geekettes may be inclined to take the router route, just because they tend to focus on specs. Dedicated routers have a number of obvious advantages, and since this is an engineering blog, I see no point in explaining why proper routers trump smartphone tethering.</p>
<p>However, that does not mean we should dismiss unlocked dual-SIM smartphones because they have quite a few things going for them as well. In fact, they’re probably a <em>better choice for most people</em>. They tend to be cheaper, more compact and offer more functionality and flexibility. If you don’t need to connect loads of devices at once, and don’t expect to go through a few gigabytes of data a day, a simple smartphone should suffice. Your AirBnB or hotel room will have WiFi anyway to take care of “heavy” stuff.</p>
<p>There are a few points you need to consider:</p>
<ul>
<li>Are you going to travel with a few coworkers or go solo?</li>
<li>How often will you be away from WiFi access and for how long?</li>
<li>Will you even consider accommodation without broadband access?</li>
<li>Would you rather have a dedicated device or a smartphone Swiss Army Knife?</li>
<li>How much money are you willing to spend?</li>
<li>Can you live with 3G connectivity rather than full 4G speeds?</li>
</ul>
<p>Personally, I prefer backup phones over routers because I rarely find myself in a situation that would necessitate the use of a mobile router on the road. While routers look better on paper, I simply don’t need them, but that’s just my routine and may not be applicable to everyone. A good “world-mode” 4G router usually costs $200 to $300, and for that sort of money, you should be able to pick up a great backup phone. Cheaper routers are available as well, but they usually can’t deal with 4G bands, whereas most cheap phones can.</p>
<p><img loading="lazy" decoding="async" class="" src="https://uploads.toptal.io/blog/image/92751/toptal-blog-image-1468229013145-197fd1d63500aba799dc5f1f3f482731.jpg" alt="Dual-SIM phones are a good alternative to mobile routers. They are cheap, unlocked, and can prove very useful on the road." width="496" height="496" /></p>
<div class="pop_out_box is-full_width is-big">Dual-SIM phones are a good alternative to mobile routers. They are cheap, unlocked, and can prove very useful on the road.</div>
<div class="tweet_this"></div>
<p>Android phones are clearly the more frugal option, yet they can augment or even replace your primary phone in an emergency. You also end up with a lot more choice.</p>
<p>For example, you can buy a very compact phone, or an oversized design with a 5.5- to 6.5-inch screen that can double as a tablet. If you’re an avid outdoorsman, you can get a ruggedized smartphone that can take a lot of punishment and won’t die if you soak it in mud and water. Some vendors offer smartphones with oversized batteries, rated at 6000mAh or even 10000mAh. These devices are designed to double as powerbanks, allowing you to top off your iPhone or Nexus anywhere while providing tethered connectivity. However, that’s just marketing. This is why you <em>really</em> need a big battery in your cheap travel phone: 4G connectivity consumes a lot of power, especially if you are going to tether more than one device and use up a lot of bandwidth.</p>
<p>I recently bought a backup/travel phone and decided to go for a dual-SIM all-rounder: a big-brand device that doesn’t skimp on performance yet doesn’t cost much. It packs a 5.5-inch display, aluminium body, 2GB of RAM, 16GB of storage (expandable), 4000mAh battery, and a mid-range Qualcomm Snapdragon 650 processor under the hood. It’s even got a fingerprint scanner and a decent 16-megapixel Sony camera with PDAF, although these are hardly priorities for a backup device.</p>
<p>It set me back about $150. Do you think I overpaid? Because I don’t.</p>
<h2 id="getting-online-and-staying-there">Getting Online and Staying There</h2>
<p>No matter what you do and what sort of platform you prefer, you are bound to need extra power for your gadgets. This is the great equalizer between <a href="https://www.toptal.com/ios">iOS</a> and Android, Linux and Windows &#8211; all toys need a socket.</p>
<p>Luckily, the industry has done much to standardize DC chargers, so the days of worrying whether or not your device will work on a different continent are long gone. You do, however, need a multi-socket adapter if you are traveling overseas, but I guess that goes without saying. As far as smaller devices go, USB is the ubiquitous standard. All you need are the appropriate cables or adapters and you’re good to go (micro-USB on most devices, USB Type C on next-gen devices, Lightning for Apple devices).</p>
<p>It sounds simple, but there are a few things you need to keep in mind.</p>
<p>First off, <em>please don’t buy the cheapest power supply units, adapters, cables or anything that plugs into your DC port.</em> It’s just not worth the risk.</p>
<p>For example, with cheap USB cables and chargers you can face the following headaches:</p>
<ul>
<li>Lack of support for fast-charging standards, namely Qualcomm Quick Charge 2.0 and 3.0</li>
<li>Lower than declared output</li>
<li>Horrible cables incapable of handling 2 amps or more</li>
<li>Questionable reliability</li>
<li>Safety/security concerns</li>
</ul>
<p>Before Apple users start making fun of their Android counterparts and their cheap micro-USB chargers, they probably need to consider the following: Apple’s own chargers and cables tend to get the worst imaginable reviews of any Apple product, and <a href="http://www.apple.com/shop/product/MD818AM/A/lightning-to-usb-cable" target="_blank" rel="noopener noreferrer">here’s a good (or bad) example</a> of what I’m on about. So, if you want to bash non-Apple users, I suggest you just show them your MagSafe connector and you’ll win by default.</p>
<p>With chargers out of the way, let’s take a quick look at so-called powerbanks. These cheap and practical devices come in a variety of capacities and form-factors. Every self-respecting geek should have one in their travel bag, period.</p>
<p>You should be able to get a good powerbank for $20 to $40. This should be enough to get a unit with dual USB output rated at 2A or more, with capacity ranging from 10,000mAh to 20,000mAh, and Quick Charge support to boot. Many are based on 18650 batteries, so a unit with four 18650 cells on average delivers 10,000mAh, which is enough to charge an average phone three or four times. Some DIY designs also allow you to charge 18650 cells, which comes in handy if you have other devices compatible with these cells (flashlights, laser pointers, bicycle lights, and so on).</p>
<p>While many people may not be familiar with this battery standard, it’s actually been around for ages. Laptop batteries of yesteryear were basically three to eight 18650 cells soldered to each other, so chances are, you already used them without even knowing.</p>
<p>A lot of new powerbanks also support Quick Charge, USB Type-C output, while others feature integrated wireless chargers. Also, if you’re an iPhone user, or use a big-brand Android device, you should have no trouble getting ruggedized cases with an integrated battery, which will protect your device and give you an extra day of battery life.</p>
<h2 id="the-ultimate-travel-hardware-guide">The Ultimate Travel Hardware Guide</h2>
<p>Sorry, but I haven’t got one. It all depends on your needs, your hardware, and lifestyle. It would be presumptuous to assume otherwise.</p>
<p><img loading="lazy" decoding="async" class="" src="https://uploads.toptal.io/blog/image/92752/toptal-blog-image-1468229032343-e2d066946371a68f593493353830f50b.jpg" alt="Must-have gadgets for every geek backpack: check out what they can do for you." width="505" height="505" /></p>
<div class="pop_out_box is-full_width is-big">Must-have gadgets for every geek backpack: check out what they can do for you.</div>
<div class="tweet_this"></div>
<p>However, I can think of loads of inexpensive must-have items for every geek backpack.</p>
<ul>
<li>High-quality multi port USB charger</li>
<li>Extra USB cables and adapters for all your devices</li>
<li>Universal AC socket adapter (or two)</li>
<li>10,000mAh+ power bank</li>
<li>SIM card removal tool, nano-to-micro SIM adapter</li>
<li>MicroSD to SD adapter and/or compact MicroSD USB reader</li>
<li>HDMI adapter (hardware dependant)</li>
<li>Spare phone and/or mobile router</li>
<li>Spare flash drive, memory cards</li>
<li>Backup headphones</li>
<li>Bluetooth mouse with spare batteries</li>
<li>Cable and hardware travel organizer</li>
</ul>
<p>All items listed above should weigh just a few hundred grams and take up a little space in your bag, provided you organize them properly. Their overall cost, save for the spare phone or router, should be around $100. A secondary dual-SIM phone should add about $150 to the total. All of these items are readily available online, via Amazon, eBay, or Chinese e-commerce platforms like AliExpress.</p>
<p>I took the liberty of including a few bits that aren’t directly related to productivity, such as memory cards and corresponding adapters, since I assume most don’t rely solely on their smartphones for photography. I did not include toys and gadgets that many of us take to the beach, like action cameras or fitness trackers, but much of the travel hardware listed above should help you deal with them as well.</p>
<p>But what if you want a bit more? Well, having a secondary computer is always a good idea. I’m a fan of redundancy, and I hate having to sort out hardware issues on the road. At today’s prices, you just need a few hundred bucks to get a good Atom-based backup machine, provided you don’t insist on using a MacBook all the way. The same goes for smartphones. It’s always good to have a backup, but more importantly, a cheap dual-SIM phone can be used for tethering.</p>
</div>
</div>
</div>
</div>
</section>
</div>
]]></content:encoded>
					
					<wfw:commentRss>https://avp-blogs.com/2017/01/essential-gadgets-maintaining-productivity-traveling/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>8 Reasons To Use Microsoft Stack For Building Apps</title>
		<link>https://avp-blogs.com/2016/12/8-reasons-use-microsoft-stack-building-apps/</link>
					<comments>https://avp-blogs.com/2016/12/8-reasons-use-microsoft-stack-building-apps/#respond</comments>
		
		<dc:creator><![CDATA[avp]]></dc:creator>
		<pubDate>Fri, 30 Dec 2016 17:06:59 +0000</pubDate>
				<category><![CDATA[Tech]]></category>
		<category><![CDATA[microsoft]]></category>
		<category><![CDATA[microsoft developer tools]]></category>
		<category><![CDATA[microsoft framework]]></category>
		<guid isPermaLink="false">http://avp-blogs.com/?p=1229</guid>

					<description><![CDATA[Want to stick with Microsoft framework for developing new apps but not convinced? Here are some reasons to continue using it. The below article first appeared on Toptal and is reproduced in it&#8217;s entirety. Life was great for Microsoft developers 10 years ago. Companies were happy with going 100 percent Microsoft for their development projects. ...]]></description>
										<content:encoded><![CDATA[<p>Want to stick with Microsoft framework for developing new apps but not convinced? Here are some reasons to continue using it.</p>
<p><em>The below article first appeared on <a href="https://www.toptal.com/microsoft/eight-reasons-why-microsoft-stack-is-still-a-viable-choice">Toptal </a>and is reproduced in it&#8217;s entirety.</em></p>
<p>Life was great for Microsoft developers 10 years ago. Companies were happy with going 100 percent Microsoft for their development projects. With ASP.NET on the frontend, .NET middle-tier and SQL Server on the backend, things worked very well for the most part. When they didn’t, developers just accepted that as something that came with territory. Microsoft was all but running the show. Then, at the end of the last decade, Microsoft’s 800-pound gorilla status started to unravel. Maybe it was due to the introduction of the iPhone and Microsoft missing the shift to mobile, or maybe it was because of the proliferation of open source projects, but things changed, and today those same companies need to be persuaded that going with Microsoft Stack is a good idea. This article presents eight reasons in favor of sticking with the Microsoft software stack.</p>
<h2 id="reason-1-net-is-still-one-of-the-best">Reason #1: .NET is Still One of the Best</h2>
<p>Introduced more than 10 years ago, <a href="https://www.toptal.com/dot-net">.NET Framework</a> is feature-rich and thoroughly battle-tested. While it was commonplace to have to combine native development with managed code in the early days of .NET, the vast majority of development tasks are supported out of the box today. Even companies such as Oracle released components that are 100 percent .NET managed code (i.e. ODP.NET managed driver) to interface with their products. .NET API is consistent, well documented and used by millions.</p>
<p>The knowledge-base available via MSDN, StackOverflow and thousands of forums and blogs is massive. In my years of developing in .NET, I cannot recall an instance where I would get stuck for long on a framework bug; each time, someone had already experienced, researched and posted an answer, not always the answer I was hoping for, but still something that moved me forward. With the upcoming 2015 release, .NET Core will be open-source and available on non-Windows systems.</p>
<h2 id="reason-2-aspnet-has-evolved">Reason #2: ASP.NET has Evolved</h2>
<p><img loading="lazy" decoding="async" class="" src="https://assets.toptal.io/uploads/blog/image/91406/toptal-blog-image-1436860586341-cab0d8de58caf9312f76d1383a3944e3.jpg" alt="microsoft stack" width="581" height="581" /></p>
<p>Looking back at the traditional web-to-database Microsoft stack from 10 years ago, it’s interesting to see which parts survived the test of time and which parts faded away. While the back-end of the Microsoft stack remained pretty much unchanged (we still use the same set of patterns and components, such as Dependency Injection, Tasks, Linq, EF or ADO) the front-end, the ASP.NET piece, saw a fundamental shift from “do it the Microsoft way “ (i.e. Web Forms) to “do it your way and use ASP.NET as a platform.” Today, ASP.NET is an MVC-based framework featuring robust infrastructure for authentication, bundling and routing that integrates with many non-Microsoft technologies such as Bootstrap and AngularJS. ASP.NET sites look nice on a wide range of form-factors, from phones to desktops, and its Web API capabilities make exposing web services a breeze. The framework has been open-source for a number of years, so if you get stuck on a problem, the source is available on GitHub. ASP.NET has changed, and changed for the better.</p>
<h2 id="reason-3-simplicity-of-web-api-and-power-of-wcf">Reason #3: Simplicity of Web API and Power of WCF</h2>
<p><img loading="lazy" decoding="async" class="" src="https://assets.toptal.io/uploads/blog/image/91407/toptal-blog-image-1436860600598-0a28490a70c2edef51607199e924a9a6.jpg" alt="web and microsoft stack" width="566" height="566" /></p>
<p>My all-time favorite quote is from Alan Kay who said, “Simple things should be simple; complex things should be possible”. When Windows Communication Foundation (WCF) first came out in 2006, it was anything but simple; behaviors, endpoints, and bindings were overwhelming. So, Microsoft released Web API, an easy-to-use framework that makes exposing HTTP web services a piece of cake. With a few lines of configuration, your API turns into a secure, “industry-standard” web service.</p>
<p>If your use case does not fit the “standard” mold, and you need full control over how your API is exposed over the wire, you can always fall back on WCF. With the myriad of configuration options and hooks, WCF lets you custom-serialize your data, log, intercept, route message, use peer-to-peer and queuing, and much-much more. Web API, together with WCF, delivers on both tenets of Kay’s quote: if you need a simple web service, you are done in minutes with Web API; if your service requirements are complex, “all” is possible with WCF. These two technologies provide a comprehensive coverage of service scenarios and come prepackaged with the .NET framework.</p>
<h2 id="reason-4-sql-server-is-as-solid-as-ever">Reason #4: SQL Server is as Solid as Ever</h2>
<p>For many years, it seemed like the tidal wave of new development languages, frameworks and patterns came through the front and middle tiers and spared the database back-end. After all, the good old “SELECT” is still as much in use today as it was 20 years ago. I suppose this is due to the fact that many companies view their data as the core of their business, and keeping the integrity of that core far outweighs the excitement of trying “something new” at the database layer.</p>
<p>SQL Server excels at its primary role of a data keeper with a myriad of features for transactions, referential integrity, backups, mirroring and replication, but what sets SQL Server apart from competition is how well it integrates with the rest of the Microsoft stack. For rapid development, there is the Entity Framework, currently in version 6, passed adolescence and delivering well on its promise of streamlining data access. If you need computing power, the .NET Framework is loaded in-process with SQL Server, meaning you can embed .NET code as stored procedures, functions or aggregates without sacrificing performance. Pair that with the fact that SQL Server 2014 comes with in-memory tables, and you can come up with some pretty slick real-time solutions that could not be made fast enough solely with SQL and regular tables. After years in the industry, SQL Server is still on top of my list of RDBMSs.</p>
<h2 id="reason-5-its-easily-testable">Reason #5: It’s Easily Testable</h2>
<p>So many times, working in corporate IT, I saw software turning into these untouchable black boxes because there were no tests, and nobody wanted to mess with the code for fear of “breaking something else”. Then, I worked on systems that had thousands of tests, and it was a great feeling to be able to tell business that, “yes, we can make these changes,” years after software had been released. The Microsoft stack is designed with testability in mind. ASP.NET MVC has hooks for dependency injection, and in version 5, dependency injection will be included in the framework itself. In the middle tier, it’s a similar story: we use dependency injection to disassociate implementation from the interface, which lets us swap production types with mocks at test time. Even on the database side, there are SQL Server Data Tools that come with templates for testing against the stored procedure layer. Testing is an inseparable part of the software development process today, and the Microsoft stack comes well equipped for this new reality.</p>
<div class="embeddable_form-wrapper for-post" data-role="blog_subscribe" data-view="blog_subscribe#form">
<form class="embeddable_form" action="https://www.toptal.com/blog/subscription" method="post" data-entity="blog_subscription" data-remote="" data-view="form#form">
<div class="embeddable_form-step is-email_form is-current">
<div class="embeddable_form-row is-label">
<h2 class="embeddable_form-label_title"><strong>Reason #6: Elaborate Support Ecosystem</strong></h2>
</div>
</div>
</form>
</div>
<p><img loading="lazy" decoding="async" class="" src="https://assets.toptal.io/uploads/blog/image/91408/toptal-blog-image-1436860615667-54b96df1fb60239c6ae61fae2e02b638.jpg" alt="" width="557" height="557" /></p>
<p>When it comes to support, it’s nice to have a range of options, starting with community forums and ending with an actual live human being working on-site on your server. The online ecosystem for Microsoft products is one of the largest in the industry. After all, Microsoft was started by Bill Gates, a software developer himself, who saw the wide adoption by developers as the key to proliferation of Microsoft products. That meant providing these developers with lots and lots of support.</p>
<p>Microsoft was among the first to encourage its employees to blog about the technology they were working on, and while the rest of the industry has certainly caught up, the amount and the quality of instructional videos, guides and articles coming directly from Microsoft today is still very impressive. That layer of quality online content is supplemented by a large number of community-based support ecosystems such as StackOverflow, which are not as consistent when it comes to content quality, but are, nevertheless, far more helpful than not.</p>
<p>Lastly, there is always an option to pick up the phone and call Microsoft support. I rarely had to use it, but there were a handful of production emergencies when having Microsoft devs analyze core dumps saved the day. The range of support options is clearly a factor in favor for going with the Microsoft stack.</p>
<h2 id="reason-7-microsoft-sticks-to-their-products">Reason #7: Microsoft Sticks to their Products</h2>
<p>A few years back, choosing Microsoft Silverlight as the front-end for an application seemed like a valid choice, but that’s no longer the case. With the mobile trend in full swing and JavaScript frameworks dominating the front-end space, Silverlight is no longer a feasible option; nevertheless, it’s still supported by Microsoft through 2021. Microsoft sticks to its guns, which is good for those of us who have to make technology choices without having a magic eight ball to tell us what technology trend will dominate the software landscape in the future. Going with the Microsoft stack ensures that time and money is invested into technology that will be supported even if it falls out of favor with the industry.</p>
<h2 id="reason-8-visual-studio-umbrella">Reason #8: Visual Studio Umbrella</h2>
<p><img loading="lazy" decoding="async" class="" src="https://assets.toptal.io/uploads/blog/image/91409/toptal-blog-image-1436860633285-e0871eaeed76ec03872a298743f3f3d3.jpg" alt="" width="556" height="556" /></p>
<p>A decade ago, I was spending about 50 percent of my time working in Visual Studio and about 50 percent in other tools. Today, the split is overwhelmingly in favor of Visual Studio. Microsoft’s vision for Visual Studio to be a one-stop solution for hosting IDEs is coming to fruition with many Microsoft and non-Microsoft products offering some level of integration with Visual Studio. From database development with SQL Server Data Tools to writing iPad and Android apps with Xamarin, Visual Studio provides a familiar developer experience with a consistent user interface. The same can be said about working with Microsoft Azure, a cloud platform encompassing a variety of services from database hosting to mobile services.</p>
<p>Visual Studio obfuscated the complexities of distributed cloud infrastructure making the experience of developing cloud applications consistent with that of developing applications not hosted in the cloud. All the pieces seem to fit together nicely under the umbrella of Visual Studio, making the overall development process very efficient.</p>
<h2 id="microsoft-stack---the-best-of-both-worlds">Microsoft Stack &#8211; The Best of Both Worlds</h2>
<p>Today, there are far more choices for writing quality software compared to 10 years ago. That is certainly a good thing because competition forces big players, such as Google, Apple, Amazon and Microsoft, to continue to innovate and not get complacent. While Microsoft has been pushed from the top of the mountain by the tech evolution of the past decade, the company has shown that it’s willing to adapt and is attuned to realities of the current technological trends. ASP.NET embraced other technologies and methodologies, many of them open source, with the original Web Forms fading into history. The <a href="https://www.toptal.com/dot-net/dotnet-core-going-wild-and-open-source-what-took-you-so-long">.NET framework continues to evolve</a>, breaking new frontiers with libraries for multi-threading and many-core computing. With the imminent 2015 release, the core of the framework will be open-source and portable to non-Windows platforms, which is a step in the direction of inclusiveness and transparency.</p>
<p>These welcomed improvements come from a company that has long-established processes for releasing software that’s tested, documented and supported. Going with the Microsoft stack brings the excitement of working with modern languages and frameworks plus the stability of being backed by a software giant with decades of experience in the development industry. This is why I am recommending the Microsoft stack today.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://avp-blogs.com/2016/12/8-reasons-use-microsoft-stack-building-apps/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>The 10 Most Common Mistakes In WordPress Development</title>
		<link>https://avp-blogs.com/2016/10/topmistakeswordpressdev/</link>
					<comments>https://avp-blogs.com/2016/10/topmistakeswordpressdev/#respond</comments>
		
		<dc:creator><![CDATA[avp]]></dc:creator>
		<pubDate>Sun, 30 Oct 2016 04:06:21 +0000</pubDate>
				<category><![CDATA[Tech]]></category>
		<category><![CDATA[common wordpress developer mistakes]]></category>
		<category><![CDATA[wordpress]]></category>
		<category><![CDATA[wordpress developer tips]]></category>
		<category><![CDATA[wordpress development]]></category>
		<guid isPermaLink="false">http://avp-blogs.com/?p=1218</guid>

					<description><![CDATA[The below article describes the most common mistakes made during WordPress development and how to fix them. This tutorial first appeared in TopTal and reproduced in it&#8217;s entirety. We are only human, and one of the traits of being a human is that we make mistakes. On the other hand, we are also self-correcting, meaning ...]]></description>
										<content:encoded><![CDATA[<p><em>The below article describes the most common mistakes made during WordPress development and how to fix them. This tutorial first appeared in <a href="https://www.toptal.com/">TopTal</a> and reproduced in it&#8217;s entirety.</em></p>
<p>We are only human, and one of the traits of being a human is that we make mistakes. On the other hand, we are also self-correcting, meaning we tend to learn from our mistakes and hopefully are thereby able to avoid making the same ones twice. A lot of the mistakes I have made in the WordPress realm originate from trying to save time when implementing solutions. However, these would typically rear their heads down the road when issues would crop up as a result of this approach. Making mistakes is inevitable. However, learning from other people’s oversights (and your own of course!) is a road you should proactively take.</p>
<p><img loading="lazy" decoding="async" class="alignnone " src="https://assets.toptal.io/uploads/blog/image/121148/toptal-blog-image-1473346255146-be87e01c6f10f15e58358d278acbf2c5.jpg" alt="" width="585" height="585" /></p>
<h2>Common Mistake #1: Keeping the Debugging Off</h2>
<p>Why should I use debugging when my code is working fine? Debugging is a feature built into WordPress that will cause all PHP errors, warnings, and notices (about deprecated functions, etc.) to be displayed. When debugging is turned off, there may be important warnings or notices being generated that we never see, but which might cause issues later if we don’t deal with them in time. We want our code to play nicely with all the other elements of our site. So, when adding any new custom code to WordPress, you should always do your development work with debugging turned on (but make sure to turn it off before deploying the site to production!).</p>
<p>To enable this feature, you’ll need to edit the wp-config.php file in the root directory of your WordPress install. Here is a snippet of a typical file:</p>
<p>[cc lang=&#8221;php&#8221;]</p>
<p>// Enable debugging<br />
define(&#8216;WP_DEBUG&#8217;, true);</p>
<p>// Log all errors to a text file located at /wp-content/debug.log<br />
define(&#8216;WP_DEBUG_LOG&#8217;, true);</p>
<p>// Don’t display error messages write them to the log file /wp-content/debug.log<br />
define(&#8216;WP_DEBUG_DISPLAY&#8217;, false);</p>
<p>// Ensure all PHP errors are written to the log file and not displayed on screen<br />
@ini_set(&#8216;display_errors&#8217;, 0);</p>
<p>[/cc]<br />
This is not an exhaustive list of configuration options that can be used, but this suggested setup should be sufficient for most debugging needs.</p>
<h2>Common Mistake #2: Adding Scripts and Styles Using wp_head Hook</h2>
<p>What is wrong with adding the scripts into my header template? WordPress already includes a plethora of popular scripts. Still, many developers will add additional scripts using the wp_head hook. This can result in the same script, but a different version, being loaded multiple times.</p>
<p>Enqueuing here comes to the rescue, which is the WordPress friendly way of adding scripts and styles to our website. We use enqueuing to prevent plugin conflicts and handle any dependencies a script might have. This is achieved by using the inbuilt functions wp_enqueue_script or wp_enqueue_style to enqueue scripts and styles respectively. The main difference between the two functions is that with wp_enqueue_script we have an additional parameter that allows us to move the script into the footer of the page.</p>
<p>[cc lang=&#8221;php&#8221;]</p>
<p>wp_register_script( $handle, $src, $deps = array(), $ver = false, $in_footer = false )<br />
wp_enqueue_script( $handle, $src = false, $deps = array(), $ver = false, $in_footer = false )</p>
<p>wp_register_style( $handle, $src, $deps = array(), $ver = false, $media = &#8216;all&#8217; )<br />
wp_enqueue_style( $handle, $src = false, $deps = array(), $ver = false, $media = &#8216;all&#8217; )</p>
<p>[/cc]<br />
If the script is not required to render content above the fold, we can safely move it to the footer to make sure the content above the fold loads quickly. It’s good practice to register the script first before enqueuing it, as this allows others to deregister your script via the handle in their own plugins, without modifying the core code of your plugin. In addition to this, if the handle of a registered script is listed in the array of dependencies of another script that has been enqueued, that script will automatically be loaded prior to loading that highlighted enqueued script.</p>
<h2>Common Mistake #3: Avoiding Child Themes and Modifying WordPress Core Files</h2>
<p>Always create a child theme if you plan on modifying a theme. Some developers will make changes to the parent theme files only to discover after an upgrade to the theme that their changes have been overwritten and lost forever.</p>
<p>To create a child theme, place a style.css file in a subdirectory of the child theme’s folder, with the following content:</p>
<p>[cc lang=&#8221;php&#8221;]</p>
<p>/*<br />
Theme Name: Twenty Sixteen Child<br />
Theme URI: http://example.com/twenty-fifteen-child/<br />
Description: Twenty Fifteen Child Theme<br />
Author: John Doe<br />
Author URI: http://example.com<br />
Template: twentysixteen<br />
Version: 1.0.0<br />
License: GNU General Public License v2 or later<br />
License URI: http://www.gnu.org/licenses/gpl-2.0.html<br />
Tags: light, dark, two-columns, right-sidebar, responsive-layout, accessibility-ready<br />
Text Domain: twenty-sixteen-child<br />
*/</p>
<p>[/cc]<br />
The above example creates a child theme based on the default WordPress theme, Twenty Sixteen. The most important line of this code is the one containing the word “Template” which must match the directory name of the parent theme you are cloning the child from.</p>
<p>The same principles apply to WordPress core files: Don’t take the easy route by modifying the core files. Put in that extra bit of effort by employing WordPress pluggable functions and filters to prevent your changes from being overwritten after a WordPress upgrade. Pluggable functions let you override some core functions, but this method is slowly being phased out and replaced with filters. Filters achieve the same end result and are inserted at the end of WordPress functions to allow their output to be modified. A trick is always to wrap your functions with if ( !function_exists() ) when using pluggable functions since multiple plugins trying to override the same pluggable function without this wrapper will produce a fatal error.</p>
<h2>Common Mistake #4: Hardcoding Values</h2>
<p>Often it looks quicker to just hardcode a value (such as a URL) somewhere in the code, but the time spent down the road debugging and rectifying issues that arise as a result of this is far greater. By using the corresponding function to generate the desired output dynamically, we greatly simplify subsequent maintenance and debugging of our code. For example, if you migrate your site from a test environment to production with hardcoded URLs, all of a sudden you’ll notice your site it is not working. This is why we should employ functions, like the one listed below, for generating file paths and links:</p>
<p>[cc lang=&#8221;php&#8221;]</p>
<p>// Get child theme directory uri<br />
stylesheet_directory_uri();<br />
// Get parent theme directory<br />
get_template_directory_uri();<br />
// Retrieves url for the current site<br />
site_url();</p>
<p>[/cc]<br />
Another bad example of hardcoding is when writing custom queries. For example, as a security measure, we change the default WordPress datatable prefix from wp_ to something a little more unique, like wp743_. Our queries will fail if we ever move the WordPress install, as the table prefixes can change between environments. To prevent this from happening, we can reference the table properties of the wpdb class:</p>
<p>[cc lang=&#8221;php&#8221;]</p>
<p>global $wpdb;<br />
$user_count = $wpdb-&gt;get_var( &#8220;SELECT COUNT(*) FROM $wpdb-&gt;users&#8221; );</p>
<p>[/cc]<br />
Notice how I am not using the value wp_users for the table name, but instead, I’m letting WordPress work it out. Using these properties for generating the table names will help ensure that we return the correct results.</p>
<h2>Common Mistake #5: Not Stopping Your Site From Being Indexed</h2>
<p>Why wouldn’t I want search engines to index my site? Indexing is good, right? Well, when building a website, you don’t want search engines to index your site until you have finished building it and have established a permalink structure. Furthermore, if you have a staging server where you test site upgrades, you don’t want search engines like Google indexing these duplicate pages. When there are multiple pieces of indistinguishable content, it is difficult for search engines to decide which version is more relevant to a search query. Search engines will in such cases penalize sites with duplicate content, and your site will suffer in search rankings as a result of this.</p>
<p>As shown below, WordPress Reading Settings has a checkbox that reads “Discourage search engines from indexing this site”, although this does have an important-to-note underneath stating that “It is up to search engines to honor this request”.</p>
<p><img loading="lazy" decoding="async" class="alignnone " src="https://assets.toptal.io/uploads/blog/image/121146/toptal-blog-image-1473090685498-bd9b4071dbd51b9527b5428feb1792d7.jpg" alt="" width="559" height="364" /></p>
<p>WordPress Reading Settings</p>
<p>Bear in mind that search engines often do not honor this request. Therefore, if you want to reliably prevent search engines from indexing your site, edit your .htaccess file and insert the following line:</p>
<p>[cc lang=&#8221;php&#8221;]</p>
<p>Header set X-Robots-Tag &#8220;noindex, nofollow&#8221;<br />
Common Mistake #6: Not Checking if a Plugin is Active</p>
<p>[/cc]</p>
<p>Why should I check if a plugin function exists if my plugin is always switched on? For sure, 99% of the time your plugin will be active. However, what about that 1% of the time when for some reason it has been deactivated? If and when this occurs, your website will probably display some ugly PHP errors. To prevent this, we can check to see if the plugin is active before we call its functions. If the plugin function is being called via the front-end, we need to include the plugin.php library in order to call the function is_plugin_active():</p>
<p>[cc lang=&#8221;php&#8221;]</p>
<p>include_once( ABSPATH . &#8216;wp-admin/includes/plugin.php&#8217; );<br />
if ( is_plugin_active( &#8216;plugin-folder/plugin-main-file.php&#8217; ) ) {<br />
// Run plugin code<br />
}</p>
<p>[/cc]<br />
This technique is usually quite reliable. However, there could be instances where the author has changed the main plugin directory name. A more robust method would be to check for the existence of a class in the plugin:</p>
<p>[cc lang=&#8221;php&#8221;]</p>
<p>if( class_exists( ‘WooCommerce’ ) ) {<br />
// The plugin WooCommerce is turned on<br />
}</p>
<p>[/cc]<br />
Authors are less likely to change the name of a plugin’s class, so I would generally recommend using this method.</p>
<h2>Common Mistake #7: Loading Too Many Resources</h2>
<p>Why should we be selective in loading plugin resources for pages? There is no valid reason to load styles and scripts for a plugin if that plugin is not used on the page that the user has navigated to. By only loading plugin files when necessary, we can reduce our page loading time, which will result in an improved end user experience. Take, for example, a WooCommerce site, where we only want the plugin to be loaded on our shopping pages. In such a case, we can selectively remove any files from being loaded on all the other sites pages to reduce bloating. We can add the following code to the theme or plugin’s functions.php file:</p>
<p>[cc lang=&#8221;php&#8221;]</p>
<p>function load_woo_scripts_styles(){</p>
<p>if( function_exists( &#8216;is_woocommerce&#8217; ) ){<br />
// Only load styles/scripts on Woocommerce pages<br />
if(! is_woocommerce() &amp;&amp; ! is_cart() &amp;&amp; ! is_checkout() ) {</p>
<p>// Dequeue scripts.<br />
wp_dequeue_script(&#8216;woocommerce&#8217;);<br />
wp_dequeue_script(&#8216;wc-add-to-cart&#8217;);<br />
wp_dequeue_script(&#8216;wc-cart-fragments&#8217;);</p>
<p>// Dequeue styles.<br />
wp_dequeue_style(&#8216;woocommerce-general&#8217;);<br />
wp_dequeue_style(&#8216;woocommerce-layout&#8217;);<br />
wp_dequeue_style(&#8216;woocommerce-smallscreen&#8217;);</p>
<p>}<br />
}<br />
}</p>
<p>add_action( &#8216;wp_enqueue_scripts&#8217;, &#8216;load_woo_scripts_styles&#8217;);</p>
<p>[/cc]<br />
Scripts can be removed with the function wp_dequeue_script($handle) via the handle with which they were registered. Similarly, wp_dequeue_style($handle) will prevent stylesheets from being loaded. However, if this is too challenging for you to implement, you can install the Plugin Organizer that provides the ability to load plugins selectively based on certain criteria, such as a post type or page name. It’s a good idea to disable any caching plugins, like W3Cache, that you may have switched on to stop you from having to refresh the cache constantly to reflect any changes you have made.</p>
<h2>Common Mistake #8: Keeping the Admin Bar</h2>
<p>Can’t I just leave the WordPress Admin Bar visible for everyone? Well, yes, you could allow your users access to the admin pages. However, these pages very often do not visually integrate with your chosen theme and don’t provide a seamless integration. If you want your site to look professional, you should disable the Admin Bar and provide a front-end account management page of your own:</p>
<p>[cc lang=&#8221;php&#8221;]</p>
<p>add_action(&#8216;after_setup_theme&#8217;, &#8216;remove_admin_bar&#8217;);</p>
<p>function remove_admin_bar() {<br />
if (!current_user_can(&#8216;administrator&#8217;) &amp;&amp; !is_admin()) {<br />
show_admin_bar(false);<br />
}<br />
}</p>
<p>[/cc]<br />
The above code, when copied into your theme’s functions.php file will only display the Admin Bar for administrators of the site. You can add any of the WordPress user roles or capabilities into the current_user_can($capability) function to exclude users from seeing the admin bar.</p>
<h2>Common Mistake #9: Not Utilizing the GetText Filter</h2>
<p>I can use CSS or JavaScript to change the label of a button, what’s wrong with that? Well, yes, you can. However, you’re adding superfluous code and extra time to render the button, when you can instead use one of the handiest filters in WordPress, called gettext. In conjunction with a plugin’s textdomain, a unique identifier that ensures WordPress can distinguish between all loaded translations, we can employ the gettext filter to modify the text before the page is rendered. If you search the source code for the function load_plugin_textdomain($domain), it will give you the domain name we need to override the text in question. Any reputable plugin will ensure that the textdomain for a plugin is set on initialization of the plugin. If it’s some text in a theme that you want to change, search for the load_theme_textdomain($domain) line of code. Using WooCommerce once again as an example, we can change the text that appears for the “Related Products” heading. Insert the following code into your theme’s functions.php file:</p>
<p>[cc lang=&#8221;php&#8221;]</p>
<p>function translate_string( $translated_text, $untranslated_text, $domain ) {<br />
if ( $translated_text == &#8216;Related Products&#8217;) {<br />
$translated_text = __( &#8216;Other Great Products&#8217;, &#8216;woocommerce&#8217; );<br />
}<br />
return $translated_text;<br />
}</p>
<p>add_filter( &#8216;gettext&#8217;, &#8216;translate_string&#8217;, 15, 3 );</p>
<p>[/cc]<br />
This filter hook is applied to the translated text by the internationalization functions __() and _e(), as long as the textdomain is set via the aforementioned functions.</p>
<p>[cc lang=&#8221;php&#8221;]</p>
<p>_e( &#8216;Related Products&#8217;, &#8216;woocommerce&#8217; );</p>
<p>[/cc]<br />
Search your plugins for these internationalization functions to see what other strings you can customize.</p>
<h2>Common Mistake #10: Keeping the Default Permalinks</h2>
<p>By default, WordPress uses a query string with the post’s ID to return the specified content. However, this is not user-friendly and users may remove pertinent parts of the URL when copying it. More importantly, these default permalinks do not use a search engine friendly structure. Enabling what we call “pretty” permalinks will ensure our URLs contain relevant keywords from the post title to improve performance in search engine rankings. It can be quite a daunting task having to retrospectively modify your permalinks, especially if your site has been running for a significant period of time, and you’ve got hundreds of posts already indexed by search engines. So after you’ve installed WordPress, ensure you promptly change your permalinks structure to something a little more search engine friendly than just a post ID. I generally use the post name for the majority of sites I build, but you can customize the permalink to whatever format you like using the available <a href="https://codex.wordpress.org/Using_Permalinks">permalink structure tags</a>.</p>
<p><img loading="lazy" decoding="async" class="alignnone " src="https://assets.toptal.io/uploads/blog/image/121145/toptal-blog-image-1473090647255-589ca439f39b957b0915a0a8156777aa.jpg" alt="" width="621" height="255" /></p>
<p>WordPress Permalink Settings</p>
<p>Conclusion</p>
<p>This article is by no means an exhaustive list of mistakes made by <a href="https://www.toptal.com/wordpress">WordPress developers</a>. If there’s one thing you should take away from this article, though, it’s that you should never take shortcuts (and that’s true in any development platform, not just in WordPress!). Time saved now by poor programming practices will come back to haunt you later. Feel free to share with us some mistakes that you have made in the past – and more importantly any lessons learned – by leaving a comment below.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://avp-blogs.com/2016/10/topmistakeswordpressdev/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>WordPress Development Tips And Best Practices</title>
		<link>https://avp-blogs.com/2016/09/wordpress-development-tips-best-practices/</link>
					<comments>https://avp-blogs.com/2016/09/wordpress-development-tips-best-practices/#respond</comments>
		
		<dc:creator><![CDATA[avp]]></dc:creator>
		<pubDate>Mon, 05 Sep 2016 12:20:47 +0000</pubDate>
				<category><![CDATA[Blogging]]></category>
		<category><![CDATA[how to develop efficient wordpress plugins and themes]]></category>
		<category><![CDATA[wordpress]]></category>
		<category><![CDATA[wordpress developer tips]]></category>
		<guid isPermaLink="false">http://avp-blogs.com/?p=1196</guid>

					<description><![CDATA[Here are some tips on efficient WordPress development by experienced developers to get the most out of your WordPress powered websites and blogs. This article first appeared on Toptal and reproduced in it&#8217;s entirety. WordPress is easily the most powerful open source blogging and content management system available online today, and so working knowledge of ...]]></description>
										<content:encoded><![CDATA[<p><em>Here are some tips on efficient WordPress development by experienced developers to get the most out of your WordPress powered websites and blogs. This <a href="https://www.toptal.com/wordpress/tips-and-practices">article</a> first appeared on <a href="https://www.toptal.com/">Toptal </a>and reproduced in it&#8217;s entirety.</em></p>
<p>WordPress is easily the most powerful open source blogging and content management system available online today, and so working knowledge of its intricacies is a boon to any developer or designer resume.</p>
<p>This resource contains a collection of WordPress development best practices and WordPress development tips provided by our Toptal network members. As such, this page will be updated on a regular basis to include additional information and cover emerging techniques. This is a community driven project, so you are encouraged to contribute as well, and we are counting on your feedback.</p>
<p>Check out the Toptal <a href="https://www.toptal.com/resources">resource pages</a> for additional information on WordPress development; there is a WordPress developer <a href="https://www.toptal.com/wordpress#hiring-guide">hiring guide</a> and WordPress developer <a href="https://www.toptal.com/wordpress/interview-questions">interview questions</a>.</p>
<p>Also, <a href="https://www.reviews.com/web-hosting/">here</a> is a detailed guide on selecting web hosts based on various parameters like customer support, types of web hosting offered, technical reliability and ease of use.</p>
<h2>Use Child Themes and Plugins</h2>
<p>A lot of newcomers to WordPress dive right in and start modifying their core theme files. This is a definite mistake. All of your changes will disappear right after an upgrade, and since plugins and themes are updated about as often as apps on your phone, this is pretty frequently.</p>
<p>To avoid this, create children of your plugins and themes. Not only will you preserve your changes, you can upgrade on your own time. The same steps used to create a child theme can be applied to creating a child plugin, but let’s use creating a child theme as our example.</p>
<p>To get started making your child theme, create a new folder in your themes folder with a unique name, then create a style.css file in your new folder.</p>
<p>In WordPress, all theme parameters are stored in the style.css file as the first comment block. Open the style.css from your original theme, the parent, to see an example of this.</p>
<p>For your child theme, go ahead and copy that comment block from your original theme’s style.css to the new file and rename it. Adding the template parameter to this header will link your new theme to the original. The Template parameter should point to the folder name of the original theme, like so:</p>
<p>[cc lang=&#8221;css&#8221;]<br />
/*Theme Name: Twenty Fourteen Child Theme<br />
Description: My new child theme based on Twenty Fourteen<br />
Template: twentyfourteen<br />
Version: 1.0<br />
*/<br />
[/cc]</p>
<p>Now, if you want to modify files of the original theme, copy them from the original theme’s folder and paste them into your child theme folder. WordPress will use original template files unless it sees the same file in your child theme. So if you want to make changes to header.php, copy it from your original theme into your new child theme folder, and make the changes in the copy. For adding new or modified code, you likewise create a new functions file in your child theme and make your changes there.</p>
<div data-view="content#body">
<p>This same file copying strategy goes for many plugins as well: create a folder with the same name as a plugin inside your child theme, and then adhering to the file structure of the original plugin folder, copy files from the original plugin to your new folder and modify them. Most major plugins support this, but it’s always good to check with the author if you are not sure.</p>
</div>
<div class="tip_category_contributors">
<div data-view="content#body">
<h2>Speed Things Up with Caching</h2>
<p>WordPress optimized hosting services such as <a href="https://www.siteground.com/" target="_blank" rel="noopener noreferrer">Siteground</a>, or the more expensive <a href="https://wpengine.com/" target="_blank" rel="noopener noreferrer">Wpengine</a>, automatically support WordPress caching. If your host is one that has WordPress specific caching available, it’s the best option.</p>
<p>For those running on a VPS server with root access, Google PageSpeed is a turn key caching and optimization solution by Google that works with Apache and nginx. If that’s of interest to you, check out this guide on how to <a href="https://fabriceleven.com/dev/how-to-install-google-pagespeed-in-parallels/" target="_blank" rel="noopener noreferrer">install PageSpeed on Plesk with CentOS</a>.</p>
<p>If all of that sounds like too much work, then go with Cloudflare, a free CDN/Firewall/Caching and minification system.</p>
<p>Speaking of minification, minify your files yourself during development. Third party tools tend to break things more often than not, especially during upgrades. Doing it yourself gives you more control and awareness of when and where things go wrong.</p>
</div>
<div class="tip_category_contributors">
<div data-view="content#body">
<h2>Pay Attention to Security</h2>
<p>WordPress’s popularity makes it a high priority target for hackers. If you don’t update often, you are pretty much asking to get your site hacked.</p>
<p>Automatic updates are a little too dangerous for users with a lot of customizations and plugins, which is why I strongly suggest installing some sort of security plugin.</p>
<p>I personally recommend <a href="https://wordpress.org/plugins/better-wp-security/" target="_blank" rel="noopener noreferrer">iTheme Security</a>, which implements security options like a password lockout and file monitoring. And <a href="https://wordpress.org/plugins/wordfence/" target="_blank" rel="noopener noreferrer">Wordfence Security</a>, a WordPress specific firewall for your site.</p>
</div>
<div></div>
<div>
<div data-view="content#body">
<h2>Three Developer Tools to Make Life Easier</h2>
<p>WordPress has many plugins and add-ons to make your developer life a lot easier. In particular, I recommend:</p>
<h4 id="wp-cli">WP-Cli</h4>
<p><a href="https://wp-cli.org/" target="_blank" rel="noopener noreferrer">WP-Cli</a> lets you work with WordPress using the command line. With this great tool you can upgrade and downgrade WordPress in seconds, as well as update plugins. Notably, when you find yourself migrating to a different server, the built in search-replace command will take care of all the url changes for you, and it’s worth installing it simply because of that.</p>
<h4 id="advanced-database-cleaner">Advanced Database Cleaner</h4>
<p>The <a href="https://wordpress.org/plugins/advanced-database-cleaner/" target="_blank" rel="noopener noreferrer">Advanced Database Cleaner</a> plugin cleans out spam comments, built in revisions, and transients. You can even set up tasks to run automatically.</p>
<h4 id="query-monitor">Query Monitor</h4>
<p>When things are running slowly and you’re not sure what to blame, <a href="https://wordpress.org/plugins/query-monitor/" target="_blank" rel="noopener noreferrer">Query Monitor</a> lets you see what queries are taking too long to execute, as well as show you PHP warnings and errors.</p>
</div>
<h2> Don&#8217;t Overdose on Plugins</h2>
<div>
<div data-view="content#body">
<p>Yes, WordPress has tons of plugins, but that doesn’t mean you should install them all. The more plugins you have, the bulkier your site and the slower your loading times, so don’t use plugins unless absolutely necessary. If you only need to add a few custom fields to your posts (a functionality already included in WordPress) don’t overengineer the solution by installing the advanced custom field plugin, <a href="https://wordpress.org/plugins/advanced-custom-fields/" target="_blank" rel="noopener noreferrer">ACF</a>.</p>
<p>If you must use a lot of plugins, make sure you have <a href="https://wordpress.org/plugins/plugin-organizer/" target="_blank" rel="noopener noreferrer">Plugin Organizer</a> installed to manage them. This great plugin lets you specify what plugins are activated on which pages (you can even use regular expressions), and this selective loading will significantly speed up your site.</p>
<p>You can also use tools like <a href="https://wordpress.org/plugins/p3-profiler/" target="_blank" rel="noopener noreferrer">P3 (Plugin Performance Profiler)</a> to see what plugins are taking up most of your precious resources.</p>
</div>
<div>
<div data-view="content#body">
<h2>Spring Clean Your WordPress Functions</h2>
<p>Although great, WordPress comes out of the box with a lot of things that cannot be turned off in the settings. Here are a handful of steps to take any fresh WordPress install and make it more secure and perform better:</p>
<h3 id="remove-the-wordpress-version">Remove the WordPress Version</h3>
<p>Get rid of the WordPress version number to make your site harder to be identified by hackers. To do this, add the following to your functions.php file:</p>
<p>[cc lang=&#8221;php&#8221;]<br />
add_filter( &#8216;the_generator&#8217;, &#8216;__return_null&#8217; );<br />
[/cc]</p>
<h3 id="remove-script-versions">Remove Script Versions</h3>
<p>Get rid of the version number after scripts. By default, WordPress adds versions to all your scripts. This can lead to issues with caching/minification plugins, as well as helps hackers identify your site better. To prevent this functionality, add the following code to your theme functions file:</p>
<p>[cc lang=&#8221;php&#8221;]<br />
function remove_cssjs_ver( $src ) {<br />
if( strpos( $src, &#8216;?ver=&#8217; ) )<br />
$src = remove_query_arg( &#8216;ver&#8217;, $src );<br />
return $src;<br />
}<br />
add_filter( &#8216;style_loader_src&#8217;, &#8216;remove_cssjs_ver&#8217;, 1000 );<br />
add_filter( &#8216;script_loader_src&#8217;, &#8216;remove_cssjs_ver&#8217;, 1000 );<br />
[/cc]</p>
<h3 id="restrict-woocommerce">Restrict WooCommerce</h3>
<p>Did you install WooCommerce, and now the site is running slowly? Adding this function to your functions.phpwill prevent WooCommerce from loading its scripts on non-WooCommerce pages:</p>
<p>[cc lang=&#8221;javascript&#8221;]<br />
/**<br />
* Tweak WooCommerce styles and scripts.<br />
* Original credit goes to Greg from: https://gist.github.com/gregrickaby/2846416<br />
*/<br />
function grd_woocommerce_script_cleaner() {</p>
<p>// Remove the generator tag, to reduce WooCommerce based hacking attacks<br />
remove_action( &#8216;wp_head&#8217;, array( $GLOBALS[&#8216;woocommerce&#8217;], &#8216;generator&#8217; ) );<br />
// Unless we&#8217;re in the store, remove all the scripts and junk!<br />
if ( ! is_woocommerce() &amp;&amp; ! is_cart() &amp;&amp; ! is_checkout() ) {<br />
wp_dequeue_style( &#8216;woocommerce_frontend_styles&#8217; );<br />
wp_dequeue_style( &#8216;woocommerce-general&#8217;);<br />
wp_dequeue_style( &#8216;woocommerce-layout&#8217; );<br />
wp_dequeue_style( &#8216;woocommerce-smallscreen&#8217; );<br />
wp_dequeue_style( &#8216;woocommerce_fancybox_styles&#8217; );<br />
wp_dequeue_style( &#8216;woocommerce_chosen_styles&#8217; );<br />
wp_dequeue_style( &#8216;woocommerce_prettyPhoto_css&#8217; );<br />
wp_dequeue_style( &#8216;select2&#8217; );<br />
wp_dequeue_script( &#8216;wc-add-payment-method&#8217; );<br />
wp_dequeue_script( &#8216;wc-lost-password&#8217; );<br />
wp_dequeue_script( &#8216;wc_price_slider&#8217; );<br />
wp_dequeue_script( &#8216;wc-single-product&#8217; );<br />
wp_dequeue_script( &#8216;wc-add-to-cart&#8217; );<br />
wp_dequeue_script( &#8216;wc-cart-fragments&#8217; );<br />
wp_dequeue_script( &#8216;wc-credit-card-form&#8217; );<br />
wp_dequeue_script( &#8216;wc-checkout&#8217; );<br />
wp_dequeue_script( &#8216;wc-add-to-cart-variation&#8217; );<br />
wp_dequeue_script( &#8216;wc-single-product&#8217; );<br />
wp_dequeue_script( &#8216;wc-cart&#8217; );<br />
wp_dequeue_script( &#8216;wc-chosen&#8217; );<br />
wp_dequeue_script( &#8216;woocommerce&#8217; );<br />
wp_dequeue_script( &#8216;prettyPhoto&#8217; );<br />
wp_dequeue_script( &#8216;prettyPhoto-init&#8217; );<br />
wp_dequeue_script( &#8216;jquery-blockui&#8217; );<br />
wp_dequeue_script( &#8216;jquery-placeholder&#8217; );<br />
wp_dequeue_script( &#8216;jquery-payment&#8217; );<br />
wp_dequeue_script( &#8216;jqueryui&#8217; );<br />
wp_dequeue_script( &#8216;fancybox&#8217; );<br />
wp_dequeue_script( &#8216;wcqi-js&#8217; );</p>
<p>}<br />
}<br />
add_action( &#8216;wp_enqueue_scripts&#8217;, &#8216;grd_woocommerce_script_cleaner&#8217;, 99 );</p>
<p>[/cc]</p>
<h3 id="enable-shortcodes-in-a-widget-area">Enable Shortcodes in a Widget Area</h3>
<p>Trying to use shortcodes in a widget area and getting nothing? Drop this in into functions.php to use shortcodes in widget areas:<br />
[cc lang=&#8221;php&#8221;]<br />
add_filter(&#8216;widget_text&#8217;, &#8216;do_shortcode&#8217;);<br />
[/cc]</p>
<div></div>
<div data-view="content#body">
<h2>Use a Function to Load Scripts and CSS</h2>
<p>WordPress already keeps track of all the scripts and CSS that it has loaded, so instead of adding your JS and CSS into a header or footer, let WordPress handle it with its enqueue functionality. This way WordPress will keep dependencies in check and you will avoid potential conflicts. You add enqueue methods to your theme’s function.php file: wp_enqueue_script() or wp_enqueue_style(), respectively. Here is an example with some explanatory comments:</p>
<p>[cc lang=&#8221;javascript&#8221;]</p>
<p>function add_theme_scripts() {<br />
//example script from CDN, true means our script will be in the footer.<br />
wp_enqueue_script( &#8216;particles&#8217;, &#8216;//cdn.jsdelivr.net/particles.js/2.0.0/particles.min.js&#8217;, array(), null, true );<br />
});</p>
<p>//All referred to when to load your style like: &#8216;screen&#8217;, &#8216;print&#8217; or &#8216;handheld.<br />
wp_enqueue_style( &#8216;slider&#8217;, get_template_directory_uri() . &#8216;/css/slider.css&#8217;,false, null,&#8217;all&#8217;);</p>
<p>//this will actually execute our function above<br />
add_action( &#8216;wp_enqueue_scripts&#8217;, &#8216;add_theme_scripts&#8217; );</p>
<p>[/cc]</p>
<p><a href="https://developer.wordpress.org/themes/basics/including-css-javascript/" target="_blank" rel="noopener noreferrer">WordPress.org’s Theme Handbook</a> further explains the many parameters to an enqueue method, but here’s the method signature for both enqueue methods:</p>
<p>[cc lang=&#8221;php&#8221;]<br />
wp_enqueue_style($handle, $src, $deps, $ver, $media );<br />
wp_enqueue_script($handle, $src, $deps, $ver, $in_footer);<br />
[/cc]</p>
<p>As you can see, the only difference between these two methods is the final parameter. For wp_enqueue_style(), the last parameter sets the media for which this stylesheet has been defined. Such as screen (computer), print (print preview mode), handheld, and so on. The last parameter for wp_enqueue_script() specifies whether or not the script should be loaded in the footer.</p>
<p>Here’s a breakdown for the other parameters in our example:</p>
<ul>
<li>$handle is the name of the stylesheet, which can be anything you’d like.</li>
<li>$src is where the stylesheet is located (CDN, local, etc). This is the only required parameter.</li>
<li>$deps stands for dependencies. When passed a stylesheet handle, it will load it before executing the source script. When $deps is passed in wp_enqueue_script(), it’s an array.</li>
<li>$ver sets the version number.</li>
<li>$media is the wp_enqueue_style() only parameter. It specifies which type of display media the stylesheet is designed for, such as ‘all’, ‘screen’, ‘print’ or ‘handheld.’</li>
<li>$in_footer is the wp_enqueue_script()’s only parameter, a boolean that allows you to place your scripts in the footer of your HTML rather than in the header, which means it will not delay the loading of the DOM tree.</li>
</ul>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
]]></content:encoded>
					
					<wfw:commentRss>https://avp-blogs.com/2016/09/wordpress-development-tips-best-practices/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>ARM Servers v/s X86 Servers &#8211; A Design Consideration For Data Centres</title>
		<link>https://avp-blogs.com/2016/08/arm-servers-vs-x86-servers-design-consideration-data-centres/</link>
					<comments>https://avp-blogs.com/2016/08/arm-servers-vs-x86-servers-design-consideration-data-centres/#respond</comments>
		
		<dc:creator><![CDATA[avp]]></dc:creator>
		<pubDate>Tue, 09 Aug 2016 09:44:40 +0000</pubDate>
				<category><![CDATA[Tech]]></category>
		<category><![CDATA[arm servers v/s x86 servers]]></category>
		<category><![CDATA[datacentre design considerations]]></category>
		<category><![CDATA[server engineering]]></category>
		<guid isPermaLink="false">http://avp-blogs.com/?p=1189</guid>

					<description><![CDATA[Are ARM Servers the new paradigm shift for datacentre designs? The below article from Toptal explains the X86 servers v/s ARM servers as a design consideration for modern datacentres. &#160; I am getting old. Back in my day, if you wanted top notch CPU performance, you had to go with a high-end x86 chip, or, ...]]></description>
										<content:encoded><![CDATA[<p><em>Are ARM Servers the new paradigm shift for datacentre designs? The below <a href="https://www.toptal.com/back-end/arm-servers-armv8-for-datacentres">article</a> from <a href="https://www.toptal.com/">Toptal</a> explains the X86 servers v/s ARM servers as a design consideration for modern datacentres.</em></p>
<p>&nbsp;</p>
<p>I am getting old. Back in my day, if you wanted top notch CPU performance, you had to go with a high-end x86 chip, or, if you had deeper pockets, you could get something exotic, like a PowerPC system. The industry’s dependence on x86 processors appeared to be increasing, not declining.</p>
<p>Ten years ago, Apple joined the x86 club, and this prompted many observers to conclude the era of non-x86 processors in the mass market was over. Just a few years later, they had to eat their words, and yet again, Apple had something to do with it. ARM servers are coming, and they could revitilise the server industry.</p>
<h2 id="rethinking-processor-design">Rethinking Processor Design</h2>
<p>As the paradigm shifted and mainstream users embraced smartphones and tablets, it quickly became apparent that x86 chips from Intel, AMD, and VIA, simply weren’t up to the task. While x86 was the most prolific instruction set on the planet, it wasn’t a good choice for mobile devices for a number of reasons. In fact, Intel’s instruction set <em>still isn’t a popular choice</em> for mobile processors, although this is starting to change thanks to Intel’s foundry tech lead. In any case, when it comes to this market segment, x86 is not as efficient as other CPU architectures out there, namely processors based on ARM’s 32-bit ARMv7 and 64-bit ARMv8 instruction sets.</p>
<p>Over the past decade, and especially over the past five years, ARM processors have come to dominate the smartphone and tablet landscape, and they had a lot going for them. They offered a lot of performance-per-watt, they were cheap to design, produce and deploy. Big vendors could buy the necessary building blocks and design their own processors based on ARMv7 or ARMv8, adding other components according to their needs (high-speed modems and different GPUs to name a couple).</p>
<p>This led some chip designers to take a somewhat different approach and design their own, custom CPU cores. Qualcomm and Apple led the way, both companies became big players on the mobile System-on-Chip (SoC) market, and their development of sophisticated, custom cores, played an instrumental role in their success. However, custom ARM cores were still used in high-end processors, while all other market segments were covered by standard ARM Cortex CPU cores, like the 32-bit Cortex-A8, A9, A7, and A15, followed up by 64-bit designs like the Cortex-A53, A57, and the new A72 core, which is about to start shipping.</p>
<p>The other prerequisite for ARM’s success was Microsoft’s failure.</p>
<p>Windows only ran on x86 processors, so if Microsoft were to gain a foothold in mobile, it would tip the scales in Intel’s favour. However, by the close of the last decade, it became apparent that Redmond had dropped the ball and ceded this lucrative market to Google and Apple. Speaking of balls, long-time Microsoft CEO Steve Ballmer departed the company a couple of years ago, admitting he and his team failed to recognize the potential of smartphone and tablets. Anyway, it’s not Ballmer’s problem anymore: he has other balls on his mind right now, basketballs to be exact.</p>
<p><img loading="lazy" decoding="async" class="" src="https://assets.toptal.io/uploads/blog/image/92065/toptal-blog-image-1454584847911-9da8f3996033f623c8c57da452dd4da9.jpg" alt="ARM processors dominate the mobile landscape, and they’re making inroads into other product categories. Servers are a good place to start." width="603" height="603" /></p>
<div class="pop_out_box is-full_width is-big">ARM processors dominate the mobile landscape, and they’re making inroads into other product categories. Servers are a good place to start.</div>
<div class="tweet_this"></div>
<p>However, mobile is not the first or only market segment to witness a Microsoft failure of epic proportions. The other is the server market. On the face of it, smartphones and data centres don’t have much in common, but from a technological and business perspective, they have some overlap.</p>
<p>Whether you’re designing a smartphone or a server, you need to emphasise similar aspects of your hardware platform, such as power efficiency, good thermals, performance per dollar, and so on. Most importantly, you<em>don’t really need an x86-based processor</em> for smartphones and many types of servers. Thanks to Microsoft’s failures, these market segments aren’t dominated by any flavour of Windows. They rely on <em>UNIX-based operating systems</em> instead: Android, iOS, and various Linux distributions.</p>
<p>Microsoft also attempted to leverage the potential of ARM processors, so it tried developing a version of Windows that would run on ARM hardware, which conveniently brings me to the next Microsoft fail: Windows RT. Microsoft eventually pulled the plug on Windows RT, or “Windows on ARM” as it was originally called. Microsoft’s latest Surface tablets employ x64 processors and standard Windows 10. Microsoft’s Lumia smartphone line (née Nokia Lumia) still uses ARM processors from the House of Qualcomm, but Windows Phone is all but dead as a mainstream smartphone platform.</p>
<h2 id="servers-dont-have-to-cost-an-arm-and-a-leg">Servers Don’t Have To Cost An ARM And A Leg</h2>
<p>Right now, we have a couple of billion smartphone and tablets in the wild, and the vast majority are based on ARM processors. However, ARM chips aren’t making their way into other market segments. There are just a handful high-volume computing platforms based on ARM that don’t fall into the smartphone and tablet category. Google Chromebooks are probably the best-known example. However, ARM chips are used in heaps of other devices: routers, set-top boxes and smart TVs, smartwatches, some gaming devices, automotive infotainment systems and so on.</p>
<p>What about ARM servers?</p>
<p>This is where it gets tricky. I’ve been hearing talk of ARM servers since 2010, but progress has been slow and limited. ARM’s market share in the server segment remains negligible and the ecosystem remains dominated by x86 Xeon and Opteron parts from Intel and AMD respectively. Since AMD is in a world of trouble on the CPU front, Intel has managed to extend its market share lead in recent years.</p>
<p><img loading="lazy" decoding="async" class="" src="https://assets.toptal.io/uploads/blog/image/92066/toptal-blog-image-1454584872574-88087e9b692e44aaa1f39ef2fc45d39f.jpg" alt="ARM servers could end up significantly cheaper than their counterparts based on Intel and AMD x86 chips." width="566" height="566" /></p>
<div class="pop_out_box is-full_width is-big">ARM servers could end up significantly cheaper than their counterparts based on Intel and AMD x86 chips.</div>
<div class="tweet_this"></div>
<p>But why did ARM servers sound like a good idea to begin with?</p>
<p>Money. I could try listing all the geeky points that make ARM a viable alternative to x86 in the server market, but at the end of the day it’s mostly about money, so I will attempt to explain it in a few lines.</p>
<ul>
<li>Price/Performance</li>
<li>Data centre workloads are evolving and changing</li>
<li>Ability to source processors from various suppliers</li>
<li>Use of custom designed chips for various niches</li>
<li>ARM chips are more suitable to some infrastructure applications</li>
<li>It’s a good way to stick it to Intel and erode its market position (Intel is on the verge of becoming a monopoly in the server space)</li>
</ul>
<p>We don’t need a huge and expensive Xeon processor for everything. Moreover, using obsolete x86 processors to handle undemanding workloads isn’t a good option due to their power draw. Remember, we are talking about servers, not your MacBook or desktop PC. Servers run around the clock, so every efficiency gain, including relatively small ones, tends to be important. It’s not <em>just</em> about getting a bigger electric bill; data centres have to be cooled and maintained, so processors with a lower Thermal Design Power (TDP) rating are much more valuable to enterprise users than individuals.</p>
<h2 id="why-use-arm-servers">Why Use ARM Servers?</h2>
<p>So, what sort of enterprise application are ARM processors good for?</p>
<p>Well, ARM expects to get the vast <em>majority of design wins</em> for networking infrastructure applications. Due to their flexibility, small size, efficiency, and low price, ARM processors are a great choice for infrastructure. You can use ARM processors in routers, high-performance storage solutions, and certain types of servers.</p>
<p>However, ARM expects the <em>majority of enterprise growth</em> this decade to come from servers since its other segments are already mature and it has a healthy market share in them. Server workloads are changing as well, and this trend is tied to the growth of cloud services. As a result, servers have to deal with an increasing number of smaller tasks.</p>
<p>Many organisations prefer to keep their options open, so they source hardware from multiple vendors. This is good news for ARM server processors because they could be marketed by a number of different companies. In addition, ARM’s licensing policies and modular approach to processor design can be utilised to design custom processors for specific applications. This is, obviously, something that’s not an option for small companies, but what might happen if big players like Amazon, Facebook or Google start asking for bespoke server processors, designed to excel at one particular application?</p>
<p>As for “sticking it to Intel,” I should note that I don’t mean Intel any harm, and I don’t want to see it fail or be pushed out of various market segments, but at the same time I am concerned that Intel’s domination could end up stifling growth and innovation. More competition should result in lower prices for end-users, and this is what ARM servers are all about.</p>
<div class="embeddable_form-wrapper for-post" data-role="blog_subscribe" data-view="blog_subscribe#form">
<form class="embeddable_form" action="https://www.toptal.com/blog/subscription" method="post" data-entity="blog_subscription" data-remote="" data-view="form#form">
<div class="embeddable_form-step is-email_form is-current">
<div class="embeddable_form-row is-label"></div>
<h2 class="embeddable_form-row form-field is-email_field">Multithreading: How Many CPU Cores Is Enough?</h2>
</div>
</form>
</div>
<p>Only a decade ago, multicore x86 processors were reserved for high-performance computers and servers, but now you can get quad-core x86 chips in $100 tablets.</p>
<p>In the early days of multicore computing, you still needed big CPU cores to get adequate levels of performance. Lots of software was not able to take advantage of these new processors and their extra cores, so good single-thread performance was vital. Things sure have changed; nowadays, we have octa-core smartphones, quad-core Intel tablets and phones, and 16-core x86 server processors.</p>
<p>There is a good reason for this. Building a multi-core processor makes perfect sense from a technological and financial perspective. It’s a lot easier to distribute the load to a few smaller, more efficient CPU cores than to develop a single, huge core capable of running at high frequencies. The multicore approach ensures superior efficiency and chip yields.</p>
<p><img loading="lazy" decoding="async" class="" src="https://assets.toptal.io/uploads/blog/image/92067/toptal-blog-image-1454584896229-ba7c6d55af62477aebc977ca90011d1f.jpg" alt="Multithreading like a boss: ARM server processors could sport a lot more physical cores than your average x86 server part." width="559" height="559" /></p>
<div class="pop_out_box is-full_width is-big">Multithreading like a boss: ARM server processors could sport a lot more physical cores than your average x86 server part.</div>
<div class="tweet_this"></div>
<p>ARM has the potential to take the core craze to the next level. ARM CPU cores tend to be smaller than Intel’s so called “big cores” used in server and desktop parts (Intel’s “small core” Atoms are reserved for mobile, although Atom-based server parts are available too). However, this does not mean we will see 128-core or 256-core ARM processors anytime soon, although in theory, they are possible. It depends on how the new crop of ARMv8 server processors handles multithreaded loads. There are some encouraging signs, and chances are that ARM servers will be a good choice for a range of workloads that could benefit from their multicore processors.</p>
<p><a href="https://www.qualcomm.com/news/releases/2015/10/08/qualcomm-makes-significant-advancements-its-server-ecosystem" target="_blank" rel="noopener noreferrer">Qualcomm’s first server processor</a> has 24 ARMv8 CPU cores, and the chipmaker made it clear that future models will sport even more cores. Remember AMD and its server market woes? Well, the company introduced its long overdue ARM-based <a href="http://www.amd.com/en-us/products/server/opteron-a-series" target="_blank" rel="noopener noreferrer">Opteron A1100</a> processor just a couple of weeks ago. Qualcomm made the announcement in October, so both these products will become available over the next few months.</p>
<p>Of course, Intel will not be attending this ARM party, but Qualcomm and AMD are not the only chip outfits working on ARM-based enterprise chips. Chipmakers like Broadcom, Calxeda, Cavium Networks and Huawei HiSilicon have worked on ARM-based server products as well. Nvidia and Samsung, two heavyweights in the SoC and GPU business, also experimented with ARM server parts until a couple of years ago when they decided to halt development. Texas Instruments, Xilinx and Marvell are also exploring ARM server parts.</p>
<p>Some of these companies worked on custom ARM cores, too, but the only non-Apple 64-bit custom ARM core available today is Nvidia’s Denver, which only got a handful of design wins.</p>
<h2 id="what-are-arm-custom-cores">What Are ARM Custom Cores?</h2>
<p>I know most people can’t be bothered keeping track of all industry niches, including the CPU space, so I think now would be a good time to explain what makes ARM cores different and what custom cores actually are. I will not dissect processors and explain the difference between x86 and ARM instruction sets, but I will outline the differences from a business perspective.</p>
<p>You see, ARM isn’t different just because it uses a different instruction set, although that would make for a quick and geeky explanation, in my opinion, the biggest difference between Intel, AMD and ARM is not the architecture, it’s the business model. Besides, architectures change, new CPU designs are unveiled on a regular basis, but ARM’s approach to marketing and licensing its technology hasn’t changed in years.</p>
<p>Here is a simple example.</p>
<p>An Intel processor is developed by Intel, using Intel instruction sets. It is manufactured in an Intel foundry, packaged and shipped with <em>“Intel Inside”</em> branding. It might sound simple, but let’s not forget the billions that went into R&amp;D over the decades, or the fact that Intel relies on its own fabs for manufacturing (and if you are in the market for a 14nm foundry, make sure you have some spare change on you, because a chip fab costs as much as a nuclear aircraft carrier).</p>
<p>What about ARM products? Well, ARM is not a <em>chipmaker</em>, it’s a chip <em>designer</em>, or a <em>“fabless”</em> chip company, so it doesn’t deal with manufacturing and does not sell own-brand chips. ARM sells something much more interesting: <em>intellectual property</em>. This means ARM clients can choose any of a number of different licensing plans and start making their own designs. Most of them choose ARM’s in-house designs (Cortex series CPUs, Mali series GPUs), so they pay a licensing fee for every CPU/GPU core they produce.</p>
<p>However, a client does not have to license these ready-to-go CPUs; it can license the architecture set instead and develop a <em>custom core based on an ARM instruction set</em>. This is what Apple does. It uses the ARMv8 instruction set to build big and powerful 64-bit CPU cores for its iOS devices. Nvidia’s Denver CPU is similar in this respect, and so are Qualcomm’s custom cores (32-bit Krait and 64-bit Kryo series).</p>
<p>Designing a custom CPU core is not easy. It’s not like you’ll find chip designers out of work and offering to design a custom processor on Craigslist, so this approach is usually reserved for big players who have the necessary technical, financial and human resources to pull it off. Therefore, most companies use off-the-shelf ARM Cortex cores instead (the 64-bit Cortex-A57 core can be employed in a server environment and it’s used by most next-generation ARM server processors).</p>
<p>It is important to note that virtually ARM-based chips <em>are custom designed</em> but the <em>CPU cores used in most are not</em>.</p>
<p>The vast majority of ARM processors rely on standard ARM CPU designs (Cortex CPUs) rather than custom CPU cores. This means chipmakers can choose any of a number of ARM CPU cores, third-party GPUs and other components, and tailor a processor to meet their needs without having to develop a custom CPU core. It’s a cheap way of making the architecture more flexible, and it has more to do with ARM’s licensing policies than engineering.</p>
<p><img loading="lazy" decoding="async" class="" src="https://assets.toptal.io/uploads/blog/image/92068/toptal-blog-image-1454584924544-232eeb13b47833747772a57fc79048dc.jpg" alt="The new generation of 64-bit ARM server processors, such as AMD’s Opteron A1100, boast an impressive feature set." width="523" height="523" /></p>
<div class="pop_out_box is-full_width is-big">The new generation of 64-bit ARM server processors, such as AMD’s Opteron A1100, boast an impressive feature set.</div>
<div class="tweet_this"></div>
<p>It is also important to note that these forthcoming ARM servers, based on the latest ARM 64-bit CPU architecture, don’t have much in common with the experimental ARM servers of years gone by. For example, one of our colleagues played around with Scaleway ARM servers, but they are based on ARMv7 processors and have a number of hardware limitations (for example, Scaleway used shared I/O controllers, and the lack of 64-bit support created another set of challenges). The new generation of ARM-based servers won’t suffer from these teething problems; they are much closer to Intel hardware in terms of features and standards.</p>
<h2 id="arm-server-pros-and-cons">ARM Server Pros And Cons</h2>
<p>The problem with ARM servers is that they tend to be used for small niches, and they are not suitable for small developers who can live with any server. While some big companies find them attractive, the ARM servers that are currently available aren’t suitable for most <a href="https://www.toptal.com/arm">individual developers</a>.</p>
<p>However, the forthcoming server solutions are different and should appeal to more niches. This is what could make them appeal to a much wider user-base:</p>
<ul>
<li>Reduced hardware costs, potentially superior efficiency (performance per dollar, performance per Watt).</li>
<li>Increasing compatibility and availability of popular ports.</li>
<li>Support for cutting-edge technology and new industry standards.</li>
<li>Ability to excel at certain types of workloads (simple but multithreaded loads).</li>
<li>Potential for more competition and product diversity than in x86 space.</li>
</ul>
<p>I have to stress that, at this stage, some of these points are theoretical since the hardware isn’t out yet. However, while I can’t categorically claim to know what will happen over the next few quarters, I am confident the new breed of ARM servers will deliver these (and more) benefits. Why am I so confident? Well, if they didn’t have the potential to make a difference, ARM, Qualcomm, AMD, and other companies wouldn’t be wasting their time and burning money on their development.</p>
<p>So, what about ARM server downsides? There are quite a few, and some of them are big. Luckily, the industry is working hard to address them.</p>
<ul>
<li>Hit and miss software support</li>
<li>Availability, potential deployment issues</li>
<li>ROI concerns</li>
<li>Tiny ecosystem</li>
<li>Old habits die hard</li>
</ul>
<p>Software-related issues will, probably, be the biggest immediate concern. While a lot of popular services will run on ARM servers, <em>software support will be a problem</em>. It’s not enough to merely port stuff to new hardware; we have to make sure everything functions properly so there are no performance hits or failures. In other words, the ported software has to be mature. Nobody will develop and deploy a service built on buggy foundations.</p>
<p><img loading="lazy" decoding="async" class="" src="https://assets.toptal.io/uploads/blog/image/92069/toptal-blog-image-1454584943307-9d2469ecf072db2b22a58a890b55b76a.jpg" alt="The ARM server ecosystem is small, but a number of big industry names are already on board." width="549" height="549" /></p>
<div class="pop_out_box is-full_width is-big">The ARM server ecosystem is small, but a number of big industry names are already on board.</div>
<div class="tweet_this"></div>
<p>With all the money to be made in the server market, one would expect to see fast progress, but that isn’t always the case. Adopting new hardware and tweaking all the software that runs on it is never easy, and the pace depends on market adoption. The size of the ARM server ecosystem is (very) limited, and I doubt a couple of new processors would make much of a difference in the short run. While influential companies like ARM and Qualcomm have a vested interest in seeing a pickup in demand for ARM servers, there is not much they can do about software. They have next to no influence over software developers, so they can’t force them to add ARM support to existing products.</p>
<p>Long story short: Take a good look at your stack and try to figure out whether everything will run properly on ARM hardware. Given enough time, developers will start adding support for ARM hardware, but this won’t be a fast process. They will have to tweak frameworks and applications to take into account a new architecture, and I suspect, many of them won’t bother until there are enough ARM servers out there (which may take years). Support for legacy software is another obvious problem.</p>
<p>This brings us to the next point: Market availability and potential deployment issues. There aren’t that many ARM servers out there, so choice is limited, and so is availability. A year or two down the road, we could see a number of ARM-based hosting packages on offer, but we won’t see too many. Worse, there’s a good chance these servers will be concentrated in certain parts of the world, making them less attractive to some developers. There are a lot of unknowns related to deployment, so it’s still too early to say how things will pan out.</p>
<p>Slow adoption could create another set of challenges. These aren’t restricted to ARM servers; they apply to most enterprise technology. A lot of organisations are bound to explore the possibility of using ARM servers, but that doesn’t necessarily mean they will actually use them. In order to ensure enough development and consumer demand, market adoption needs to grow steadily. Otherwise, risk-averse people will probably stay away, taking the wait-and-see approach. The other potential problem is economic: If developers aren’t sure the ecosystem is growing fast enough, they might conclude the potential return is simply not worth the effort.</p>
<p>What about these old habits? Well, since server space doesn’t evolve fast, people tend to <a href="https://www.toptal.com/it/hosting-for-freelance-developers-paas">stick to proven platforms</a>, namely x86 hardware. The motto is simple: <em>If it ain’t broke, don’t fix it</em>. Industry veterans might see ARM servers as an opportunity and take a gamble on them. It would take a fair amount of courage and confidence to tie part of a complex project to what many people still perceive as an untested or immature hardware platform. I fear many people won’t be willing to take the plunge, at least not this early on.</p>
<h2 id="bright-future-and-a-pinch-of-hype">Bright Future And A Pinch Of Hype</h2>
<p>I’ve spent the better part of my adult life covering cutting edge silicon, and my personal take on ARM servers is that they have a lot of potential, but, <em>they’re not for everyone</em>. They could play a vital role in the Internet of tomorrow by providing cheap building blocks for infrastructure and handling niche server workloads.</p>
<p>However, at the same time, I cannot escape the feeling that ARM servers tend to be overhyped. Despite this, I don’t see them as a fad. I think they are here to stay, but vendors must carve out a few specific niches that can truly benefit from the new architecture.</p>
<p>In other words, we won’t see a lot of simple LAMP web hosting servers based on ARM, but we could see loads of them in more exotic niches (and some horribly boring ones). ARM processors could be a perfect fit for specific loads, especially those that can take advantage of a large number of small physical CPU cores, stuff that’s not CPU-bound. It might not sound like much, but this actually covers a lot of potential uses: data logging, large volumes of simple queries, certain types of databases, various storage services and so on.</p>
<p>I could go on, listing various use-cases, pros and cons of ARM servers, and potential problems, but at the end of the day, I suspect ARM server adoption will depend on good old cash. Technology aside, ARM servers will only make sense if the economic component checks out. In other words, they will have to offer a lot more bang for buck than x86 processors if they are to justify their existence.</p>
<p>Since this is more or less the whole point of introducing this new architecture to the server industry, I expect attractive pricing, but it will be a few months before we know for sure.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://avp-blogs.com/2016/08/arm-servers-vs-x86-servers-design-consideration-data-centres/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>A Detailed Guide To Optimizing SQL Database</title>
		<link>https://avp-blogs.com/2016/07/detailed-guide-optimizing-sql-database/</link>
					<comments>https://avp-blogs.com/2016/07/detailed-guide-optimizing-sql-database/#respond</comments>
		
		<dc:creator><![CDATA[avp]]></dc:creator>
		<pubDate>Sun, 31 Jul 2016 04:48:36 +0000</pubDate>
				<category><![CDATA[Tech]]></category>
		<category><![CDATA[optimizing sql]]></category>
		<category><![CDATA[sql optimizing tips for developers]]></category>
		<guid isPermaLink="false">http://avp-blogs.com/?p=1183</guid>

					<description><![CDATA[The below detailed guide on optimizing SQL Databasee first appeared on Toptal and can be found here. Database tuning can be an incredibly difficult task, particularly when working with large-scale data where even the most minor change can have a dramatic (positive or negative) impact on performance. In mid-sized and large companies, most SQL database ...]]></description>
										<content:encoded><![CDATA[<h3><em><strong>The below detailed guide on optimizing SQL Databasee first appeared on <a href="https://www.toptal.com/">Toptal</a> and can be found <a href="https://www.toptal.com/sql/sql-database-tuning-for-developers">here</a>.</strong></em></h3>
<p>Database tuning can be an incredibly difficult task, particularly when working with large-scale data where even the most minor change can have a dramatic (positive or negative) impact on performance.</p>
<p>In mid-sized and large companies, most SQL database tuning will be handled by a Database Administrator (DBA). But believe me, there are <a href="https://www.toptal.com/sql">plenty of developers</a> out there who have to perform DBA-like tasks. Further, in many of the companies I’ve seen that <em>do</em> have DBAs, they often struggle to work well with developers—the positions simply require different modes of problem solving, which can lead to disagreement among coworkers.</p>
<div class="pop_out_box is-full_width is-big">When working with large-scale data, even the most minor change can have a dramatic impact on performance.</div>
<p>On top of that, corporate structure can also play a role. Say the DBA team is placed on the 10th floor with all of their databases, while the devs are on the 15th floor, or even in a different building under a completely separate reporting structure—it’s certainly hard to work together smoothly under these conditions. ￼ In this article, I’d like to accomplish two things:</p>
<ol>
<li>Provide developers with some developer-side database tuning techniques.</li>
<li>Explain how developers and DBAs can work together effectively.</li>
</ol>
<h2 id="database-optimization-in-the-codebase">Database Optimization (in the Codebase)</h2>
<h2>Indexes</h2>
<p>If you’re a complete newcomer to databases and even asking yourself “What is SQL tuning?”, you should know that indexing is an effective way to tune your SQL database that is often neglected during development. In basic terms, an <a href="https://en.wikipedia.org/wiki/Database_index" target="_blank" rel="noopener noreferrer">index</a> is a data structure that improves the speed of data retrieval operations on a database table by providing rapid random lookups and efficient access of ordered records. This means that once you’ve created an index, you can select or sort your rows faster than before.</p>
<p>Indexes are also used to define a primary-key or unique index which will guarantee that no other columns have the same values. Of course, indexing is a vast an interesting topic to which I can’t do justice with this brief description (<a href="http://stackoverflow.com/questions/1108/how-does-database-indexing-work/1130#1130" target="_blank" rel="noopener noreferrer">here’s</a> a more detailed write-up).</p>
<p>If you’re new to indexes, I recommend using this diagram when structuring your queries: ￼</p>
<p class="is-centered"><img decoding="async" src="https://assets.toptal.io/uploads/blog/image/149/toptal-blog-1_C.png" alt="This diagram illustrates a few SQL query performance tuning tips every developer should know." /></p>
<p>Basically, the goal is to index the major searching and ordering columns.</p>
<p>Note that if your tables are constantly hammered by <code>INSERT</code>, <code>UPDATE</code>, and <code>DELETE</code>, you should be careful when indexing—you could end up <a href="http://stackoverflow.com/questions/141232/how-many-database-indexes-is-too-many/141243#141243" target="_blank" rel="noopener noreferrer">decreasing performance</a> as all indexes need to be modified after these operations.</p>
<p>Further, DBAs often drop their indexes before performing million+ row batch inserts to <a href="http://stackoverflow.com/questions/13700575/is-a-good-practice-to-disable-indexes-before-insertion-of-many-records-on-sql-se" target="_blank" rel="noopener noreferrer">speed up the insertion process</a>. After the batch is inserted, they then recreate the indexes. Remember, however, that dropping indexes will affect every query running in that table; so this approach is only recommended when working with a single, large insertion.</p>
<h2 id="sql-server-performance-tuning-execution-plans">SQL Server Performance Tuning: Execution Plans</h2>
<p>By the way: the Execution Plan tool in <a href="https://www.toptal.com/sql-server/how-to-tune-microsoft-sql-server-for-performance">SQL Server</a> can be useful for creating indexes.</p>
<p>Its main function is to graphically display the data retrieval methods chosen by the SQL Server query optimizer. If you’ve never seen them before, <a href="http://www.brentozar.com/archive/2013/05/the-basics-of-sql-server-execution-plans-video/" target="_blank" rel="noopener noreferrer">here’s</a> a detailed walkthrough.</p>
<p>To retrieve the execution plan (in SQL Server Management Studio), just click “Include Actual Execution Plan” (CTRL + M) before running your query.</p>
<p>Afterwards, a third tab named “Execution Plan” will appear. You might see a detected missing index. To create it, just right click in the execution plan and choose the “Missing Index Details…”. It’s as simple as that!</p>
<p class="is-zoomable"><img loading="lazy" decoding="async" class="" src="https://assets.toptal.io/uploads/blog/image/146/toptal-blog-image2.png" alt="This screenshot demonstrates one of the performance tuning techniques for your SQL database." width="603" height="173" /></p>
<p class="is-centered">
<h2 id="tune-sql-query-performance-by-avoiding-coding-loops">Tune SQL query performance by avoiding coding loops</h2>
<p>Imagine a scenario in which 1000 queries hammer your database in sequence. Something like:</p>
<pre lang="java"><code>for (int i = 0; i &lt; 1000; i++)
{
    SqlCommand cmd = new SqlCommand("INSERT INTO TBL (A,B,C) VALUES...");
    cmd.ExecuteNonQuery();
}
</code></pre>
<p>You should <a href="http://codeutopia.net/blog/2010/10/07/optimizing-sql-removing-queries-inside-loops/" target="_blank" rel="noopener noreferrer">avoid such loops</a> in your code. For example, we could transform the above snippet by using a unique <code>INSERT</code> or <code>UPDATE</code> statement with multiple rows and values:</p>
<pre lang="sql"><code>INSERT INTO TableName (A,B,C) VALUES (1,2,3),(4,5,6),(7,8,9) -- SQL SERVER 2008

INSERT INTO TableName (A,B,C) SELECT 1,2,3 UNION ALL SELECT 4,5,6 -- SQL SERVER 2005

UPDATE TableName SET A = CASE B
        WHEN 1 THEN 'NEW VALUE'
        WHEN 2 THEN 'NEW VALUE 2'
        WHEN 3 THEN 'NEW VALUE 3'
    END
WHERE B in (1,2,3)
</code></pre>
<p>Make sure that your <code>WHERE</code> clause avoids updating the stored value if it matches the existing value. Such a trivial optimization can dramatically increase SQL query performance by updating only hundreds of rows instead thousands. For example:</p>
<pre lang="sql"><code>UPDATE TableName
SET A = @VALUE
WHERE
      B = 'YOUR CONDITION'
            AND A &lt;&gt; @VALUE -- VALIDATION
</code></pre>
<h2 id="avoid-correlated-subqueries">Avoid correlated subqueries</h2>
<p>A <a href="https://en.wikipedia.org/wiki/Correlated_subquery" target="_blank" rel="noopener noreferrer">correlated subquery</a> is one which uses values from the parent query. This kind of query tends to run <a href="http://technet.microsoft.com/en-us/library/ms187638(v=sql.105).aspx" target="_blank" rel="noopener noreferrer">row-by-row</a>, once for each row returned by the outer query, and thus decreases SQL query performance. New developers are often caught structuring their queries in this way—because it’s usually the easy route.</p>
<p>Here’s an example of a correlated subquery:</p>
<pre lang="sql"><code>SELECT c.Name, 
       c.City,
       (SELECT CompanyName FROM Company WHERE ID = c.CompanyID) AS CompanyName 
FROM Customer c
</code></pre>
<p>In particular, the problem is that the inner query (<code>SELECT CompanyName…</code>) is run for <em>each</em> row returned by the outer query (<code>SELECT c.Name…</code>). But why go over the <code>Company</code> again and again for every row processed by the outer query?</p>
<p>A more efficient performance tuning technique would be to refactor the correlated subquery as a join:</p>
<pre lang="sql"><code>SELECT c.Name, 
       c.City, 
       co.CompanyName 
FROM Customer c 
	LEFT JOIN Company co
		ON c.CompanyID = co.CompanyID
</code></pre>
<p>In this case, we go over the <code>Company</code> table just once, at the start, and JOIN it with the <code>Customer</code> table. From then on, we can select the values we need (<code>co.CompanyName</code>) more efficiently.</p>
<h2 id="select-sparingly">Select sparingly</h2>
<p>One of my favorite SQL optimization tips is to avoid <code>SELECT *</code>! Instead, you should individually include the specific columns that you need. Again, this sounds simple, but I see this error all over the place. Consider a table with hundreds of columns and millions of rows—if your application only really needs a few columns, there’s no sense in querying for <em>all</em> the data. It’s a massive waste of resources. (<em>For more issues, see <a href="http://stackoverflow.com/questions/3639861/why-is-select-considered-harmful#answer-3639964" target="_blank" rel="noopener noreferrer">here</a>.</em>)</p>
<p>For example:</p>
<pre lang="sql"><code>SELECT * FROM Employees
</code></pre>
<p class="is-centered">vs.</p>
<pre lang="sql"><code>SELECT FirstName, City, Country FROM Employees
</code></pre>
<p>If you really need every column, explicitly list every column. This isn’t so much a rule, but rather, a means of preventing future system errors and additional database performance tuning. For example, if you’re using an <code>INSERT... SELECT...</code> and the source table has changed via the addition of a new column, you might run into issues, even if that column isn’t needed by the destination table, e.g.:</p>
<pre lang="sql"><code>￼￼￼￼￼￼￼INSERT INTO Employees SELECT * FROM OldEmployees

Msg 213, Level 16, State 1, Line 1
Insert Error: Column name or number of supplied values does not match table definition.
</code></pre>
<p>To avoid this kind of error, you should declare each column individually:</p>
<pre lang="sql"><code>INSERT INTO Employees (FirstName, City, Country)
SELECT Name, CityName, CountryName
FROM OldEmployees
</code></pre>
<p>Note, however, that there are some situations where the use of <code>SELECT *</code> could be appropriate. For example, with temp tables—which leads us to our next topic.</p>
<div class="embeddable_form-wrapper for-post" data-role="blog_subscribe" data-view="blog_subscribe#form">
<form class="embeddable_form" action="https://www.toptal.com/blog/subscription" method="post" data-entity="blog_subscription" data-remote="" data-view="form#form">
<div class="embeddable_form-step is-email_form is-current">
<div class="embeddable_form-row is-label"></div>
<div class="embeddable_form-row is-privacy">
<div class="embeddable_form-privacy">
<div class="embeddable_form-privacy_icon"></div>
<h2 class="embeddable_form-privacy_text"><strong>The use of temp(orary) tables</strong></h2>
</div>
</div>
</div>
</form>
</div>
<p><a href="http://www.tutorialspoint.com/sql/sql-temporary-tables.htm" target="_blank" rel="noopener noreferrer">Temporary tables</a> usually increase a query’s complexity. If your code can be written in a simple, straightforward manner, I’d suggest avoiding temp tables.</p>
<p>But if you have a stored procedure with some data manipulation that <em>cannot</em> be handled with a single query, you can use temp tables as intermediaries to help you to generate a final result.</p>
<p>When you have to join a large table and there are conditions on said table, you can increase database performance by transferring your data in a temp table, and then making a join on <em>that</em>. Your temp table will have fewer rows than the original (large) table, so the join will finish faster!</p>
<p>The decision <a href="http://stackoverflow.com/questions/11169550/is-there-a-speed-difference-between-cte-subquery-and-temp-tables#answer-11169910" target="_blank" rel="noopener noreferrer">isn’t always straightforward</a>, but this example will give you a sense for situations in which you might want to use temp tables:</p>
<p>Imagine a customer table with millions of records. You have to make a join on a specific region. You can achieve this by using a <code>SELECT INTO</code> statement and then joining with the temp table:</p>
<pre lang="sql"><code>SELECT * INTO #Temp FROM Customer WHERE RegionID = 5
SELECT r.RegionName, t.Name FROM Region r JOIN #Temp t ON t.RegionID = r.RegionID
</code></pre>
<p>(<em>Note: some SQL developers also avoid using <code>SELECT INTO</code> to create temp tables, saying that this command locks the tempdb database, disallowing other users from creating temp tables. Fortunately, this is <a href="http://stackoverflow.com/questions/1302670/sql-server-select-into-and-blocking-with-temp-tables#answer-1302787" target="_blank" rel="noopener noreferrer">fixed in 7.0 and later</a></em>.)</p>
<p>As an alternative to temp tables, you might consider using a subquery as a table:</p>
<pre lang="sql"><code>SELECT r.RegionName, t.Name FROM Region r 
JOIN (SELECT * FROM Customer WHERE RegionID = 5) AS t 
ON t.RegionID = r.RegionID
</code></pre>
<p>But wait! There’s a problem with this second query. As described above, we should only be including the columns we need in our subquery (i.e., not using <code>SELECT *</code>). Taking that into account:</p>
<pre lang="sql"><code>SELECT r.RegionName, t.Name FROM Region r 
JOIN (SELECT Name, RegionID FROM Customer WHERE RegionID = 5) AS t 
ON t.RegionID = r.RegionID
</code></pre>
<p>All of these snippets will return the same data. But with temp tables, we could, for example, create an index in the temp table to improve performance. There’s some good discussion <a href="http://stackoverflow.com/questions/11169550/is-there-a-speed-difference-between-cte-subquery-and-temp-tables/11169910#11169910" target="_blank" rel="noopener noreferrer">here</a> on the differences between temporary tables and subqueries.</p>
<p>Finally, when you’re done with your temp table, delete it to clear tempdb resources, rather than just wait for it to be automatically deleted (as it will be when your connection to the database is terminated):</p>
<pre lang="sql"><code>DROP TABLE #temp
</code></pre>
<h2 id="does-my-record-exist">Does my record exist?</h2>
<p>This SQL opimization technique concerns the use of <code>EXISTS()</code>. If you want to check if a record exists, use <code>EXISTS()</code> instead of <code>COUNT()</code>. While <code>COUNT()</code> scans the entire table, counting up all entries matching your condition, <code>EXISTS()</code> will exit as soon as it sees the result it needs. This will give you <a href="http://sqlblog.com/blogs/andrew_kelly/archive/2007/12/15/exists-vs-count-the-battle-never-ends.aspx" target="_blank" rel="noopener noreferrer">better performance and clearer code</a>.</p>
<pre lang="sql"><code>IF (SELECT COUNT(1) FROM EMPLOYEES WHERE FIRSTNAME LIKE '%JOHN%') &gt; 0
 	PRINT 'YES' 
</code></pre>
<p class="is-centered">vs.</p>
<pre lang="sql"><code>IF EXISTS(SELECT FIRSTNAME FROM EMPLOYEES WHERE FIRSTNAME LIKE '%JOHN%')
    PRINT 'YES'
</code></pre>
<h2 id="database-optimization-in-the-office">Database Optimization (in the Office)</h2>
<p>SQL database administrators (DBAs) and developers often clash over data- and non-data-related issues. Drawn from my experience, here are some tips (for both parties) on how to get along and work together effectively.</p>
<p class="is-centered"><img decoding="async" src="https://assets.toptal.io/uploads/blog/image/143/toptal-blog-1_A.png" alt="SQL performance tuning goes beyond the codebase when DBAs and developers have to work together effectively." /></p>
<p class="is-centered">
<h2 id="for-developers">For developers:</h2>
<ol>
<li>If your application stops working suddenly, it may not be a database issue. For example, maybe you have a network problem. Investigate a bit before you accuse a DBA!</li>
<li>Even if you’re a ninja SQL data modeler, ask a DBA to help you with your relational diagram. They have a lot to share and offer.</li>
<li>DBAs don’t like rapid changes. This is natural: they need to analyze the database as a whole and examine the impact of any changes from all angles. A simple change in a column can take a week to be implemented—but that’s because an error could materialize as huge losses for the company. Be patient!</li>
<li>Do not ask SQL DBAs to make data changes in a production environment. If you want access to the production database, you have to be responsible for all your own changes.</li>
</ol>
<h2 id="for-sql-database-administrators">For SQL Database Administrators:</h2>
<ol>
<li>If you don’t like people asking you about the database, give them a real-time status panel. Developers are always suspicious of a database’s status, and such a panel could save everyone time and energy.</li>
<li>Help developers in a test/quality assurance environment. Make it easy to simulate a production server with simple tests on real-data. This will be a significant time-saver for others as well as yourself.</li>
<li>Developers spend all day on systems with frequently-changed business logic. Try to understand this world being more flexible, and be able to break some rules in a critical moment.</li>
<li>SQL databases evolve. The day will come when you have to migrate your data to a new version. Developers count on significant new functionality with each new version. Instead of refusing to accept their changes, plan ahead and be ready for the migration.</li>
</ol>
]]></content:encoded>
					
					<wfw:commentRss>https://avp-blogs.com/2016/07/detailed-guide-optimizing-sql-database/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>A Detailed Guide To Optimizing Android Apps</title>
		<link>https://avp-blogs.com/2016/07/detailed-guide-optimizing-android-apps/</link>
					<comments>https://avp-blogs.com/2016/07/detailed-guide-optimizing-android-apps/#respond</comments>
		
		<dc:creator><![CDATA[avp]]></dc:creator>
		<pubDate>Sun, 10 Jul 2016 04:39:25 +0000</pubDate>
				<category><![CDATA[Tech]]></category>
		<category><![CDATA[a detailed guide to android apps optimization]]></category>
		<category><![CDATA[android apps]]></category>
		<category><![CDATA[how to optimize android apps]]></category>
		<guid isPermaLink="false">http://avp-blogs.com/?p=1125</guid>

					<description><![CDATA[The below detailed guide on optimizing Android apps first appeared on Toptal and can be found here. Android devices have a lot of cores, so writing smooth apps is a simple task for anyone, right? Wrong. As everything on Android can be done in a lot of different ways, picking the best option can be ...]]></description>
										<content:encoded><![CDATA[<h3><em><strong>The below detailed guide on optimizing Android apps first appeared on <a href="https://www.toptal.com/">Toptal</a> and can be found <a href="https://www.toptal.com/android/android-performance-tips-tools">here</a>.</strong></em></h3>
<p>Android devices have a lot of cores, so writing smooth apps is a simple task for anyone, right? Wrong. As everything on Android can be done in a lot of different ways, picking the best option can be tough. If you want to choose the most efficient method, you have to know what’s happening under the hood. Luckily, you don’t have to rely on your feelings or sense of smell, since there’s a lot of tools out there that can help you find bottlenecks by measuring and describing what’s going on. Properly optimized and smooth apps greatly improve the user experience, and also drain less battery.</p>
<p>Let’s see some numbers first to consider how important optimization really is. According to a <a href="http://blog.nimbledroid.com/2015/09/03/why-you-should-care-about-app-performance.html" target="_blank" rel="noopener noreferrer">Nimbledroid post</a>, 86% of users (including me) have uninstalled apps after using them only once due to poor performance. If you’re loading some content, you have less than 11 seconds to show it to the user. Only every third user will give you more time. You might also get a lot of bad reviews on Google Play because of it.</p>
<p><a href="https://avp-blogs.com/wp-content/uploads/2016/07/1.png"><img loading="lazy" decoding="async" class="aligncenter size-full wp-image-1126" src="https://avp-blogs.com/wp-content/uploads/2016/07/1.png" alt="1" width="640" height="640" srcset="https://avp-blogs.com/wp-content/uploads/2016/07/1.png 640w, https://avp-blogs.com/wp-content/uploads/2016/07/1-150x150.png 150w, https://avp-blogs.com/wp-content/uploads/2016/07/1-300x300.png 300w, https://avp-blogs.com/wp-content/uploads/2016/07/1-56x56.png 56w" sizes="auto, (max-width: 640px) 100vw, 640px" /></a></p>
<p>The first thing every user notices over and over is the app’s startup time. According to <a href="http://blog.nimbledroid.com/2016/02/17/cold-start-times-of-top-apps.html" target="_blank" rel="noopener noreferrer">another Nimbledroid post</a>, out of the 100 top apps, 40 start in under 2 seconds, and 70 start in under 3 seconds. So if possible, you should generally display some content as soon as possible and delay the background checks and updates a bit.</p>
<p>Always remember, premature optimization is the root of all evil. You should also not waste too much time with micro optimization. You will see the most benefit of optimizing code that runs often. For example, this includes the onDraw() function, which runs every frame, ideally 60 times per second. Drawing is the slowest operation out there, so try redrawing only what you have to. More about this will come later.</p>
<h2 id="performance-tips">Performance Tips</h2>
<p>Enough theory, here is a list of some of the things you should consider if performance matters to you.</p>
<h3 id="string-vs-stringbuilder">1. String vs StringBuilder</h3>
<p>Let’s say that you have a String, and for some reason you want to append more Strings to it 10 thousand times. The code could look something like this.</p>
<p>[ccie_c]</p>
<p>String string = &#8220;hello&#8221;;<br />
for (int i = 0; i &lt; 10000; i++) {<br />
string += &#8221; world&#8221;;<br />
}</p>
<p>[/ccie_c]</p>
<p>You can see on the Android Studio Monitors how inefficient some String concatenation can be. There’s tons of Garbage Collections (GC) going on.</p>
<p><a href="https://avp-blogs.com/wp-content/uploads/2016/07/2.png"><img loading="lazy" decoding="async" class="aligncenter size-full wp-image-1127" src="https://avp-blogs.com/wp-content/uploads/2016/07/2.png" alt="2" width="640" height="640" srcset="https://avp-blogs.com/wp-content/uploads/2016/07/2.png 640w, https://avp-blogs.com/wp-content/uploads/2016/07/2-150x150.png 150w, https://avp-blogs.com/wp-content/uploads/2016/07/2-300x300.png 300w, https://avp-blogs.com/wp-content/uploads/2016/07/2-56x56.png 56w" sizes="auto, (max-width: 640px) 100vw, 640px" /></a></p>
<p>This operation takes around 8 seconds on my fairly good device, which has Android 5.1.1. The more efficient way of achieving the same goal is using a StringBuilder, like this.</p>
<p>[ccie_c]</p>
<p>StringBuilder sb = new StringBuilder(&#8220;hello&#8221;);</p>
<p>for (int i = 0; i &lt; 10000; i++){ sb.append(&#8221; world&#8221;);}</p>
<p>String string = sb.toString();</p>
<p>[/ccie_c]</p>
<p>On the same device this happens almost instantly, in less than 5ms. The CPU and Memory visualizations are almost totally flat, so you can imagine how big this improvement is. Notice though, that for achieving this difference, we had to append 10 thousand Strings, which you probably don’t do often. So in case you are adding just a couple Strings once, you will not see any improvement. By the way, if you do:</p>
<p>[ccie_c]</p>
<p>String string = &#8220;hello&#8221; + &#8221; world&#8221;;</p>
<p>[/ccie_c]</p>
<p>It gets internally converted to a StringBuilder, so it will work just fine.</p>
<p>You might be wondering, why is concatenating Strings the first way so slow? It is caused by the fact that Strings are immutable, so once they are created, they cannot be changed. Even if you think you are changing the value of a String, you are actually creating a new String with the new value. In an example like:</p>
<p>[ccie_c]</p>
<p>String myString = &#8220;hello&#8221;;</p>
<p>myString += &#8221; world&#8221;;</p>
<p>[/ccie_c]</p>
<p>What you will get in memory is not 1 String “hello world”, but actually 2 Strings. The String myString will contain “hello world”, as you would expect. However, the original String with the value “hello” is still alive, without any reference to it, waiting to be garbage collected. This is also the reason why you should store passwords in a char array instead of a String. If you store a password as a String, it will stay in the memory in human-readable format until the next GC for an unpredictable length of time. Back to the immutability described above, the String will stay in the memory even if you assign it another value after using it. If you, however, empty the char array after using the password, it will disappear from everywhere.</p>
<h3 id="picking-the-correct-data-type">2. Picking the Correct Data Type</h3>
<p>Before you start writing code, you should decide what data types you will use for your collection. For example, should you use a Vector or an ArrayList? Well, it depends on your usecase. If you need a thread-safe collection, which will allow only one thread at once to work with it, you should pick a Vector, as it is synchronized. In other cases you should probably stick to an ArrayList, unless you really have a specific reason to use vectors.</p>
<p>How about the case when you want a collection with unique objects? Well, you should probably pick a Set. They cannot contain duplicates by design, so you will not have to take care of it yourself. There are multiple types of sets, so pick one that fits your use case. For a simple group of unique items, you can use a HashSet. If you want to preserve the order of items in which they were inserted, pick a LinkedHashSet. A TreeSet sorts items automatically, so you will not have to call any sorting methods on it. It should also sort the items efficiently, without you having to think of sorting algorithms.</p>
<div>Sorting integers or strings is pretty straightforward. However, what if you want to sort a class by some property? Let’s say you are writing a list of meals you eat, and store their names and timestamps. How would you sort the meals by timestamp from the lowest to highest? Luckily, it’s pretty simple. It’s enough to implement the Comparable interface in the Meal class and override the compareTo() function. To sort the meals by lowest timestamp to highest, we could write something like this.</div>
<div></div>
<div></div>
<div>
<p>[ccie_c]</p>
<p>&nbsp;</p>
<p>@Override<br />
public int compareTo(Object object)<br />
{Meal meal = (Meal) object;<br />
if (this.timestamp &lt; meal.getTimestamp())<br />
{return -1;}<br />
else if (this.timestamp &gt; meal.getTimestamp())<br />
{return 1;}<br />
return 0;}</p>
<p>[/ccie_c]</p>
</div>
<div class="pop_out_box is-full_width is-big"></div>
<div class="pop_out_box is-full_width is-big"></div>
<h3 id="location-updates">3. Location Updates</h3>
<p>There are a lot of apps out there which collect the user’s location. You should use the Google Location Services API for that purpose, which contains a lot of useful functions. There is a <a href="https://www.toptal.com/android/android-developers-guide-to-google-location-services-api">separate article</a> about using it, so I will not repeat it.</p>
<p>I’d just like to stress some important points from a performance perspective.</p>
<p>First of all, use only the most precise location as you need. For example, if you are doing some weather forecasting, you don’t need the most accurate location. Getting just a very rough area based on the network is faster, and more battery efficient. You can achieve it by setting the priority to LocationRequest.PRIORITY_LOW_POWER.</p>
<p>You can also use a function of LocationRequest called setSmallestDisplacement(). Setting this in meters will cause your app to not be notified about location change if it was smaller than the given value. For example, if you have a map with nearby restaurants around you, and you set the smallest displacement to 20 meters, the app will not be making requests for checking restaurants if the user is just walking around in a room. The requests would be useless, as there wouldn’t be any new nearby restaurant anyway.</p>
<p>The second rule is requesting location updates only as often as you need them. This is quite self explanatory. If you are really building that weather forecast app, you do not need to request the location every few seconds, as you probably don’t have such precise forecasts (contact me if you do). You can use the setInterval() function for setting the required interval in which the device will be updating your app about the location. If multiple apps keep requesting the user’s location, every app will be notified at every new location update, even if you have a higher setInterval() set. To prevent your app from being notified too often, make sure to always set a fastest update interval with setFastestInterval().</p>
<p>And finally, the third rule is requesting location updates only if you need them. If you are displaying some nearby objects on the map every x seconds and the app goes in background, you do not need to know the new location. There is no reason to update the map if the user cannot see it anyway. Make sure to stop listening for location updates when appropriate, preferably in onPause(). You can then resume the updates in onResume().</p>
<h3 id="network-requests">4. Network Requests</h3>
<p>There is a high chance that your app is using the internet for downloading or uploading data. If it is, you have several reasons to pay attention to <a href="https://developer.android.com/training/efficient-downloads/efficient-network-access.html" target="_blank" rel="noopener noreferrer">handling network requests</a>. One of them is mobile data, which is very limited to a lot of people and you shouldn’t waste it.</p>
<p>The second one is battery. Both WiFi and mobile networks can consume quite a lot of it if they are used too much. Let’s say that you want to download 1 kb. To make a network request, you have to wake up the cellular or WiFi radio, then you can download your data. However, the radio will not fall asleep immediately after the operation. It will stay in a fairly active state for about 20-40 more seconds, depending on your device and carrier.</p>
<p><a href="https://avp-blogs.com/wp-content/uploads/2016/07/3.png"><img loading="lazy" decoding="async" class="aligncenter size-full wp-image-1129" src="https://avp-blogs.com/wp-content/uploads/2016/07/3.png" alt="3" width="640" height="640" srcset="https://avp-blogs.com/wp-content/uploads/2016/07/3.png 640w, https://avp-blogs.com/wp-content/uploads/2016/07/3-150x150.png 150w, https://avp-blogs.com/wp-content/uploads/2016/07/3-300x300.png 300w, https://avp-blogs.com/wp-content/uploads/2016/07/3-56x56.png 56w" sizes="auto, (max-width: 640px) 100vw, 640px" /></a></p>
<p>So, what can you do about it? Batch. To avoid waking up the radio every couple seconds, prefetch things that the user might need in the upcoming minutes. The proper way of batching is highly dynamic depending on your app, but if it is possible, you should download the data the user might need in the next 3-4 minutes. One could also edit the batch parameters based on the user’s internet type, or charging state. For example, if the user is on WiFi while charging, you can prefetch a lot more data than if the user is on mobile internet with low battery. Taking all these variables into account can be a tough thing, which only few people would do. Luckily though, there is GCM Network Manager to the rescue!</p>
<p>GCM Network Manager is a really helpful class with a lot of customizable attributes. You can easily schedule both repeating and one-off tasks. At repeating tasks you can set the lowest, as well as the highest repeat interval. This will allow batching not only your requests, but also requests from other apps. The radio has to be woken up only once per some period, and while it’s up, all apps in the queue download and upload what they are supposed to. This Manager is also aware of the device’s network type and charging state, so you can adjust accordingly. You can find more details and samples in <a href="https://www.bignerdranch.com/blog/optimize-battery-life-with-androids-gcm-network-manager/" target="_blank" rel="noopener noreferrer">this article</a>, I urge you to check it out. An example task looks like this:</p>
<p>[ccie_c]</p>
<p>Task task = new OneoffTask.Builder()</p>
<p>.setService(CustomService.class)</p>
<p>.setExecutionWindow(0, 30)</p>
<p>.setTag(LogService.TAG_TASK_ONEOFF_LOG)</p>
<p>.setUpdateCurrent(false)</p>
<p>.setRequiredNetwork(Task.NETWORK_STATE_CONNECTED)</p>
<p>.setRequiresCharging(false)</p>
<p>.build();</p>
<p>&nbsp;</p>
<p>[/ccie_c]</p>
<p>By the way, since Android 3.0, if you do a network request on the main thread, you will get a NetworkOnMainThreadException. That will definitely warn you not to do that again.</p>
<h3 id="reflection"><strong> 5. Reflection</strong></h3>
<p>Reflection is the ability of classes and objects to examine their own constructors, fields, methods, and so on. It is used usually for backward compatibility, to check if a given method is available for a particular OS version. If you have to use reflection for that purpose, make sure to cache the response, as using reflection is pretty slow. Some widely used libraries use Reflection too, like Roboguice for dependency injection. That’s the reason why you should prefer Dagger 2. For more details about reflection, you can check a <a href="http://blog.nimbledroid.com/2016/02/23/slow-Android-reflection.html" target="_blank" rel="noopener noreferrer">separate post</a>.</p>
<h3 id="autoboxing">6. Autoboxing</h3>
<p>Autoboxing and unboxing are processes of converting a primitive type to an Object type, or vice versa. In practice it means converting an int to an Integer. For achieving that, the compiler uses the Integer.valueOf()function internally. Converting is not just slow, Objects also take a lot more memory than their primitive equivalents. Let’s look at some code.</p>
<p>[ccie_c]</p>
<p>Integer total = 0;<br />
for (int i = 0; i &lt; 1000000; i++) {<br />
total += i;<br />
}</p>
<p>[/ccie_c]</p>
<p>While this takes 500ms on average, rewriting it to avoid autoboxing will speed it up drastically.</p>
<p>[ccie_c]</p>
<p>int total = 0; for (int i = 0; i &lt; 1000000; i++) { total += i; }</p>
<p>[/ccie_c]</p>
<p><span style="line-height: 1.5;">This solution runs at around 2ms, which is 25 times faster. If you don’t believe me, test it out. The numbers will be obviously different per device, but it should still be a lot faster. And it’s also a really simple step to optimize.</span></p>
<p>Okay, you probably don’t create a variable of type Integer like this often. But what about the cases when it is more difficult to avoid? Like in a map, where you have to use Objects, like Map&lt;Integer, Integer&gt;? Look at the solution many people use.</p>
<p>[ccie_c]<br />
Map&lt;Integer, Integer&gt; myMap = new HashMap&lt;&gt;(); for (int i = 0; i &lt; 100000; i++) { myMap.put(i, random.nextInt()); }<br />
[/ccie_c]</p>
<p><span style="line-height: 1.5;">Inserting 100k random ints in the map takes around 250ms to run. Now look at the solution with SparseIntArray.</span></p>
<p>[ccie_c]<br />
SparseIntArray myArray = new SparseIntArray(); for (int i = 0; i &lt; 100000; i++) { myArray.put(i, random.nextInt()); }<br />
[/ccie_c]</p>
<p><span style="line-height: 1.5;">This takes a lot less, roughly 50ms. It’s also one of the easier methods for improving performance, as nothing complicated has to be done, and the code also stays readable. While running a clear app with the first solution took 13MB of my memory, using primitive ints took something under 7MB, so just the half of it.</span></p>
<p>SparseIntArray is just one of the cool collections that can help you avoid autoboxing. A map like Map&lt;Integer, Long&gt; could be replaced by SparseLongArray, as the value of the map is of type Long. If you look at the <a href="https://github.com/android/platform_frameworks_base/blob/master/core/java/android/util/SparseLongArray.java#L45" target="_blank" rel="noopener noreferrer">source code</a> of SparseLongArray, you will see something pretty interesting. Under the hood, it is basically just a pair of arrays. You can also use a SparseBooleanArray similarly.</p>
<p>If you read the source code, you might have noticed a note saying that  SparseIntArray can be slower than HashMap . I’ve been experimenting a lot, but for me SparseIntArray was always better both memory and performance wise. I guess it’s still up to you which you choose, experiment with your use cases and see which fits you the most. Definitely have the SparseArrays in your head when using maps.</p>
<h3 id="ondraw">7. OnDraw</h3>
<p>As I’ve said above, when you are optimizing performance, you will probably see the most benefit in optimizing code which runs often. One of the functions running a lot is onDraw(). It may not surprise you that it’s responsible for drawing views on the screen. As the devices usually run at 60 fps, the function is run 60 times per second. Every frame has 16 ms to be fully handled, including its preparation and drawing, so you should really avoid slow functions. Only the main thread can draw on the screen, so you should avoid doing expensive operations on it. If you freeze the main thread for several seconds, you might get the infamous Application Not Responding (ANR) dialog. For resizing images, database work, etc., use a background thread.</p>
<div class="pop_out_box is-full_width is-big">If you think your users won&#8217;t notice that drop in frame rate, you are wrong!</div>
<div class="tweet_this"></div>
<div class="tweet_this">I’ve seen some people trying to shorten their code, thinking that it will be more efficient that way. That definitely isn’t the way to go, as shorter code totally doesn’t mean faster code. Under no circumstances should you measure the quality of code by the number of lines.</div>
<p>One of the things you should avoid in onDraw() is allocating objects like Paint. Prepare everything in the constructor, so it’s ready when drawing. Even if you have onDraw() optimized, you should call it only as often as you have to. What is better than calling an optimized function? Well, not calling any function at all. In case you want to draw text, there is a pretty neat helper function called drawText(), where you can specify things like the text, coordinates, and the text color.</p>
<h3 id="viewholders">8. ViewHolders</h3>
<p>You probably know this one, but I cannot skip it. The Viewholder design pattern is a way of making scrolling lists smoother. It is a kind of view caching, which can seriously reduce the calls to findViewById() and inflating views by storing them. It can look something like this.</p>
<p>[ccie_c]<br />
static class ViewHolder { TextView title; TextView text; public ViewHolder(View view) { title = (TextView) view.findViewById(R.id.title); text = (TextView) view.findViewById(R.id.text); } }<br />
[/ccie_c]</p>
<p>Then, inside the getView() function of your adapter, you can check if you have a useable view. If not, you create one.</p>
<p>[ccie_c]<br />
ViewHolder viewHolder; if (convertView == null) { convertView = inflater.inflate(R.layout.list_item, viewGroup, false); viewHolder = new ViewHolder(convertView); convertView.setTag(viewHolder); } else { viewHolder = (ViewHolder) convertView.getTag(); } viewHolder.title.setText(&#8220;Hello World&#8221;);<br />
[/ccie_c]</p>
<p>You can find a lot of useable info about this pattern around the internet. It can also be used in cases when your list view has multiple different types of elements in it, like some section headers.</p>
<p>&nbsp;</p>
<h3 id="resizing-images">9. Resizing Images</h3>
<p>Chances are, your app will contain some images. In case you are downloading some JPGs from the web, they can have really huge resolutions. However, the devices they will be displayed on will be a lot smaller. Even if you take a photo with the camera of your device, it needs to be downsized before displaying as the photo resolution is a lot bigger than the resolution of the display. Resizing images before displaying them is a crucial thing. If you’d try displaying them in full resolutions, you’d run out of memory pretty quickly. <a href="https://developer.android.com/training/displaying-bitmaps/index.html" target="_blank" rel="noopener noreferrer">There</a> is a whole lot written about displaying bitmaps efficiently in the Android docs, I will try summing it up.</p>
<p>So you have a bitmap, but you don’t know anything about it. There’s a useful flag of Bitmaps called inJustDecodeBounds at your service, which allows you to find out the bitmap’s resolution. Let’s assume that your bitmap is 1024&#215;768, and the ImageView used for displaying it is just 400&#215;300. You should keep dividing the bitmap’s resolution by 2 until it’s still bigger than the given ImageView. If you do, it will downsample the bitmap by a factor of 2, giving you a bitmap of 512&#215;384. The downsampled bitmap uses 4x less memory, which will help you a lot with avoiding the famous OutOfMemory error.</p>
<p>Now that you know how to do it, you should not do it. … At least, not if your app relies on images heavily, and it’s not just 1-2 images. Definitely avoid stuff like resizing and recycling images manually, use some third party libraries for that. The most popular ones are <a href="http://square.github.io/picasso/" target="_blank" rel="noopener noreferrer">Picasso</a> by Square, <a href="https://github.com/nostra13/Android-Universal-Image-Loader" target="_blank" rel="noopener noreferrer">Universal Image Loader</a>, <a href="http://frescolib.org/" target="_blank" rel="noopener noreferrer">Fresco</a> by Facebook, or my favourite, <a href="https://github.com/bumptech/glide" target="_blank" rel="noopener noreferrer">Glide</a>. There is a huge active community of developers around it, so you can find a lot of helpful people at the issues section on GitHub as well.</p>
<h3 id="strict-mode">10. Strict Mode</h3>
<p>Strict Mode is a quite useful developer tool that many people don’t know about. It’s usually used for detecting network requests or disk accesses from the main thread. You can set what <a href="https://developer.android.com/reference/android/os/StrictMode.ThreadPolicy.Builder.html#detectAll()" target="_blank" rel="noopener noreferrer">issues</a> Strict Mode should look for and what penalty it should trigger. A google sample looks like this:</p>
<p>[ccie_c]<br />
public void onCreate() { if (DEVELOPER_MODE) { StrictMode.setThreadPolicy(new StrictMode.ThreadPolicy.Builder() .detectDiskReads() .detectDiskWrites() .detectNetwork() .penaltyLog() .build()); StrictMode.setVmPolicy(new StrictMode.VmPolicy.Builder() .detectLeakedSqlLiteObjects() .detectLeakedClosableObjects() .penaltyLog() .penaltyDeath() .build()); } super.onCreate(); }</p>
<p>[/ccie_c]</p>
<p>If you want to detect every issue Strict Mode can find, you can also use detectAll(). As with many performance tips, you should not blindly try fixing everything Strict Mode reports. Just investigate it, and if you are sure it’s not an issue, leave it alone. Also make sure to use Strict Mode only for debugging, and always have it disabled on production builds.</p>
<h2 id="debugging-performance-the-pro-way">Debugging Performance: The Pro Way</h2>
<p>Let’s now see some tools that can help you find bottlenecks, or at least show that something is wrong.</p>
<h3 id="android-monitor">1. Android Monitor</h3>
<p>This is a tool built into Android Studio. By default, you can find the Android Monitor at the bottom left corner, and you can switch between 2 tabs there. Logcat and Monitors. The Monitors section contains 4 different graphs. Network, CPU, GPU, and Memory. They are pretty self explanatory, so I will just quickly go through them. Here is a screenshot of the graphs taken while parsing some JSON as it is downloaded.</p>
<p><a href="https://avp-blogs.com/wp-content/uploads/2016/07/4-1.png"><img loading="lazy" decoding="async" class="aligncenter size-full wp-image-1130" src="https://avp-blogs.com/wp-content/uploads/2016/07/4-1.png" alt="4" width="640" height="640" srcset="https://avp-blogs.com/wp-content/uploads/2016/07/4-1.png 640w, https://avp-blogs.com/wp-content/uploads/2016/07/4-1-150x150.png 150w, https://avp-blogs.com/wp-content/uploads/2016/07/4-1-300x300.png 300w, https://avp-blogs.com/wp-content/uploads/2016/07/4-1-56x56.png 56w" sizes="auto, (max-width: 640px) 100vw, 640px" /></a></p>
<p>The Network part shows the incoming and outgoing traffic in KB/s. The CPU part displays the CPU usage in percent. The GPU monitor displays how much time it takes to render the frames of a UI window. This is the most detailed monitor out of these 4, so if you want more details about it, <a href="https://developer.android.com/studio/profile/am-gpu.html" target="_blank" rel="noopener noreferrer">read this</a>.</p>
<p>Lastly we have the <a href="https://developer.android.com/studio/profile/am-memory.html" target="_blank" rel="noopener noreferrer">Memory monitor</a>, which you will probably use the most. By default it shows the current amount of Free and Allocated memory. You can force a Garbage Collection with it too, to test if the amount of used memory drops down. It has a useful feature called Dump Java Heap, which will create a HPROF file which can be opened with the <a href="https://developer.android.com/studio/profile/am-hprof.html" target="_blank" rel="noopener noreferrer">HPROF Viewer and Analyzer</a>. That will enable you to see how many objects you have allocated, how much memory is taken by what, and maybe which objects are causing memory leaks. Learning how to use this analyzer is not the simplest task out there, but it is worth it. The next thing you can do with the Memory Monitor is do some timed Allocation Tracking, which you can start and stop as you wish. It could be useful at many cases, for example when scrolling or rotating the device.</p>
<h3 id="gpu-overdraw">2. GPU Overdraw</h3>
<p>This is a simple helper tool, which you can activate in Developer Options once you have enabled developer mode. Select Debug GPU overdraw, “Show overdraw areas”, and your screen will get some weird colors. It’s ok, that’s what is supposed to happen. The colors mean how many times a particular area was overdrawn. True color means that there was no overdraw, this is what you should aim for. Blue means one overdraw, green means two, pink three, red four.</p>
<p><a href="https://avp-blogs.com/wp-content/uploads/2016/07/5.png"><img loading="lazy" decoding="async" class="aligncenter size-full wp-image-1131" src="https://avp-blogs.com/wp-content/uploads/2016/07/5.png" alt="5" width="640" height="640" srcset="https://avp-blogs.com/wp-content/uploads/2016/07/5.png 640w, https://avp-blogs.com/wp-content/uploads/2016/07/5-150x150.png 150w, https://avp-blogs.com/wp-content/uploads/2016/07/5-300x300.png 300w, https://avp-blogs.com/wp-content/uploads/2016/07/5-56x56.png 56w" sizes="auto, (max-width: 640px) 100vw, 640px" /></a></p>
<p>While seeing true color is the best, you will always see some overdraws, especially around texts, navigation drawers, dialogs and more. So don’t try getting rid of it fully. If your app is blueish or greenish, that’s probably fine. However, if you see too much red on some simple screens, you should investigate what’s going on. It might be too many fragments stacked onto each other, if you keep adding them instead of replacing. As I’ve mentioned above, drawing is the slowest part of apps, so there is no sense drawing something if there will be more than 3 layers drawn onto it. Feel free to check out your favourite apps with it. You will see that even apps with over a billion downloads have red areas, so just take it easy when you are trying to optimize.</p>
<h3 id="gpu-rendering">3. GPU Rendering</h3>
<p>This is another tool from the Developer options, called <a href="https://developer.android.com/studio/profile/dev-options-rendering.html" target="_blank" rel="noopener noreferrer">Profile GPU rendering</a>. Upon selecting it, pick “On screen as bars”. You will notice some colored bars appearing on your screen. Since every application has separate bars, weirdly the status bar has its own ones, and in case you have software navigation buttons, they have their own bars too. Anyway, the bars get updated as you interact with the screen.</p>
<p>The bars consist of 3-4 colors, and according to the Android docs, their size indeed matters. The smaller, the better. At the bottom you have blue, which represents the time used to create and update the View’s display lists. If this part is too tall, it means that there is a lot of custom view drawing, or a lot of work done in the onDraw() functions. If you have Android 4.0+, you will see a purple bar above the blue one. This represents the time spent transferring resources to the render thread. Then comes the red part, which represents the time spent by Android’s 2D renderer issuing commands to OpenGL to draw and redraw display lists. At the top is the orange bar, which represents the time the CPU is waiting for the GPU to finish its work. If it’s too tall, the app is doing too much work on the GPU.</p>
<p>If you are good enough, there is one more color above the orange. It is a green line representing the 16 ms threshold. As your goal should be running your app at 60 fps, you have 16 ms to draw every frame. If you don’t make it, some frames might be skipped, the app could become jerky, and the user would definitely notice. Pay special attention to animations and scrolling, that’s where the smoothness matters the most. Even though you can detect some skipped frames with this tool, it won’t really help you figuring out where exactly the problem is.</p>
<h3 id="hierarchy-viewer">4. Hierarchy Viewer</h3>
<p>This is one of my favourite tools out there, as it’s really powerful. You can start it from Android Studio through Tools -&gt; Android -&gt; Android Device Monitor, or it is also in your sdk/tools folder as “monitor”. You can also find a standalone hierarachyviewer executable there, but as it’s deprecated you should open the monitor. However you open the Android Device Monitor, switch to the Hierarchy Viewer perspective. If you don’t see any running apps assigned to your device, <a href="https://developer.android.com/studio/profile/hierarchy-viewer-setup.html" target="_blank" rel="noopener noreferrer">there</a> are a couple things you can do to fix it. Also try checking out <a href="https://github.com/romainguy/ViewServer/issues/14" target="_blank" rel="noopener noreferrer">this</a> issue thread, there are people with all kinds of issues and all kinds of solutions. Something should work for you too.</p>
<p>With Hierarchy Viewer, you can get a really neat overview of your view hierarchies (obviously). If you see every layout in a separate XML, you might easily spot useless views. However, if you keep combining the layouts, it can easily get confusing. A tool like this makes it simple to spot, for example, some RelativeLayout, which has just 1 child, another RelativeLayout. That makes one of them removable.</p>
<p>Avoid calling requestLayout(), as it causes traversing of the entire view hierarchy, to find out how big each view should be. If there is some conflict with the measurements, the hierarchy might be traversed multiple times, which if happens during some animation, it will definitely make some frames be skipped. If you want to find out more about how Android draws its views, you can <a href="https://developer.android.com/guide/topics/ui/how-android-draws.html" target="_blank" rel="noopener noreferrer">read this</a>. Let’s look at one view as seen in Hierarchy Viewer.</p>
<p>The top right corner contains a button for maximizing the preview of the particular view in a standalone window. Under it you can also see the actual preview of the view in the app. The next item is a number, which represents how many children the given view has, including the view itself. If you select a node (preferably the root one) and press “Obtain layout times” (3 colored circles), you will have 3 more values filled, together with colored circles appearing labelled measure, layout, and draw. It might not be shocking that the measure phase represents the time it took to measure the given view. The layout phase is about the rendering time, while the drawing is the actual drawing operation. These values and colors are relative to each other. Green one means that the view renders in the top 50% of all views in the tree. Yellow means rendering in the slower 50% of all views in the tree, red means that the given view is one of the slowest. As these values are relative, there will always be red ones. You simply cannot avoid them.</p>
<p>Under the values you have the class name, such as “TextView”, an internal view ID of the object, and the android:id of the view, which you set in the XML files. I urge you to build a habit of adding IDs to all views, even if you don’t reference them in the code. It will make identifying the views in Hierarchy Viewer really simple, and in case you have automated tests in your project, it will also make targeting the elements a lot faster. That will save some time for you and your colleagues writing them. Adding IDs to elements added in XML files is pretty straightforward. But what about the dynamically added elements? Well, it turns out to be really simple too. Just create an ids.xml file inside your values folder and type in the required fields. It can look like this:</p>
<p>[ccie_c]</p>
<p>&lt;resources&gt;</p>
<p>&lt;item name=&#8221;item_title&#8221; type=&#8221;id&#8221;/&gt;</p>
<p>&lt;item name=&#8221;item_body&#8221; type=&#8221;id&#8221;/&gt;</p>
<p>&lt;/resources&gt;</p>
<p>[/ccie_c]</p>
<pre></pre>
<pre></pre>
<p>Then in the code, you can use setId(R.id.item_title). It couldn’t be simpler.</p>
<p>There are a couple more things to pay attention to when optimizing UI. You should generally avoid deep hierarchies while preferring shallow, maybe wide ones. Do not use layouts you don’t need. For example, you can probably replace a group of nested LinearLayouts with either a RelativeLayout, or a TableLayout. Feel free to experiment with different layouts, don’t just always use LinearLayout and RelativeLayout. Also try creating some custom views when needed, it can improve the performance significantly if done well. For instance, did you know that Instagram doesn’t use TextViews for <a href="http://engineering.instagram.com/posts/1633609290216367/improving-comment-rendering-on-android/" target="_blank" rel="noopener noreferrer">displaying comments</a>?</p>
<p>You can find some more info about Hierarchy Viewer on the <a href="https://developer.android.com/studio/profile/optimize-ui.html" target="_blank" rel="noopener noreferrer">Android Developers site</a> with descriptions of different panes, using the Pixel Perfect tool, etc. One more thing I would point out is capturing the views in a .psd file, which can be done by the “Capture the window layers” button. Every view will be in a separate layer, so it’s really simple to hide or change it in Photoshop or GIMP. Oh, that’s another reason to add an ID to every view you can. It will make the layers have names that actually make sense.</p>
<p>You will find a lot more debugging tools in Developer options, so I advise you to activate them and see what are they doing. What could possibly go wrong?</p>
<p>The Android developers site contains a set of <a href="https://developer.android.com/training/best-performance.html" target="_blank" rel="noopener noreferrer">best practices for performance</a>. They cover a lot of different areas, including memory management, which I haven’t really talked about. I silently ignored it, because handling memory and tracking memory leaks is a whole separate story. Using a third party library for efficiently displaying images will help a lot, but if you still have memory issues, check out <a href="https://github.com/square/leakcanary" target="_blank" rel="noopener noreferrer">Leak canary</a> made by Square, or read <a href="http://blog.nimbledroid.com/2016/05/23/memory-leaks.html" target="_blank" rel="noopener noreferrer">this</a>.</p>
<h2 id="wrapping-up">Wrapping Up</h2>
<p>So, this was the good news. The bad new is, optimizing <a href="https://www.toptal.com/android">Android</a> apps is a lot more complicated. There are a lot of ways of doing everything, so you should be familiar with the pros and cons of them. There usually isn’t any silver bullet solution which has only benefits. Only by understanding what’s happening behind the scenes will you be able to pick the solution which is best for you. Just because your favorite developer says that something is good, it doesn’t necessarily mean that it’s the best solution for you. There are a lot more areas to discuss and more profiling tools which are more advanced, so we might get to them next time.</p>
<p>Make sure you learn from the top developers and top companies. You can find a couple hundred engineering blogs at <a href="https://github.com/kilimchoi/engineering-blogs" target="_blank" rel="noopener noreferrer">this link</a>. It’s obviously not just Android related stuff, so if you are interested only in Android, you have to filter the particular blog. I would highly recommend the blogs of <a href="https://code.facebook.com/" target="_blank" rel="noopener noreferrer">Facebook</a> and <a href="http://engineering.instagram.com/" target="_blank" rel="noopener noreferrer">Instagram</a>. Even though the Instagram UI on Android is questionable, their engineering blog has some really cool articles. For me it’s awesome that it’s so easy to see how things are done in companies which are handling hundreds of millions of users daily, so not reading their blogs seems crazy. The world is changing really fast, so if you aren’t constantly trying to improve, learn from others and use new tools, you will be left behind. As Mark Twain said, a person who doesn’t read has no advantage over one who can’t read.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://avp-blogs.com/2016/07/detailed-guide-optimizing-android-apps/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>A Useful Comparison Tool For Different Types Of Data Recovery Software</title>
		<link>https://avp-blogs.com/2015/11/a-useful-comparison-tool-for-different-types-of-data-recovery-software/</link>
					<comments>https://avp-blogs.com/2015/11/a-useful-comparison-tool-for-different-types-of-data-recovery-software/#comments</comments>
		
		<dc:creator><![CDATA[avp]]></dc:creator>
		<pubDate>Thu, 26 Nov 2015 12:51:07 +0000</pubDate>
				<category><![CDATA[Misc]]></category>
		<category><![CDATA[data recovery]]></category>
		<category><![CDATA[data review recovery website]]></category>
		<category><![CDATA[data-recovery-software.review]]></category>
		<guid isPermaLink="false">http://avp-blogs.com/?p=1101</guid>

					<description><![CDATA[Data recovery can be a complex process if one is not familiar with various nuances associated with it. For a home user, the availability of so many data recovery programs to choose from can be overwhelming. data-recovery-software.review is a website that systematically evaluates the various recovery software commercially available and which one will best fit ...]]></description>
										<content:encoded><![CDATA[<p>Data recovery can be a complex process if one is not familiar with various nuances associated with it. For a home user, the availability of so many data recovery programs to choose from can be overwhelming.</p>
<p><a href="http://www.data-recovery-software.review/Default.aspx">data-recovery-software.review</a> is a website that systematically evaluates the various recovery software commercially available and which one will best fit a user&#8217;s needs based on their requirements.</p>
<p>All the evaluated data recovery software on that website uses general common parameters for ratings like :</p>
<ul>
<li>Price</li>
<li>Ease of use</li>
<li>Refund</li>
<li>Lifetime updates</li>
<li>Recovery speed</li>
<li>User Manual</li>
<li>Type of file system supported</li>
</ul>
<p>The test results for these evaluated data recovery software are listed in an easy to understand tabular format with the steps involved in testing them (testbed).</p>
<p><a href="https://avp-blogs.com/wp-content/uploads/2015/11/reviewtable.png"><img loading="lazy" decoding="async" class="aligncenter wp-image-1102" src="https://avp-blogs.com/wp-content/uploads/2015/11/reviewtable.png" alt="review table for commercially available data recovery programs" width="627" height="408" srcset="https://avp-blogs.com/wp-content/uploads/2015/11/reviewtable.png 1115w, https://avp-blogs.com/wp-content/uploads/2015/11/reviewtable-300x195.png 300w, https://avp-blogs.com/wp-content/uploads/2015/11/reviewtable-1024x666.png 1024w" sizes="auto, (max-width: 627px) 100vw, 627px" /></a></p>
<p>As per the spectrum of data recovery tasks,<a href="http://www.data-recovery-software.review/Default.aspx"> the website</a> broadly categorizes data recovery tasks into 4 groups :</p>
<ul>
<li><a href="http://www.data-recovery-software.review/data-recovery.aspx"><strong><em>General data recovery</em></strong></a> : This the most common of all data recovery software programs. Simply put, this involves restoring data back to a formatted hard drive after reinstalling OS or recovering a deleted file/folder using any of the data recovery software aimed for home users.</li>
</ul>
<p><em>List of software programs reviewed for general data recovery</em>: EaseUS., GetDataBack, ReclaiMe, RecoverMyFiles, R-Studio, Stellar Phoenix, UFS Explorer and ZAR.</p>
<ul>
<li><a href="http://www.data-recovery-software.review/nas-recovery.aspx"><strong><em>NAS data recovery</em> </strong></a>: <a href="https://en.wikipedia.org/wiki/Network-attached_storage">NAS</a> (Network Attached Storage) is more inclined for enterprise storage platforms that deals with a lot of data and uses Linux. NAS recovery programs in brief first try to access and read the Linux based file systems and them attempt to restore the data.</li>
</ul>
<p><em>List of software programs reviewed for NAS recovery : </em>HomeNAS recovery, ReclaiMe, Runtime NAS recovery, UFS Explorer and ZAR.</p>
<ul>
<li><strong><em><a href="http://www.data-recovery-software.review/raid-recovery.aspx">RAID data recovery</a> </em></strong>: <a href="https://en.wikipedia.org/wiki/RAID">RAID</a> (Redundant Array of Independent Disks) recovery can either be a software or hardware based. Again, this is usually an enterprise level storage platform and tools for this come in two main formats : those which just restore RAID configuration and those who along with that recover file systems too. It is explained in much more detail <a href="https://www.cloudwards.net/what-is-raid/">here</a>.</li>
</ul>
<p><em>List of software programs reviewed for RAID recovery</em> : ReclaiMe Free RAID Recovery, RAID reconstructor, R-Studio and ZAR.</p>
<ul>
<li><a href="http://www.data-recovery-software.review/photo-recovery.aspx"><em><strong>Photo data recovery</strong> </em></a>: Photos and image files can be a pain to recover if not backed up properly! This also includes files that are stored on portable drives, memory cards and thumb drives ideally no more than 32GB in size.  Usually as these files are stored on relatively smaller capacity external storage, the data to be recovered is not massive but it still needs to be recovered from the typical FAT file system which these portable devices use for storage.</li>
</ul>
<p><em>List of software programs reviewed for photo data recovery</em> : EaseUS, GetDataBack, ReclaiMe, RecoverMyFiles, R-Studio, Recuva, Stellar Phoenix, ZAR.</p>
<p>Overall, as this website groups different types of data recovery tasks and then sorts related programs in a tabular format, it becomes easy to focus on what kind and which program is best suited for purchasing.</p>
<p><a href="http://www.data-recovery-software.review/Default.aspx">Do give it a try</a>!</p>
<p>&nbsp;</p>
]]></content:encoded>
					
					<wfw:commentRss>https://avp-blogs.com/2015/11/a-useful-comparison-tool-for-different-types-of-data-recovery-software/feed/</wfw:commentRss>
			<slash:comments>8</slash:comments>
		
		
			</item>
	</channel>
</rss>
