Parameters for Daydream - google-vr

Does anybody have the parameters of the daydream headset?
I need the parameters of the Daydream in order to add it as a supported device to our VR sites.
The QR codes found in https://www.reddit.com/r/daydream/comments/5cfkvm/daydream_view_qrcode/ are either broken or from another headset.
The extracted short url from the QR code should look like this:
vendor: "BOBOVR Z3"
model: "BOBOVR Z3"
screen_to_lens_distance: 0.045
inter_lens_distance: 0.06
left_eye_field_of_view_angles: 75
left_eye_field_of_view_angles: 75
left_eye_field_of_view_angles: 75
left_eye_field_of_view_angles: 75
tray_to_lens_distance: 0.038
distortion_coefficients: 0.25
distortion_coefficients: 0.0001
has_magnet: false
vertical_alignment: BOTTOM

Daydream uses the same params as V2 https://github.com/googlevr/webvr-polyfill/issues/182

Related

HTBasic for receiving data from a RS232 device

I am not coding neither understand much about it, although have to run an experiment in the laboratory, and have to use HTBasic to receive data from 2 GPIB devices (IEE 488) and one RS232 (this one is a high precision lab scale ).
I am changing/adding to an old script that someone else wrote. It was only to receive data from the 2 GPIB devices.
I must get data only every 15-30 minutes (the experiment will run for a month) and even though I successfully receive data from the lab scale (device interface select code = 12) they only arrive "synchronous" for a loop every e.g. 10ms (milliseconds). If I make it every 1 second the data are "old" e.g. I removed the item from the scale and instead of showing me ZERO "0" it still shows the weight. Imagine what if I ask for a loop every 15 minutes.
It seems that received data arrives in order one by one and displayed with that order. Probably there is an internal buffer or something that stores them. Does any one know how to OPEN and CLOSE the communication with a serial device on DEMAND? e.g. for GPIB devices I am sending a command like TALK (talk) and UNT (untalk) every time the loop takes place, but I can't find out how to do this with the serial device.
I tried the CONTROL 12,100;0 and CONTROL 12,100;1 (XOFF/XON) but it didn't work.
Here is one of the scripts I tried that gives me the correct weighting values, but for loops every 0.01 seconds.
LOOP
ENTER 12 USING "10D";W
PRINT TABXY(70,20),"wEIGHT IS:";W
WAIT 0.01
END LOOP
END
I would suggest trying using handshake control.
You can control the Serial Interface using the HTBASIC CONTROL statement.
For example, you can turn:
CONTROL 9,5;0 ! use DTR and RTS
CONTROL 9,12;0 ! read DSR, CD, and CTS
You should also use Interface handles as such:
ASSIGN #Serial TO 9 ! Opens the Serial Port, and clears buffer
ASSIGN #Serial TO * ! Closes the Serial Port
This should work for 15 Min Cycle (900 Sec):
ON CYCLE 900 GOSUB Get_Serial
LOOP
END LOOP
STOP
Get_serial:!
ASSIGN #Serial TO 12
ENTER #Serial USING "10D";W
RETURN
END
Hi guys and thanks for your answers (they came a bit late though).
Most probably both of your suggestions may work (havent try them ..maybe in the near future)
What I did those days to solve my problem , was basicly something like : LOOP continuusly and print on specific area of the screen (CRT) the serial device values (weight in gramms) , ONDELAY of specific time (eg every 15minutes) go to NEW LOOP (called it LOOOP in the code) which tells program to grab the value of RS232 labscale from the screen (not the device directly) and ofcourse the 2 GPIB devices, and after that repeat the continuus LOOP to show on CRT screen the real/continuus labscale values to prevent bufffer from being full ... and so everything worked smoothly..
I understand that this in not a GOOD way for coding, but as i said i am a rookie in this field ...BUT IT WORKED
So the code i wrote was something like:
[....]
33 ASSIGN #Scale TO 12
52 ENTER #Scale USING "10D";Weight
54 PRINT TABXY(70,20),"Captured LabScaLE Weight=";Weight;" g"
55 A=Weight
90 ON DELAY T GOTO Loooop
92 LOOP
93 ENTER #Scale USING "10D";A
94 A=A
95 PRINT TABXY(65,35);A;TABXY(65,35);
96 !
97 END LOOP
98 !
99 Loooop: GOTO 100 !GRAPSE THN GRAMMH PU AKOLOYTHEI PX 171
100 !
101 !
102 ENTER CRT;A
116 !==============================================START LISTENING FROM RS232 labscale (DISPAY ON CRT CONTINUUS DATA)======
117 !ENTER CRT;Weight
118 Weight=A
119 PRINT TABXY(70,20),"Captured LabScaLE Weight=";Weight;" g"
120 !
121 !==============================================START LISTENING FROM GDS CTRL=======
122 SEND 9;UNL UNT MLA TALK 14 DATA CHR$(255)
123 ENTER 9 USING "#,B,4D,6D";S,Pressurea,Volumea
124 SEND 9;UNT DATA CHR$(255)
128 !=============================================START LISTENING FROM GDS CTRL=======
129 !
130 SEND 8;UNL UNT MLA TALK 13 DATA CHR$(255)
131 ENTER 8 USING "#,B,4D,6D";S,Pressureb,Volumeb
132 SEND 8;UNT DATA CHR$(255)
[.....]
150 GOTO 92 !

Magnolia 5.5.5 ModalityLevel of Component Dialog

As it is written here
https://documentation.magnolia-cms.com/display/DOCS56/Dialog+definition I assume there is a possibility for every dialog to insert the following line into the yaml:
modalityLevel: non-modal
If I do this to an existing Component-Dialog which could be quite complex (with tabs and so on) the console logs an error.
WARN agnolia.config.source.yaml.YamlConfigurationSource: 1 major and 0 minor problems have been encountered
(Note: if I do modalityLevel: light it works..)
The reason I want to do this is to have more than one dialog opened at once.
Is that possible in Magnolia 5.5.5 (or 5.6)?
Okay there we go, after some investigation it turns out that the problem is within Magnolia. I have created the following issue https://jira.magnolia-cms.com/browse/MGNLUI-4328 for the problem. For now please ignore what the definition app says and we will fix it as soon as possible.
Cheers,
FWIW, I get the same behavior on the current demo ...
It's defined here:
info.magnolia.ui.api.overlay.OverlayLayer
65 /**
66 * The available levels of modality.
67 * Determines how "modal" it is -
68 * -STRONG creates a dark background that prevents clicks.
69 * -LIGHT adds a border, creates a transparent background that prevents clicks.
70 * -NON_MODAL does not prevent clicks.
71 */
72 public static enum ModalityLevel {
73 STRONG("strong", "modality-strong"),
74 LIGHT("light", "modality-light center-vertical"),
75 NON_MODAL("non-modal", "modality-non-modal");
And it's used here:
info.magnolia.ui.framework.overlay.OverlayPresenter
216 final OverlayCloser closer = openOverlay(new ViewAdapter(shortcutPanel), ModalityLevel.NON_MODAL);
And it's used here:
info.magnolia.dam.app.assets.field.UploadAssetActionRenderer
155 progressIndicatorCloseHandle = layer.openOverlay(new ViewAdapter(progressIndicator), ModalityLevel.NON_MODAL);
and etc.
So that seems like a false positive.
Interestingly, I don't see any tests for this ... for example, I see:
assertEquals("light", session.getProperty("/modules/ui-framework/dialogs/rename/modalityLevel").getString());
and
assertEquals("strong", session.getProperty("/modules/pages/dialogs/createPage/modalityLevel").getString());
but nothing with "non-modal"
I thought maybe the "-" character, but this appears, all else equal, to be valid yaml
---
modalityLevels: strong
modalityLeveln: non-modal
modalityLevell: light
Would have to dig deeper to see what is happening here.
UPDATE: if you change it to "non_modal", there's no longer an error in the definitions app.

verify input calculator application

Hello I need to test if the input is valid for calculator application:
3 * 9
100 + 20
200 - 99
Here's my regex:
(d).(*|+|-).(d)
but it doesn't seem to work. how can I verify and scrape the decimal values? thanks
Assuming ASP uses the standard notation, this should be
\d+\s[*+-]\s\d+

Posting data to web forms using submit buttons from R

I would like to post data to a web form from R, and retrieve the result. Is this possible at all?
In particular, I would like to pass a text file to this website
http://ionspectra.org/aristo/batchmode/
and retrieve the result.
The post method the website uses is
<form action="../batchreport/" method="post" enctype="multipart/form-data"><div style='display:none'><input type='hidden' name='csrfmiddlewaretoken' value='d9c49e206913e5d8b515bc9705ca2e09' />
First I would like to check the radio button "format" to Tab-delimited:
<input type="radio" name="format" value="tsv" /> Tab-delimited <br/>
Then I would like to upload a given file:
<input type="file" name="batchfile" size="20"><br/>
Then have the submit button clicked:
<input type="submit" value="Ontologize!" />
And finally have the resulting text file be retrieved.
Question is, can this be scripted from R, and if so, using what package?
Can it be done using RCurl's postForm perhaps? But if so, what would be the syntax in this case?
Any advice welcome!
cheers, Tom
This is a little trickier than normal since it's a Django website, and we need to deal with Django's Cross-site Request Forgery protection by generating a CSRF token.
Here's how to do it with httr, using the example file provided here:
library(httr)
csrf <- GET(url='http://ionspectra.org/aristo/batchmode/')$cookies$csrftoken
res <- POST(url='http://ionspectra.org/aristo/batchreport/',
body=list(batchfile=upload_file('example.txt'),
format='tsv',
csrfmiddlewaretoken=csrf))
out <- read.delim(file=textConnection(content(res)),
stringsAsFactors=FALSE)
The GET call generates the CSRF token, which is needed for the subsequent POST call.
This also works and does not require the GET request. Basically, the ionspectra website plants a cookie when you access the webform, and sends that cookie back to the server in a hidden variable when you SUBMIT. Then the server compares the two. The code below spoofs the cookie using set_cookies(csrftoken=...), to be the same as csrfmiddlewaretoken in the body of the POST. As you can see, the token can be just about anything.
library(httr)
# download example dataset and save as file "example.txt"
data <- readLines("http://ionspectra.org/static/aristo/example.txt")
file <- writeLines(data,"example.txt")
# POST request; z$content is the returned content, in raw format
z <- POST(url="http://ionspectra.org/aristo/batchreport/",
set_cookies(csrftoken="arbitrarytoken"),
body=list(csrfmiddlewaretoken="arbitrarytoken",
format="tsv",
filter="filter",
submit="Ontologize!",
batchfile=upload_file("example.txt")))
df <- read.csv(text=rawToChar(z$content),header=T,sep="\t")
head(df)
# scan. title score ChEBI_ID ChEBI_Name N AUC Est..Precision Correct.
# 1 8 CHEBI:34205 0.781 CHEBI:53156 polychlorobiphenyl 24 0.990 1 True
# 2 8 CHEBI:34205 0.755 CHEBI:35446 chlorobiphenyl 27 0.990 1 True
# 3 8 CHEBI:34205 0.708 CHEBI:22888 biphenyls 38 0.943 1 True
# 4 8 CHEBI:34205 0.698 CHEBI:36686 chloroarene 40 0.966 1 True
# 5 8 CHEBI:34205 0.694 CHEBI:36820 ring assembly 49 0.827 1 True
# 6 8 CHEBI:34205 0.681 CHEBI:50887 haloarene 44 0.955 1 True

Percentage Reported By PHPUnit: What Does it Mean?

I'm working on my first project in which I'm utilizing PHPUnit for unit testing. Things have been moving along nicely; however, I've started getting the following output with recent tests:
................................................................. 65 / 76 ( 85%)
...........
Time: 1 second, Memory: 30.50Mb
OK (76 tests, 404 assertions)
I cannot find any information about what the "65 / 76 ( 85%)" means.
Does anyone know how to interpret this?
Thanks!
It means the amount of tests that have been run so far (test methods actually, or to be even more precise: test method calls, because each test method can be called several times).
65 / 76 ( 85%)
65 tests of 76 have already run (which is 85% overall)
And as long as you see dots for each of them - all of them passed
I didn't understand it until I kept writing more tests, here's a sample of what you see as the number of tests grow:
............................................................... 63 / 152 ( 41%)
............................................................... 126 / 152 ( 82%)
..........................
...it's just a progress indicator of the number of tests that have been run. But as you can see, it still gets to the end.

Resources