Showing posts with label the. Show all posts
Showing posts with label the. Show all posts

Monday, March 9, 2015

On the road again upcoming events around the world

We’ve been busy traveling and meeting enthusiastic developers from around the world at our Google Developer Day and DevFest events. Early this month Ryan Boyd and Nicolas Garnier were off to Moscow, Prague, and Paris (with a side trip to a Warsaw GTUG). Before that, Saurabh Gupta and I were in Buenos Aires and Sao Paulo while Claudio Cherubino and Michael Manoochehri headed to Hyderabad and Bangalore.

Up next, I’ll be at our events in Tokyo, Sydney, Singapore, and Jakarta. Ryan Boyd and Michael Manoochehri will also be in Tel Aviv and Berlin. If you’re building integrations with Google Apps into your products to connect users with their data, helping customers integrate Google Apps with other parts of their Enterprise IT systems, or are simply customizing your own Google Apps environment, let’s meet!

Here’s my schedule:
  • Google Developer Day in Tokyo - November 1st
  • Google Developer Day in Sydney - November 8th
  • Google DevFest in Singapore - November 12th
  • Google DevFest in Jakarta - November 16th
For Ryan and Michael:
  • Google Developer Day in Tel Aviv - November 13th
  • Google DevFest in Berlin - November 19th
For those a little closer to our home in the San Francisco Bay Area, there are two other events here that are noteworthy. Neither is a Google sponsored event, but you’ll find several members of the Google Apps team in attendance.
  • First up is the gSocial conference on November 8-9 in Santa Clara, California. This is a peer-to-peer conference for Google Apps Resellers and Independent Software Vendors (ISVs) to collaborate, share best practices, and partner to grow their businesses.
  • The Small Business Web is hosting its first Summit on November 11-12 in San Jose, California. Software vendors, resellers, and distributors serving small businesses are attending to make decisions to push the industry forward over the next few months.
If you’re coming to any events of just happen to be near by, drop us a note on Google+ or twitter and we’d be happy to meet and talk with you.



Steven Bazyl   profile | twitter | events

Steve is a Developer Advocate for Google Apps and the Google Apps Marketplace. He enjoys helping developers find ways to integrate their apps and bring added value to users.


Read more »

Saturday, January 31, 2015

Simple AS3 Collision Detection Using the AS3 hitTestObject Method

In this tutorial, were going to learn how to create basic AS3 collision detection using the AS3 hitTestObject() method of the MovieClip class. Collision detection refers to the process of checking whether 2 or more objects are hitting each other - if parts or the whole of each object are occupying the same space on the stage (i.e. if they are overlapping). For this exercise, well put two square shaped MovieClip instances on the stage and make one of them draggable. When the user drags and then drops that instance, Flash will check whether the user moved it to a new location where it is now hitting the other instance.

Lets begin.

  1. Create a new Flash ActionScript 3 document.
  2. Draw a square shape on the stage and convert it into a Movie Clip symbol.
  3. Put a total of 2 instances of this Movie Clip symbol on the stage.
  4. In the Properties Inspector, give one of them an instance name of square1_mc, and give the other one an instance name of square2_mc.
  5. Create a new layer for the ActionScript.
  6. Bring up the Actions panel and add the following code:
square1_mc.addEventListener(MouseEvent.MOUSE_DOWN, drag);
stage.addEventListener(MouseEvent.MOUSE_UP, drop);

function drag(e:MouseEvent):void
{
e.target.startDrag();
}

function drop(e:MouseEvent):void
{
stopDrag();
if (square1_mc.hitTestObject(square2_mc))
{
trace("Collision detected!");
}
else
{
trace("No collision.");
}
}
When you test the movie, you should be able to drag and drop the square1_mc MovieClip instance. And when you drop it, Flash will check whether its hitting the other MovieClip instance or not. If they are hitting, you will see a message in the Output window that says: Collision detected! If they are not hitting, the message you will see is: No collision.

Heres the same code for our simple AS3 collision detection using the AS3 hitTestObject() method, but with comments:
/*You can use the AS3 hitTestObject() method of the MovieClip class
to test whether 2 objects are hitting each other. Hitting refers
to whenever objects collide or overlap on the stage.

Example:
mc1.hitTestObject(mc2);

The example above tests whether mc1 and mc2 are overlapping.
This statement returns a boolean value - true if the objects
are hitting and false if they are not. You can use this method
in an if statement condition.

In this example, we should have 2 MovieClip instances on the stage -
square1_mc and square2_mc.
We are going to make the square1_mc MovieClip
draggable. And when the user drops it, Flash will
check whether square1_mc and square2_mc are hitting.*/

/*Add the MOUSE_DOWN event listener to the MovieClip
instance that we would like to make draggable.*/
square1_mc.addEventListener(MouseEvent.MOUSE_DOWN, drag);

/*Add the MOUSE_UP event listener to the stage.*/
stage.addEventListener(MouseEvent.MOUSE_UP, drop);

/*This event listener function will make the first
MovieClip instance draggable.*/
function drag(e:MouseEvent):void
{
e.target.startDrag();
}

/*This event listener function disables the dragging.
It also checks whether the MovieClip instance being dragged
overlaps with the other MovieClip instance after
it was dropped.*/
function drop(e:MouseEvent):void
{
/*Drops the MovieClip thats currently being dragged.*/
stopDrag();

/*This if statement uses the AS3 hitTestObject() method to check
whether the first MovieClip instance is hitting the
second one.*/
if (square1_mc.hitTestObject(square2_mc))
{
/*Flash outputs this message if they are
hitting each other.*/
trace("Collision detected!");
}
else
{
/*Flash outputs this message if they are
NOT hitting each other.*/
trace("No collision.");
}
}
And that concludes this tutorial on creating simple AS3 collision detection using the AS3 hitTestObject() method.
Read more »

Monday, January 26, 2015

The best minds of my generation are thinking about how to make people click ads and thats ok

"The best minds of my generation are thinking about how to make people click ads. That sucks." - Jeff Hammerbacher
There is a meme going around that too many programmers are wasting their careers working on meaningless software: they spend all their time trying to get people to click on ads, they arent tackling the important stuff, and they arent solving the biggest problems of today. Its as if all programmers should drop what they are doing and instead try to cure cancer, end world hunger, and generally save the world.

Im going to call bullshit.

First of all, dont knock ads--or, to be more accurate, dont not knock making money. The most well intentioned company in the world cant accomplish any of its lofty goals if it has no money, and for many companies, ads are the best way to earn that money.

For example, you are probably one of the billion plus people who search Google over 100 billion times per month (!) to help plan your day, learn new information, and answer questions. Its hard to imagine life without it.
Google also builds maps, video, email, phones, and even more recently, they are trying to provide Internet access for everyone in the world, define what it means to be a healthy human, and to create self-driving cars. And all of this is powered by ads: more than 90% of Googles revenue comes from advertising.

If you kept in touch with your friends and family, read the news, or even followed a link to this blog post, it was probably through Twitter or Facebook. Twitter has played a part in starting revolutions in several countries; so has Facebook. In fact, almost everyone with Internet access has been touched by Facebook (they have 1.32 billion active monthly users) and for those without Internet access, Facebook is trying to help. And just like Google, 90% of Twitters revenue and nearly 90% of Facebooks revenue comes from ads.

Many talented engineers spent enormous amounts of time at these companies getting you to click on those ads. The result, Id argue, has been remarkably world changing: three companies, driven primarily by ad clicks, have connected us to information and to each other like never before. Its almost as if Adam Smith was on to something with the whole invisible hand idea.

But this debate isnt really about ads. Im guessing what people are actually upset about is that so many talented developers are working on products that are not "important". That is, they are building software for their own personal amusement or financial gain instead of working for the benefit of us all.

Well, heres a question: how do we determine which companies or ideas will most benefit the world?

In a remarkable talk called The Importance of Mathematics, Timothy Gowers tackles this same question with regards to mathematics:


Gowers claims that most mathematicians are drawn to intellectually interesting problems rather than practical ones. In fact, he talks about the famous Cambridge mathematician G. H. Hardy, who was "perfectly content, indeed almost proud, that his chosen field, Number Theory, had no applications, either then or in the foreseeable future. For him, the main criterion of mathematical worth was beauty."

Many mathematicians prefer problems that are beautiful to those that are useful. Despite that, mathematics has been the basis for countless discoveries of immense practical value: physicists, chemists, engineers, programmers, and countless others use math on a daily basis to build all the tools and technology of modern society. Even Number Theory, which seems entirely like math for maths sake, turns out to have many practical applications, including RSA encryption, the basis of all Internet security, and the reason you can use passwords, credit card numbers, and exchange other information online securely. Hardy wouldve been disappointed.
Gowers diagram of math knowledge: there is no way to separate the "useful" and the "useless"
Math is deeply interconnected and unpredictable: there is simply no way to know which parts of it will turn out to be important in the real world and which parts wont. The world of companies and products is similar: there is simply no way to know what companies or ideas will end up being a huge benefit to the world and which ones wont.

For example, it wouldve been hard to argue an algorithm inspired by citation analysis could change the world so profoundly--even Larry Page was not convinced as, in the late 90s, he offered to sell the company to Excite for just $1.6M (today, Google is worth around $400B). Many people would scoff at the idea of starting a company to share podcasts, but this is actually the origin of Twitter. As many as 50% of all scientific discoveries may happen by accident and many of the most world-changing ones were not the result of an explicit effort to save humanity (examples). Even the porn industry has had a profound impact on technology. You never know what will change the world.

There is an old Soviet joke my dad used to tell:

Stalin asks his staff, "how many movies do we make per year?"
"100 movies, Comrade Stalin."
"And how many of them turn out good?"
"10, Comrade Stalin."
"Alright, next year, only make the 10 good ones."

Of course, this isnt a justification to blindly build dumb crap, JerkTech, or anything actively harmful. This is not an excuse to work on projects you dont care about nor a reason to put up with Dilbert-like jobs. This post is a call for moderation: it would be impractical for everyone to try to work on projects that obviously change the world; it would be misguided to abandon all projects that change the world, but not obviously.

If youve got the passion and the skills to cure cancer or take on world hunger, then by all means, do it. But if you dont--and many people dont--its perfectly fine to work on something else youre passionate about. If you can build something people want, you have a chance to make the world a better place. Even if it involves ads.

Read more »

Saturday, January 17, 2015

PART 3 Fun with ActionScript 3 variables Complete the story Introduction to Flash AS3 Variables


Create a new Flash ActionScript 3.0 document. Then copy the code below and paste it in the script pane of the Actions Panel. Do not read the trace statement! Just read the variables so as not to spoil the activity.

Your task is to replace the value of each variable with whatever is suggested in order to complete the story in the trace statement. Do not remove the quotation marks when you replace the values. Once all the values have been replaced, test your movie, then go to the output window to read your story. You can do this activity with a friend and try to think of funny and ridiculous values for each variable.

var popArtist:String = "name of famous pop artist";
var cheese:String = "name of type of cheese";
var chemElement:String = "name of chemical element";
var bodyPart:String = "name of external body part";
var internalOrgan:String = "name of internal organ";
var songTitle:String = "title of cheesy love song";
var fighter:String = "name of famous martial artist or boxer";
var fungalInfection:String = "name of a type of fungal skin infection";

trace("A new superhero has been spotted around campus, leaping from building to building. Who is he? Are you sure you wanna know?

Rumor has it that this superhero is a student on campus who was bitten by a radioactive " + popArtist + ". When he woke up, he felt very strange, but still decided to attend class. His classmates thought he was acting strange, and they began to avoid him because he started smelling like " + cheese + " mixed with burnt " + chemElement + ".

But things changed when a crime occurred on campus in the afternoon of that same day. A young girl was being held at gunpoint, and was being asked to surrender her fake " + bodyPart + ". Then out of nowhere, a blurry figure came rushing to save the girl! It was the student who smelled like " + cheese + " and " + chemElement + "! He was now dressed in a lovely costume designed by " + fighter + ". With great speed, he went straight for the gunman and kicked him right in the " + internalOrgan + ". He kicked him with such great force that it made the gunamn scream: " + songTitle + "! And then the gunman ran away. The young girl was safe. And the students cheered!

Happy and thankful, the young girl came up to her savior, gave him a kiss on the cheek and asked, "What is your name, kind sir?" To which our brave superhero replied: I am " + fungalInfection + " Man!");

//Story credits:
//dip magazine, August 2002 issue

After completing this exercise, try making your own version, and ask your friends to fill in the variables.

<< PREV: Variable Naming Rules and Conventions - Introduction to Flash AS3 Variables - PART 2
Read more »