Change text in Eclipse at compile - eclipse

I want to be able to write for example ((DATE)) in Eclipse and have it replaced with the current date when compiled. How to accomplish this?
The idea is to use dates in version numbers, so I could have the program output stuff like 1.0.2012.01.13
Edit: Language is Java and platform is Android

Can't be done unless you templatize your code using something like Velocity, which is going to be much more trouble than it's worth. Factor these strings out into .properties files and generate those, perhaps.

Related

How to port BlitzBasic 3D to BlitzMax IDE

Can someone help me on porting a game written in BlitzBasic to BlitzMax IDE. I tried running the .bb file into MaxIDE but it says "process failure with file.bb". Also where can i find more information regarding this?
You must rename the .bb files to .bmx. Though a superset, BlitzBasic is a completely different language than BlitzMax.
You can use the BlitzMax IDE Community Edition project which has the feature to import .bb files then convert them to .bmx files.
In regard to the 3D commands part and as Spark Fountain as mentioned, it is not supported by default, but you can use MiniB3D or OpenB3DMax.
http://blitzmax-ide.sourceforge.net/
BlitzMax IDE Community Edition
BlitzMax introduces several new features such as classes, real object orientation, inheritance and many more. Anyways, most of the BlitzBasic syntax elements remain or can at least be re-used.
To port your BlitzBasic programs to BlitzMax, I suggest you learn and understand the basic language elements. You can also use the following guide as a starting point.
comments start with ' or REM instead of ;
arrays are defined with Local array[10] instead of Dim array(10)
3D commands are not supported but you could use i. e. MiniB3D

Scala Dynamic Tracing

I'm solving a problem about scala tracing.
What I want to do is get the environment after executing each line of a scala file, which means, for a program in scala, I could know which line it is executing now and the variables existing now, for every line.
Now I'm using the method of stepping. I let the program step into or step return automatically(by editting the scala IDE in Eclipse) for every line, and then I could get what we want.
But for a long program, it's very slow and will cost a large amount of memory, more than 20GB!
So do you have any better idea about how to achieve it?Give me the whole trace in source code format for every line of a program, with source file path, line number and current variables.
Thanks!
AFAIK there is no free/opensource tools for the task you described, only commercial ones:
Chronon, but looks like that only Java is supported.
Jidebug, I also not sure about Scala.
They both can record runtime traces of your JVM code and later you can drill into these to understand what has happened there.

How to format AspectJ *.aj files with eclipse

Am I missing something or is it currently not possible to format AspectJ (*.aj) with eclipse built-in formatter?
I'm using eclipse kepler with AJDT-plugin and the formater doesn't do anything with those files. Currently I'm formatting manually.
Thanks in advance
You should be able to use the formatter. There are certain constructs that are not handled well or are just ignored. I can't quite recall, but I believe declare statements are ignored. So, it may be that your file does not contain any formattable code.
Also, check your error log to make sure there are no exceptions being thrown.

Eclipse Auto-Correct?

Is there a way to have Eclipse auto-correct certain misspellings? For example, I tend to type "System" as "Sysetm", and Eclipse catches it. However, it only tells me it's an invalid package, and I have to manually correct it. I'm hoping there's a way like in Microsoft Word, where you can add words to be auto-corrected.
Trust me you don't want something like that. It would make it almost impossible to write code with it changing what it thinks you want a variable called. Also its use would be very limited.
I have a hard enough time trying to convince word I mean colour and not color.
try to use "alt+/" after input 'sys'

Eclipse basic shortcuts - assigning assistant, extract variable

There are some pretty basic tasks and I'm in doubt how it can be effectively done in Eclipse IDE:
Content assisted variable declaration/assignment:
Imagine you have to write something like this DateFormat df = new SimpleDateFormat();. How can it be effectively typed? One guess like DateFormat df = new plus some quick Ctrl+Space, not very, very long SimpleDateFormat. But this does not work, it will show completely useless alphabetically sorted types from classpath, usually unassignable to DateFormat.
Extracting variable:
Is there any way to extract variable like Alt+Shift+L does but WITHOUT the need to manipulate the mouse to select expression or whole line? Just like extract content under cursor? Or is there some way to select line (this work only for standalone expression but better than mouse)?
Extracting field:
Any way to extract field in more convenient way than perform 2. followed by another magic - convert variable to field?
I'm doing mentioned combos every 1-5 minute, and it seems to me like editor completely unusable for serious work. (Iff one is not Ray Manzarek)How are you typing in Eclipse? Note that I prefer default settings, no fine-tuning which stops working after first upgrade or terminal change. Thanks.
For your first problem, here's how I do:
DateF<ctrl-space><Enter> df = new SDF<ctrl-space><Enter>
For your second problem, I simply select the text I want with ctrl-shift-left_or_right_arrow.
For your third problem, no idea. I don't remember having transformed a local variable into a field for a long long time. Maybe I just know beforehand which fields I'll need for a given class.
For the first one, I find I just need to type DateF Alt-\ Enter df = new Sim Alt-\ Enter ;, which doesn't seem too bad to me.
For your second question Shift-Option-Right extends the selection to the right one word at a time, and Shift-Option-Left to the left; that, in combination with the keyboard shortcut you mention, should do what you want (those are Mac keys, of course, but I'm sure there are Windows equivalents; I understand some folks actually develop software on Windows.)
For number three: don't think so. You could write your own plugin to do it pretty easily.