I'm trying to do something simple with nitrogen in erlang. I have successfully set validation on text fields:
wf:wire(submit, desk,
#validate{ validators=[ #is_required{text="Required"} ]}),
where desk_name is a textbox and submit is the button at the bottom of the page.
I just want to do the same for a panel. However, using this same code does not seem to work.
Is there a way to have validation for fields other than a textbox??
I really appreciate your help! Thank you.
In nitrogen, you can use its documentation to see all that you can do with its elements. These elements are Erlang records. records have fields and you cannot add anything to a record that was not yet there at compile time.
I suggest you read the wf.hrl file which is the header file for a number of nitrogen elements (you can find it in a path $NITROGEN/apps/nitrogen/include/wf.hrl), or you could access the documentation for all elements here.
Another thing is, (to me) you sound like you have not yet learned as much erlang as you may need to successfully develop in nitrogen (no offense). Usually, Frameworks developed in erlang will become obvious once you have learned to play with the language's data structures. you will easily understand why a developer of a given library chose to do something the way you see it. I therefore suggest (with due respect) that you look at this good guide to Erlang Programming.
Most new developers in nitrogen get "Erlang errors" other than "Nitrogen errors" in most of their code.
Do not forget that you can use only as much functionality on a nitrogen element as has been built around the element through its record structure and support action functions. read the documentation, and you will be successful!
success!
Related
Is anyone aware of how to retrieve the exact version (major, minor, patch) that a specific feature was added/removed/altered to the Ruby language?
Obviously one could comb through the history to find out, which is not ideal, and can be cumbersome to navigate. Was curious if anyone might know a better way to do it, as the documentation doesn't state when a method, class, etc. was added.
When documenting my own gems with YARD, it is easy to just add a #since tag to clearly show when something was added, but the Ruby API doesn't seem to have any such mechanism in its own documentation.
When writing gems, it is obviously handy to know such details when managing dependencies, and I was hoping there was a simpler solution, such as simply typing a method name into a website, and seeing the exact version it was added.
To clarify, basically a "changelog" for any item. For example, type in method name, see log of when it was added, changed, deprecated, removed, etc.
A prime example would be something akin to .NET Core's Reverse Package Search.
I was just doing this, unfortunately my answer is what you were hoping to avoid.
I was looking through history, but able to use GitHub's handy Blame feature to help track down when a specific line was edited. With this I could open the file in question click "Blame" and see when it was last edited/created.
Was a great way to track down when Exception2MessageMapper was added to the standard library. It was 17 years ago, as part of v1.4.0:
https://github.com/ruby/ruby/blame/trunk/lib/e2mmap.rb#L55
As an enthusiasting refactorer, there's an IntelliJ feature that I love: "Refactor --> Change signature".
Basically, you have a function and you can decide to remove a parameter or add a new one, setting a default value. This is so convenient, so beautiful, and I dearly love it.
So when I got involved in an oldschool UFT project with maintenance tasks, I felt jaded.
It there a way to achieve this without changing each and every instance of the function? Please tell me yes. Please!
Well, no. I don´t know of any tool capable of this.
There seem to be people who created a C# adapter for the UFT test object API, enabling them to write their tests in C#, and to use VisualStudio for development of test scripts. In VS, you have the refactoring support you look for. But you don´t create UFT scripts anymore, you´d create C# apps. (Note I am not talking about the API testing aspect of UFT, which uses C# anyways -- I am talking about the VBScript test scripts for GUI tests and BPT components.)
UFT itself is not capable of doing real static code analysis. (Let this statement drown a minute, and you´ll agree: it´s true.)
Adding this to the fact that the UFT´s IDE is, let´s say: sub-optimal, this led to the development of Test Design Studio (TDS), a VisualStudio "feel-alike" subset of VS for UFT (VBScript) scripts. You can check it out here: http://www.patterson-consulting.net/products/test_design_studio/Default.aspx
Among other things, TDS does static code analysis for UFT scripts in a pretty complete way (as far as an interpreted variant-typed language like VBScript allows that at all), and the author of the tool seems to be thinking about adding refactoring features like the one you asked for, but -- this has not happened yet. It will probably come only if demand is high.
Until then, TDS could help you:
You could simply change the signature
If TDS knows all calls (which is usually does), it will list you all locations where you need to edit -- and this happens at design-time, not at runtime
TDS allows you to specify the type of identifiers, for example: formal parameters, variables, and so on. This means you might even get warnings if you change nothing about the pure VBScript signature (which does not include type information), but do change the TDS directive of that signature parameter of which you changed the type.
This is no advertisement. I am not part of the company that developed TDS.
This is just an honest answer to the (slightly offtopic) question that I wish would have gotten years ago, asking questions like yours, and it proved to be a real lifesaver.
In summary, TDS quadrupled (or more) my productivity when creating and maintaining test scripts, especially if a large base framework is used. So I´d recommend checking out the option of using TDS to better handle changes like the ones you outlined.
I have an interesting problem that I would like to throw out to you all - see if anyone can think of anything I haven't.
What I need to be able to do here is to somehow assign / determine identifers for all the paragraphs in a Presentation. I then need to be able, at some point in the future, to open / manipulate that presentation using OpenXML, and the identifiers have to be available for use at this point.
In short then, I need some form of persistent identifier.
I've tried looking at the OpenXMLFormat itself, and cannot see anything there that I can use that's already built in. If anyone knows of anything, any element that's already in the schema I might use, any attribute etc, then please shout up...
Trying to solve this problem myself, I have written code using XLinq and SharpZipLib to open up the various xml files and add a custom attribute to every element - the attribute basically containing a Guid. The code does what it is supposed to - but both Powerpoint and OpenXML 2.5 will then no longer talk to the file - presumably because I have introduced attributes that are not in the schema... I could live without Powerpoint being able to access the file at this point, but OpenXML is a bit of a blocker because the file will be undergoing some processing later on that has a definite dependency on the OpenXml library.
Anyone got any ideas?
For some background, I'm currently an intern who has been asked to use GWT to create some kind of table/grid that can be sorted by column. Ideally my boss (who told me to ask for help about this here on Stack Overflow) also wants to be able to have multiple pages of data as well, but I'm concentrating on the sorting part right now.
Before jumping to suggest the various EXT and GXT things, unfortunately 1) what this will be used for will eventually be a part of their product, and therefore, used commercially and 2) this is for a not-for-profit company, so they don't really want to pay for a license. I have been searching for what feels like weeks in vain for something that I can both use and understand.
I am using Eclipse (indigo) to create GWT web apps, but I am still quite a newbie at anything related to GWT and I'm sure that most of my problem is that I don't really understand how to get and use the code that is presented as an example in tutorials. I have read through all the GWT documentation I can find and many tutorials and showcases, but I still don't really understand how to do things... which is unfortunate and frustrating. I have also tried using the GWT Designer in Eclipse and while neat, I can't use the CellTable stuff (which of course is exactly what my boss wants) - I assume because I don't have the license for it? Right now, I don't need to be getting data from a server (literally, if I could just put all my people-data in an ArrayList and populate columns from there, I would be very happy).
Can anyone help me out with this? Sorry it's kind of a two-fold question (one that I'm such a newbie about GWT, two that I am not having any luck figuring out how to make a sortable table/grid) but I would really appreciate any help.
CellTable is one of the more complicated concepts in GWT. You are looking in the right place, the documentation is here: https://developers.google.com/web-toolkit/doc/2.4/DevGuideUiCellTable.
This should have everything you need including all the code with an EntryPoint class. I think it is just a case of getting this code running on your machine and working through it line by line understanding what it is doing.
I've just started work on an existing Joomla! site, and have a requirement to add an alternative language version of an article. Note that this isn't a full-internationalization effort - we don't need every part of the interface translated - just the need to have another 'version' of an article. Ideally, though, this would include more than just the core content - for example, title. I don't really want to create a second article because, in essence, this really is just a single article, and I don't want things like comments to be split between two separate articles.
Does anyone know if this can be done using joomla core?
If not, can anyone recommend an existing component that will do this?
A good component for manage translations in Joomla 1.5 is Joom!fish. It allows you to do a whole internationalization that, as you said, isn't exactly what you want to do. However I like to think in the long run so, if there's more change, I have not to restructure again and again just because of I haven't thought it before. Hence, if I were you, I would like to use Joom!fish anyway.
Well, as a short fix - Google Translator works and can be installed into your template you're using.
Then you can set it to be hidden unless the users browser is set to use a different language as default - then a small pop-up box drops down and it asks to translate it using google translate.
If that's not the option you're looking for - joom!fish is a good component others rave about but I don't have much experience with personally. Outside of that I'm not really sure.
Hanny had a good idea that would be really easy to implement in an article with the right extension. You can use this extension -
http://www.nonumber.nl/extensions/tabber
This would allow you to easily create tabs with the translations available anywhere you have them. The page above uses the extension to display the tabs, it would be trivial to implement.