DevExtreme Angular: Intl vs Globalize - localization

In DevExtreme(Angular), there is two methods for localize strings,number date and currency:
Intl
Globalize
I have tried both the method, but not able to find which one is better and why?
What is the difference between this two?
Which one should i use?

Globalize is powerful in terms of features but harder to configure. Intl is simple and straightforward. I would suggest that you start with Intl and only if it's not enough then switch to Globalize.

Related

What are the advantages and disadvantages of using from_xml function in ruby

I want to use the from_xml method provided by the rails active support core ext,
An example :
hash = Hash.from_xml("my_xml.xml")
for converting XML into a Hash.
I want to use this because parsing a Hash is a lot easier than XML in ruby.
However, I would want to know what are the pros and cons of using this approach. Is there a better approach I can use for converting an XML into hash.
Thanks
XML unlike JSON is a document format and not just data exchange format and not always actually maps cleanly to programming language constructs like hashes. XML is actually ridiculously complex if you look at all the features like namespaces.
Hash.from_xml really only handles the simplest of cases and doesn't have a clue how to deal with stuff like attributes. It really only knows how to parse the XML generated by Hash#to_xml.
Advantages:
its so naive that its cute
Disadvantages:
see advantages
For non-trivial examples you'll need an actual XML parser like Nokogiri.

Parse arbitrary text to produce dependency graph

How to create dependency graph (parse tree) for random sentences. Is there any predined grammer to parse english sentences using nltk.
Example:
I want to make a parse tree for the sentence
“A large company needs a sustainable business model.”
which should look like this.
Please suggest me how this can be done.
This question is a near-duplicate of 3125926. But I'll elaborate just a little on the answer given there.
I don't have personal experience with dependency parsing under NLTK, but according to the accepted answer, the integration with MaltParser is documented at http://nltk.googlecode.com/svn/trunk/doc/api/nltk.parse.malt.MaltParser-class.html
If for some reason MaltParser doesn't suit your needs, you might also take a look at MSTParser and the Stanford Parser. I think those three options are the best-known, and I expect one (or all) of them will work for you.
Note that the Stanford Parser includes routines to convert from constituency trees and between several of the standard dependency representations, so if you need a specific format, you might look at the format-conversion arguments to the edu.stanford.nlp.trees.EnglishGrammaticalStructure class.
e.g., to convert from constituency trees to basic dependencies:
java -cp stanford-parser.jar edu.stanford.nlp.trees.EnglishGrammaticalStructure -treeFile <input trees> -basic

Library for optimizing strings ( Boyer-Moore Algorithm )

I heavily use strings in a project so what i am looking for is a fast library for handling them.I think the Boyer-Moore Algorithm is the best.
Is there a free solution for that ?
You can consider the following resources implementing Boyer–Moore algorithm:
Boyer-Moore Horspool in Delphi 2010
Boyer-Moore-Horspool text searching
Search Components - Version 2.1
Boyer-moore, de la recherche efficace
Last Edit:
The StringSimilarity package of theunknownones project is a good source for fuzzy and phonetic string comparison algorithms:
DamerauLevenshtein
Koelner Phonetik
SoundEx
Metaphone
DoubleMetaphone
NGram
Dice
JaroWinkler
NeedlemanWunch
SmithWatermanGotoh
MongeElkan
CAUTION: Answering to the comment rather than to the question itself
There is (or, rather, was, because it has been abandoned currently) a Delphi unit (namely!) FastStrings which implements Boyer–Moore string search algorithm by heavy use of inline assembler. Is is one you are looking for?
As side note: project homepage is defunct now as long as author's e-mail, so i'm finding reuse (and modification and, naturally, any further development) of this code rather problematic given how restrictive are licensing terms.

Is there any .NET string.format compatible function for Delphi win32?

Is there any .NET string.format compatible function for Delphi Win32 ?
I want to use it's argument order syntax.
I found one at delphi3000.com, but it's pretty simple and without supporting number precition, etc.
Don't you know any better open-source implementation ?
Thanks.
Use SysUtils.Format.
It also supports argument order syntax as string.format in .Net does.
You can change argument order like following example.
Format('%1:s - %0:d', [7, 'Text'])
As I was a C programmer, I thought SysUtils.Format was just like printf in C.
But SysUtils.Format is not just like "printf" and it's more powerful as RRUZ & Cosmin Prund taught me in the comments above. (I should have checked help ;-)
I wanted .Net's string.format mainly because I wanted to use it's famous argument order syntax.
Argument order syntax is useful especially for translating message text into languages (like English to Japanese), but I don't need .Net compatibility.
If you had to port .Net's code to Delphi win32, or you are very familiar with .Net's format syntax, these library would be useful if exists, but it isn't in my case.

Best practice to represent Money (value + currency) in Grails

I'm not much familiar to Java Currency type, and how it being used in Grails. Though, I'm yet to use it, I saw a tag <g:currencySelect> to use in the views. So, how do I represent it in the domain class.
class Money {
BigDecimal value
Currency currency
....
}
or is there a better sol, which compares diff money objects, format according to the locale ( ',' in EU for separator etc)
thanks in advance.
Babu.
You should use BigDecimal. Groovy and Grails has excellent native support for it as a datatype on GORM domain classes as well. For reasoning behind using it, see here
What is the best data type to use for money in java app?
You might want to take a look a the Currencies plugin. It provides a Money class for holding monetary amounts of differing currencies. They can be embedded into domain classes like so:
class CustomerTransaction {
Date date = new Date()
Money amount
static embedded = ['money']
}
Use the JScience library. It's just a shame it's not in a Maven repo yet, and doesn't have a Groovy wrapper to make it Groovier (TM).
If you want to have also live exchage rates updates then following plugin could help https://grails.org/ExchangeRates+Plugin all rates are pulled from Yahoo Finance.
since the original answer seems to be outdated, you might want to take a look at the money-plugin which is fresh and currently maintained.

Resources