Postgres SPI cursor options: Where is a complete list? / What are the default options? - postgresql

From the Postgresql documentation:
int cursorOptions
Integer bit mask of cursor options; zero produces default behavior.
What is the default behavior? Where is a complete list of cursor options? I've been looking through the documentation for an hour now. Can someone provide a link or point me in the right direction?

I am compiling a list of cursorOptions as I peel through the documentation to help save the others the trouble.
Defined in <src/include/nodes/parsenodes.h>:
CURSOR_OPT_BINARY (0x0001)
CURSOR_OPT_SCROLL (0x0002) is required by several SPI commands. Setting this option will allow for more complex movement through cursors. Further details are explained in the documentation of SPI_cursor_fetch, SPI_cursor_move, SPI_scroll_cursor_fetch, SPI_scroll_cursor_move
CURSOR_OPT_NO_SCROLL (0x0004)
CURSOR_OPT_INSENSITIVE (0x0008)
CURSOR_OPT_HOLD (0x0010) is ignored by SPI_prepare_cursor. However, it's behavior for SPI_prepare_params and SPI_cursor_open_with_args is not specified in the documentation.
CURSOR_OPT_CUSTOM_PLAN (0x0020)
CURSOR_OPT_FAST_PLAN (0x0040)
CURSOR_OPT_GENERIC_PLAN (0x0080)
NOTE: If anyone with the ability to edit posts wishes to contribute to this answer (additional options, functionality or insights), please feel free to do so. I will try to move comments up into the answer as they come.

Related

Is "health.config.enabled" still being processed, and where?

Is the property "health.config.enabled" still valid and being processed in current Spring Cloud?
If yes, where in the code it is being done?
The property is in the current official documentation and has worked well for me so far (in cloud clients).
But as a whole string, it cannot be found anywhere in the current source code (besides the doc source).
For me as a beginner, it was easy to find in the old version of ConfigClientAutoConfiguration.java
Recent version of ConfigClientAutoConfiguration.java does not contain that whole property name, although I guess it's still being processed but in a more abstract way that I don't understand yet. Thus I'd appreciate even a hint in the form of "what used to be done on line "#ConditionalOnProperty(value = "health.config.enabled", matchIfMissing = true)" before is now roughly done on line XY".
Thanks.
It is replaced by #ConditionalOnEnabledHealthIndicator("config") (see here).
From the javadoc for that annotation
Blockquote
#Conditional that checks whether a default health indicator is enabled. Matches if the value of the management.health.<name>.enabled
So the new property is management.health.config.enabled

How does "attachments" option in exextra work?

I would like to know more about the attachments option in \exextra. Does this option allow the attachment(s) from students when they are submitting their answers? I could not find any worked example on this feature in http://www.r-exams.org/ or in any other sources. Many thanks!
We haven't advertised this option much because we hope to further improve and streamline it in the future. There is one worked example, though: http://www.R-exams.org/templates/essayreg/. Essentially all the exextra options specified in that exercise map to the corresponding options in Moodle.

AutoHotKey ControlGet

I have a script that is throwing and error when I issue a ControlGet.
OtPtVar := AfxWnd422
strMPP := Material Planning Profile
ControlFocus,%OtPtVar%,,%strMPP%
Control,Show,,%OtPtVar%,,%strMPP%
These all work but when it gets to the next line it throws an error:
ControlGet,sysList,List,,%OtptVar%,,%strMPP%
The control is a grid with five fields row number,Part,Description,Time,Lateness.
`ControlFocus,%OtPtVar%,,%strMPP%`
`Control,Show,,%OtPtVar%,,%strMPP%`
`ControlGet,sysList,List,,%OtPtVar%,,%strMPP%`
The error occurs on the last line.
Thank you.
After searching the AutoHotKey site I found to the following:
Those Afx window classes were custom classes distributed with early versions of MFC, before the "Common Controls" concept was introduced.
Many people have tried to "read" text from them but you CAN'T, not with messages anyway!
They're almost certainly owner-drawn - the text is not delivered by messages, it's "hand-drawn" into the window's DC
...
Messages are a dead-end I think - those who have pursued this problem must have already clocked up several hundreds of hours of monitoring message traffic between them!
So its not possible to get a hold of the control.
ControlGet's List subcommand can only handle standard listview controls, which usually have the class 'SysListView32'.
Did you try AccViewer just in case.
This link mentions textcapturex by Deskperience Software in case that helps.
"AfxWnd42s" Please Help - AutoIt General Help and Support - AutoIt Forums
https://www.autoitscript.com/forum/topic/49057-afxwnd42s-please-help/
There are theoretically process hacker methods,
but I'm not an expert on those, and wouldn't recommend such methods.
And yes, unfortunately when I really needed to, I used OCR once.
Potentially you can do OCR, recreate the text in the same font,
and check for an exact image match as a double-check.
Also, if possible, set the font to one where characters such as capital i and small L are unambiguous.

In Padrino, where does access_control come from?

The Padrino Admin Guide (http://www.padrinorb.com/guides/padrino-admin) has the object "access_control", but it is not clear to me where it is set? I can guess, but that is not good enough. We have essentially:
class Admin < Padrino::Application
register Padrino::Admin::AccessControl
enable :authentication
set :login_page, "/admin/sessions/new"
access_control.roles_for :any do |role| #How is access_control set?
role.protect "/"
role.allow "/sessions"
end
...
I am expecting that access_control is set somewhere, but where? I am guessing that this has to do with the "register" command, but have not found any help in docs yet.
thanks for any help...
Well, little interest in this, but I needed an answer, so here is mine.
I have at the top register Padrino::Admin::AccessControl which also lists Authorization, Base, ProjectModule. I can see some of the methods used in the app from the docs:
https://www.padrinorb.com/api/Padrino/Admin/AccessControl.html
However, nothing I could see about "access_control". I finally saw in the docs something I had missed, the line:
Defined in:padrino-admin/lib/padrino-admin/access_control.rb
AhHa! That is what I needed. Github if I need to look further.

Query with toLocalizedTime in Plone

I'm using toLocalizedTime to output a date, as below
<span tal:content="python:here.toLocalisedTime(date.get('start_date'))"/>
This outputs eg. 2007/08/02, I'm just curious as to how one would alter the output so that it reads 02/08/2007
I'm not having much luck finding much info on toLocalizedTime, would someone point me in the right direction?
This depends on whether you have English selected as the site language (Site Setup >> Language). If so, then the default settings are used. You can change the defaults by dropping down into the ZMI, then into 'portal_properties', then 'site_properties'. The fields to change are either 'localTimeFormat' or 'localLongTimeFormat' depending on whether you pass in 'long_format=1' to the toLocalisedTime function.
If on the other hand, you have translations set up, the format may instead be pulled from the translation file for the locale selected. I'm not sure what is the easy way to change the format in this case (other than switching the site back to English). I guess you can register your own translation file but I've never needed to do that so you're going to have to look up the details.
Date string formatting follows the Python rules (http://docs.python.org/library/time.html#time.strftime).
Perhaps even more detail than you need:
here.toLocalizedTime()
is defined in the plone browser view at...
CMFPlone/browser/ploneview.py
which looks up the 'translation_service' utility, to call its 'ulocalized_time' function, defined at...
CMFPlone/TranslationServiceTool.py
which itself calls the 'ulocalized_time' function defined at...
CMFPlone/i18nl10n.py
As always, you can learn interesting things by grepping the source code ;-)
For an up to date answer for Plone 4.3 (after going through the source code)
These fields are now in the registry found at:
http://localhost:8080/yoursite/portal_registry
Then filter on "i18nl10n", which should give you the 4 fields you need to change.