SPARK AR storing values - spark-ar-studio

Guys I am creating a game where users collect various items in. I want to display the items collected on the side of my screen in the sequence it was collected. I can't figure out any way to create this in the patch editor. Is there anyone who can give me some pointers ?
something like this

I'm not sure if you will be able to do it through the patch editor, but did you try using scripts? Maybe using some variables to store values or an array. As I don't know how the users collect the items I'm supposing that you could make a logic that every time the item is collected by the user it is sent to an array, and you can use that array to show the content of that array as images at the left bar. What do you think about it? Make sense to you?
In case you would like to give Scripts a try, here's the documentation address: https://sparkar.facebook.com/ar-studio/learn/scripting/scripting-basics

Related

App Maker Multi Select?

So I'm quite new to Google App Maker and what the situation is is that I have one datasource which has a section that I would like to use a multiselect for. I've followed the Partner Management template to try and understand how relations work a bit better and I've read all of the documentation on them but despite what I do the multi select either always unticks everything by default when I come out of the edit dialog or it changes the values for all of the multiselects within each request. I'm struggling to bind the data. I know it's hard to describe without showing you but basically I just wondered if anyone would be able to explain to me a bit better how exactly I would get a multiselect to work and keep it's value for each individual request.
Unfortunately in datasource only one item can be selected, you can add checkbox column, so you will be able to get list of checked items.

Scan an area of a web page's source code for changes while reporting it?

this is one heck of a confusing question to ask so here it goes. Firstly, I'm not asking you to write me any code I just need help going in the right direction for what I'm trying to achieve here. Basically the task is this, I want to scan a select area of a web page's source code for changes and if something does change, I want to report it somewhere (like a console or something). However, I do not want just a notification of change, I also want what the change is/was. I've been looking into things like jsoup but I am still struggling to even find out what this is called.
Any pointers would be insanely appreciated. Thanks, Optimistic.
Here are some steps assuming this is from a node.js project:
Get the URL for the specific script file you're looking for a change in.
Using the request() module, fetch that URL.
Break the data up into lines (probably using .split()).
Find the specific line you are looking for either by counting line numbers of by searching for some representative text in that line.
Using some sort of search in that line (perhaps a regex), find the current value of the exact item in that line you are looking for.
Save the current value.
Then, at some future time, repeat this whole process and compare what you find to the previous value.
If this is being done from a browser instead of node.js, then use an Ajax call to retrieve the file. If the file is on another domain from your web page and that domain does not permit cross-origin requests, then you cannot solve this problem in an automated fashion from a browser in your own web page.
Here is how I would do it with Jsoup:
Document doc = Jsoup.connect(url).get();
String scriptCssQuery = "script"; // Tune this CSS query to find THE script you need.
Element script = doc.select(scriptCssQuery).first();
if (script != null) {
String scriptLines = script.html();
// Store the changing line somewhere and compare it to its previous value...
}

Sequentialising Google Sheets Macro

I'm looking for a way to recursively generate links to next pages on a website with canonical structure. In essence, I'm trying to generate a link to each next page and then feed that result back in to the process to find the following page ad infinitum. However, I'm having problems automating this as the macro seems to be trying to generate the result for cells that are empty (i.e. the results for an earlier cell hasn't been created/copied yet).
So I'd like to sequentialise the macro to start from A20, generate the result for that cell, copy that result to A21, then begin the macro again for A21, et cetera, without requiring constant human input.
The Google spreadsheet with the error can be seen here in cell C27 and the macro itself can be seen here.
I realise this may be quite a roundabout way to perform this task and am open to any suggestions that may be easier, more intuitive, or faster.
So two suggestions: one is that with stuff that is a continuous scroll, its very easy to find the json of the source, and either grab all the data you want in one go, or by easily picking out the "next page" or pagination...
I personally use importdata() and importxml() more than any other functions, and when in google sheets I also use regexextract() and regexreplace() when needed.
for example the json your looking for is here: http://iconosquare.com/controller_nl.php?action=nlGetMethod&method=mediasTag&value=cricket&max_id=1145408330912313787
if you look at the top row, it tell you what the next min and max is so technically you could just extract that piece to generate your url.
Second option is to just build the query such that it autoincrements the urls. I can give you an example, but I would like to understand a little more about what you really want in the end result...
Are you just looking for the pagination urls, or are you wanting to extract the actual data from them?

Why does my code produce a different result on occasion in apps-script?

I have a very strange problem. I load my app, switch to the correct tab and then press the button I need to press. This runs a function and when I first load the page it may only provide part of the correct result. However if I wait a few seconds it produces the correct result in full. Any ideas why this might be happening?
Additional Information
The button simply checks through a list of objects returned via ScriptDB. Objects that are valid are displayed and objects that are in-valid are not. If the object appears again in updates the text to display how many have been found in the list (eg: the label would change from "Object A" to "Object A (2)").
It seems to me like it doesn't have the rest of the list somehow as it doesn't always stop at the same object. It's Very strange and not something I've experienced before. The other features of my app using ScriptDB work completely regardless of how quickly I use them.
I've figured it out now. I somehow had some erroneous data in the database which was returning a null field. I can only assume that this was from a import that I did last week from a spreadsheet.
This was copied from my comment to show that it has been resolved.

Plone and Mysql Searching

I have Mysql and Zope talking to each other nicely.
I can insert values in, and even view one record from the databse and have it show up in the form fields(not that cool really).
I have just been following tutorials, but now I need to search the Database and display the results.
I have been fiddling with this for a while but I haven't gotten far.
I know that using a Zope Page template we can call the Zsql method and show the results with TAL, but I need to some how using a script and a redirect form the search form pass the search data.
Can anyone help we get started?
Can anyone show me a way to do it with formgen and a custom script adapter?
Go into your ZMI, and add a "Z Search Interface" object in the same folder as your ZSQL method. Your ZSQL methods should show as "searchable objects". Select the ZSQL method you want, fill in the rest of the fields, and it will generate form and display page templates. Then modify the templates to taste.