How to search numbers (e.g. years) in commit messages with GitAhead? - gitahead

I noticed that GitAhead (v2.6.1) doesn't seem to index numbers (e.g. years).
Example commit message: "prepare for January 2020 release".
The search terms "message:January" or "message:release" do find this commit, whereas the search term "message:2020" does not.
How can I search for commit messages containing a certain number?

Related

Why does Bing News Search API "since" parameter do nothing?

I need to routinely call Bing News Search results via its API, checking for fresh stories matching a given search query.
I only want to return stories newly published since the last time I called the API.
For example, an hourly call to the API should constrain the search for stories from between the last hour and now (ie. stories published within the last hour).
Here is documentation for Bing News Search API - https://learn.microsoft.com/en-us/rest/api/cognitiveservices/bing-news-api-v7-reference
It makes clear a parameter, "since", which takes Unix epoch time. I will always be able to programmatically generate the epoch time for the start of the period.
Documentation states:
The Unix epoch time (Unix timestamp) that Bing uses to select the trending topics. Bing returns trending topics that it discovered on or after the specified date and time, not the date the topic was published.
If I want to return stories starting from June 22, epoch time for human GMT time Friday, June 22, 2018 12:39:51 PM is 1529671191.
This should allow me to generate API query URL https://api.cognitive.microsoft.com/bing/v7.0/news/search?q=%22Cardiff%22&since=1529671191000&count=100&sortBy=Date&textDecorations=true&textFormat=HTML
q="Cardiff"
since=1529671191000
count=100 (maximum)
sortBy=Date
textDecorations=true
textFormat=HTML
However, when that call is performed, the longest-ago "datePublished" field for a returned story object is "2018-06-20T23:18:00.0000000Z" (ie. June 20), which is clearly two days before the "since" parameter that I specified.
It's so curious, and frustrating. The alternative constraint parameter "freshness", when specified as "Day", seems to successfully constrain the search period to the last 24 hours. But that is not granular enough. "Since" does not work and does not do anything at all.
Is "since" only intended to be used to return Bing News' "Trending Topics" story lists, and not results of news search queries? The documentation language may be ambiguous.
If this is the case, how can I constrain the start/"since" date for my search through the API, other than with "freshness"?
I think the answer is on your question question:
You say:
However, when that call is performed, the longest-ago "datePublished"
field for a returned story object is "2018-06-20T23:18:00.0000000Z"
(ie. June 20), which is clearly two days before the "since" parameter
that I specified.
But just before, you are quoting this from the documentation:
The Unix epoch time (Unix timestamp) that Bing uses to select the
trending topics. Bing returns trending topics that it discovered on or
after the specified date and time, not the date the topic was
published.
So it has probably been discovered after your since value, you cannot compare with the datePublished field

Can you use Google Analytics API as Visitor Counter?

I mean like, count how many clicks the website since beginning and get their country location.
i already testing Google Analytics API but it requires to input date range, which i want from the beginning but no "Since beginning" or "All data" option available.
will set start date from year 2007 works? any suggestion?
will set start date from year 2007 work
Sure, why shouldn't it. The limit is the number of rows your query returns (10 000 per query. Number of row depends on the number of distinct values for the selected combination of dimensions) and the frequency with which you run your query, not the timeframe selected.
You can test this with the Query Explorer were you can run your metrics/dimension combinations without writing API code, so you can first check if you get the expected results.

Issue exists in auto generation of number sequence AX

I have been trying to import customer master through data management tool in AX7 using "Customers" standard data entity, I have marked "Auto-Generate" for customer account field. And I am facing a number sequence error while the data gets inserted into staging. When I check the execution log I see the below error.
"Issue exists in auto generation of number sequence
Issue exist in generate staging data
'4' 'Customers' record(s) inserted in staging"
I checked number sequence setup for Customer account and it is proper it is as below:
Note:
Gives the same error irrespective of Continuous is marked or not for the number sequence code.
Any quick inputs would be appreciated!
Thanks Fh-Inway!
I have figured out the issue, and it's an issue with standard AX. An application hot fix (Metadata) is available for this which can be found in the LCS as a part of AX update2. I have installed it, tested it to be working fine.
Not sure whether I can share the Hotfix KB Article number here for the same.
Note: That hotfix has a common fix that addresses auto-generation of number sequences across all the data entities.

Parsing RTF files into R?

Couldn't find much support for this for R. I'm trying to read a number of RTF files into R to construct a data frame, but I'm struggling to find a good way to parse the RTF file and ignore the structure/formatting of the file. There are really only two lines of text I want to pull from each file -- but it's nested within the structure of the file.
I've pasted a sample RTF file below. The two strings I'd like to capture are:
"Buy a 26 Inch LCD-TV Today or a 32 Inch Next Month? Modeling Purchases of High-tech Durable Products"
"The technology level [...] and managerial implications." (the full paragraph)
Any thoughts on how to efficiently parse this? I think regular expressions might help me, but I'm struggling to form the right expression to get the job done.
{\rtf1\ansi\ansicpg1252\cocoartf1265
{\fonttbl\f0\fswiss\fcharset0 ArialMT;\f1\froman\fcharset0 Times-Roman;}
{\colortbl;\red255\green255\blue255;\red0\green0\blue0;\red109\green109\blue109;}
\margl1440\margr1440\vieww10800\viewh8400\viewkind0
\deftab720
\itap1\trowd \taflags0 \trgaph108\trleft-108 \trbrdrt\brdrnil \trbrdrl\brdrnil \trbrdrt\brdrnil \trbrdrr\brdrnil
\clvertalt \clshdrawnil \clwWidth15680\clftsWidth3 \clbrdrt\brdrnil \clbrdrl\brdrnil \clbrdrb\brdrnil \clbrdrr\brdrnil \clpadl0 \clpadr0 \gaph\cellx8640
\itap2\trowd \taflags0 \trgaph108\trleft-108 \trbrdrt\brdrnil \trbrdrl\brdrnil \trbrdrt\brdrnil \trbrdrr\brdrnil
\clmgf \clvertalt \clshdrawnil \clwWidth14840\clftsWidth3 \clbrdrt\brdrnil \clbrdrl\brdrnil \clbrdrb\brdrnil \clbrdrr\brdrnil \clpadl0 \clpadr0 \gaph\cellx4320
\clmrg \clvertalt \clshdrawnil \clwWidth14840\clftsWidth3 \clbrdrt\brdrnil \clbrdrl\brdrnil \clbrdrb\brdrnil \clbrdrr\brdrnil \clpadl0 \clpadr0 \gaph\cellx8640
\pard\intbl\itap2\pardeftab720
\f0\b\fs26 \cf0 Buy a 26 Inch LCD-TV Today or a 32 Inch Next Month? Modeling Purchases of High-tech Durable Products\nestcell
\pard\intbl\itap2\nestcell \lastrow\nestrow
\pard\intbl\itap1\pardeftab720
\f1\b0\fs24 \cf0 \
\pard\intbl\itap1\pardeftab720
\f0\fs26 \cf0 The technology level of new high-tech durable products, such as digital cameras and LCD-TVs, continues to go up, while prices continue to go down. Consumers may anticipate these trends. In particular, a consumer faces several options. The first is to buy the current level of technology at the current price. The second is not to buy and stick with the currently owned (old) level of technology. Hence, the consumer postpones the purchase and later on buys the same level of technology at a lower price, or better technology at the same price. We develop a new model to describe consumers\'92 decisions with respect to buying these products. Our model is built on the theory of consumer expectations of price and the well-known utility maximizing framework. Since not every consumer responds the same, we allow for observed and unobserved consumer heterogeneity. We calibrate our model on a panel of several thousand consumers. We have information on the currently owned technology and on purchases in several categories of high-tech durables. Our model provides new insights in these product markets and managerial implications.\cell \lastrow\row
\pard\pardeftab720
\f1\fs24 \cf0 \
}
1) A simple way if you are on Windows is to read it in using WordPad or Word and then save it as a plain text document.
2) Alternately, to parse it directly in R, read in the rtf file, find lines with the given pattern, pat producing g. Then replace any \\' strings with single quotes producing noq. Finally remove pat and any trailing junk. This works on the sample but you might need to revise the patterns if there are additional embedded \\ strings other than the \\' which we already handle:
Lines <- readLines("myfile.rtf")
pat <- "^\\\\f0.*\\\\cf0 "
g <- grep(pat, Lines, value = TRUE)
noq <- gsub("\\\\'", "'", g)
sub("\\\\.*", "", sub(pat, "", noq))
For the indicated file this is the output:
[1] "Buy a 26 Inch LCD-TV Today or a 32 Inch Next Month? Modeling Purchases of High-tech Durable Products"
[2] "The technology level of new high-tech durable products, such as digital cameras and LCD-TVs, continues to go up, while prices continue to go down. Consumers may anticipate these trends. In particular, a consumer faces several options. The first is to buy the current level of technology at the current price. The second is not to buy and stick with the currently owned (old) level of technology. Hence, the consumer postpones the purchase and later on buys the same level of technology at a lower price, or better technology at the same price. We develop a new model to describe consumers'92 decisions with respect to buying these products. Our model is built on the theory of consumer expectations of price and the well-known utility maximizing framework. Since not every consumer responds the same, we allow for observed and unobserved consumer heterogeneity. We calibrate our model on a panel of several thousand consumers. We have information on the currently owned technology and on purchases in several categories of high-tech durables. Our model provides new insights in these product markets and managerial implications."
Revised several times. Added Wordpad/Word solution.

Counting occurances outside the range of my report

In Crystal Reports XI I am writing a report that displays all companies that have been sent legal referals in the past week. I want to add a fiel to the report that can count how many times (if any) each company that has been refered this week has been refered in the past. I am not sure how to execute this since I need to use two different date parameters. One for the main report (1 week) and one for the past count (3 years).

Resources