Vim-like command-line spreadsheet SC - How do you deal with the lack of Undo feature? [closed] - command-line

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack Exchange site, you can leave a comment to explain where the question may be able to be answered.
Closed 8 years ago.
Improve this question
I'm looking for a command-line spreadsheet and so far sc is my best find (I explain why at the end of this message).
But the lack of Undo feature is killing me. How do you deal with the lack of this vital missing feature?
Right now, when I make a mistake, I either have to correct it manually; or I have to close the file without saving, re-open it, and re-do all the recent changes - which is a pain; in fact, it makes me just want to not use sc at all, which is a shame as it's the only spreadsheet that seems to do everything else I want.
I've come up with a wonky solution (haven't tried it yet): as the F-keys are programmable, I could make one of them commit my spreadsheet in Git, and another one "undo" my recent changes, by reversing to the previous commit. And maybe also one to redo. That's not ideal, really... So I would appreciate any better idea.
Oh, also! Another missing feature of sc is the community. There is not mailing list (nor IRC channel). If there's people around using sc, I might be up for setting up a mailing list so we can exchange questions and ideas. Any takers?
Appendix: Why sc is the best command-line spreadsheet for me so far:
It's still (passively) maintained,
has Vim key bindings,
functions can be programmed in any language
cells can run external commands and return their output in the cell
can apply colors to cells and text (I use spreadsheets to "tell a story", or to "help me understand something", so I need it to be visually obvious, what values I can manipulate and where the interesting results are)
can encrypt/decrypt spreadsheets
Here is a bit more info about sc:
simple tutorial
manual (lists most key bindings)
step by step manual
man page (That's where you will find most info, really)
And here is the Github issue for the Undo feature. It is tagged "will take patch", and there is a discussion of different ways the feature could be implemented.
PS: Another command-line spreadsheet you might want to have look at is teapot, which also seems excellent (and also lacks the Undo feature). In fact it has got excellent features that sc lacks, but personally I would use sc for the Vim key bindings, the colors, and the fact that I can program functions in any language.
PPS: I didn't have enough reputation to post this message with the tag "sc", so I tagged it Vim instead, as Vim users might be interested by this spreadsheet.

Related

How do you organize example code for future reference? [closed]

Closed. This question is opinion-based. It is not currently accepting answers.
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed last month.
Improve this question
Very often when programming, I find that I encounter problems that I have solved in the past, but don't remember the solution to. I've been trying to record notes and code snippets of solutions I come up with so that I can reference them in the future. but I don't know the best way organize my solutions so that I can quickly and productively find them in the future.
Right now I've been putting code examples into separate files in a big directory, but it can get hard to find things for the future. It would also be nice to have the ability to search for keywords so that I can quickly find what I'm looking for.
Does anyone have any suggestions for how to organize a personal body of code to use as reference for future programming?
In the past, I tried to organize my folders and make a "Dictionary" of different problems with their solutions. Unfortunately, I found it was very time consuming even though it was well organized with a few collegues.
If you're working with common languages (C#, VB.Net, Java, html, javascript, css, ...), Internet is your best repository. I find it faster to type what I want on a search engine (or stackoverflow directly) than browse into a home made repository.
If you still want to make a repository, I prefered keeping the entire projects and have a "master file (excel can do)" where you can search for keywords and find which project deals with the problem.
Once in a project, you can do another search for the exact location. I found it less time consuming to do another search than pointing the diffrerents files/functions to look at in the "master file".
Hope this helps.
A friend of mine introduced me to Notion. It's basically like Evernote but has quite a lot more and you can write code blocks etc. Ever since, I use that to keep references of code and some explanations etc. Most of the time I'm too lazy to even copy and paste code snippets I find on Stack Overflow and so I just copy links into there as well. Anyway, I think some sort of integrated solution like this is pretty great.

What are the most important features of an IDE for Perl development? [closed]

Closed. This question is opinion-based. It is not currently accepting answers.
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 1 year ago.
Improve this question
As some of you might know I am the lead developer of Padre, The Perl IDE. In the first year of its development, Padre became an acceptable text editor with some extra features for Perl development.
I'd like to ask the Stack Overflow community for some help in driving the project further to turn it into an exceptional IDE for Perl development. So I'd be glad to read what do you think are the most important features of an IDE that are still missing from Padre?.
Especially I'd be interested in people who currently use Eclipse+EPIC, Komodo, Visual Studio, or any of the text editors for programmers.
The most important feature of an IDE for Perl development (including Padre) is:
an interactive debugger that actually works. E.g. remembering breakpoints, ability to drill down into complicated data structures, and copy (to clipboard) should work on watched variables - including a menu command Copy Special that allows putting it in various formats; say CSV, XML or tab-separated.
The two most invaluable features I find:
line-by-line debugging, watchpoints, breakpoints, and so on, so I can properly debug my code.
code completion so I don't have to go looking up docs (even online).
OK, here's my third answer, although I hate to say it.
The competition is pretty easy to install. Padre isn't. I tried to update to the latest release today and, once again, got failing tests.
I am a heavy Perl EPIC user and my biggest gripe is not being able to jump to a function that is clearly defined in the current context (usually by pressing F3). It is pretty
much hit or miss at this point.
Stability. People turn away quickly if their editor crashes and they lose their work.
I work with Komodo. I also use other editors but I come back to Komodo most of the time. A good IDE shoud have:
A good Debugger. Breakpoints, watch lists, everything you need.
Remote debugging. Threads debugging capability.
Syntax highlighting including weighted fonts as well ( I was pretty disappointed by Oxygen, for example, an XSLT IDE, where I can not use bold fonts to emphasize reserved terms)
Syntax completion.
Project management tools, preferable extendable by plugins.
Good VCS integration. This is something that I absolutely love in Eclipse: You instantly see what files have local changes and which aren't added to the repository yet. And you get to browse the different versions and have a nice diff view just one mouse click away.
A project manager. It's essential for me to be able to define the set of files and folders that comprise a particular codebase. Sessions are useful but not a replacement.
Testing integration.
Perl has great unit testing tools. When I run my test suite and get a failure, I want to see the code for the test that failed.
Having a good way to jump through test results and see the code for the failed test along with the expected and actual results would be a great boon.
The first thing I look for is some kind of overview of the currently active file. I'd like to see methods/functions and, if possible, the used modules and especially any use base statements.
You solved that pretty well in Padre.
Visual-Studio style refactoring for variables and function names and extraction of functions.
Visual studio searches your whole module for all references and allows you to see all changed lines in case you do not want to change one instance (for whatever reason)...
The question seems more debatable than answerable.
Risking myself of being accused copyright abuser, I will post contents that I remember from the book "Interactive programming environments" by David R. Barstow, Howard E. Shrobe, Erik Sandewall.
It will not be exactly the same, as I have read the book many years ago and I've jotted down it in another language.
PRINCIPLES OF A GOOD INTERACTIVE PROGRAMMING ENVIRONMENT
1: Know the user
+ Know the previous knowledge and practice of the user
2: Minimize the memorization
+ Selection and not characters entering
+ Names and not numbers
+ Predictable behavior: the user should have a previous impression of what the system will do
+ Possible access and changing of the parameters of the system
3: Optimization of operations
+ Fast execution of common operations
+ Inertia of visualization: the screen should change the less possible
+ Memorization of system operation in user's memory
+ The meaning of specific operations should have a simple relationship with the state of the system
+ The system must be prepared to accept more than 10 followed commands per second, so that it can operate on the user's muscular memory
+ The system should be prepared to organize the parameters of a command
4: Engineer for the errors
+ Provide good error messages.
+ Engineer it to remove away the common errors.
+ The system should provide reversible actions.
+ Redundancy: the operations should have more than one way of being done.
+ Integrity of data structures.
The ability to configure and run external (command-line) tools. Plug-ins are great but end-users won't necessarily want to author one just to integrate with an external tool. Allowing users to configure their own tools provides a great deal of extensibility with minimal barriers to entry.
My editor of choice is UltraEdit. It's not an IDE, but through its support for user tools, I've been able to integrate IDE features such as lint, version control, debugging, and more.
This can be possibly achieved via use strict; but could be as well a valuable feature even if not use'd explicitly, namely:
the other day we spent about 10-20 minutes debugging the following behavior:
my %hash;
$hash->{'key1'} = value1;
# on reading in a different module
print $hash{'key1'}; # is, of course, empty, but was so easy to overlook in the code above
resume:
proper Perl type safety brought in by the IDE.
It might be already implemented in Padre, though, as it turned out not in Eclipse+EPIC
I use emacs. I would like a system that helps me refactor code, especially when I'm working on ugly 1999 code that uses the begin-at-the-beginning-go-to-the-end philosophy combined with duplicate-and-modify.
I looked at Eclipse, but I can't work with a system that requires me to create a project before I can make a one-character correction to a file.
I looked at Padre, but it's slow and crashes.
I looked at Kod which claims to be configured by CSS, but I can't find a man page that will tell me where to put the CSS.
Integration of a read-eval-print loop. As a heavy Emacs user, I very much appreciate Sepia. Very useful for trying things out before I commit them to code.
Ability to create and debug XS code.
The ability to use my own choice of editor (which it may have, as far as I know). That has a chance of winning over the vim/emacs people.
I don't know if Padre can do this, but the ability to split the screen is very important to me. As a VIM user, I constantly split my screen to look at another file while coding.
Line ending policies for files, by directory, and project-wide.
So, for a given project or directory, I'd like to make all line endings be LF only. While in another directory I may wish to have a mix of CRLF and LF files.
I work a lot on stuff that goes back and forth between Unix and Win32 environments.
The typical solution of automatically converting all files back and forth as one moves from platform to platform hasn't worked well for me.
When a file gets created in the wrong format by accident, it can be a real pain.

Emacs Wishlist: what features is emacs lacjing right now? [closed]

Closed. This question is opinion-based. It is not currently accepting answers.
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 9 years ago.
Improve this question
Emacs is great. To me at least, Emacs is a metaphor of all software. Still, I know that it lacks some features sometimes that you have to actually migrate to other environments. Given emacs is so customizable, and great and everything, we only have to wish for it right? What do you think is a feature that emacs lacks right now?
Note: As of Emacs 23, there is support for M-x butterfly.
There is a wishlist on EmacsWiki.
I'd like to see a better package manager for emacs. Perhaps something like RIP? ELPA looks interesting, but I don't like that it's trying host and consolidate all the packages. I'd prefer to be able to add modules from any git or cvs repository I find. I'd also like the modules in this theoretical package manager to have a standard way to include icons and info file. Finally, I'd like it to have a dead-simple method of compiling all modules.
I've tried to modularize my emacs files in this style (see my github emacs.d repo), though I'd happily ditch it if something better gained widespread support.
An implementation of elisp that's not 1985's state of the art. I mean, seriously -- global variables everywhere? A non-reentrant parser? It's like they don't want people to work on it. I briefly looked at adapting Emacs to be a shared library, but I couldn't get past even parsing elisp files.
I wish a standard code sense autocompletion(hippie-expand is some kind out of date), and a better GUI to support such things as the flowing completion candidates list which should be no worse than that of VIM.
Well, since Emacs is moving to guile, meaning modern lisp is imminent, the only things I want is the ability to add buttons somewhere. A button browser, or a toolbar buffer would be nice.
On the other hand, one of the best things about emacs is that it doesn't populate your screen with just about anything.
However, the ability to for instance, make a JUnit testing buffer in it's own buffer, etc. would be great. Perhaps forcing button buffers being in it's own frame of something (a new type of frame, like GUI-frame or something?)
Oh, and better rendering capabilities, and a flash plugin so we don't have to start a separate program just to browse the web.
Edit: By "imminent" I mean imminent as in geologically imminent.
Since you have C-x M-c M-butterfly, you really don't need much else.

Is there any good tool to refactor Perl web code? [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
Questions asking us to recommend or find a tool, library or favorite off-site resource are off-topic for Stack Overflow as they tend to attract opinionated answers and spam. Instead, describe the problem and what has been done so far to solve it.
Closed 9 years ago.
Improve this question
I'm currently working on a Perl web app LAMP style and recently stumbled upon this death maze of code left by some previous developer. He left so many magic numbers and weird logic that it gives me a headache every time I had to go through it.
I'm learning unit testing right now so I want to find some useful tool to refactor the code and write unit test along the way to make sure that I don't accidentally break anything.
Any recommendation for any good refactoring tool for Perl?
Preferably free :)
I think Eclipse / EPIC has "some" Perl refactoring tools... but don't quote me on that ;-)
Might also be worth checking out Komodo. However the full version isn't free like Eclipse / EPIC. You could try their opensource version Komodo Edit but I guess it won't have all the features?
I've not used either above or any other refactoring tools... I get by with vi/vim & TextMate editors and what they provide (or what I've so far found in each of these editors!).
Making unit tests is a good start. Also have a look perltidy / Perl::Tidy & Perl::Critic which may help peer thru the mess and find some of those "code smells".
Probably, volunteers on Refactor :my => 'code' can help you. Anyway, it's free to ask :)
Perl's dynamic nature means that it is very hard to create refactoring tools for it.
However with regards to testing you should be able to put together some regression tests to help you on your way. This works by starting with the code as it is now and capturing its current output. This might be running the CGI script from the commandline and saving the resultant HTML to file.
Once you've captured this you can change the code and as you go check to see that the HTML has not changed, which means that the code has not broken. When changes do occur you can then either find the bug, or change the test to accept the new HTML as correct.
This can be a bit of a chore to set up but will make your life easier in the long run. You should try to automate these tests to make the easy to run. Checkout Test::WWW::Mechanize and Test::LongString as well as all the others.
While it's not really refactoring in any great depth, this PerlMonks node describes a couple of Vim mappings for deobfuscating perl code using B::Deparse.
Their examples:
You can type _d when your cursor is over this line in normal mode:
--$|&&s|\n|-|;
... and it will be replaced with:
s/\n/-/ if --$|;
And this line:
$foo and $bar or $baz = 1;
... would be replaced with:
$baz = 1 unless $foo and $bar;
Eclipse with the EPIC plug-in does have some refactoring support. Not as sophisticated as IntelliJ's refactoring for Java tool. Not 100% sure it would help with your problem though. They way I've used it is to highlight blocks of code and move them into functions / methods. In your case you're probably going to want to do a lot of search/replace on those magic numbers...
I assume you're going to use Test::More to write your unit tests. Some of the other EPIC tools could help with that (eg "todo" tags).
You could also use Test::WWW::Mechanize and Test::WWW::Selenium -- would be useful in your case to have selenium tests defined to make sure you don't break any end-user functionality. EPIC doesn't have anything in particular to help with that though but it should be possible to use it to step-through the code when debugging.
Good luck. :-)
See Devel::Refactor - Perl extension for refactoring Perl code.
https://metacpan.org/pod/Devel::Refactor
vim! (Or any other text editor)
There really isn't a magic tool to refractor your code, there is tools around to (for example) rename variables/functions, but there is no way it can magically fix horrible code structure or weird logic.
Padre has some refactoring tools.
Renaming of variables works pretty good for a while (two years or so) now.
http://padre.perlide.org/
Disclaimer: I am a Padre contributor.

How to make mockup screenshots without VB [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations.
Closed 6 years ago.
Improve this question
I am looking for a program to make mockup screenshots with. I first found out I could do it with Visual Basic (uglier names I have yet to hear a programming language being called) from joelonsoftware.com. I don't want to start learning VB now, especially since I am still in the process of learning Java. I then found mockupscreens.com, with the searchstring "how to make mockup screenshots". But seeing as I am going to use this program quite infrequently, I don't think paying $80 for it is worth it.
The mockups I'd like to do would be mainly for Windows XP (perhaps also for GNOME, KDE and Mac OSX, but these are not top-priority).
Edit: Balsamiq is suggested, but this is also a non-free program.
Balsamiq
Visio works well, if you have it.
Personally, I like paper and a pen. Then I can't get bogged down in the LOOK of it, and go more for the usability and function. Same with websites.
Once you have the form infront of a customer, you have zero room to move - it you dont deliver it pixel-perfect, they get..... angry. :)
You don't have to learn the language to use the visual forms designer from Visual Studio to create mockups. Furthermore, the Express Edition of Visual Studio is freely available in several languages, namely VB, C# and C++. Take your pick. All ship with the same forms designer that generates backend code in one of the languages. But if you only need the designer, the code might not be relevant for you.
Microsoft Visio used to come with a template containing common Windows UI elements for this purpose. I don't know if it still does.
Jeff Attwood posted about this on CodingHorror - where he mentions Powerpoint prototyping
pen and paper, or if possible, whiteboard. Once you have something you personally think could work I'd go for as rough a computerized model as you can so you don't spend time agreeing font size before the workflow etc is done. The tool I have used here is my visual designer of Visual Studio (it doesn't look too good with screenshots, only good enough to convey what you'd like to build).
Pencil (runs within firefox)
As suggested, C# Express would be well for this, as like VB, it has a GUI designer, but it is also syntactically similar to Java, so - given what you are trying to learn and do with this, it might be a nice fit.
There is a pretty exhaustive list here:
http://c2.com/cgi/wiki?GuiPrototypingTools
Important point is whether the tool has "black&white" (or "hand-drawn") skin for your mockups, as already commented by others. Many of the tools (including my own, MockupScreens) do.
wxGlade would work as well, plus it's free software.
http://balsamiq.com/ was already mentioned, but I want to explain why I like it.
It will allow you to sketch up a screenshot, and it still looks like a pen and paper version, or a whiteboard discussion.
If you get to detailed on your screenshot, then the customer thinks you are "done" and does not understand whats taking you so long to finish the project. So this "sketchyness" serves as another layer of abstraction.
MockupUI is another one, but its mockups don't look like hand-drawn. They look like the real thing and with real data. It lets you draw wireframes as well as native widgets inheriting their appearance from your OS configuration (aka Windows visual style).
About high-fidelity mockups: The risk that a customer thinks that it's "already done" is minimal as long as you do your mockups during the design specification phase of your project (that's before starting to code). On the contrary, a sketch may be too abstract for the customer to digest, unless he is a software designer too. Sketches are for developers not customers.
Wireframes (or sketches) and mockups are not the same thing and they have different uses. One is to explain functionality, the other is a representation of what the product will look like. Check out Yisela's post about the difference between wireframes and mockups.
Your question was about mockup screenshot software, but you ended-up buying a pretty powerful wireframing software.