How to implement Regex in Kotlin for a specific condition? - android-studio

I've tried implementing Regex according to the conditions shown in the image. However it doesnt work. There is no error message,but when I entered the correct details, it doesn't move on to the next page. This is my first time with Regex in kotlin and im not really sure how it works either. Could anyone guide me in the correct direction?

Related

How do I check if certain text exists on a page (puppeteer)

Sorry in advance if I seem kinda clueless, I just started using puppeteer yesterday and I’m inexperienced with this kinda stuff.
I’m trying to check if a certain page (opened with puppeteer) has the phrase “hello” for example, keep in mind that I know the XPath of the text (if it exists). I’ve tried .waitForXPath() but I can’t seem to get it to work. Is there an easier function for this?
(await page.content()).match('hello')
That depends on what you typed into .waitforXPath() method.
I can imagine this can work:
await page.waitForXPath("//*[contains(text(), 'hello')]");
But it might be slow because all texts of all elements will be searched. It's better to narrow down the search to e.g. some elements. Unfortunately you don't provide more specifics, so I can't help you there.

Search Orders on BrightPearl API

I am trying to search BrightPearl orders through API using the following URL pattern using REST API
order-service/order-search?createdOn/2018-09-12T00:00:00/2018-09-12T23:59:59
This is how their documentation says. But it is not returning orders as expected within the date range instead, it returns all the orders available in the store regardless of the date range we applied.
Can anyone say the correct URL pattern which fulfills my requirement?
Please note that it is not a coding issue but URL pattern issue. If someone came across this problem earlier and fixed could help
http://api-docs.brightpearl.com/order/order/search.html
https://help.brightpearl.com/hc/en-us/articles/212644983-Resource-search?flash_digest=187c68ecc5151c9d3a390e14fd8e4f114db11bcd#autolink-heading-2
Thanks in advance
I got an answer from the bright pearl support which solved my issue. Let me share it here
It looks like you are using the wrong string.
If you are using GET method the URL endpoint should look like this
/order/*/goods-note/goods-out/20
and if you are using PUT method the endpoint should look like this
/warehouse-service/goods-note/goods-out/20
This guide might help with the syntax: http://api-docs.brightpearl.com/warehouse/goods-out-note/get.html

Accessing Area.Name Throws Error

I'm just trying to find a way to access the name property of an Area element inside Revit Python Shell, tried looking on Jeremy Tammik's amazingly informative blog, tried AUGI, Revit API docs, been looking for 2 days now...
Tried accessing via a bunch of ways, FilteredElementsCollector(doc).OfCategory(BuiltInCategory.OST_Areas), tried by Area class, tried through AreaTag, every single time I get an error under every circumstance and it's driving me nuts, it seems like such a simple issue that I can't seem to grasp!
EDIT: Also tried by element id, through tags, through area schemes, nada, no go...
Can anyone please tell me how to access this property via RPS?
I would say two things:
areaObject.LookupParameter("Name")
areaObject.GetParameters("Name")
...are valid methods. Please notice how I used GetParameters() NOT GetParameter(). There are some drawbacks to using either one of the two. The lookup method will return FIRST parameter that matches the name which in many cases might be a different parameter for different elements. It's not very reliable.
GetParameters() method will return them all if there are multiple so then you have to deal with a List<Parameter> rather than a single object that you can extract your value from.
I would personally recommend to use areaObject.get_Parameter(BuiltInParameter.ROOM_NAME) method to extract a Name value from Area object. The BuiltInParameter always points at the same parameter, and will reliably return just that one parameter. Here's a little more details about these methods:
http://www.revitapidocs.com/2018/4400b9f8-3787-0947-5113-2522ff5e5de2.htm
To answer my own question, I actually never thought of looking through the code of other Revit Python scripts... in this case of PyRevit, which is in my opinion far more eloquently written than RPS, raelly looking forward for their console work to be done!
Basically, I had mistakenly used GetParameter('parameter') instead of LookupParameter('parameter').
As I said, it was something stupidly simple that I just didn't understand.
If anyone has sufficient knowledge to coherently clarify this, please do answer!
Many thanks!
Maybe your issue is the same as this one ? :
https://groups.google.com/forum/#!searchin/RevitPythonShell/name|sort:relevance/revitpythonshell/uaxB1FLXG80/sdJNrTfoPuUJ
Your_Area.Name # throws error
Element.Name.GetValue(Your_Area) # works great

{exp:search:keywords} filtering out insignificant words

With my current project I need to display the exact search phrase entered on the results/no-results pages.
However the {exp:search:keywords} variable seems to have insignificant keywords removed.
“Who am I?” becomes “who am”
I understand why this is the case but for the purposes of this particular website I need the exact phrase.
Does anyone know how I can achieve this ? Please let there be a workaround...
I am using the Simple Search module in 2.7.0
Thanks.
/system/expressionengine/modules/search/mod.search.php:236 (v2.7.0)
//$original_keywords = $this->keywords;
$original_keywords = $_POST['keywords'];

Search result empty wordpress

I am trying to search any post by typing a related keyword but every times the result seems to be empty. Here is the link http://apprs.com/ripple/?s=music . I must say there is a post with the keyword i typed. Why isn't the search working. I checked the
search.php and
searchform.php.
Those seems all OK. I don't know what i am missing.
I will be feeling good if i could get any help.
I changed the theme.. Its working now..

Resources