Eclipse - Number of times compiled over project? - eclipse

My team just finished a huge project. We're going to present it to class in a week, and want to add some interesting stats.
Is there any way to find out how many times we've compiled the code over the last X days?
Thanks

Not that I'm aware of but if you go into Project>Properties>Refactoring History you can see a detail of all the refactoring you've done. That may make for some interesting stats.

I'm not aware of such functionality but you can install a metrics plugin such as this for other code metrics. Eclipse auto-compiles code so I'm not sure how useful such as statistic is.

I don't know of any way to get the number of times you compiled. But if you want some similar (and hopefully useful) statistics, go to .metadata\.plugins\org.eclipse.core.resources.history. You will see the change history there. Each time you make a change, Eclipse keeps track of the change by creating a file here. Sort the files by date, and you can easily get some statistics to display for your presentation.

Related

Where do I get XHProfLive for XHProf?

I've read a long page about XHProfLive, but I didn't manage to find where to download it. Where do I find it?
http://www.facebook.com/note.php?note_id=62667953919
I am aware that XHProf comes with some UI, but I didn't find anything more advanced than that.
XHProf was open sourced, not XHProfLive.
But do look into XHGui: http://phpadvent.org/2010/profiling-with-xhgui-by-paul-reinheimer
It has been more than a year since I've asked the original question. There hasn't been much of an improvement to the original UI ever since. Therefore, I've undertaken the development of xhprof.io - GUI to analyze the profiling data collected using XHProf.
Furthermore, as #gazarsgo have already mentioned, there is Reinheimer's branch of the original XHProf UI.

Automating Eclipse tasks

I'm currently looking for ways to automate some tasks in Eclipse.
For instance, let's say I have a couple of ant files that I'll want to run a couple of times per hour. Being able to assign a hot key to each one of them, so that I could easily run them without having to click, bring the context menu up and click again would bring joy into my life.
Other example would be build/run configurations. I have a couple of them on my project and I'd love to have a way of running each one of them with a different hot key configuration.
Moreover, the very nature of a project I'm currently working on involves a lot of experimentation and trying, so having to click and use my mouse a lot is definitely driving me insane. There are other similar things that I would like to get automated as well (for example, each time I do a commit I'd like to also run some command over my project's folder, etc).
Is there some tool for Eclipse(or outside it) that'll somehow allow me to automate these kinds of tasks? Would Vim for Eclipse help me anyhow?
After some years coding I feel like I have hit a stone wall. I came to the conclusion that I am losing way too much time with my mouse. Yes, I know that a lot of Eclipse actions have correspondent hot keys, but a lot of others don't. I want the ultimate solution !
There are several solutions:
Use a console. Consoles allow to remember the last commands (on Unix, you can even search). So instead of mouse-fu, it's Alt-TabUpReturn
There was Eclipse Monkey to script Eclipse. Not sure if it still works but it might.
On Sourceforge is Practical Macro. No documentation that I could find, though.
EclipseShell might also work, not sure.
Update (Year 2022). Aaron has provided many options in his answer. It seems any of those are working. I am going to try the old ant builder.
https://www.vogella.com/tutorials/ApacheAnt/article.html

Eclipse diff for large file shows incorrect differences

I am not sure if anybody has experienced this.
I am working with a very large file having 7000 lines of code.
I made a lot of changes and when i compared the file with the repository version, it showed me incorrect differences.
I guess the diff algorithm buffers only limited number of lines ahead/behind for searching the current line, and on failing to find that, it simply shows diff with current line in new file.
One such snapshot > http://picasaweb.google.com/lh/photo/ENwZ4gqXxiCF3SWqVnVAqA?feat=directlink
If anybody knows any workaround, please let me know.
Thanks
Easy workaround - use another diff tool. I'm serious. I wouldn't waste time splitting up my files, or wondering how to get it to work with Eclipse's diff tool if there's some known issue with really big files.
I recommend Beyond Compare 3. I say this having used many different diff tools. It's not free, but it's worth it. In the rare chance that it gets confused, it allows you to with a couple of clicks realign any areas that it got confused on. I have used it with some pretty large files, and it rocks.
If you're concerned about Eclipse integration, there's even a plugin, BeyondCVS, that allows you to launch your Beyond Compare diffing from the Eclipse right click 'Compare' menus. Its name is kind of misleading though, as it doesn't appear to be related to CVS.
If you need something free, try one of these diff tools instead:
WinMerge
SourceGear DiffMerge
What version of eclipse are you using? And what edition? (Java? CDT? ...)
Depending on those data, it could make a difference, since files with several thousand lines are known to be a problem for the diff algorithm.
See this thread for illustration.
And do check, as mentioned in the same thread, your error log to check if any particular message could help you to pinpoint the cause of the failed diff.

How to highlight the differences between two versions of a text in .NET web app?

I have been supporting a web application at work for our Call Center unit for about 2 years now. The app is written in ASP.NET 3.5 with SQL server 2005 database. I’ve been asked to expand the call detail section to allow agents to edit the current call note with the ability to revert back to its previous version. Now, that’s all cool but now the manager wants to be able to click on any particular note and see all edits with changes highlighted in yellow (and if something was deleted, he wants to SEE the deleted text crossed out). Actually, what I need is very similar to how Stackoverflow handles edits on their questions. I’ve been thinking about how to go about this and after doing research and Google-ing of course, I am still unsure which route to take. I am fairly new to .NET development. Any ideas on the best technique for highlighting the changes in UI? I am afraid I am going to have to store a copy of the entire note each time they make a change because the manager wants to be able to easily review notes and revert back to ANY version (not just the most recent one) before sending the monthly call report off to our VIP customers. Since this department OFTEN changes their mind on things, I want to make sure the new functionality is scalable and easy to maintain. Any ideas would be greatly appreciated. I am really just looking for someone to point me in the right direction; maybe there are some tools out there that can be useful, recommended keywords in Google lookup, etc.
This will be difficult do to.
You'll need a "text editor" control that can not only edit the text, but which can also tell you what changes were made.
You then need to store not only the final text string, but also the list of changes
You'll then need to be able to display the text plus changes, using strike-outs, and different colors for inserts vs. changes
You'll need to do this not only for the changes of a single user, but you'll need to store each users' changes in the database, and will need to be able to display all the changes, all at once.
Your manager should be really sure he needs this.
Some tools for doing the diff for you can be found at Any decent text diff/merge engine for .NET?.
This would entail storing every version like you say. This should allow you to implement it similarly to SO. I seem to recall reading or hearing Jeff mention it, but wasn't able to find it, likely in one of the SO podcasts.
Easiest would be to store the text for each revision, then when the user wants to see the diff use a diff tool to generate the highlighted text.
Here is some Javascript diff code:
http://ejohn.org/projects/javascript-diff-algorithm/
If all the computers have Word installed you may be able to use a Word control to accomplish this. TortoiseSVN has scripts in its program directory which can take two word documents and produce a document with changes highlighted. To see this create c:\aaa.doc and bbb.doc, then install TortoiseSVN and run:
wscript.exe "C:\program files\tortoisesvn\Diff-Scripts\diff-doc.js" c:\aaa.doc c:\bbb.doc //E:javascript
I think you should see http://en.wikipedia.org/wiki/Revision_control

How do you keep track of your programming TODOs? [closed]

As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance.
Closed 10 years ago.
I'm one of those people who can't get anything done without a to-do list. If it isn't on the list it doesn't exist.
Notepad Method:
When I'm programming I've been keeping notepad open with a list of to-do's for my current project. I'll constantly re-arrange these based off priority and I cross them off and move them to the completed section when I'm finished with that particular task.
Code Comments:
Some programmers pepper their projects source code with:
// TODO: Fix this completely atrocious code before anyone sees it
Plus, I know that there are some tools that show you a list of all TODOs in your code as well.
Website Task Tracker:
Remember The Milk
Backpack
Manymoon
Voo2do
Gmail Tasks
TeuxDeux
TodoDodo
Ta-da lists
... and many more
What have you found to be the best method of keeping track of your to-do lists for multiple projects?
Like others, I pepper them about my code, but I use the warning directive to generate a compiler warning too:
#warning TODO: Implement foobar
This way I can still search for "TODO" but they also shout at me whenever I build.
Pen and paper.
Combined with the genious PocketMod, it's totally perfect.
Striking TODOs is soooo satisfying!
I can't speak for other IDE's, but Eclipse will search your project's source files for TODO comments (as well as FIXME and XXX by default) and create tasks for you in the tasks view.
This leads to intriguing situations where you check the tasks view, double-click on a TODO task, and read the comment:
// TODO: Add this functionality.
Eclipse will also add TODO comments when generating certain code blocks, like method implementations, catch blocks for exceptions, etc.
TODO (and other) comments are great with Visual Studio and ReSharper installed:
(source: jetbrains.com)
Although I didn't try it I really like the idea of tests as todos. What else should get you going if not a failed test?
NextAction, from TimeSnapper
Personal Abstract Todos
I use Tomboy Notes or paper to make a quick list of abstract high level tasks. Often when I'm on the phone with my manager, I just need to get things written down.
Source Code Specfic Todos
I use the inline TODO: / #todo comment marker in my code and then use the Netbeans plugins that give me a running list of todos throughout the project. Since Netbeans can aggregate todo markers from multiple projects, it does not make a difference how many different projects I'm running.
Multiperson Tasks / Todos
Once I have to keep track of todos for more than myself, I move to project management software like OpenProj, MS Project, etc. Also, if the todos involve bugs or feature requests, I use our bugtracker. Other todos, can be manged by a helpdesk system as well.
I use ToDoList from AbstractSpoon. It lets you divide your ToDo list into projects and can even be used by a number of users for larger projects using a shared network drive.
For every task in a project i create a new entry in the issue tracker (Bugzilla for me).
A big advantage is that you can track back every changes made by the issue ID.
You can report customers or project members the status of your task.
You can create a new bug type like "task", "todo" or "feature-request".
It's a central solution. No local stuff...
I our development team there is a rule which says: "Do never change any code without a corresponding entry in the issue tracker. Never!"
I use Pen and Paper to jot down notes. I also use TODO/FIXME tags in code that gets highlighted yellow in Vim and tracked by the TODO extension in Komodo.
One of the most useful additions for me has been using Samurize to embed a plain text file onto my desktop (http://lifehacker.com/software/plain-text/geek-to-live--incorporate-text-files-onto-your-desktop-213280.php). I have 3 virtual desktops and it lives on my email desktop which is where I wind up first thing every morning. It contains a text file with the items that I need to do and it rarely runs more than a week ahead.
Wednesday 2/11/2009
- Item 1
- Item 2
Thursday 2/12/2009
- Item 3
I use Executor that has a keyword "todo" that automatically opens gvim with this file when I want to edit/add/remove items. This makes it about 3 keystrokes to get it open and ready to modify. It helps me remember the Monday morning production moves before I get buried in email and meetings. As soon as I edit, it's reflected on the desktop.
Obviously for longer and more detailed things, I rely on Roundup, Outlook reminders, etc. but this has been a handy way to jot things down so they won't get lost in the shuffle.
I use inline TODO: comments as Visual Studio will track these for me, of course I still have to look at the task list to see them. I cannot count the number of times I have found a TODO: comments whilst reviewing some code I thought was complete.
I would make a clear difference between FIXME and TODO. FIXME is a critical and must be fixed before commit/release. TODO can live a bit longer but should be cleaned away eventually.
A simple plain text file (TODO) in the top level of the project's cvs/svn area works for me for simple projects.
Like others have mentioned, I use the standard FIXME/TODO/XXX in my code comments, and then can find the list of tasks within my IDE using their various tools. I also use hudson's task scanner plugin to keep track of everything, since I'm a sucker for graphs.
I created a build task that picks out //TODO: lines from my code files and generates a report I include in team city. It gives you a quick way of see any outstandings on a project without having to check it out.
you can also use the CodeTagsPlugin with Trac
When programming Java in Eclipse, I find it really useful to, as you say "pepper my source code with // TODO: comments - mainly because Eclipse looks up each one in the project and compiles a task list for me =) In Visual Studio, there is a Task List panel, which I use sometimes, but I don't find it as streamlined as just having the comments in Eclipse.
I use eclipse as IDE, which collects all TODO's to a list and shows it in an outline. Very easy and usable.
I use emacs org-mode to keep track of not only code TODOs, but my whole life. It works as an extremely powerful outliner with some spreadsheet and calendar features as well. I use mercurial for lightweight version handling and simple replication between different machings.
It works surprisingly well.
Having done an extensive search for a suitable "to do list" application I settled on mylyn - the one that comes supplied with Eclipse.
It is easy to create and manage tasks. Tasks can be imported and linked to Bugzilla or a number of other different task repositories. It also has a "task context" which enables files that are relevant to a task to be highlighted and those that are irrelevant to be hidden (which is far more useful than I anticipated it would be).
Eclipse tracks your TODO and list them in a proper windows automatically. I find it powerful enough if you don't need advanced features.
I'm quite fond of tracks. It has the flavour of GTD without getting too regimented about it.
I can quickly whack stuff in there as I think of it, and then not have to worry about forgetting after that.
Wow, I just had this question yesterday. After some searching, I settled on the ReminderFox Firefox extension. It's completely integrated into the browser and has pop ups to remind you every time you open your browser when a task is due.
I like Mylyn a lot: integrated into Eclipse, works with many trackers as well as without (local tasks) and realizes new concepts like the focused UI.
There is also Task Scanner Plugin for Hudson (in case it fits in your environment). With that you can track number of TODOs/FIXMEs on your continuous integration build reports.
alt text http://www.86th.org/hudson.jpg
We use the "Open Tasks Trend" feature in Hudson, this works for a slew of languages. For our C# project we have 3 levels of tasks and this is accomplished by different TODO: style comments.
High Priority
Matches on FIXME:, HARDCODED: or HACK:
Medium Priority
Matches on TODO:
Low Priority
Matches on MEH: or CODEREVIEW:
Hudson will then take this list and trend graph it as shown in the picture, as well as have a sortable, filterable list of the tasks and it will display the messages on the web page with links that will take you right to the line in the source code on Hudson.
Plus we can easily setup points of interest for code reviews with CODEREVIEW: and have a nice concise list to print out.
I use Sandglaz and place my todos in 3 columns now, next and later (a little like their blog, but only one row)...and its easy and fast to use. I'm a freelancer so I work on several projects at a time so it works for me
I use pending tests only to remind myself to write tests. I use Rspec, so it has that build it.
For C++ projects (native/ATL):
#ifndef _TODO_H_
#define _TODO_H_
#pragma once
// from atldef.h:
#ifndef _ATL_STRINGIZE
#define __ATL_STRINGIZE(_Value) #_Value
#define _ATL_STRINGIZE(_Value) __ATL_STRINGIZE(_Value)
#endif
// put x in quotes, no need to use #pragma!
#define __TODO(x) __pragma(message(__FILE__"("_ATL_STRINGIZE(__LINE__)") : TODO: "x))
#define __WTF(x) __pragma(message(__FILE__"("_ATL_STRINGIZE(__LINE__)") : WTF?! "x))
// prefer to use ISO-formatted date
#define __BUGFIX(date, x) __pragma(message(__FILE__"("_ATL_STRINGIZE(__LINE__)") : BUGFIX: "#date" "x))
#define __CHANGE(date, x) __pragma(message(__FILE__"("_ATL_STRINGIZE(__LINE__)") : CHANGE: "#date" "x))
#endif _TODO_H_
Looking for something like that for C#.
doxygen can track such issues
One of our source code modules is absolutely littered with inline #pragma todo lines. The build output is polluted so we never can really tell when there are any new compiler warnings. Some of the todos have been there for years and the original developer has long since left the company.
When I have many many todos I discovered that it is useless to track them. You end up with hundreds of todos that can't be done.
Only write what you are asked (boss ) and do what bring the biggest benefits everyday.
I however have a next list. I wrote what I'm currently doing at the top and things I need to fix to complete it. My next list can be done in hours or days usually.