Google's Code Editor
docs.google.com
docs.google.com
Google Apps Script is very useful in conjunction with Google's online apps and their rich libraries. JavaScript makes for a good customization language.
One non-obvious irritation, however, is that scripts cannot be shared. So, for example, one has to duplicate code between multiple spreadsheets rather than being able to import it as one would expect. There's an issue open, but even with a high priority, it's two years old:
http://code.google.com/p/google-apps-script-issues/issues/de...
It is incredibly useful in general, but definitely not news.
Using Google Spreadsheets and the Google finance API available with Google Apps script, I was able to automate every part of this except syncing it with my account (since there's no API to access my financial records.) All I have to do is click a button, and the cells change color based on whether I should buy, sell or hold.
Thank you for your help.
The current price of the share is fetched from another sheet using a vlookup. That sheet is populated by the script. The script is here! https://gist.github.com/2717042
The overall system is based on research I found here: http://seekingalpha.com/article/15134-the-seeking-alpha-etf-...
Here is the scripting engine part: https://gist.github.com/2717042
It's actually possible to simulate a browsing session and have the App Script log in to your broker's site and scrape the data you need. Here is some prototyping code: https://gist.github.com/aaf74e50b9a281396722
http://googleappsdeveloper.blogspot.com/2012/05/introducing-...
Yay!
"Google Apps Script gives users a new level of control over Google products. Now you can access and control Google Spreadsheets and other products using JavaScript scripts that you write yourself and can share with others. Unlike browser-based JavaScript, the scripts you write run directly on Google servers in order to provide direct access to the products they control.You can also use Google Apps Script from Google Sites."
This online code editor seems to be a new and improved UI for creating / editing apps scripts. That said, this editor isn't proprietary. A quick look at the source shows that they're using CodeMirror (http://codemirror.net/). We've tried out various code editors for unclassroom.com (where I work) and code mirror has been the best to work with in terms of features, ease of use and comprehensive documentation. The second version (CodeMirror2) is really top notch compared to other alternatives out there.
But, I'm not sure if I would do it again.
Development style is not enjoyable, coding inside textarea with syntax highlighting is simply not good enough. I would prefer to use my text editor and some way to deploy changes without the need to copy-paste from editor to browser. I want to use my
Also, tell me exactly what language and what runtime is being used on the server. I remember searching the docs and it was "it's javascript". Maybe it's better now, I haven't looked since. Or just use node, after all it's V8.
In ideal world, this is what I would like (and really use):
* let me code offline: my editor. my source control.
* give me some SDK to run code offline like app engine
* give me a way to push changes to server
* great documentation
Without these, it's just too much like VBA in the nineties.
edit: 200 lines of code
I know a great tool for the job.
It works fine with source control and allows documents to be diffed and merged.
The editor is 100% offline as is the product or it can be 100% online at will. No need to push changes to server - just replicate/copy. If you fancy collaboration tools you can use use extensive ones on a subscription basis.
It's got a well documented SDK and an interface that you can call.
Documentation is wonderful.
Automation can be done with PowerShell, VB.Net, C#, Python, Ruby, VBScript, JScript/JavaScript, Java or even Common Lisp if it takes your fancy.
Seriously just use Excel - it's just what you've asked for.
But for two things:
Excel for Mac - $129 (http://www.amazon.com/dp/B003YCOJBC)
Excel for Win - $121 (http://www.amazon.com/dp/B0039L2XG6)
And you need a Windows box or Mac with Excel installed. I personally have access to dozens of machines, literally none of which have Excel. All of them have a web browser, and thus access to Google Spreadsheets and Google Apps Script for free. To me, and many others, that makes all the difference in the world.You can use Office 2010 web apps FREE from a SkyDrive account and openly collaborate with people or you can pay $20 a month per seat for Office 365 and you will get Sharepoint and ALL Office 2010 desktop apps.
The office web apps work perfectly in all browsers (I've tried Chrome, Firefox and IE).
Considering the cost of playing around with Google spreadsheet with those restrictions, it's possibly a good idea.
I've always used Excel to publish result data to a spreadsheet rather than the entire thing. Data collection is done using InfoPath so you get the following workflow:
[www:InfoPath Office 365] -> [dt:Excel]-> [www:Excel report on Office 365]
It depends on your use case. I'd be tempted to use a sharepoint list with a custom report for anything more complicated.
And I don't even use Excel, I run linux, although I've used Excel a lot and I think it's awesome at what it does.
I didn't find your reply as trollish, you certainly do make a very valid point.
We tend to give senior people access to windows machines with Office 2010 Professional Plus on and relegate support staff to Linux machines with Office web apps (in Chrome).
Granted, excel is a powerful tool for an individual to work with, but for teams working with a large number of complex sheets the model breaks down quickly. Keeping up with changes and versions using excel is a nightmare.
Also Word/Excel 2010 have excellent change management tools which integrate nicely with mercurial and SVN built in (under review changes).
You have to frig a couple of command line switches to get it to work but TortoiseSVN has those preconfigured.
EDIT: answers.microsoft.com is full of trash - ignore it...
http://www.ipreferjim.com/2010/11/tip-for-writers-and-noveli...
We have 400+ page documents in the system and they all work nicely :)
What are those collaboration tools for Excel? This is an honest question: all I see is some spreadsheet on shared drive or Sharepoint with some ad hoc process around editing, making sure the need for the merge is avoided.
Something to diff zips of xml almost certainly exists and could be used in the same manner.
Now, patch is another thing ...
Edit, it is not due to my keyboard language, i simply cant use the "}" character, the AltGr combination with the third button after the "L" is not working (My keybard has "ñ").
Ideal would be allowing any publicly accesible URL (with some security measure to avoid blatant security holes) like Github raw master (always up-to-date).
The closest I've found is using eval (which is clearly NOT the best approach). There would need to be a format to specify which services you want to use (as currently it derives these from the source you write in the editor).
I would LOVE to be able to load in 'authorised' libraries to avoid redundant code.
You can hack some of these. Scripts can import code from a remote server, which allows you to edit where you like, push to your remote server and pull it into App Script. That tool enables small libraries, I've used it to write a simple test environment. I think you could test App Script JsTestDriver et al with some kind of mock-up strategy.
I haven't enjoyed it, but it has met the client requirements and that's the main thing, right?
For that matter, why doesn't App Script expose an interface that expresses page components as part of a DOM? The Sheet app could provide an interface to a cell with classes for its particular column, row and sheet, allowing access with jQuery / CSS selectors. Instead users have to learn a new interface with stuff like Spreadsheeet.getRange().
And maybe they've revised the docs, but I spent a fair amount of time in them and didn't see any discussion of what JavaScript tools would not be available. I had to figure that out by trial and failure.
Btw, I was invited to YC interview round to show it. But sadly PG passed on it due to an enterprise strategy. :( Funny thing is I had an acquisition offer on the table during the YC meeting and subsequently closed a round. :)
The coding environment is not very good, but you can build ERPs, CRMs, document management and similar for small businesses on Google Docs, in a way Microsoft Office / VBA never made possible. The modules it provides (spreadsheets, forms, formatted text document, gmail, calendar, wiki) seem to be very useful building blocks for describing your business processes.
I hope they end up expanding this and using it for things like phone code interviews, though. Coding via the regular google docs interface was a bit of a pain.
The documentation[1] And the old support channel[2]… …which is now officially at[3]
[1] https://developers.google.com/apps-script/guide [2] http://productforums.google.com/forum/#!forum/apps-script [3] http://stackoverflow.com/questions/tagged/google-apps-script
Although using the interface builder brings back memories of VB...
I typically do more webapps than anything else, so I have gotten used to designing my own UIs from scratch. I don't mind as it helps keep things very lean... but I'd love to use something like Sencha's app designer thing. I just can't justify the cost currently.
Evidently, you could smell a VB product a mile away because of the awkward widget positionings in the window and the usually-not-resizable aspect.
You had to write manual resize code for all window components in VB, whereas in Qt it was all automatic.
And that's good IMHO
I think that's the idea of Fusion Tables [1]. Since there is an API, I don't see why you couldn't combine it with Apps Script (what this editor is), if you wanted to. I don't think tight integration is there yet but the pieces seem to be in place. I think they just need to allow a script to be invoked from a Table.
Yes, you can do more than a few hundred lines of code. My in house library is now about 5k LOC. Yes, it's basically straight JavaScript. Everything is there except for the DOM. Yes, the online editor sucks. I don't use it at all. (see below how) No, you cannot use jQuery/Prototype, etc (there's no DOM or Window class). No, you cannot use long running methods. Google Docs cuts you off at around 30 seconds of execution. No, you cannot share code. (see below)
-- How I develop on Google Docs:
1. I develop it outside of Google Docs using Sublime Text 2
2. I test using Node.JS + assert() + methane.js (see below)
3. I then minify it using Google Closure Tool
4. Then I copy and paste it into Google Docs
This works well because the online editor blows when you're doing anything semi-complex.
--- Testing in Google Docs
I use node.js + assert() + methane.js. What is methane.js? It's a little piece of JS that mocks some of the Google Apps classes and functions. I can then override that mocked method to return the value I expect Google to return and test my own methods.
It's here: https://github.com/chrisle/methane
Consider it alpha code. It's not very well documented. It works for me!(tm)....
-- Sharing code in Google Docs:
Inside of onLoad() I've seen people use UrlFetch and then eval() the response string as a way of getting shared code to work. Not ideal, but it works. I personally don't share code or use this method.
https://github.com/adobe/brackets-app/
It's early in development and not ready for general use yet.
Unlike Google this one is open source and it runs as a desktop app built primarily with JavaScript, CSS and HTML5.
The same logic applies to another where I let the client update SEO keywords/meta/OG info. Of course I could have built a CMS for it, but then again, they already have a google account and revision history with gdocs is a nice touch.
File -> Build a user interface.
Consider this code: var i = (function () { var k = 1; return function () { return ++k; } } () );
i();
edit: Sorry, this isn't meant to be a dig on the Google's Code Editor as much as it's meant to be praise of how impressive I find CodeMirror (and it's competitor/friend Ace).
Can you give some examples?
The right place for a code editor is as a native application.