Is it not possible to get the proper millisecond POSITION value
in Standard MIDI Files having multiple Tempos?
This line
ret = mciSendString("status MCIMIDI position", 0, 0, 0)
works only if the MIDI file has ONE Tempo setting.
How do you deal with multiple Tempos?
I don't understand why this is so hard to find, but basically, I have some values that I calculated in a macro in ImageJ, and when I print using this method:
print("Radius 1: "+r1);
The string and value both get printed in the same cell. I would like to make this more friendly for Matlab when I have to plot so was wondering if there was a way to print it in separate columns?
EDIT:
SOLVED I realized that you don't use print, it's like this:
setResult("Radius", 0, r1);
setResult("Radius", 1, r2);
setResult("Radius", 2, r3);
setResult("Arc Length",0, al1);
setResult("Arc Length",1, al2);
setResult("Arc Length",2, al3);
I'm using coordinate_cleaner's country test cc_coun but it's flagging entries with coordinates near to the edges country borders. To try to keep them I wanted to buffer the terrestrial area of countries, essentially expanding their borders a little so that it doesn't flag these entries.
I've tried:
require(rnaturalearth)
world <- ne_countries(scale = "large", returnclass = "sf") %>% st_buffer(dist=.001)
Using st_buffer(dist=.001) does change the geometry, but I noticed whatever I put into dist doesn't matter as it changes it to the same thing regardless (I tried .001, 0.1, 1, 2, and -1, though any minus number removes the geometry altogether).
I found that maybe I need to transform my sf file into something else and then use st_buffer so it's in meters rather than degrees(?). I saw this question/answer but I don't understand it well enough to help my situation: What unit is the `dist` argument in `st_buffer` set to by default?
In the end I'm looking to create a SpatialPolygonsDataFrame reference file to feed into cc_coun. Using the above code I followed on with:
world <- sf:::as_Spatial(world)
coun_test <- cc_coun(x = data,
lon = "Decimal_Long",
lat = "Decimal_Lat",
iso3 = "Country_code",
value = "flagged",
ref = world,
verbose = TRUE)
Which ended up flagging more entries than when I didn't use st_buffer on the reference fine.
In summary, I want to add a buffer to the edge of every country border by around 100 meters in a file I can use as a reference in this test. Is this the best way to go about it or is there a better/easier way? I'd appreciate any advice.
Thank you
I see example code in which different buffers are put at the same index during a single render pass. Like this:
renderEncoder.setVertexBuffer(firstBuffer, offset: 0, index: 0)
renderEncoder.drawPrimitives(type: .triangle, vertexStart: 0, vertexCount: vcount1)
renderEncoder.setVertexBuffer(secondBuffer, offset: 0, index: 0)
renderEncoder.drawPrimitives(type: .point, vertexStart: 0, vertexCount: vcount2)
The index parameter is an index into the "buffer argument table", which has 32 entries, so the legal values are 0 to 31.
But I also see documentation that says you can't change the contents of a buffer until after the GPU completes its work on the given render pass.
So, is the above code legal and not prone to any timing issues?
If so, I guess that means the limit of 32 is a limit on how many buffers you can use in a single draw call, not how many buffers you can use in a single pass, aka MTLCommandBuffer. Correct?
You can't change the contents of the buffers themselves, meaning the MTLBuffer objects. What you can change is which buffers are bound. When you call setVertexBuffer, command encoder remembers which buffer you bound there until you bind nil or another buffer and every time you issue a draw command (like drawPrimitives, or a dispatch command (like dispatchThreadgroups) the current bindings are "saved" and you can go ahead and encode new buffers (and also textures).
I have been researching a solution to a problem that I just can not seem to avoid, and have yet to find a solution.
In brief, I am trying to calculate unique probabilities that lead to a "1 or 0" for more than one variable, but all in one cell.
Here is my working code line that represents the probability of just one variable:
=sum(if(randbetween(1,100) > subtotal(1,L23), 0, 1))
What I am trying to figure out is how to repeat this function times x, but with it yielding a different randbetween number each time, all in one cell.
As my x variable can represent 10 different independent variables at this time, and stem over 30 specific formula lengths for each IV, utilizing the preset workaround would lead me to creating hundreds of cells of data. I obviously do not want that clutter.
If code worked the way I wanted it to, the best formula-esque way I would describe what I wanted to happen is this:
=sum(repeatuniqueformula(sum(if(randbetween(1,100) > subtotal(1,L23), 0, 1)), x))
Simplified, relevant question gathered from a problem by problem analysis:
How to replicate a function in the function line that allows for the randbetween to recalculate each time.
Sub-information: If you simply multiply the function by lets say 6, it will multiply the answer of the randbetween function without recalculating.
=sum(if(randbetween(1,100) > subtotal(1,L23), 0, 1)*6)
Alternatively, I could do a workaround and create other cells with individual randbetween functions, but that causes a lot of manual work due to having to adjust the number of times a function in a line is repeated.
=sum(if(Q2 > subtotal(1,L15), 0, 1),if(Q3 > subtotal(1,L15), 0, 1),if(Q4 > subtotal(1,L15), 0, 1),if(Q5 > subtotal(1,L15), 0, 1),if(Q6 > subtotal(1,L15), 0, 1),if(Q7 > subtotal(1,L15), 0, 1),if(Q8 > subtotal(1,L15), 0, 1))
The alternative is both cluttery and takes a lot of effort to maintain, as changing the number of "x" will change the amount of
if(Q2 > subtotal(1,L15), 0, 1)
I would need.
In order to get what you want to happen (=sum(repeatuniqueformula(sum(if(randbetween(1,100) > subtotal(1,L23), 0, 1)), x))) you will have to create a custom function by using Google Apps Script, but x should be replaced by number or by a reference to a cell having a value or formula that returns that value.
References
https://developers.google.com/apps-script/guides/sheets
https://developers.google.com/apps-script/guides/sheets/functions