I was recently given access to Google’s App Inventor. You know, that ‘building-block’ development environment that’s supposed to make application development on Android handsets easy and fun?
If you’re like me, you followed the setup procedures provided by Google. And then you eagerly created a new project and tried to start the “Blocks Editor”, as per the next set of instructions provided by Google. And then things broke.
The Blocks Editor requires super user permissions to run, otherwise the web start crashes. Here’s how to easily launch the Blocks Editor.
From the command line, create a file
touch javaWebStart.sh
and make it executable
chmod +x javaWebStart.sh
and open it in your favorite editor.
Paste the following into the file
#!/bin/sh
gksudo /usr/bin/javaws $1
and save it!
Now when you click “Open the Blocks Editor” and it asks you what program you want to open it with, point it to that script. It will ask for your root password (the gksudo part does that) and Blocks Editor has everything it needs to set itself up. No more crash!
I’ve spent the last 30 minutes Googling for help to use Google’s AJAX Libraries API. You know what? The solution was right there on that page.
My problem was that I could get a jQuery example to work if I loaded the API like this
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.2.6/jquery.min.js" >
// Do whatever
</script>
but I couldn’t get the example to work if I used the recommended
<script src="http://www.google.com/jsapi"></script>
<script>
google.load("jquery", "1.2.6");
// Do whatever
</script>
Are you in the same boat? Short and simple, here’s the solution:
<script src="http://www.google.com/jsapi"></script>
<script>
google.load("jquery", "1.2.6");
google.setOnLoadCallback(function() {
// Do whatever
});
</script>
Yep, you’ve got to put all your jQuery code inside the google.setOnLoadCallback method. Use the following to test that it works for you.
<html>
<head>
<script src="http://www.google.com/jsapi"></script>
<script>
google.load("jquery", "1.2.6");
google.setOnLoadCallback(function() {
$("a").click(function(event){
event.preventDefault();
$(this).hide("slow");
});
});
</script>
</head>
<body>
<a href="http://jquery.com/">jQuery</a>
</body>
</html>
Say you’ve got a column of data
Hello
Hi
Heya
Yo
Hi
Hey
and you want to find duplicate entries within the column
Hello FALSE
Hi TRUE
Heya FALSE
Yo FALSE
Hi TRUE
Hey FALSE
Google Docs flagged Hi as being a duplicate. How? COUNTIF.
For this example the data starts in A1 and Column B is empty. So type
=COUNTIF(A:A,A1)>1
into B1. You should now see FALSE in that cell. Now copy B1 beside all the other cells you want to test for duplicates.