Just wanted to announce the first beta version of the Spreadsheet bundle (http://skiadas.dcostanet.net/afterthought/2006/04/20/more- spreadsheets-in-textmate/), which offers some basic spreadsheet-type functionality in textmate. You can see a screeshot here: http:// skiadas.dcostanet.net/uploads/SpreadsheetBundle1.jpg and you can watch the 2MB 3min screencast here: http://skiadas.dcostanet.net/uploads/SpreadsheetBundle2.mov No sound I'm afraid. Not much documentation either, it's at a very experimental stage.
Enjoy! Haris
Nice!
Now we just need to be able to use Markdown inline with it and you'd have yourself a pretty good wordprocessor ;)
On 4/21/06, Charilaos Skiadas cskiadas@uchicago.edu wrote:
Just wanted to announce the first beta version of the Spreadsheet bundle (http://skiadas.dcostanet.net/afterthought/2006/04/20/more- spreadsheets-in-textmate/), which offers some basic spreadsheet-type functionality in textmate. You can see a screeshot here: http:// skiadas.dcostanet.net/uploads/SpreadsheetBundle1.jpg and you can watch the 2MB 3min screencast here: http://skiadas.dcostanet.net/uploads/SpreadsheetBundle2.mov No sound I'm afraid. Not much documentation either, it's at a very experimental stage.
Enjoy! Haris
For new threads USE THIS: textmate@lists.macromates.com (threading gets destroyed and the universe will collapse if you don't) http://lists.macromates.com/mailman/listinfo/textmate
-- Nathan DeGruchy http://www.degruchy.org/
Excellent. And I concur with Nathan.
On Apr 21, 2006, at 2:53 PM, Nathan DeGruchy wrote:
Nice!
Now we just need to be able to use Markdown inline with it and you'd have yourself a pretty good wordprocessor ;)
On 4/21/06, Charilaos Skiadas cskiadas@uchicago.edu wrote: Just wanted to announce the first beta version of the Spreadsheet bundle ( http://skiadas.dcostanet.net/afterthought/2006/04/20/more- spreadsheets-in-textmate/), which offers some basic spreadsheet-type functionality in textmate. You can see a screeshot here: http:// skiadas.dcostanet.net/uploads/SpreadsheetBundle1.jpg and you can watch the 2MB 3min screencast here: http://skiadas.dcostanet.net/uploads/SpreadsheetBundle2.mov No sound I'm afraid. Not much documentation either, it's at a very experimental stage.
Enjoy! Haris
For new threads USE THIS: textmate@lists.macromates.com (threading gets destroyed and the universe will collapse if you don't) http://lists.macromates.com/mailman/listinfo/textmate
-- Nathan DeGruchy http://www.degruchy.org/
For new threads USE THIS: textmate@lists.macromates.com (threading gets destroyed and the universe will collapse if you don't) http://lists.macromates.com/mailman/listinfo/textmate
Yes, and a propellor and some wings and we could have Emacs!
Bleh!
S
On Apr 21, 2006, at 5:58 PM, Robert M. Ullrey wrote: Excellent. And I concur with Nathan.
On Apr 21, 2006, at 5:58 PM, Robert M. Ullrey wrote:
Excellent. And I concur with Nathan.
On Apr 21, 2006, at 2:53 PM, Nathan DeGruchy wrote:
Nice!
Now we just need to be able to use Markdown inline with it and you'd have yourself a pretty good wordprocessor ;)
On 4/21/06, Charilaos Skiadas cskiadas@uchicago.edu wrote: Just wanted to announce the first beta version of the Spreadsheet bundle ( http://skiadas.dcostanet.net/afterthought/2006/04/20/more- spreadsheets-in-textmate/), which offers some basic spreadsheet-type functionality in textmate. You can see a screeshot here: http:// skiadas.dcostanet.net/uploads/SpreadsheetBundle1.jpg and you can watch the 2MB 3min screencast here: http://skiadas.dcostanet.net/uploads/SpreadsheetBundle2.mov No sound I'm afraid. Not much documentation either, it's at a very experimental stage.
Enjoy! Haris
_ For new threads USE THIS: textmate@lists.macromates.com (threading gets destroyed and the universe will collapse if you don't) http://lists.macromates.com/mailman/listinfo/textmate
-- Nathan DeGruchy http://www.degruchy.org/
_ For new threads USE THIS: textmate@lists.macromates.com (threading gets destroyed and the universe will collapse if you don't) http://lists.macromates.com/mailman/listinfo/textmate
For new threads USE THIS: textmate@lists.macromates.com (threading gets destroyed and the universe will collapse if you don't) http://lists.macromates.com/mailman/listinfo/textmate
That could probably be arranged, and it is definitely a good idea. Markdown would work well with it. My conventions so far are that spreadsheet lines start with anything (though that could be changed to "|" since that is the separator), "command" lines start with % and comments with #. I guess I could change it so that spreadsheet lines start with "|", command lines with "%", and everything else is considered Markdown. Similarly, Markdown could be changed to accept these characters as starting special "spreadsheet" lines.
The syntax is something I kind of threw together in haste, with only guide to have it similar to Excel syntax, so there is a lot of room for improvement, and I am not too committed to it at the moment. (To begin with, we need to have a lot more commands created. Right now it only does sums, products and averages.)
Keep on throwing ideas! The more the better. On Apr 21, 2006, at 4:58 PM, Robert M. Ullrey wrote:
Excellent. And I concur with Nathan.
On Apr 21, 2006, at 2:53 PM, Nathan DeGruchy wrote:
Nice!
Now we just need to be able to use Markdown inline with it and you'd have yourself a pretty good wordprocessor ;)
Haris
On Apr 21, 2006, at 5:14 PM, Charilaos Skiadas wrote:
(To begin with, we need to have a lot more commands created. Right now it only does sums, products and averages.)
Filter the formulas through Ruby and we gain an instance programming language. You could even use const_missing() to spring the cell references to life as needed... :D
Just a thought.
James Edward Gray II
On Apr 21, 2006, at 5:19 PM, James Edward Gray II wrote:
Filter the formulas through Ruby and we gain an instance programming language. You could even use const_missing() to spring the cell references to life as needed... :D Just a thought.
It's a good thought. I definitely need to retain the cell lookup functionality and have it look as much like Excel style as possible. I'm planning to add variables, probably as lowercase words, and the way the thing works now is that when the parser find command that is capitalized, like SUM(2,3,4), then it runs the function with name "sum" from the ParserDelegate instance. So one can add functionality by simply adding methods to this instance, though I haven't made that terribly transparent atm. These methods atm take one argument, which is an array of values to be processed.
Hm, I think I see what you mean by the const_missing idea. How about cells like C$5 though, or $C$5? Would they be as easy to work with? I definitely want the syntax to allow ranges like C$4:F$4 etc.
The whole design of the underlying Ruby classes leaves a lot to be desired, but I don't have the time to refactor and clean things up right now. That's one of my projects for the summer.
James Edward Gray II
Haris
On Apr 21, 2006, at 5:38 PM, Charilaos Skiadas wrote:
Hm, I think I see what you mean by the const_missing idea. How about cells like C$5 though, or $C$5? Would they be as easy to work with? I definitely want the syntax to allow ranges like C$4:F$4 etc.
No, the dollar signs and ranges need to be beat with the Ruby stick, if you go this way. You could always get const_missing() to support something like C4_F4, returning and Array range. C4::F4 is also possible with some clever proxy object work.
If you want it to look like Excel though, this is not the way to go.
James Edward Gray II
I'm not exactly sure what the interest is in having a powerful spreadsheet in textmate, as there are some fine open source alternatives, but piping commands through R (maybe even using R syntax in your "spreadsheet" file) could rapidly give you additional functionality.
Google R if you haven't heard of it,
Jeff.
On Apr 21, 2006, at 7:09 PM, James Edward Gray II wrote:
On Apr 21, 2006, at 5:38 PM, Charilaos Skiadas wrote:
Hm, I think I see what you mean by the const_missing idea. How about cells like C$5 though, or $C$5? Would they be as easy to work with? I definitely want the syntax to allow ranges like C$4:F $4 etc.
No, the dollar signs and ranges need to be beat with the Ruby stick, if you go this way. You could always get const_missing() to support something like C4_F4, returning and Array range. C4::F4 is also possible with some clever proxy object work.
If you want it to look like Excel though, this is not the way to go.
James Edward Gray II
For new threads USE THIS: textmate@lists.macromates.com (threading gets destroyed and the universe will collapse if you don't) http://lists.macromates.com/mailman/listinfo/textmate
On Apr 21, 2006, at 6:15 PM, Jeffrey Robert Spies wrote:
I'm not exactly sure what the interest is in having a powerful spreadsheet in textmate, as there are some fine open source alternatives,
namely? Please don't say OpenOffice or NeoOffice, because they are bloated and slow for my purposes. I don't need it to be extremely powerful, but I do need it to be fast to load, easy to edit, and easy to create new functions if I want to. For instance, one key function i want to is to be able, from a list of cells, to produce the average of the list after dropping the lowest 3 grades, without having to manually sort the rows that I want to do this in. I just haven't found a way to do it efficiently in NeoOffice, which is what I use when I do need a spreadsheet these days (well, up until now :) ).
I'll also not accept solutions that require X11 and/or are not too easy to install. But if you have some projects in mind. (R.app might do it, I haven't tried it yet. Does it offer a spreadsheet way of editing data?)
but piping commands through R (maybe even using R syntax in your "spreadsheet" file) could rapidly give you additional functionality.
Google R if you haven't heard of it,
Using R actually sounds like a pretty good good idea, though I don't know much about it yet. I actually thought that googling just "r" would be useless, and tried "R language" instead, which indeed gave me some links and much to think about. But it turns out, that searching for "r" also returns the right answer :)
I'll have to look into R more in the future anyway, since I'll be teaching a number of Applied Statistics courses next year. I'll try to incorporate this as an option, like having rows starting with "%R" be passed to R for processing.
Haris
On Apr 21, 2006, at 4:40 PM, Charilaos Skiadas wrote:
I'll also not accept solutions that require X11 and/or are not too easy to install. But if you have some projects in mind. (R.app might do it, I haven't tried it yet. Does it offer a spreadsheet way of editing data?)
Its built-in editor isn't so hot, and it doesn't have a data editor, but it handles tab- or other-delimted data just fine. I use it to calculate grades from a tab-delimited roster that I edit in TM.
Using R actually sounds like a pretty good good idea, though I don't know much about it yet. I actually thought that googling just "r" would be useless, and tried "R language" instead, which indeed gave me some links and much to think about. But it turns out, that searching for "r" also returns the right answer :)
Searches can be hit or miss sometimes. Adding "r-project" to a search will often focus in on documentation or mailing lists that are likely to have good answers.
I'll try to incorporate this as an option, like having rows starting with "%R" be passed to R for processing.
You'd also have to pass the data itself to R or load it otherwise. I'm not exactly sure how you'd do that, but the bundle could probably do it in the background -- pass the sheet contents as a data frame or something, the name of which could be specified, while allowing one to refer to the data in the format that R would understand. Actually, thinking about it more, that would be really pretty cool -- a neat way of editing and performing calculations on ad-hoc tables or relatively small sets of numbers.
On the subject of R, thanks again to the folks who sent feedback on my issue with sending lots of lines to R. I didn't come up with a great solution yet, but I threw together a new command that sends code via a temporary source file. All indications are that there's a bottleneck of some kind in R.app; if anyone else encounters the lock- up problem that I had been having, I'm happy to share the command. (It's short.)
-Alan
On 22/4/2006, at 2:15, Alan Schussman wrote:
[...] a neat way of editing and performing calculations on ad-hoc tables or relatively small sets of numbers.
While the work by Haris looks great, I just wanted to point out that there is an excellent (included by default) math bundle for ad hoc table calculations.
I recorded a screenshot demoing it together with a bit of column selection stuff (all narrated by yours truly):
http://macromates.com/screencast/math_and_column_selections.mov (12 minutes, 26MB)
I haven’t added it to the feed yet.
On Apr 21, 2006, at 9:39 PM, Allan Odgaard wrote:
I recorded a screenshot demoing it together with a bit of column selection stuff (all narrated by yours truly):
http://macromates.com/screencast/math_and_column_selections.mov (12 minutes, 26MB)
Dang, I lost count of how many new tricks I learned in that screencast somewhere around 400!
Thanks for the lesson.
James Edward Gray II
New version of the spreadsheet bundle is out, much improved. And the new screencast to go with it. http://skiadas.dcostanet.net/uploads/SpreadsheetBundle3.mov http://skiadas.dcostanet.net/uploads/SpreadsheetBundle.zip Sorry, still no sound and not much documentation, but let me know if you have any questions.
Haris
On Apr 22, 2006, at 9:27 PM, Charilaos Skiadas wrote:
New version of the spreadsheet bundle is out, much improved. And the new screencast to go with it. http://skiadas.dcostanet.net/uploads/SpreadsheetBundle3.mov http://skiadas.dcostanet.net/uploads/SpreadsheetBundle.zip Sorry, still no sound and not much documentation, but let me know if you have any questions.
Another random idea from an obvious Ruby nut:
set_data([...], ...)
feels more natural as
data[...] = ...
James Edward Gray II
On Apr 23, 2006, at 4:59 PM, James Edward Gray II wrote:
Another random idea from an obvious Ruby nut:
set_data([...], ...)
feels more natural as
data[...] = ...
It does, but it won't quite work as it is. Right now the method data simply returns the array @rows, whose entries are each arrays, one corresponding to each data row. Now, suppose @rows = [[1,2,3],[4,5,6]] and you want to set the cell B3 to some value. Then you would try to do: data[2,1]=7, but this would change @rows into [[1,2,3],[4,5,6],7] instead of [[1,2,3],[4,5,6],[nil,5,nil]] set_data calls another method that makes sure to create any new rows necessary, and fill the required entries with "". So, in this case it would return [[1,2,3],[4,5,6],["",5,""]]. Actually, all those numbers will be strings because that's how the program deals with them. I also want to avoid having nils in the array. Basically, I made an implementation choice to make sure the array is always "full". Maybe this was a mistake, but it made iterating over rows and columns easier without having to deal with nils. Anyway, point is that this would require overriding "data" to somehow return something that could call this "fill rows" function based on the coordinates of the point [2,1] or whatever that is asked of you.
Btw, ideally I would like to be able to also say: data["B3"]=7 instead. It would have to way for the next iteration, which will probably happen in two months.
I guess my problem is that I cannot define a method like: def data[]=(row,col)
or can I?
James Edward Gray II
Haris
in python, you can create a class that redefines __getitem__, __setitem__ and __delitem__.
data["B4"] = data.__getitem__("B4") data["B4"] = 12 -> data.__setitem__("B4", 12) del data["B4"] -> data.__delitem__("B4")
and instead of data[i][j] you could use data[i, j], or just let data [n] (n in N) return another object that overrides __getitem__, __setitem__ and __delitem__ for the specific row. concurrency problems may arise. anyway, kudos for the work!
ciao,
domenico
On Apr 24, 2006, at 6:11 AM, Domenico Carbotta wrote:
Gotta love the nomenclature, too ;-:).
it might stink, but it works :)
Works just fine in Ruby too, without ugly methods: ;)
class SpreadSheet def initialize( rows ) @cells = rows end def []( x, y ) @cells[y][x] end def []=( x, y, value ) # do your cell adding here... @cells[y][x] = value end end
James Edward Gray II
On Apr 24, 2006, at 7:45 AM, James Edward Gray II wrote:
class SpreadSheet def initialize( rows ) @cells = rows end def []( x, y ) @cells[y][x] end def []=( x, y, value ) # do your cell adding here... @cells[y][x] = value end end
This would allow calls like: spreadsheet[row,col] , while I think we were talking about calls like data[row,col], which would mean implementing these methods for the actual array @cells, thus overriding the accessors of @cells. Hence my aliasing suggestion. Here data is a method of SpreadSheet instances which returns the array @cells.
James Edward Gray II
Haris
On Apr 24, 2006, at 3:55 AM, Sune Foldager wrote:
On 24/04/2006, at 10:03, Domenico Carbotta wrote:
in python, you can create a class that redefines __getitem__, __setitem__ and __delitem__.
Gotta love the nomenclature, too ;-:). In Ruby, [] at least, can be overridden without problems.
I don't exactly want to override it, I do want to call it eventually, just under some preliminary work. So I would have to probably alias it and then define a new []=, after creating an object-specific class for the array @rows (since I really need this change only for @rows). So I am guessing something like this, with more interesting implementations for [] and []= :
class <<rows alias_method :orig, :[] alias_method :orig_eq, :[]= def [](row,col) return orig(row) end def []=(row,col,value) orig_eq(row,value) end end
Heh, my first use for object-specific classes. Yey!
-- Sune.
Haris
On Apr 24, 2006, at 7:43 AM, Charilaos Skiadas wrote:
I don't exactly want to override it, I do want to call it eventually, just under some preliminary work.
Just delegate all the methods, then override as needed:
class SpreadSheet instance_methods.each { |m| undef_method m unless m =~ /^__/ } def initialize( cells ) @cells = cells end def method_missing( meth, *args, &block ) @cells.send(meth, *args, &block) end # ... end
Hope that helps.
James Edward Gray II
On Apr 24, 2006, at 7:56 AM, James Edward Gray II wrote:
Just delegate all the methods, then override as needed:
I am not really sending any other methods to @cells, I don't want to delegate anything to it. I really just want to change the accessor methods for the Array object @cells, like my aliasing code suggested. Any reason that code wouldn't work?
Haris
PS: Nice to see how delegating works in Ruby though. :)
On Apr 24, 2006, at 8:04 AM, Charilaos Skiadas wrote:
On Apr 24, 2006, at 7:56 AM, James Edward Gray II wrote:
Just delegate all the methods, then override as needed:
I am not really sending any other methods to @cells, I don't want to delegate anything to it. I really just want to change the accessor methods for the Array object @cells, like my aliasing code suggested. Any reason that code wouldn't work?
That will work fine too. Just modify the row creation method to replace the []=() method of the row it creates.
James Edward Gray II
Excellent idea for a bundle. Thanks for thinking of this and making it happen.
On 4/21/06, Charilaos Skiadas cskiadas@uchicago.edu wrote:
I actually thought that googling just "r" would be useless, and tried "R language" instead, which indeed gave me some links and much to think about. But it turns out, that searching for "r" also returns the right answer :)
Kinda interesting what you get when you Google 'r':
http://www.google.com/search?q=r
R, followed, by flickr, followed by the Guggenheim...
-- Chris Boone
http://hypsometry.com/ : website edification http://uvlist.org/ : free classifieds for the Upper Valley
On Apr 21, 2006, at 5:19 PM, James Edward Gray II wrote:
Filter the formulas through Ruby and we gain an instance programming language. You could even use const_missing() to spring the cell references to life as needed... :D
I just updated the bundle (same link), and it now has a lot more ruby support. First off, you can have it execute one-liners of the form "% r aRubyCommandHere ". These are executed by a Spreadsheet instance. You can access the data by calling "data". So "data[4][5]" will return the entry in E5. To set values, use set_data. so both "set_data ([4,5],28)" and "set_data("E5",28)" will set the value of E5 to 28. Atm the whole program must be in one line I'm afraid. (currently, "data["E5"] will unfortunately not return what you would expect.)
The other way is to add to the built in functions. The file commands.rb contains the module ParserDelegateMethods. This module is being loaded into ParserDelegate. If you add to this module a command like:
def foo(array) dosomethingwitharrayandreturnvalue end
then in your files you could use FOO(2,3,4) to call this command.
Just a thought.
James Edward Gray II
Haris
On Apr 21, 2006, at 5:14 PM, Charilaos Skiadas wrote:
That could probably be arranged, and it is definitely a good idea. Markdown would work well with it. My conventions so far are that spreadsheet lines start with anything (though that could be changed to "|" since that is the separator), "command" lines start with % and comments with #. I guess I could change it so that spreadsheet lines start with "|", command lines with "%", and everything else is considered Markdown. Similarly, Markdown could be changed to accept these characters as starting special "spreadsheet" lines.
The syntax is something I kind of threw together in haste, with only guide to have it similar to Excel syntax, so there is a lot of room for improvement, and I am not too committed to it at the moment. (To begin with, we need to have a lot more commands created. Right now it only does sums, products and averages.)
Haris,
You might want to check the MultiMarkdown table syntax. It would be really cool if your spreadsheet just turned into a nicely formatted table. The syntax is here: http://fletcher.freeshell.org/wiki/ MultiMarkdown
Brad
For new threads USE THIS: textmate@lists.macromates.com (threading gets destroyed and the universe will collapse if you don't) http://lists.macromates.com/mailman/listinfo/textmate
On Apr 21, 2006, at 5:29 PM, Brad Miller wrote:
Haris,
You might want to check the MultiMarkdown table syntax. It would be really cool if your spreadsheet just turned into a nicely formatted table. The syntax is here: http:// fletcher.freeshell.org/wiki/MultiMarkdown
Good idea! Should not be too hard to do i think. I'll have a look at it. Are you thinking of it as an exporting capability, or how the file actually looks like at all times? Or more along the lines of turning the current selection back and forth between the two styles?
Hm, looking at it again, it might not be too easy to accomplish atm, at least not the active editing and moving around. Adding headers should not be too hard, but having cells spanning more than one columns would not be too easy to do (emphasis on "too" here :) ). It would definitely be worth it though, to have the two systems consistent.
Exporting to a multimarkdown array could be done probably with almost no pain.
I mainly use spreadsheets to keep grade score for my classes, compute averages etc, so I haven't had the need for much fancy stuff like that, I was mainly interested on basic computing capabilities, formatting into columns and easy navigation between cells. I guess I should start thinking about it though, there seems to be a fair amount of interest in this. :)
Brad
Haris
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1
I'll have to fix those colors, though ;)
Let us know when you have the spreadsheet theme ready ;)