Import freetrack into steamVR - kinect

I've got an oculus dk1, leap motion for hand tracking and a kinect v1 for positional tracking. With opentrack & opentrackkinect I get as Output freetrack. Is there a method to import that into SteamVR and be so Positional Tracked. I really don't need answers like buy you a vive or something like that. My Vive will came 10 July but I want to test something with the Oculus.

try VRIDGE / RIFTCAT. it should work with opentrack and freetrack data, and translates that to STEAMVR.

Related

Convert all items in a list to string format

I am trying to seperate sentences (with spacy sentencizer) within a larger text format to process them in a transformers pipeline.
Unfortunately, this pipeline is not able to process the sentences correctly, since the sentences are not yet in string format after sentencizing the test. Please see the following information.
string = 'The Chromebook is exactly what it was advertised to be. It is super simple to use. The picture quality is great, stays connected to WIfi with no interruption. Quick, lightweight yet sturdy. I bought the Kindle Fire HD 3G and had so much trouble with battery life, disconnection problems etc. that I hate it and so I bought the Chromebook and absolutely love it. The battery life is good. Finally a product that lives up to its hype!'
#Added the sentencizer model to the classification package, so all the sentences in the summary texts of the reviews are being disconnected from each other
import spacy
nlp = spacy.load("en_core_web_sm")
doc = nlp(string)
sentences = list(doc.sents)
sentences
This leads to the following list:
[The Chromebook is exactly what it was advertised to be.,
It is super simple to use.,
The picture quality is great, stays connected to WIfi with no interruption.,
Quick, lightweight yet sturdy.,
I bought the Kindle Fire HD 3G and had so much trouble with battery life, disconnection problems etc.,
that I hate it,
and so I bought the Chromebook and absolutely love it.,
The battery life is good.,
Finally a product that lives up to its hype!]
When I provide this list to the following pipline, I get this error: ValueError: args[0]: The Chromebook is exactly what it was advertised to be. have the wrong format. The should be either of type str or type list
#Now in this line the list of reviews are being processed into triplets
from transformers import pipeline
triplet_extractor = pipeline('text2text-generation', model='Babelscape/rebel-large', tokenizer='Babelscape/rebel-large')
model_output = triplet_extractor(sentences, return_tensors=True, return_text=False)
extracted_text = triplet_extractor.tokenizer.batch_decode([x["generated_token_ids"] for x in model_output])
print("\n".join(extracted_text))
Therefore, can someone please indicate how I can convert all the sentences in the 'sentences' list to string format?
Looking forward for the response. : )
Your sentences are Span objects. You can convert them to strings by using sentence.text, so [ss.text for ss in sentences] for all of them.
What is triplet_extractor? You don't explain it anywhere.

#BFxForward() in the Bloomberg python api

I've used https://github.com/691175002/BLPInterface as a wrapper to the terribly-documented (and non-supported by Bloomberg Help) Bloomberg python API. I use it to pull price histories, etc.
Lately I've needed to pull specific FX date values. In excel I do that as =#BFxForward("usdjpy",J10, "BidOutright") where J10 is a date.
I would like to pull this information via the Bloomberg Python API (or even better, with the BLPInterace wrapper) but it's not clear how to do it. I've seen someone ask a similar question for a .Net implementation, but the only answer cited page 207 of a developers guide. Every developer guide I can find on bloomberg is well less than 200 pages, and none of it mentions pulling fx values.
Wondering if anyone can point me at some examples or resources to build on to get this ?
It does take some finding, to be sure, but I tracked it down via the Bloomi Terminal. The way I found the information is as follows (for future reference):
Type DAPI in the Bloomberg Terminal
Choose 'Additional Resources' in the left hand panel
Choose 'Help Page for DAPI' in the right hand panel, and a window pops up
Choose 'Constructing Formulas' in the left hand panel
Choose 'FX Broken Dates Forwards Syntax' in the right hand panel
Or paste this link into Bloomi:
{LPHP DAPI:0:1 2277846 }
There are a lot of different examples and options (FX fwds are not my area of expertise), but simply using this format for the ticker seems to work:
ccy1/ccy2 mm/dd/yy Curncy
and then the field PX_BID. You can try this in a BDP call in Excel, for example:
=BDP("EUR/GBP 08/08/22 Curncy","PX_BID")
When it comes to Python, perhaps try using the xbbg python package (other wrappers are available): it does a good job of hiding all the intricacies of the low-level API.
Here's a code sample using xbbg, that pulls back the forward fx rate in the example:
from xbbg import blp
from datetime import datetime
ccy1 = 'EUR'
ccy2 = 'GBP'
fwdDate = datetime(2022,8,8)
ticker = '{0:}/{1:} {2:} Curncy'.format(ccy1,ccy2,fwdDate.strftime('%m/%d/%y'))
df = blp.bdp(ticker,'PX_BID')
print(df)
Output:
px_bid
EUR/GBP 08/08/22 Curncy 0.85344
EDIT: Looking at the OP's choice of Bloomi wrapper, the xbbg call could possibly be replaced by:
blp.referenceRequest(ticker, 'PX_BID')

How to store data from Google Ngram API?

I need to store the data presented in the graphs on the Google Ngram website. For example, I want to store the occurences of "it's" as a percentage from 1800-2008, as presented in the following link: https://books.google.com/ngrams/graph?content=it%27s&year_start=1800&year_end=2008&corpus=0&smoothing=3&share=&direct_url=t1%3B%2Cit%27s%3B%2Cc0.
The data I want is the data you're able to scroll over on the graph. How can I extract this for about 140 different terms (e.g. "it's", "they're", "she's", etc.)?
econpy wrote a nice little module in Python that you can use through a command-line interface.
For your "it's" example, you would need to type this command in a terminal / windows console:
python getngrams.py it's -startYear=1800 -endYear=2008 -corpus=eng_2009 -smoothing=3
This will automatically save the query result in a CSV file named after your query parameters.
econpy's package, in #HugoMailhot's answer, no longer works (2021) and seems not maintained.
Here's a updated version, with some improvements for easier integration into Python code:
https://gitlab.com/cpbl/google-ngrams
You can call this from the command line (as in econpy's) to create a CSV file, e.g.
getngrams.py it's -startYear=1800 -endYear=2008 -corpus=eng_2009 -smoothing=3
or call it from python to get (and plot) data directly in python, e.g.:
from getngrams import ngrams
df = ngrams('bells and whistles -startYear=1900 -endYear=2018 -smoothing=2')
df.plot()
The xkcd functionality is still there too.
(Issues / bug fix pull requests /etc welcome there)

fetch google finance data

can anyone provide me an example on how I can fetch the real-time stocks of google finance
Came across this (and your post) trying to figure this out myself...
This currently retrieves some XML:
http://www.google.com/ig/api?stock=F
Of course they may close this down as well soon...
I think 'last data=' will give current quote
EDIT:
The api is now completely shutdown and no longer works. An alternative to 'api' for a 'realtime' quote would be:
http://finance.google.com/finance/info?client=ig&q=NYSE:F
As for now (2015), the google finance api is deprecated. If you are comfortable with python, you may use the pypi module googlefinance.
Install googlefinance
$pip install googlefinance
It is easy to get current stock price:
>>> from googlefinance import getQuotes
>>> import json
>>> print json.dumps(getQuotes('AAPL'), indent=2)
[
{
"Index": "NASDAQ",
"LastTradeWithCurrency": "129.09",
"LastTradeDateTime": "2015-03-02T16:04:29Z",
"LastTradePrice": "129.09",
"Yield": "1.46",
"LastTradeTime": "4:04PM EST",
"LastTradeDateTimeLong": "Mar 2, 4:04PM EST",
"Dividend": "0.47",
"StockSymbol": "AAPL",
"ID": "22144"
}
]
Google finance is a source that provides real-time stock data. There are also other APIs from yahoo, such as yahoo-finance, but they are delayed by 15min for NYSE and NASDAQ stocks.
I've been struggling with trying to find a lifetime free access for this data for some time as well, but today I came across Alpha Vantage (https://www.alphavantage.co) and used their data to build an Annotated Timeline from Google Charts.
All you need is to request an API Key (which you get at the moment you fill in their form) and follow their Documentation.
An example of getting a JSON output in PHP:
$url = file_get_contents('https://www.alphavantage.co/query?function=TIME_SERIES_DAILY&outputsize=full&symbol=AAPL&apikey='.$apiKey);
$decoded = json_decode($url, true);
Here's a very simple example: http://googlified.com/files/finance-api.html
The link in the earlier answer was broken when I tried it, so here is another example. You have to do a bit of processing but otherwise it's pretty easy.
http://www.google.com/finance/info?client=ig&q=goog,msft

did yahoo finance api stock returning stock option data?

i'm using the yahoo finance api for stock and stock option data. this used to work:
http://quote.yahoo.com/d/quotes.csv?s=VCR.X&f=l1c1n
that's once of the options for Visa. this doesn't work anymore, and when i go to yahoo finance their option symbols are all differnt now, looking like this:
VEH100220P00055000
that's an option for Visa now. and if i plug that long one into the url it doesn't work either. anyone know if they are changing things with their options and broke this?
Option symbology is highly complicated. The symbols for option chains will periodically change, when the contracts roll and new contracts are available.
If you want options market data that has been cleaned, you will probably have to pay for it. XIgnite has a couple of web services providing options data: http://www.xignite.com/xoptions.asmx
As of 1/4/16
http://finance.yahoo.com/q/?s=v160122C00075000
will return the Option quote where:
v is the Visa Ticker symbol
160122 is the Date
C is for Call (change to P for put)
00075000 is the price (or $75)
but in excel, this will place the data vertically in 2 columns (first being header, second being the data)