Acceleo counting occurrences - acceleo

I've recently started working with Acceleo and it's really hard to me.
Nevertheless I've encountered a problem:
All variables are 'final', but I'd like to count how many times occurred specific statement. Let's say: how many times I have 'if'.
I've found some idea to add new items to collection, but I don't really know how to do it.
Please: understand I'm total newbie in acceleo, so please: any easy solution?

You'd have to use java services to keep track of state such as counters.
Could you share the reason why you need to count statements?
Because as Acceleo is a text generator it sounds odd to have this requirement, and maybe it's because you're doing something wrong.
So I wouldn't recommend to use java services without knowing more about why you want to count statements.

Related

Simple arithmetic functions in Elasticsearch

I am starting to get acquainted with the use of ELK for work purposes, but struggle to find a solution to use simple mathematic requests in my database.
As shown on the picture, my DB contains 16 available fields, but I would like to create others, without doing it on Excel before converting my file in CVS again.
For example, I would like to create a variable #Bugs/Release. I've heard that this is quite easy to make with no need of scripting, but I can't find the way to do it... Has anybody the solution of this problem?
Huge thanksenter image description here

Using of Sitecore's XPath builder to test queries

i'm getting started with sitecore and i just discovered this tool sitecore offers to test our queries:
My problem is i just can't make it return results and i do know this query works perfectly cause i've been using it on my project right now.
There is probably a problem of syntax somwhere i don't know.
Thank you for helping me to put some light on this !
It's a bit difficult to tell due to how bits of that are redacted (there might be other syntax errors hiding under the boxes), but there's one obvious issue there, I think: You don't need the "query:" bit on the beginning of what you've typed.
In general, if the API or web form your filling in can only take a query expression you can leave the "query:" bit off. But if you're putting text into somewhere that might take a query or might take something else then "query:" is needed to tell Sitecore what it's looking at.

Pagination with Letters as index

I may have misunderstood what index is, after reading my question, you'll soon realize so please correct me if i was wrong. anyhow,
Is there any tutorial on paginating in codeigniter. Something that is simple and concise, i don't need complex ones since ill have hard time understanding the whole code.
A B C D
Ants
Airplane
Something like above, instead of number paging, would it be possible to paginate by first letters?
Ive encountered alot of sites that have these although im not sure if coding this would need any add-ons.
I think you have to build one. already this topic is disccused in CI forum.
Please check the forum link:
http://ellislab.com/forums/viewthread/164849/

Best way to get acclimated with a new Ruby on Rails project

What tools or steps would you recommend to someone who is brand new to a project and they are trying to get acclimated to a Ruby on Rails codebase that has no testing?
I am considering something like: https://codeclimate.com/ to help run some analysis on the code but I wanted other suggestions.
Thanks!
I use the command line tool wc to find where the code hotspots are. Running wc ./app/models/**/*.rb | sort -nr on my Mac gives me a pretty good idea of where the code is sitting. You can replace models with controllers or any other directory to find the details there.
Once I have a good idea of where things are, it's easier to find the larger and more complex areas of code. A brief description of the project and a run of wc should give you a pretty good idea of which data models and controllers are the most complex, and give you an idea of where to go for further investigation.
If the project is well tested I would definitely take the time to read through the spec headings. I'd take time to read through the implementation details of specs that interest me.
The Ruby Rogues podcast has a pretty good episode about code reading that you may find helpful: http://rubyrogues.com/031-rr-code-reading/
I'm hoping this is a will tested project... If it is, I always read through the tests first as they give you an understanding of what the expectations of each piece of code is. This its by far the best method that has worked for me.

A step by step small app creation guide in Ruby

I'm looking for a step to step tutorial to make an app, not so complex in Ruby, so students can do it. By now, i have only medium-big examples that i have developed for companies some years ago,but they require extra knowledge as i used diff frameworks and libraries and i want something that can be done only with the ruby interpreter itself.
A well commented app will be good as well as i can make some step-to-step guide based on that, and yea maybe I can do one but the thing is that im running out of time, and i haven't used ruby in like 1.5-2years, so as i said im looking for something not so complex and not so big, 200 , 300, 400, or 500 lines of code is ok
Could be anything, like administration or managing purpose like idk, a script that generates word documents for certain department. A script that reads a .txt or .doc and do something with that, idk.
Thanks in advance!
It's not an app really, but it's smallish, it's Ruby, it's sort of a game, and it's fun. http://github.com/ryanb/ruby-warrior

Resources