CSV export from ActiveScaffold - ruby-on-rails-3

It looks like there have been a couple of plugins developed in past years for Rails/ActiveScaffold to export an ActiveScaffold index view as CSV. One of them (last commits around 5 years ago) is referenced in the answer here:
How to Make CSV Format Report of User Information using Active Scaffold in Rails 2.3.8
The projects I can find look like they're dead, and despite searching I'm not finding updated versions.
Before I dive in and modernise one of these, I wanted to ask: is there a current (ActiveScaffold 3.4) plugin that will allow CSV export?
edit: found https://github.com/naaano/active_scaffold_export which was last updated in 2013

It turns out that, despite its 2-year old update status, Naaano's GitHub project took almost nothing to get working with ActiveScaffold 3.4.
Head over to https://github.com/naaano/active_scaffold_export, grab the code, and follow the very well written install/config instructions. Then simply modify the gemspec to require AS >=3.4.0, rebuild the gem, and you're good to go.

Related

How can I export and share my IDEA bookmarks and Favorites

Is there a way to export my IntelliJ IDEA favourites for backup, or to share with colleagues, like the way I can export my code formatting preferences (File > Export Settings)?
I'm working on a large codebase (one IDEA project), and have to switch between different new feature tasks and bug fixes, so I find it really convenient to create new Favourites list per Task or Jira ticket.
My Favourites tab is full with tens of favourite lists, and it's getting harder everyday to browse through them. So I could organise my work better if I could export them (ideally a different export per task, but grouping them is OK too), and reimport when I need to work on them again.
Any alternative suggestions are welcome. Thanks
#Eugene Morozov Fortunately yes !
And I must admit that I'm very disappointed in the fact that there is no IntelliJ team support for this topic,
or some guidance to help people, as this happens pretty much after all new versions of IntelliJ and it's update,
and as a consequence, it impacts a developer's work, at least for us who work on really big projects.
So I've decided, to make this short tutorial how to restore back your bookmarks for Windows 10 users :
As of version 2020.1, IntelliJ operates under hidden Windows user AppData folder :
e.g. C:\Users<windows.user.name>\AppData\Roaming\JetBrains\IntelliJIdea\workspace
Even more, under C:\Users<windows.user.name>\AppData\Roaming\JetBrains there are previous versions, (along with backup folders !)
and under appropriate version, in folder "workspace" there are all modifications, in the form of <funny_ssh_like_fileName>.xml
(e.g. 1lFTpsTT6pUo3tksBtYpwaD5qZ2.xml)
So, in my case, I've :
opened ~\AppData\Roaming\JetBrains\IntelliJIdea2020.3\workspace
sort files to descend based on modified flag
opened the newest one, and found that there is just one new bookmark, without previous ones !
so, I opened next recent xml, found and copied everything in between,
into the current IntelliJ workspace file
(Note this answer may now be out of date)
Bookmarks come under <component name="BookmarkManager"> in the .idea\workspace.xml. (Since the answer was posted the location changed to AppData)
But the problem is that:
If you try to use the bookmarks on a file that has changed, the line numbers the bookmarks point to will likely have changed and the links are broken.

Workflow / best practices for XLIFF

I am using a command line tool (ng-xi18n) to extract the i18n strings from an angular 2 app I wrote. The output of this command is a messages.xlf file. Coming from a .po background, and being not familiar with .xlf, I assumed that this file is the equivalent to the .pot file (correct me if I am wrong).
I then assumed that if I want to translate my app, I had to cp messages.xlf messages.de.xlf to have a copy (messages.de.xlf) of the template file (messages.xlf) where I can translate each message into German (hence the .de.xlf).
After translating some dummy texts and running the app, I saw that it worked as expected, so I quit translating and continued developing the app. After some time, I added more i18n strings, and eventually thought that I had to update my template. And this is where things got hardly maintainable. I updated the template messages.xlf file, and quickly was wondering how I could update the new strings to my already translated messages.de.xlf file without loosing my progress.
When I was developing using .po files, this was no problem thanks to good tools like poEdit, but I didn't find anything comparable for .xlf. After trying some tools, I thought that the best choice would be Lokalize, but I didn't find a possibility to merge the template file to already translated (but outdated) files either.
Up to now, this was rather an essay than a question, so here's a quick summary:
Is the workflow of dealing with .xlf files really comparable to .po as I initially thought (described above), or is it completely different?
How am I suppose to update my already translated files?
What are the best practices dealing with .xlf files?
What are proof of concept tools to work with .xlf?
Sidenotes:
The Lokalize handbook was not helpful at all. I see a lot of functions that sound promising, like:
"File" > "Update file from template". I did not find anything in the handbook to explain this function. If I click on this, nothing happens.
"Sync" > "Open file for sync/merge". This seems to be a function to merge two similar files (by multiple translators) rather than a tool to update the translation file from a template. Even though there is a tooltip in Lokalize's primary sync tab, notifying me about "x unmatched entries", I just couldn't find anything to append those unmatched entries to my .de.xlf file.
[Update] Turns out, I had similar issues as in this question. After downgrading my version of Lokalize to the suggested one, many issues (including the ones mentioned in the question) disappeared. However, now the "Update file from template" option is greyed out, and I don't know why.
I also tried OmegaT, which does not work at all on my platform (Ubuntu 16.04).
[Update] Virtaal works great for merging new strings from a template, but the UI in general is very poorly designed...
Googling did not help, as every hit seems to be related to XCode or something.
Thanks for any help in advance, I really appreciate it
I wrote a small npm command line tool called xliffmerge.
In principle it does the same, that Roland Oldengarm does with his gulp tasks described in his blog article.
It is free and you can have a look at it at https://github.com/martinroob/ngx-i18nsupport#readme
The best workflow automation solution I have seen described so far is from Roland Oldengarm's blog entry "Angular 2: Automated i18n workflow using gulp". To summarize, in a few dozen lines of Gulp code he created the tooling to handle some of the challenges you faced. Specifically it runs ng-xi18n to extract the messages; creates an English translation with sources copied to targets; updates existing translations by adding new trans-units, keeping existing ones, and removing missing ones; and then exposes all xlf files as TypeScript string constants. These last strings can then be imported to supply the bootstrapModule with its translation provider options.
Caveat: I have not used this exact solution (and code) myself, but I was able to expose generated xlf as TypeScript strings and use them in an app in a manner similar to what he described. As for maintaining translations, I have leveraged IntelliJ IDEA (WebStorm) file comparison features and Counterparts Lite (for Mac) for that. My own efforts are still in early stages but are working end to end for an application that is in active development.
Official Angular docs are now updated for Internationalization (i18n) at https://angular.io/docs/ts/latest/cookbook/i18n.html including a section specifically for creating a translation source file with the ng-xi18n tool.

Grails 3 - achieving customization of template in a way it was possible with _form.gsp in version 2

I am relatively new to Grails and I am little disappointed with the way _form.gsp removed with field plugin in Grails 3. _form.gsp seemed to be good time saving option when we need to customize views with Bootsrap or materialize.
Now with grails 3, install-templates does not create _form.gsp. As per this documentation, we can achieve customization by creating _wrapper.gsp, _widget.gsp etc under view/_fields/default directory. But I am not able to find the example of such custom GSPs.
Also, let's say if I customize all the four GSPs (_wrapper.gsp, _widget.gsp, _displayWrapper.gsp, _displayWidget.gsp) will it generate actual code when we run generate-view command? I mean will it replace, f:all, f:table etc tag with actual code? If not then there is quite amount of work to do I guess. Because after we are confident about our domain class and tested all CRUD operation, we run generate-view command for creating all the domain specific GSPs. Then in most cases, we need to do some changes according to our requirement, like re-ordering the fields, hiding some of the fields
So in conclusion I have two goals:
Customizing default templates and start developing.
When I run generate-view, I do not want f:all, f:table etc abstract tags. I need actual fields in place so that I can customize generated views of domain.
If any one has achieved this, then please share the solution.
Grails 3 comes with the fields plugin by default. The templates used in Grails 2.x have been replaced in full. So, your goal 2. will be hard to achieve with Grails 3 it seems.
However, here is a helpful blog which explains how you can adjust some of the fields templates by replacing them in your project: http://blog.anorakgirl.co.uk/2016/01/what-the-f-is-ftable/
Similar to the description provided, you can place a modified _list.gsp template in folder in
/grails-app/views/templates/_fields/
Hope it helps.

How can I hide a Trac project from the project listing?

Right now I'm using Trac with multiple projects and have customized the project-listing template a bit, but currently there are about 5 Trac projects, and I only want 4 of them to be showing. I successfully hid the last one by adding a py:if conditional against the exact name of the project, but that seems like a terrible way of doing it.
Is there a flag or anything I could set in each project's trac.ini that would make it not show up?
Barring the code modification you stated, I think the only way you would be able to do this is to use TRAC_ENV_PARENT_DIR in your httpd config to group the 4 common projects, and then move the 5th to another location on the filesystem.
This will require a lot of fabulous Apache Config hacks to get the 5th project to work properly, and honestly you've already taken the path with the quickest solution.

Can SlickEdit automatically update its tag files?

I prefer SlickEdit for my IDE but the only way I can get it to update the tag files to incorporate code changes is to recreate the project and/or run start a re-tag manually. Is there a way to setup Slick Edit so that it automatically incorporates changes in the code base that happen after project creation.
This problem is especially noticeable when working on large shared code bases where I must check out files that have been modified by other users.
Okay, I asked a question on the SlickEdit forums.
http://community.slickedit.com/index.php?topic=3854.0
EDIT: Winnar! Options->Editing->Background Tagging of Other Files