How can I add multiple functions with a same name for ZeroBrane's API? - zerobrane

I found in the API file for ZeroBrane I can only add one name for one function. If I add multiple functions with a same name, then I type the name in the lua IDE, it can only show me a single tip.

If I add multiple functions with a same name, then I type the name in the lua IDE, it can only show me a single tip.
This is the current limitation of the support for custom APIs in the IDE, but there is a ticket that requests support for function overloads, so you may want to follow it for any progress on this feature.

Related

how do I force a field to be translated in my Odoo code?

I am developing a module for electronic invoicing, and should express the payment term in spanish, so I am setting a dictionary with all the needed fields, and when I do this:
{
...
'FmaPago': inv.payment_term.name,
...
}
The output file contains the value "name" in english. I've tried something like
_(inv.payment_term.name)
but with the same result.
How should I force the value to be expressed in a defined translation?
The field name of Payment Terms are already translatable. You can change the translation in Odoo by clicking the little button within a field in edit mode.
If you've done that correct, you have to avoid some typical mistakes at code side if you use the old API.
always pass the context
e.g. if you browse the invoice, pass the context, to get all translations correct
use partner language if you want to translate for them
Odoo is using user language in his context, to translate the web client correctly. If you print documents for customers, you want them in customer language of course...
So you maybe need to manipulate the context (key 'lang'). For new API you have to call with_context() to do that.
You must use _() for strings that you want to be able to translate.
You must make translating files *.po (as i remmember) and thats all I think.
Dont forget to check documentation link

How does one list the changes via the API from a TeamCity build?

I'm trying to find a way to get all the comments from a particular build in TeamCity via the Rest API. How can one do that?
http://teamcity:port/httpAuth/app/rest/changes?locator=build:(id:77651)&fields=count,change:(version,username,date,href,comment,files)
Via this URL, one can list out in custom fashion exactly the fields they wish to return. I don't think this is documented, i got this from their support folks. Enjoy!
PS - There are other examples out there which iterate over each change, this lists out all the changes for a particular build id in one place, for parsing.

Need your ideas to automate

In my project we have a web based tool where it collects all the exceptions that occur in log. The list of exceptions will be displayed in table and a icon will be displayed in a column to get the stack trace. Some one needs to check all those exceptions and we need to assign to different teams based on the keywords.
Eg : If the stacktrace contains "DB Connection error" it has to be assigned to DB team, if it contains code error like "classcast exception" in particular file then it has to be assigned to individual owning the module. Currently some one has to open each n every row in the table displayed and open the stack trace and do Ctrl + F and if any of those keywords are found assign it to respective team.
We don't have any access to the tool's database and it's web based. I need some good ideas to automate it. Please suggest me with which technology and idea to automate it.
Sounds like selenium + programming language of your choice is a good fit (even without a selenium).
You need to:
download source code of the page containing exceptions table.
Use any of these: wget, curl, selenium, urllib for python, etc.
put it into variable and extract exceptions list in convenient to you format.
Use any xpath-powered tool, like selenium, lxml for python, etc.
do your thing with the extracted exceptions list: search for keywords, assign tickets, etc.
Use programming language of your choice.
Definitely you can achieve this using selenium.
Following are the steps to follow.
Supply date criteria with type command to the boxes text boxes element.
click search button.
store the required text in variable using storeValue(locator, variableName).
click on image link if you are able to keep track of popup window else you have to use
$second=$sel->getAttribute("//html/body/.../a#href"); and now your $second has link address $sel->openWindow($second,"MyWindow2"); now select that new window $sel->selectWindow("MyWindow2"); and do operation of storing required data from the popup.
Now agian for selection of previous window use `$sel->selectWindow("null"); // hear $sel is object of selenium (i.e. $this).
Select your required option using select(selectLocator, optionLocator).
Use selenium RC for above steps so that you have more manipulation with the data stored and as per requirement operations.
In above steps syntax are of PHPUnit.
Please try the steps may help you.
Regards.

UIApplicationDelegate: Is there any documented use of `annotation` by other applications?

When a document is opened in an application from another app, the file name passed into application:openURL:sourceApplication:annotation: is pretty nonsensical for display purposes. The annotation portion of this message should contain an NSDictionary containing user information, like a friendly file name. Since the structure of this field is pretty loose, is there any site that has attempted to aggregate what different apps use when passing that meta-data to other applications?
I realize that trying to account for all apps would likely be an exercise in futility, but being able to handle a few popular applications would be useful to try and accommodate.
http://handleopenurl.com/scheme, and a few more at http://wiki.akosma.com/IPhone_URL_Schemes.

Plugin configuration in Eclipse

I'm investigating the use of Eclipse as a platform and I am trying to figure out how a plugin provides configuration. For example, say I have a plugin to display a user defined message. Further, I want that user defined message to be configured by the user. What is the standard way for the user to edit this message in the platform? Is there any documentation for this?
As you mentions in the comments, the article Preferences in the Eclipse Workbench UI described the way developers define preference pages for their plug-ins.
By use of the preference store in conjunction with the preferences dialog and provided field editors a plug-in developer can quickly put together a user interface for managing preferences.
The color preference page is an example of a simple page that uses a single JFace field editor to manage its values
That way, you can define several type of custom values configured by the user:
text field
set of predefined values (dropdown list)
array of values
Example:
Found it: http://www.eclipse.org/articles/Article-Preferences/preferences.htm Wow, Stackoverflow helps a lot! You only need to post and it magically comes up in Google
Sorry to VonC but I had already found it before he posted the answer :-/