April 25, 2013

CLFR and Stirling Engines, a promising duo for the future of solar technology!


Fresnel lenses are pretty cool, they are big, flat and you can melt some metals if you have a large enough one and a sunny day... But they are hard to manufacture (and therefore expensive) especially the large, powerful ones that are need by most electric and industrial needs

There are many ways to use the principle behind Fresnel lenses, once of them is the Compact Linear Fresnel Reflector which uses an array of large and flat hori by distributing the light in many long areas (as long as the flat mirrors used) it puts less stress on the absorbers (usually up to 300 °C, allowing to use cheaper materials and a less exotic transfer fluid if needed, it can produce Steam, Saturated Steam or transfer the heat using a synthetic oil to power some heat exchange machine. It is also a modular approach so it can grow as needed so long one has enough space (and budget).

This diagram shows how the light is reflected in the absorbers in a CLFR, in this case the is one absorber at each side of the mirror array.



Here is a video that demonstrates the use of CLFR technology in creating solar power:


You can use CLFR's as a heat source for a Stirling Engine which is particularly efficient (and ecological) into transforming heat into mechanical work which can be used for machinery, generate electricity, or both, this works best if you have a cold source, like ice, a lot of fresh water or even warming cool air in very cold places, this is because stirling engines gathers energy from the thermal transference between the hot and cold zone, so the bigger the difference, the more power it can generate in less space.

If efficiency is crucial and cost its not a problem, multiple layers of smaller stirling engines can be used to transform most of the heat into work, every layer significantly improves efficiency (and cost) by gathering the transferred heat from the previous layer of engines and passing it into another (colder) reservoir. Stirling engines can be adjusted to work even with the heat of the palm of your hand! You can see an example on this video,


Another great thing about using Stirling Engines is that you can leverage costs by producing solar energy day and night! This might sound impossible, but if you gather a lot of energy during the day and store it in a thermally insulated reservoir, you can use stirling engines to extract it slowly (and efficiently) working for as long as there is some heat remaining, so if large enough it could make engine keep running on rainy days, it will even have a little extra performance on those first cold and rainy days since the outside temperature will be even colder than it was the day it was collected, that means even more "free" thermal difference. Also, stirling engines can get expensive, so one can leverage both technologies to provide a very reliable source of power in some places, like developing countries located in places with a lot of sun like tropical places, deserts or even places permanently covered by Snow (this places require deeper heat storage and/or better thermal isolation.

Here is an animation that shows the internal work of the Alpha type Stirling engine, it is important to notice that there is no engine exhaust or combustion at all, all the work come from the temperature difference between the hot and cold sides.


Also, a very small scale demonstration of a Beta type Stirling engine running around 5,000 rpm using the sun and fresnel lens as a heat source can be seen on this video.


Do you have any cool ideas about green technologies? Feel free to post your ideas at the bottom of the article or in our Google+ Site!

April 24, 2013

How to save your favorite web page, web app or browser game as an "application" shortcut using Google Chrome and Windows


Google Chrome has a very handy option that allows you to save a shortcut to any web page that looks like a Web App, it does so by saving a special shortcut in your Desktop (great for our favourite web pages), Start Menu (Great for Google Docs, Spreadsheets, Drawings, Apps Script, etc) or Pin to the Task Bar (save this for the most used ones, like Google Drive) and it will even use the web-page's icon, so far it sounds like a normal shortcut, but when we click on the icon, it open a stripped-off version of Google Chrome without tabs, buttons, address bar or menus.

To create one its very simple, just go to the page you want to save as a "Web App" using Google Chrome and do the following simple steps:


  1. Click on the Chrome Menu ( ).
  2. Select Tools.
  3. Select Create Application shortcuts.
  4. In the dialog that appears, choose which shortcuts you prefer.
  5. Enjoy!
Here you can see the differences between a normal browser tab and an Application Shortcut

Normal Web Browser Tab


Application Shortcut

Neat right?

Here are a few ideas about which pages are great for this option:

  • Facebook.
  • Google+.
  • Youtube.
  • Twitter.
  • G.Mail.
  • G.Drive.
  • Adsense Dashboard.
  • G. Analytics.
  • Blogger.
Or your favourite Browser games, like Travian...

Feel free to let us know about your ideas, suggestions, requests, etc at the bottom of this article.

April 22, 2013

Fix your internet problems with 4 internet sources using Load Balance Broadband Routers


Nowadays internet is very important in most people's lives, and the demand for broadband services growing but really high broadband (+20Mbps) it's not available in most places and sometimes the service it's not only slow, but it's fails every now and then, or maybe the internet service is great, but there are just too many people needing too much broadband at the same time, for example, let's imagine modern scenarios:

A couple it's watching a FullHD movie on Netflix in the living room, at the same time they're daughter it's having a Google+ Hangout with 9 friends because they are making plans for the school trip, her brother it's on the next room playing a First-Action-Shooter on X-Box live using headsets to talk to each other, additionally they all have smartphones, that means 4 different computers who are also downloading tweets, checking e-mail, Facebook, Google+ and maybe even updates... it may sound like too much, but it's not such a rare scenario.

Another problem it's when it's critical to always have an available source of internet, like it happens in most businesses, in this case they might not need too much broadband, but they have a lot of people using a small amount, but all at the same time.

Both scenarios could be solved by using a multi-WAN access point, this looks just like a normal hub, but it can handle many (usually 2 or up to 4) internet sources and distribute the resources as needed in an efficient way, more expensive hardware will be better and handling more requests and the same time, and this is the main point we need to take in consideration when choosing the correct multi-wan hardware.

In the house scenario, they could meet their needs with 3 or 4 internet internet services at 4Mbps each, it would be much more efficient (from a network perspective) to use many "cheap" internet sources, this will limit single connection requests, making sure there will always be a "free" one, also downloading something from a P2P source like Bittorrent makes full use of all the available power in a more efficient way by allowing more separate connections.

In the office scenario it might be better to choose a more expensive option since in an office there are going to be lots of different connection requests made by the employees, the amount of broadband will change, but most places just need to check e-mail, register sales, check pages, catalogs, etc... for this scenarios 4 lines with 2 Mbps each will be enough for a lot of employees.

When implementing Multi-WAN it's best to have internet from different company's, this may sound like a problem, but maybe you can hire internet/telephone from one company and cable-tv/internet from another. So if one fails, the other might still work. This will help avoid losing all sources simultaneously. At the office, if you have many telephone lines, you may hire up to 3 ADSL services from your favourite telephone company, also usually offer the best speeds but always hire the last line from a different source, like cable or (if available) the internet from the power lines.

We recommend using TP-LINK Load Balance Broadband Routers, it provides 3 different models so it's just picking up the one that best suits your needs/budget:

TL-R470T+

Ideal for Gaming/House/Small office  applications.

1 Fixed WAN port, 1 Fixed LAN port, 3 LAN/WAN ports.
Suited for UTP network cable up to Cat 5e.
Memory: 4MB Flash, 64Mb DRAM.
Performance of up to 10,000 concurrent session




Ideal for Small Gaming Centers/Medium office applications.

1 Fixed WAN port, 1 Fixed LAN port, 3 LAN/WAN ports.
Suited for UTP network cable up to Cat 5e.
Memory: 4MB Flash, 64Mb DRAM.
Performance of up to 30,000 concurrent session.


TL-ER5120

Ideal for Big Gaming Centers/Large Office/Enterprise applications.


Gigabit Ethernet on all ports.
1 Fixed WAN port, 1 Fixed LAN port, 3 LAN/WAN ports.
Suited for UTP network cable up to Cat 6.
Memory: 8MB Flash, 128Mb DDRII DRAM.
Performance of up to 120,000 concurrent session.
350Mbps NAT Throughput.


All these products can be found on ebay, the TL-R470P+ costs about $70 dollars.

Feel free to let us know about your ideas, suggestions, requests, etc at the bottom of this article.

April 17, 2013

Our recommendations for the office, the AMD Sempron145


It might be tricky to choose the right hardware for the office in a sea of options, the winner is usually the best looking PC at the store (within an affordable price), and this leads most business to end with Intel Atom powered computers, why? well, Intel invests a lot on advertising and it's deals with most major manufacturers makes it the most common option, giving the impression that it is better... but then, this is why most people associate office computers with poor performance. This is not only the processor's fault, bad configuration (both hardware and software) and poor maintenance.

Also, it is common to expect that a new computer, made by some famous computer manufacturer will come in optimal configuration just out of the box (especially since opening the computer to add anything will void the warranty in most cases), but this is not true at all! this company's usually care more about revenue and need to comply with contracts, this is especially true in entry-level level computers (and all Atom/Sempron computers falls in this category).

My favourite feature of the Sempron145 is it's the amount and kind of RAM it can handle, up to 32Gb of DDR3 (1333mhz) (we recommend a minimum of 4Gb and a maximum of 8Gb) with 10.6GB/s of memory bandwidth, which out scales Intel Atom, who can only hande up to 4Gb of DDR3 (1066mhz for the latest Atom 2800, the rest is 800 mhz or less) with a memory bandwidth of 6.4GB/s (Intel Atom D510). Why is this huge difference? Mostly because of the physical address extension, the Sempron has 62 bits and the Atom still uses the old (and now insufficient) 32 bit.

Another difference is the internal architecture for data handling, the AMD Sempron145 it's core has a Single-core/Single-thread at 2.8 Ghz which makes sense in the Office where people usually requires a single task done pretty fast at a time, while Intel Atom focus on parallel processing wtih 2-cores/4-threads but running at only 1.6Ghz (for the Atom D510), so it "can handle many things" in theory, but in real life, it handles everything so slow that overall performance just seems slow.

A more direct aproach to compare this could be done by benchmark scores (performance average tests) on both, so let's see what http://www.cpubenchmark.net/ says about it on its benchmarks list, for the Atom N2800 (1.86 Ghz) its 644 and 678 for the Atom D510 (1.66 Ghz) while the AMD Sempron shows 847, that's even above some Intel Core2 Duo models.

You can find the complete information from the manufacturers in the following links:

AMD Sempron 145
 http://www.amd.com/us/products/desktop/processors/sempron/Pages/AMD-sempron-processor-for-desktop.aspx

Intel Atom D510
http://ark.intel.com/products/43098/Intel-Atom-Processor-D510-1M-Cache-1_66-GHz

Intel Atom N2800
http://ark.intel.com/products/58917/Intel-Atom-Processor-N2800-(1M-Cache-1_86-GHz)

For a well balanced, cost-effective solution we recommend pairing the AMD Sempron 145 with a video card like the AMD Radeon ONE HD5450 (very cheap and comes with 512mb or 1Gb of video memory) and 8Gb of DDR3 1333mhz RAM. This build is ready (and great) for Dual-Screen, which helps people in the office to be much more productive, specially with the nice performance this build provides in most office applications, including Full-HD video-conference. We recommend Samsung's wide screen LED displays for being stylish, cost-effective and provides great images, 19" and 21.5" are the most popular choices for the office, looking for a nice and cost-effective wireless mouse and keyboard? add Logitech's MK220

Feel free to let us know about your ideas, suggestions, requests, etc. at the bottom of this article.

April 15, 2013

Easy & pretty Sign-in control for HTML/JS with OAuth2.0, Google+API & CSS


When we make a Webapp or a site, we usually need to provide some kind of registration and sign-in, but it's hard and boring for the user to register and remember usernames and passwords for many sites, and some even avoids doing so (unless they really trust/need the site) to avoid sharing his password (most people use the same password for everything or most things).

Using Google+ API and OAuth 2.0 to do the sign-in is very convenient, but for you and your client's/users, since most people will be already signed into they're Google account, all they will need to do is to authorize your App the first time they use it and it will take just 2 or 3 clicks and no typing, and once done it will always remember it, or at least until the user asks to cancel the App authorization, but the best part is that you get the User's name and even the Google+ profile picture, this looks much better than the old-fashioned text-only username that most sites still uses.

The first thing you need to be able to use the Google+ API is to have or create a Google Project, if you don't have one, please follow these steps, if you have one, you need to activate the Google+ API service in the "Services" tag of the Google APIs console.

Note: The URL for your Services in the Google APIs console looks like the following:
https://code.google.com/apis/console/b/0/#project::services

For your code, you will need to manually check 3 things:

  1. A client ID for web applications.  You need to create a new one for each web app that you create. To do this, go to the Google APIs console and click on "Create another client ID...".  In this case we are going to use "Application type" -> "Web application" and for the "Your site or hostname" since we are going to use Google Drive HTML hosting, your address would be something like: "https://googledrive.com/host/", the "Javascript origins" will be automatically set to "https://googledrive.com".
  2. The API key. This can be found in the "Simple API access" section at the bottom of the Google APIs console.
  3. The Scopes. This is where you specify the access rights required by your WebApp, in this case since we only need access to the users Name and profile picture, we are only going to need access to the users Google+ data. When the user is asked for authorization, he or she will see a list explaining the access rights your app is requesting. You can read more about scopes in this part of the documentation.

    To start coding, we need to put all this information inside variables, let's start by doing so:


We can find the rest of the Javascript code required to handle the authorization process on this part of the documentation, so let's make a copy:



So far we haven't moved away from the documentation example and it's usually a good idea to keep it unchanged to make debugging easier, the real action comes when making the API request, this is where we make the adjustments necessary to properly display the user's information with our CSS, for this example let's use a great Open Source Metro Style CSS from http://metroui.org.ua/, notice the adjustments when building the HTML code:



Now we need to add a Login button, to keep things neat, the Javascript in the authorization process hides the button when the user has a valid token (and therefore it's logged in), it is important to add this button on every page that we want the user's information (even if it's not a log-in page) this also helps to enhance security and is convenient for the user to log-in from any part of the UI in certain scenarios (E.g. when the user delete's the browser's cookies, and therefore the OAuth token). It is also interesting to point out that this also means the user is logged to a Google account on that browser, this means that you can retrieve the user's files using a Google AppsScript Script Servlet (as described on this article).

Let's look at the HTML needed for the log-in button of the example.



You can see it all working together in the following Google Drive hosted page (click here to read how to host your own).

Example
Feel free to let us know about your ideas, suggestions, requests, etc at the bottom of this article.

Happy coding!

April 5, 2013

How to parse ScriptDB JSON data into Spreadsheets


Using ScriptDB JSON data is very handy in many scenarios, specially when you need to avoid accidental overwriting when there are two or more instances trying to use the same data.

In "How to share/store Spreadsheeds as JSON data with ScriptDB!" I talked about how to populate your ScriptDB with a Spreadsheet parsed into flat JSON, now let's explore how to put that JSON data back into a Spreadsheet, and this can be done either manually for things like creating an Up-to-this-moment report, or programmatically, so you can keep only your most recent and fast-changing data in ScriptDB and keep a very well organized and readable backups inside Spreadsheets.

Let's take a look at our example Spreadsheet (it's the same one as in the previous article):



You can read an example about how to parse your ScriptDB JSON data into a new sheet in the documentation, so let's use it with a few adjustments so that every time you call the script, it dumps the data inside a sheet whose name is the date of such backup. This is very handy if you plan to use automated reports, doing it manually is very useful for things like "closing" a working shift of a Point of Sales, don't forget to empty the ScriptDB's contents in this scenarios after the data is safe inside the sheet.

Now its time to create a new script, let's get a look at our code:



Everytime we run our script, a new sheet (with the date as name) will be created. Our ScriptDB JSON data looks like this:

{"price":5,"name":"Razor blade","salesToday":0,"onStorage":50}
{"price":2.5,"name":"Toothbrush","salesToday":0,"onStorage":100}
{"price":3,"name":"Liquid Soap","salesToday":0,"onStorage":80}
{"price":3.7,"name":"Shampoo","salesToday":0,"onStorage":80}
{"price":2,"name":"Toothpaste","salesToday":0,"onStorage":150}

And once it's inside a new sheet, it will look like this:



Do note that the order of the rows and/or columns might be different from the original table, so plan your reports accordingly.

Feel free to let us know about your ideas, suggestions, requests, etc. at the bottom of this article.

Happy coding!

April 4, 2013

How to share/store Spreadsheeds as JSON data with ScriptDB!


There are many cases were we want to share data between many Apps, and one of the most popular ways it's to use Google Spreadsheets as a Central DB, and they do a great job on letting you share, download and access the Database in a very human way, but most of the time we want to efficiently query Data, but with Spreadsheets you need to know which cell has your data, filter using the visualization API or do some parsing... this makes it heavy and slow on large Data sets opposed to ScriptDB who is great for querying specific data!

Another limitation of using Spreadsheets is that they are not very good for handling shared accumulators, it's prone to over-writing when two or more users are working with the same cell at the same time, let's imagine the cell's current value its 3, and both client's add a +1, the cell's value its likely to end up as a 4 instead of 5... To prevent this ScriptDB has 2 different kinds of "locks", one public and one private, the difference is that public only allows 1 instance of the APP to run at any given time and the private lock only allows each USER to run 1 instance of the App at any given time.

Each script project get's a "sandboxed" ScriptDB for it's own use, meaning it's isolated from the rest of the users data and other ScriptDB instances from the same user. But were it really shines it's when you use a single ScriptDB for many Apps as a share point, you just need to create a tiny Apps Script webapp and share it as a library to get shared access to it's ScriptDB... not shiny enough? well, you can create many specific ScriptDBs to make everything safer, and organized by simply creating different library's and calling them as needed (creating different library's allows you to limit specific user's access) ... not enough? well, ScriptDB can be easily transferred to a Spreadsheet for a much more readable long term storage of our data. With some careful planning you can make smart data handling that's its fast, efficient and la piece de resistance... it's all free!

So, which are the limits of ScriptDB? According to the Documentation, they are actually  large enough for most cases, the quotas are per-user (so the limit is shared across all user's Apps, or in the case of the library, it goes against the owner of the library) and it depends on the kind of user:

> 50MB for consumer accounts.
> 100MB for Google Apps accounts
> 200MB for Google Apps for Business/Education/Government accounts.

Since it's all Text data wrapped inside JSON objects, this can be quite a lot of data, even for 50MB. So we are usually more limited to the query limits (default 200, maximum 50,000) and the time limit for an Apps Script instance (maximum 6 minutes processing time), in most cases it's a good idea to dump all the ScriptDB's contents inside an Apps Script sheet or sheets for more comfortable future reference and to avoid saturating the ScriptDB's query's responses.

Also keep in mind that ScriptDB it's specially useful with current and fast changing data, and Spreadsheets its better for long-term storage and for making automatic reports. In most scenarios the best approach it's to create a Sheet everyday with the Date as a name and dump the ScriptDB content on it... Also you can start a new Spreadsheet every month, all automatically and, if done properly, you will end up with a Database that your customers will love for being cheap, fast, flexible and the automatic reports are a great plus (you can even send a custom report via e-mail every time ScriptDB is dumped inside a Sheet).

Without more preamble, let's hit the code! We'll start by creating a Library that returns a ScriptDB instance that can be shared between different apps, create a new script and you only need this 3 simple lines of code!

To use this script as a library, remember you need to write down the script's project key, to get it, go to File - > Project properties.


If you plan to share access to this library with other users, remember to set the "Sharing Settings" which can be found in File - > Share...

To import your library, create (or open) a new Apps Script project and go to Resources - > Manage Libraries and write you Library's project key, inside the "Find a library" box.



Now, it's time to put some JSON data inside our library's ScriptDB! in most cases, we want to get our data from a Spreadsheet either because the Data is already on one, or simply because it is easier to write, as an example let's use the following spreadsheet:

The Apps Script code needed to do this, can be found on this part of the documentation, let's see a copy (with a few modifications):



This will make a flat JSON version of our Spreadsheet inside our shared ScriptDB! Flat JSON is very easy to work with, and remember you can put it back or make a copy in a Spreadsheet at any time.

There is a example code in the documentation to make a quick-check of your ScriptDB content, just create a new script with the following code:



Now you can see the ScriptDB's content by checking the Apps Script Log, our example spreadsheet data would look like this:

{"price":5,"name":"Razor blade","salesToday":0,"onStorage":50}
{"price":2.5,"name":"Toothbrush","salesToday":0,"onStorage":100}
{"price":3,"name":"Liquid Soap","salesToday":0,"onStorage":80}
{"price":3.7,"name":"Shampoo","salesToday":0,"onStorage":80}
{"price":2,"name":"Toothpaste","salesToday":0,"onStorage":150}


Feel free to let us know about your ideas, suggestions, requests, etc at the bottom of this article.


Happy coding!