I have the following reST text:
See this `example <https://example.org/1>`_ or this `example <https://example.org/2>`_.
But I don't want to use the embedded URI syntax because I found it less readable. What should I do for referencing my links?
See this `???`_ or this `???`_.
.. _exemple1: https://example.org/1
.. _exemple2: https://example.org/2
I have found the response here https://stackoverflow.com/a/40555211/887855
See this `example <exemple1_>`__ or this `example <exemple2_>`__.
.. _exemple1: https://example.org/1
.. _exemple2: https://example.org/2
Related
I was trying to get the content from an API (with key) from IQAir. The documentation of the API can be found via this link [api documentation][1].
I am using RStudio and new to using API. The code I use is as follow:
myurl <- paste0("http://api.airvisual.com/v2/countries?key=", Sys.getenv("my_key"))
my_raw_result <- httr::GET(myurl)
str(my_raw_result$content)
mycontent <- httr::content(my_raw_result, as = "text")
mycontent.json <- jsonlite::fromJSON(mycontent)
dplyr::glimpse(mycontent.json)
And the screenshot for the documentation is
[documentation screenshot][2]
I got an error message as below:
> dplyr::glimpse(mycontent.json)
List of 2
$ status: chr "fail"
$ data :List of 1
..$ message: chr "incorrect_api_key"
Could someone help with this? Thank you very much!
[1]: https://api-docs.iqair.com/?version=latest
[2]: https://i.stack.imgur.com/cRSiO.png
Telefone celular:*Campo de preenchimento obrigatório
my code with siteprism
class CriaScreenCadastro < SitePrism::Page
set_url 'https://quasar-flash-staging.herokuapp.com/#boxCadastro'
element :fone_cel, 'div#boxCadastro input[name="telefone_celular"]'
end
expect(screen_cadastro).to have_field 'fone_cel', disabled: false
error: Reason:
enter image description hereexpected to find css "fat_anual" but there were no matches
----------------------------------------------
my site: https://quasar-flash-staging.herokuapp.com/#boxCadastro
It’s not clear from your question where the “fat_anual” CSS is coming from but I believe for your expectation you want
expect(screen_cadastro).to have_fone_cel
Since you’ve defined the element
https://www.ncbi.nlm.nih.gov/pubmed
On the above URL, if I put "disease" in the search box, then click search. The I select "PMID List" to the right of "Format" ("Summary" is the original option).
Then, I get a list like
30929330
30929328
30929327
30929322
30929319
30929318
30929317
30929314
30929313
30929312
30929308
30929289
30929282
30929260
30929256
30929252
30929235
30929234
30929230
30929224
The body of the corresponding HTTP POST request according to postman is the following. But I am not sure how to reduce the request to the simplest.
CitationManagerCustomRange:false
CitationManagerStartIndex:1
CollectionStartIndex:1
EmailCheck1:
EmailCheck2:
EntrezSystem2.PEntrez.DbConnector.Cmd:displaychanged
EntrezSystem2.PEntrez.DbConnector.Db:pubmed
EntrezSystem2.PEntrez.DbConnector.IdsFromResult:
EntrezSystem2.PEntrez.DbConnector.LastDb:pubmed
EntrezSystem2.PEntrez.DbConnector.LastIdsFromResult:
EntrezSystem2.PEntrez.DbConnector.LastQueryKey:4
EntrezSystem2.PEntrez.DbConnector.LastTabCmd:
EntrezSystem2.PEntrez.DbConnector.LinkName:
EntrezSystem2.PEntrez.DbConnector.LinkReadableName:
EntrezSystem2.PEntrez.DbConnector.LinkSrcDb:
EntrezSystem2.PEntrez.DbConnector.QueryKey:
EntrezSystem2.PEntrez.DbConnector.TabCmd:
EntrezSystem2.PEntrez.DbConnector.Term:disease
EntrezSystem2.PEntrez.PubMed.Pubmed_Facets.BMFacets:
EntrezSystem2.PEntrez.PubMed.Pubmed_Facets.FacetSubmitted:false
EntrezSystem2.PEntrez.PubMed.Pubmed_Facets.FacetsUrlFrag:filters=
EntrezSystem2.PEntrez.PubMed.Pubmed_PageController.PreviousPageName:results
EntrezSystem2.PEntrez.PubMed.Pubmed_PageController.SpecialPageName:
EntrezSystem2.PEntrez.PubMed.Pubmed_ResultsPanel.EmailTab.Answer:
EntrezSystem2.PEntrez.PubMed.Pubmed_ResultsPanel.EmailTab.Email:
EntrezSystem2.PEntrez.PubMed.Pubmed_ResultsPanel.EmailTab.EmailCount:
EntrezSystem2.PEntrez.PubMed.Pubmed_ResultsPanel.EmailTab.EmailFormat:
EntrezSystem2.PEntrez.PubMed.Pubmed_ResultsPanel.EmailTab.EmailHID:16gQ_jkjclApXw89-veCbHLjYX7grDUT9i4D2P3WVBMdCXEkWMCK0J4zPSHf4DW8SDEsE0P1NBR0ZceMk9rQdg7Yo_M0ZMZQJ
EntrezSystem2.PEntrez.PubMed.Pubmed_ResultsPanel.EmailTab.EmailQueryKey:
EntrezSystem2.PEntrez.PubMed.Pubmed_ResultsPanel.EmailTab.EmailReport:
EntrezSystem2.PEntrez.PubMed.Pubmed_ResultsPanel.EmailTab.EmailSort:
EntrezSystem2.PEntrez.PubMed.Pubmed_ResultsPanel.EmailTab.EmailStart:
EntrezSystem2.PEntrez.PubMed.Pubmed_ResultsPanel.EmailTab.EmailSubject:
EntrezSystem2.PEntrez.PubMed.Pubmed_ResultsPanel.EmailTab.EmailText:
EntrezSystem2.PEntrez.PubMed.Pubmed_ResultsPanel.EmailTab.Holding:
EntrezSystem2.PEntrez.PubMed.Pubmed_ResultsPanel.EmailTab.HoldingFft:
EntrezSystem2.PEntrez.PubMed.Pubmed_ResultsPanel.EmailTab.HoldingNdiSet:
EntrezSystem2.PEntrez.PubMed.Pubmed_ResultsPanel.EmailTab.Key:
EntrezSystem2.PEntrez.PubMed.Pubmed_ResultsPanel.EmailTab.OToolValue:
EntrezSystem2.PEntrez.PubMed.Pubmed_ResultsPanel.EmailTab.QueryDescription:
EntrezSystem2.PEntrez.PubMed.Pubmed_ResultsPanel.EmailTab.SubjectList:
EntrezSystem2.PEntrez.PubMed.Pubmed_ResultsPanel.Pubmed_DisplayBar.FFormat:docsum
EntrezSystem2.PEntrez.PubMed.Pubmed_ResultsPanel.Pubmed_DisplayBar.FSort:
EntrezSystem2.PEntrez.PubMed.Pubmed_ResultsPanel.Pubmed_DisplayBar.FileFormat:docsum
EntrezSystem2.PEntrez.PubMed.Pubmed_ResultsPanel.Pubmed_DisplayBar.FileSort:
EntrezSystem2.PEntrez.PubMed.Pubmed_ResultsPanel.Pubmed_DisplayBar.Format:text
EntrezSystem2.PEntrez.PubMed.Pubmed_ResultsPanel.Pubmed_DisplayBar.LastFormat:
EntrezSystem2.PEntrez.PubMed.Pubmed_ResultsPanel.Pubmed_DisplayBar.LastPageSize:20
EntrezSystem2.PEntrez.PubMed.Pubmed_ResultsPanel.Pubmed_DisplayBar.LastPresentation:docsum
EntrezSystem2.PEntrez.PubMed.Pubmed_ResultsPanel.Pubmed_DisplayBar.LastSort:
EntrezSystem2.PEntrez.PubMed.Pubmed_ResultsPanel.Pubmed_DisplayBar.PageSize:20
EntrezSystem2.PEntrez.PubMed.Pubmed_ResultsPanel.Pubmed_DisplayBar.Presentation:uilist
EntrezSystem2.PEntrez.PubMed.Pubmed_ResultsPanel.Pubmed_DisplayBar.PrevPageSize:20
EntrezSystem2.PEntrez.PubMed.Pubmed_ResultsPanel.Pubmed_DisplayBar.PrevPresentation:docsum
EntrezSystem2.PEntrez.PubMed.Pubmed_ResultsPanel.Pubmed_DisplayBar.PrevSort:
EntrezSystem2.PEntrez.PubMed.Pubmed_ResultsPanel.Pubmed_DisplayBar.Sort:
EntrezSystem2.PEntrez.PubMed.Pubmed_ResultsPanel.Pubmed_DisplayBar.email_count:20
EntrezSystem2.PEntrez.PubMed.Pubmed_ResultsPanel.Pubmed_DisplayBar.email_sort:
EntrezSystem2.PEntrez.PubMed.Pubmed_ResultsPanel.Pubmed_DisplayBar.sPageSize:20
EntrezSystem2.PEntrez.PubMed.Pubmed_ResultsPanel.Pubmed_DisplayBar.sPresentation:uilist
EntrezSystem2.PEntrez.PubMed.Pubmed_ResultsPanel.Pubmed_DisplayBar.sSort:none
EntrezSystem2.PEntrez.PubMed.Pubmed_ResultsPanel.Pubmed_Pager.CurrPage:1
EntrezSystem2.PEntrez.PubMed.Pubmed_ResultsPanel.Pubmed_Pager.cPage:1
EntrezSystem2.PEntrez.PubMed.Pubmed_ResultsPanel.Pubmed_Pager.cPage:1
EntrezSystem2.PEntrez.PubMed.Pubmed_ResultsPanel.Pubmed_ResultsController.ResultCount:4276777
EntrezSystem2.PEntrez.PubMed.Pubmed_ResultsPanel.Pubmed_ResultsController.RunLastQuery:
EntrezSystem2.PEntrez.PubMed.Pubmed_ResultsPanel.TimelineAdPlaceHolder.BlobID:NCID_1_35744195_130.14.18.97_9001_1554136263_544865890_0MetA0_S_MegaStore_F_1
EntrezSystem2.PEntrez.PubMed.Pubmed_ResultsPanel.TimelineAdPlaceHolder.CurrTimelineYear:
citman_count:20
citman_start:1
coll_start:1
email_add_text:
email_address:
email_format:docsum
email_start:1
email_subj:disease - PubMed
p$a:EntrezSystem2.PEntrez.PubMed.Pubmed_ResultsPanel.Pubmed_DisplayBar.sPresentation
p$l:EntrezSystem2
p$st:pubmed
term:disease
When I reduce it to the following, the return result is still the same.
EntrezSystem2.PEntrez.DbConnector.Cmd:displaychanged
EntrezSystem2.PEntrez.DbConnector.Db:pubmed
EntrezSystem2.PEntrez.DbConnector.LastQueryKey:4
EntrezSystem2.PEntrez.PubMed.Pubmed_ResultsPanel.Pubmed_DisplayBar.Presentation:uilist
But if I remove this line, the result will be completely different. It seems that the website somehow remembers the history.
EntrezSystem2.PEntrez.DbConnector.LastQueryKey:4
Could anybody show me how to get the minimal request so that I can use curl do download the list.
How can I view the internal representation of Haskell Data.Map?
Also, what kind of data structure is used to implement it?
Is it essentially a red black tree?
Or some kind of heap min?
Here is a simple example that I am interested in dumping to a text file
(or even better, a Graphviz dot representation).
module Main( main ) where
import qualified Data.Map as Map
t = Map.fromList([
(6,"six"),
(2,"two"),
(8,"eight"),
(3,"three"),
(5,"five")])
main = do
putStrLn $ show $ Map.lookup 3 t
putStrLn $ show $ Map.lookup 7 t
Here is a textual dump with showTreeWith:
module Main( main ) where
import qualified Data.Map as Map
t = Map.fromList([
(6,"six"),
(2,"two"),
(8,"eight"),
(3,"three"),
(5,"five")])
main = do
putStrLn $ Map.showTreeWith (\k x -> show (k,x)) True False t
putStrLn $ show $ Map.lookup 3 t
putStrLn $ show $ Map.lookup 7 t
And here is how it looks:
$ ghc main.hs
$ ./main
(6,"six")
+--(3,"three")
| +--(2,"two")
| +--(5,"five")
+--(8,"eight")
Just "three"
Nothing
According to the documentation for Haskell's Data.Map:
The implementation of Map is based on size balanced binary trees (or trees of bounded balance)
I'd like to set the outdir/targetdir for each combination of platform + configuration.
function SetLibTargetDir(platforms, configs)
for i2,c in ipairs(configs) do
for i,p in ipairs(platforms) do
filter ("configurations:" .. c, "platforms:" .. p)
targetdir("bin/" .. p .. "/" .. c)
libdirs ("bin/" .. p .. "/" .. c)
libdirs ("bin_prebuilt/" .. p .. "/" .. c)--manually generated libs/dlls that premake5 can't handle
end
end
end
SetLibTargetDir({"Win32", "Win64"}, {"Debug", "Release", "Final"})
I tried using this code, while it gets the config right(debug/release/final). It places everything in Win64, so the 32 bit files & 64 files all end up in the same directory.
What am I doing wrong here? I'd like each combination of platform + configuration to have its own output dir and library paths.
Thanks
Stumbled across the answer:
https://github.com/premake/premake-core/wiki/Tokens
"%{cfg.buildcfg}" get the config
"%{cfg.platform}" gets the platform
So this code works:
targetdir("bin/" .. "%{cfg.platform}" .. "/" .. "%{cfg.buildcfg}")
libdirs("bin/" .. "%{cfg.platform}" .. "/" .. "%{cfg.buildcfg}")
libdirs("bin_prebuilt/" .. "%{cfg.platform}" .. "/" .. "%{cfg.buildcfg}")