Red or Rebol 3: choice is hard - rebol

I have tested Red, as for the language It's easy enough as it doesn't differ much from Rebol. But I really miss some console features, the most annoying for me is
red --do
and
autoloading script
which are missing. Are they planned ?

A --do command-line feature is planned for 0.6.4. Autoloading script is not planned for now, as it represents a potentially big security hole. Moreover, in Red, you can easily compile your own Red console for running your scripts, and include there whatever Red code you want integrated. You would need to download Red sources for that, then from the repo's root folder:
red -r %environment/console/console.red
You can edit the %console.red script to include whatever you want.

Related

Xcode whitespace screwed up on git rebase

After I do a git rebase, the code lines I have added/modified are indented four spaces or more to the left of the respective code block. This is incredibly annoying and time-consuming to fix, not to mention it makes it unreadable for Objective-C (imagine if I was coding in python...?)
Xcode (or whatever, git?) adds in tabs in place of the spaces, and my Xcode is set to make tabs spaces.
No one at my work seems to have a good answer for why it occurs. I made trustctime false, but that did not help. Any help?
This could be a whitespace setting. Check out the options for core.whitespace on the git-config man page. If you have that set as well as apply.whitespace, then git will do things to your whitespace, probably including during a rebase.
Try finding out what git config core.whitespace and git config apply.whitespace are and modify them in your ~/.gitconfig file or with something like:
git config --global apply.whitespace nowarn
UPDATE
I think this may be a duplicate of git whitespace woes
END UPDATE
Unless you've done some customization into your git post-commit hooks or to your git config core.whitespace settings (thanks for pointing that out jesse), git does not translate spaces to tabs or vice versa or anything like that. The changes are usually results of your environment/files and your merge activities.
Having dealt with this in various forms, my guess is that some of your peers are using tabs and some are using spaces. People will have flame wars all day long on whether you should use tabs or spaces, and depending on the day and language I hop sides. That's not something I will get into here.. However just about every rational participant in said war would agree that regardless of which you pick, you need to pick one and use it consistently throughout a project.
Most reasonable editors allow you to control whether tabs or spaces should be inserted, and I know XCode is no stranger to this.
I would suggest showing the whitespace or using briefly an editor which allows you to see the whitespace to see what the difference actually is. Seperately, after you correct a whole file you could also just use git diff -w -b to suppress white space changes. That said you should really figure out what the heck is causing your whitespace to go nuts on a rebase because that suggests to me most likely git is confused by mixed usages, and multiple people correcting it at multiple points with different resolutions.
Good luck to you, it's never easy, and someone is always unhappy when their cheese gets moved.
I don't know what about my git-config was the issue, but after clearing it out and re-doing my settings, the problem was fixed. I don't have my old git-config :( This occurred many months ago, but I thought I would express that this was not xcode related.

IntelliJ show changed lines not covered by unit tests

In my daily work, I intend to write tests for the code that I change.
My workflow usually is like this:
Find code to change
Write failing test
Change code
Watch test pass
And before commit, I run all tests.
But in reality, I could change any lines unknowingly about our test coverage.
What I do now is usually to see if the CI server will show increasing test coverage. But this is a manual task which I have to do after my commit, and it also may be cluttered by others committing code.
How can IntelliJ help me? I cannot directly find a way to compare test coverage. How can I ensure my changes drive test coverage up?
How do you currently handle this aspect of your code coverage?
IntelliJ IDEA includes the code coverage support since the 6.0 version (Ultimate edition).
Through Run -> Edit Configurations -> Code Coverage you can configure the code coverage you want, then you can issue the "Run tests with coverage" command. You'll have as a result some code coverage data on the project view. When you open a source file you can also see what lines are fully covered, partially covered, or not covered at all.
You might want to customize the Colors & Fonts through File -> Settings -> Editor -> Colors & Fonts -> General modifying the following entries:
Full line coverage
Partial line coverage
Uncovered line
For example I wanted to add more evidency to the coverage, so I configured a different background for those lines.
Once you have some red lines (not covered), you can try to cover them and if you see them becoming green it means you did a good job, and so on!

Is there a way to 'test run' an ant build?

Is there a way to run an ant build such that you get an output of what the build would do, but without actually doing it?
That is to say, it would list all of the commands that would be submitted to the system, output the expansion of all filesets, etc.
When I've searched 'ant' and 'test', I get overwhelming hits for running tests with ant. Any suggestions on actually testing ant build files?
It seems, that you are looking for a "dry run".
I googled it a bit and found no evidence that this is supoorted.
Heres a bugzilla-request for that feature, that explains things a bit:
https://issues.apache.org/bugzilla/show_bug.cgi?id=35464
This is impossible in theory and in practice. In theory, you cannot test a program meaningfully without actually running it (basically the halting problem).
In practice, since individual ant tasks very often depend on each other's output, this would be quite pointless for the vast majority of Ant scripts. Most of them compile some source code and build JARs from the class files - but what would the fileset for the JAR contain if the compiler didn't actually run?
The proper way to test an Ant script is to run it regularly, but on a test system, possibly a VM image that you can restory to the original state easily.
Here's a problem: You have target #1 that builds a bunch of stuff, then target #2 that copies it.
You run your Ant script in test mode, it pretends to do target #1. Now it comes to target #2 and there's nothing to copy. What should target #2 return? Things can get even more confusing when you have if and unless clauses in your ant targets.
I know that Make has a command line parameter that tells it to run without doing a build, but I never found it all that useful. Maybe that's why Ant doesn't have one.
Ant does have a -k parameter to tell it to keep going if something failed. You might find that useful.
As Michael already said, that's what Test Systems - VM's come in handy- are for
From my ant bookmarks => some years ago some tool called "Virtual Ant" has been announced, i never tried it. So don't regard it as a tip but as something someone heard of
From what the site says =
"With Virtual Ant you no longer have to get your hands dirty with XML to create or edit Ant build scripts. Work in a completely virtualized environment similar to Windows Explorer and run your tasks on a Virtual File System to see what they do, in real time, without affecting your real file system*. The actual Ant build script is generated in the background."
Hm, sounds to good to be true ;-)
..without affecting your real file system.. might be what you asked for !?
They provide a 30day trial license so you won't lose no money but only the time to have a look on..

Easy, automated, efficient testing methods/environments for Codeigniter and/or CakePHP?

I've been playing with Symfony's testing methods. They give you the results in the command line (for instance, green text is for OK and red text is for NOT OK). It also tells you the cause of the error.
Is there something similar to this in CodeIgniter and CakePHP?
The best tool out there that I've seen for codeigniter is a library for SimpleTest see http://codeigniter.com/wiki/SimpleTester_-_Unit_testing_library/
With cakephp, you can use e.g. simpletest as a plugin (installation a download/renaming). In fact all the cake-core tests work with it. In cake, once you have written the tests, you can run them in a one-click manner via your browser (yes, you get your green bars, too :-) ).
If I remember correctly, you can run the tests from the shell, too. If not you can create your own cake-shell as it is easy to extend.

Mercurial practices: use with IDEs and scalability

I am not an experimented user of SCM tools, even though I am convinced of their usefulness, of course.
I used some obscure commercial tool in a former job, Perforce in the current one, and played a bit with TortoiseSVN for my little personal projects, but I disliked having lot of .svn folders all over the place, making searches, backups and such more difficult.
Then I discovered the interest of distributed SCM and I chose to go the apparently simpler (than git) Mercurial way, still for my personal, individual needs. I am in the process of learning to use it properly, having read part of the wiki and being in the middle of the excellent PDF book.
I see often repeated, for example in Mercurial working practices, "don't hesitate to use multiple trees locally. Mercurial makes this fast and light-weight." and "for each feature you work on, create a new tree.".
These are interesting and sensible advices, but they hurt a bit my little habits with centralized SCM, where we have a "holy" central repository where branches are carefully planned (and handled by administrators), changelists must be checked by (senior) peers and must not break the builds, etc. :-) Starting to work on a new branch takes quite some time...
So I have two questions in the light of above:
How practical is it to do lot of clones, in the context of IDEs and such? What if the project has configuration/settings files, makefiles or Ant scripts or shell scripts or whatever, needing path updates? (yes, probably a bad idea...) For example, in Eclipse, if I want to compile and run a clone, I have to do yet another project, tweaking the Java build path, the Run/Debug targets, and so on. Unless an Eclipse plugin ease that task. Do I miss some facility here?
How do that scale? I have read Hg is OK for large code bases, but I am perplex. At my job, we have a Java application (well, several around a big common kernel) of some 2 millions of lines, weighting some 110MB for code alone. Doing a clean compile on my old (2004) Windows workstation takes some 15 minutes to generate the 50MB of class files! I don't see myself cloning the whole project to change 3 files. So what are the practices here?
I haven't yet seen these questions addressed in my readings, so I hope this will make a useful thread.
You raise some good points!
How practical is it to do lot of clones, in the context of IDEs and such?
You're right that it can be difficult to manage many clones when IDEs and other tools depend on absolute paths. Part of it can be solved by always using relative paths in your configuration files -- making sure that a source checkout can compile from any location is a good goal in itself, no matter what revision control system you use :-)
But when you cannot or dont want to bother with several clones, then please note that a single clone can cope with multiple branches. The "hgbook" emphasizes many clones since this is a conceptually simple and very safe way of working. When you get more experience you'll see that you can use multiple heads in a single repository (perhaps by naming them with bookmarks) to do the same.
How do that scale?
Cloning a 110 MB repository should be quite fast: it depends on how long it takes to write 110 MB to your disk. In a recent message to the Mercurial mailinglist it was reported that cloning 6.3 GB took 4 minutes -- scaling that down to 110 MB gives about 4 seconds. That should be fast enough that your tea is still warm :-) Part of the trick is that the history data are simply hard-linked (yes, also on Windows) and so it is only a matter of writing out the files in the working copy.
PhiLo: I'm new at this, but mercurial also has "internal branches" that you can use within a single repository instead of cloning it.
Instead of
hg clone toto toto-bug-434
you can do
cd toto
hg branch bug-434
hg update bug-434
...
hg commit
hg update default
to create a branch and switch back and forth. Your built files not under rev control won't go away when you switch branches, some of them will just go out of date as the underlying sources are modified. Your IDE will rebuild what's needed and no more. It works much like CVS or subversion.
You should still have clean 'incoming' and 'outgoing' repositories in addition to your 'work' repository. Just that your 'work' can serve multiple purposes.
That said, you should clone your work repo before attempting anything intricate. If anything goes wrong you can throw the clone away and start over.
Question 1:
PIDA IDE has pretty good Mercurial integration. We also use Mercurial for development itself. Personally I have about 15 concurrent clones going of some projects, and the IDE copes fine. We don't have the trouble of tweaking build scripts etc, we can "clone and go".
It is so easy that in many cases I will clone to the bug number like:
hg clone http://pida.co.uk/hg pida-345
For bug #345, and I am ready to fix.
If you are having to tweak build scripts depending on the actual checkout directory of your application, I might consider that your build scripts should be using some kind of project-relative path, rather than hard-coded paths.