Is there a way to convert dot shortcut classes .my-class to standard classes class="my-class", and keep slim syntax ?
Thanks a lot for your help
Related
I followed this tutorial: https://www.eclipse.org/Xtext/documentation/104_jvmdomainmodel.html, but the generated files are .java, I want to change the file extension as well as the grammar, but I want to keep some java features. Also the class DomainmodelGenerator extends AbstractGenerator does not get generated when I use grammar org.example.domainmodel.Domainmodel with org.eclipse.xtext.xbase.Xbase, only if I use terminals. How can I achieve that?
If you use Xbase then, JvmModelGenerator will be used as IGenerator(2). So you have to customize that one and override org.eclipse.xtext.xbase.DefaultXbaseRuntimeModule.bindIGenerator() for binding.
But also triple check if you really want to customize the generator and not enhance the inferrer
I'm writing an iOS app, "Best Korea". My organization name is "Srsly.co". I'm going to write re-usable "News" libraries that I'll use across my apps.
Each iOS app will have its own app-wide constants in a .h file, and the library code will have its constants as well in header files. I'll also have tests for each of these projects.
Is this the standard way of doing things?
In Ruby, Python, Java, etc., I'd set up namespaces along these lines:
co.srsly.bestkorea
co.srsly.bestkorea.test
co.srsly.newslib
co.srsly.newslib.test
As far as I can see, the Objective-C pattern is for each developer to choose two or three upper-case letters and prefix every class name with them.
So in my case, I'm thinking I'd choose BK as the app's classname prefix and NL for the news lib code? Am I thinking about this the right way?
EDIT: I'm considering not using namespacing at all in my application code as discussed here.
You're correct that Objective-C doesn't have built in support for namespaces, and the common solution is to use uppercase prefixes on each class. Note that Apple has stated that two letter prefixes are reserved for their use, so you should use three letter prefixes for your own classes. Otherwise, your suggested approach is the normal thing to do.
There is no NameSpace in Objective-C as you are expecting in Java.
Objective-C uses class Prefix like NS, UI, CG, CF etc to safely remove name space collision.
And it would be better to use 3 letter Prefix for your class.
You should read this : What is the best way to solve an Objective-C namespace collision?
I need to convert a huge number of constants from an application. Is it possible to get all the constants declared in a unit and their values, other then parsing the .pas file?
It seems that this is not possible without parsing your unit and extract the constants. During the compilation constants are replaced by value, so it is impossible to get the value from them at runtime.
LE: maybe there is someone who can explain this in depth.
There is the Open Tools API to work with the IDE in an object oriented way.
But I think it is not possible to list the constants of files.
I think the easiest way is to use grep or other similar RegEx program that can collect the string constants from files: ^\s*\w+\s*=\s*'.+?'\s*[;#\{\+]
How about changing all CONST to ResourceString, re-building, and then dump the string resources using a resource editor like XN Resource Editor?
That's how I'd approach it, if there were really THAT many of them.
hi every body
i'm new to xercses C++dom parser.can anyone tell me
can we write our own getElementsBytagName,GetNodeValue etc function ?
how to write these function and use them in my code ?
can anybody explain me the process of Dom parsing?
xerces provides methods like getElementsBytagName so you can use them in your application.
Have a look at xerces programming guide you can find there how to parse xml file and how to get elements and attributes.
I would like to globally prevent LaTeX from hyphenating 'Objective-C'. I am aware of the \hyphenation command, but I don't see how I can make use of it. If I pass 'Objective-C' to this command, the dash will be treated as a hint to hyphenate the word there.
One solution I found is wrapping Objective-C into an mbox each time I use it. However, the document I am writing contains this name a lot, and wrapping it into an mbox each time is ugly (as is defining a command and using this over and over again in the source code).
Why is defining a new command ugly? It's how \LaTeX\ defines itself.
\def\ObjectiveC{\mbox{Objective-C}}
Use \nobreakdash. That's what LyX produces when I insert a nonbreakingdash and convert it to tex.
As suggested here, you could define a command like this:
\newcommand\dash{\nobreakdash-\hspace{0pt}}
and use it like this
Consider the $n$\dash dimensional manifold ...
Also, you could use the babel package and use "~ as a protected hyphen. I'm not sure if using babel is advisable when writing in english, though.