views[] (\b) behavior in current and specified namespace in kdb - kdb

Difference in output of \b is different in current namespace and specified namespace.
When I have below table, view and query in current and another namespace.
\a works perfectly for both namespaces but same is not the case with \b.
q)t:([] a:1 2)
q).ns1.t:([] a:1 2)
q)q:select max a from t
q)v:: select max a from t
q).ns1.q: select max a from .ns1.t
q).ns1.v:: select max a from .ns1.t
q)\a
`q`t
q)\b / clearly displaying view in current namespace
,`v
q)\a .ns1
`q`t
q)\b .ns1 / not displaying the view
`symbol$()
q)\a .ns1
`q`t`v / view is displayed in the output of \a
How can we determine the table and view from the output of \a .ns1?
Am I missing something? Is there a way to get the views of the specified namespace?

The thing is that: Views and their dependencies can be defined only in the default namespace. See Kx Wiki for reference.
So, technically, even though .ns1.v is defined with :: as a view, it is not a view, but usual table.

Related

How to change default filter search clause in service now platform?

When we make a search for users or incidents the default search clause is "greater than or is" but i want to change it to "is" clause.
Can anyone tell me how to do that?
The property #Antonio mentioned is the only way to affect the default search behavior, but if you prefix your search term with an equals sign, it will do an exact match.
e.g. You want to search for London in the city field, just type =london in the search bar and you'll get an exact match.
You can also prefix with * for contains or prefix/suffix with % for a startswith/endswith.
There does not seem to be an option to do this. However, you can change the default search behavior to "contains" by creating a boolean property named glide.ui.goto_use_contains in your system properties.
More info on this here

TYPO3 Not able anymore to translate CE's to other languages

Is there a way to 'reset' or db entries to delete or something else without deleting all content already translated... (and would that solve the issue?)
In the first go all translation went well, I chose a 'one tree' setup pressing translate rather then copy, but adding and modifying the content over time certain elements where not available for translation anymore ...
at one point the second step in translation asked for the origin language (if I recall well) and trying to resolve I chose another language than the default, now I do not have the choice anymore and the record summary proposes elements from german rather than from my default language (italian) which might be the problem since I can only introduce new content in the default language.
if I try to localize from the list view clicking the language flag, in the language selection field I get [INVALID VALUE("1")] and as only option (Default) [0] to select ...
I use TYPO3 V7.6.13, EXT:gridelements and EXT:t3sbootstrap (the nested CE's where the first to show trouble)
content of my database table sys_language: (my default lang is italian)
uid | pid | tstamp | hidden | title | flag |
1 0 ... 0 English gb
2 0 ... 0 German de
does anyone know good reference or a solution to this problem ?
That sounds like your sys_language records (in yoour root-page, id = 0) are disabled or missing.
Those records make languages available for translation.
The other factor for translation selection is the translation of the current page. You need to have the page translated to a language (given above) to be able to translate any record in that page. That also is neccessary for pages which contain only data.
first check (as suggested by bernd) if your language setup is valid:
do you have a sys_language record for every added language in your
root-page ? (you can control the sys_language table with phpMyAdmin)
is the page translated ?
in my case that was all fine but I needed a thorough cleanup:
I deleted all hidden records in the backend
I activated the system extension 'recycler' and deleted all in the
list (from root-page recursive)
I then checked with phpMyAdmin which records in tt_content where
hidden (and did not show in the backend) and deleted those manually
once I did that the translate request answered perfectly and I could restore the missing CE's translations
note: I still had gridelements showing up in wrong sequence for the translation in the backend but correctly in the frontend, the nested CE's seem though, and of course 'CLEAR CASH FREQUENTLY' to avoid surprises ...

Separating Google child labels from parent labels

I want to retrieve all labels a user has at Google and display them in a neat way, like Google themselves do:
When I fetch this hierarchy of labels with the Gmail API I get the following data:
GET https://www.googleapis.com/gmail/v1/users/me/labels?key={YOUR_API_KEY}
I use "/" as a delimiter in order to figure out the parent label of a certain child label. This worked great until I realized I could create labels with "/" in the name. Bummer.
Is there another way to do this, or should I stop my users from being able to create labels with "/" in them, and just live with the potential "bad" labels they might have created elsewhere? Thanks.
It's possible to handle this case correctly, though it requires a little extra work than just splitting on the '/'.
Suppose you have the labels:
foo
bar
baz/qux
When you fetch all the labels, you'll get back 3 entries:
"foo"
"foo/bar"
"foo/bar/baz/qux"
Note that while "foo" and "foo/bar" exist, there is no "foo/bar/baz". That label doesn't exist because 'baz/qux' is the literal label name.
Rather than simply split, try prefix matching instead. The parent label is going to be the longest label (+ trailing /) that is a prefix of the one your checking. Anything remaining after the prefix is the label name itself.

Drupal 7 views block with default value contextual filter does not filter on page (Mongo)

tl;dr: Views Block, with contextual filter, WITH default value. Results show properly in preview, but NOT on the page. Page = taxonomy term page with a path alias. Running on Mongo.
=====
How my problem differs from all other contextual filter block issues I've seen:
- Using Mongo
- DO have a default value set on the Contextual filter
- Results show properly in views preview, but not on page
Using Drupal 7 on Mongo, with EFQ Views, I need to display all nodes of NODETYPE that have been tagged with term TERM, on TERM page. (With Drupal on Mongo, taxonomy index is stored in MySql but the node content in Mongo, so term pages don't work as expected, and return no content. So a view is necessary to establish this functionality. <-- Yes, this is really stupid.)
My Taxonomy is an entity with its own fields, & tagged content appears in a block, below the terms own fields. (This is why I didn't just make a page view to display tagged content -- bc. I must display the term's own fields.)
Taxonomy term pages have a path alias, "vocab/term-name".
Configurations I've tried that work successfully in preview but not on the page:
1: Using path alias.
Global: Null forarg(0)
Node: TAGS for arg(1) When filter is NOT available:
- Provide default value: Taxonomy term ID from URL
- Load default filter from term page
OR
-- Raw value from URL, Path Component 2
-- "Use Path alias" Checked
When filter IS available:
- Validator: Taxonomy Term, Vocab TAGS
- Filter value type: Term name converted to Term ID
- Transform dashes in URL to spaces in term name filter values
2: Use Term ID
When filter is NOT available:
-- Raw value from URL, Path Component 3
When filter IS available:
- Validator: Taxonomy Term, Vocab TAGS
- Filter value type: Term ID
View results in preview appear correctly whether using the term name or term id in the C.Filter. But no matter how it's set, the block on the actual page returns all NODETYPE nodes.
On the taxonomy page, the block is displayed in a custom region, or in the Main content area of the page. In both cases, all nodes display, unfiltered. Ajax is enabled on the block, for good measure.
Topics I've read / tried that don't apply / don't work: (can only post 2, but I have 15):
Drupal 7 views Contextual filters with Page & Blocks
drupal 7 views block and contextual filter not working
Turns out the settings that worked were:
Contextual filter: Taxonomy TAGS
Default value: Raw value from URL, Path component 2
Check "Use path alias"
When filter IS present - Specify validation Criteria
Validator: Taxonomy Term (from the checked vocab)
Filter value type: "Term name converted to Term ID"
Check "Transform dashes in URL to spaces in term name filter values"
The Global Nulls for arg(0) was in the way. Without that, just using the value for arg(1), things work fine.

get sibling node without relying on parent index?

I find it easy to get the text values inside cells whose row has a reliable attribute, eg. $browser.tr(:class, "datarow2_sm")
However I also need to grab the data from the very next <tr> in the table, defined only as <tr class="">.
Its HTML contents don't have anything very unique either, watir-speaking.
One reluctant method to catch that row is:
cell1value = $browser.tr(:class, "datarow2_sm").parent[3][1].text
cell2value = $browser.tr(:class, "datarow2_sm").parent[3][2].text.to_f # etc.
But I don't want to rely on a fixed index [3] as such things in the wider table may shift. In addition to .parent is there anything like .sibling (.next/*.previous* like in Mechanize)? Perhaps one that would prefer a node of the same type (tr to another tr not a td or some non-row node in the DOM)?
You could use the css adjacent sibling selector. Note that Watir-Webdriver only currently supports css selectors for elements node.
You would do the following (noting that the to_subtype is to convert it back to a TableRow rather than Element):
puts b.element(:css, "tr.datarow2_sm + tr").to_subtype.text
Update
If you want to get the second cell in that next row, you can do one of the following:
puts b.element(:css, "tr.datarow2_sm + tr").to_subtype[1].text
puts b.element(:css, "tr.datarow2_sm + tr").td(:index, 1).text
CSS has a special selector for this called adjacent sibling selector:
Adjacent sibling selectors have the following syntax: E1 + E2, where
E2 is the subject of the selector. The selector matches if E1 and E2
share the same parent in the document tree and E1 immediately precedes
E2, ignoring non-element nodes (such as text nodes and comments).