Query all the users in a specific BIM 360 account - autodesk-forge

how can I get Query all the users in a specific BIM 360 account? with no limit, because I have over 100 users :

max limit means the limit of one page (the call of one time).e.g. if you set 50, then every call, 50 items only. By default offset = 0. It means starting with the first item. i.e. one call with limit=50&offset=0 will give you No. 0-49 items only.
one call with limit=50&offset=120 will give you No. 120-169 items only.
The response of the call will tell pagination info. e.g. when I set limit=2&offset=0. It tells total number of users is 10. The next page (nexturl) will be from No 2,3.
"pagination": {
"limit": 2,
"offset": 0,
"totalResults": 10,
"nextUrl": "https://developer.api.autodesk.com/bim360/admin/v1/projects/xxxxxx-
5d39-43cb-b4c4-xxxxxx/users?limit=2&sort=name&offset=2"
},
If calling nexturl, it will tell the url of previous page(No 2,3 only) and next page (No 4,5 only).
"pagination": {
"limit": 2,
"offset": 2,
"totalResults": 10,
"nextUrl": "https://developer.api.autodesk.com/bim360/admin/v1/projects/xxxxxx-
5d39-43cb-b4c4-xxxxxx/users?limit=2&offset=4&sort=name",
"previousUrl":
"https://developer.api.autodesk.com/bim360/admin/v1/projects/xxxxxx-5d39-43cb-b4c4-
xxxxxx/users?limit=2&offset=0&sort=name"
},
And my colleague Petr's sample will be also a good reference for coding.

Related

Highchart/stockChart: Zoom with buttons into monthly-data and show affected columns

I have a simple time-series in highchart:
series: [{
"data": [[Date.UTC(2021,0,1), 22312], // January
[Date.UTC(2021,1,1), 12312], // Feburary
[Date.UTC(2021,2,1), 23322], // ... etc.
],
Now I want to zoom into one month, and show just one column with the given code:
rangeSelector: {
buttons: [{
text: '1m',
type: 'month',
count: 1, // This should show only 1 month, but it shows 2.
// If this is changed to "0", one month will be show, but
// The css "highcharts-button-pressed" is disabled, and you cannot
// see that "1m" was clicked.
},
According to documentation "rangeSelector.buttons.count" should span over an area of one month if type is "month" and count is "1". But what I´m getting here is a span over two months.
Here is an example:
https://jsfiddle.net/ds90vf5r/1/
Question 1: Why is higchart showing two columns instead of one when choosing/clicking on just 1-month (1m)?
Question 2: How can I zoom into the current date and show just one moth (or one column)?

How to fetch archived history from Chrome API

I would like to list archived (90+ days) history URLs from Google Chrome using Chrome API.
I realised that it's probably impossible because the results have not been returned:
let urlAmount = 0;
chrome.history.search(
{
"text": "",
"startTime": new Date(2018, 5, 14, 11, 0, 0).getTime(),
"endTime": new Date(2018, 6, 14, 11, 0, 0).getTime()
},
function(historyItems)
{
for (var i = 0; i < historyItems.length; i++)
{
urlAmount++;
}
});
As you can see I'm checking (2018.05.14 - 2018.06.14) time interval (it's more that 90 days ago from now).
urlAmount is 0 but for example (2019.01.14 - 2019.01.20) it's 100 (default max value is 100).
Is it possible to fetch such archived history this way?
If not what about Selenium automation approach?
The urlAmount variable is incremented inside a callback. So you should move its initialization to the callback function(historyItems), right before the for loop.
The default value for maxResults is 100 if you don't use it, but you can set to it a higher value.

amchart separate bullets individually

I am creating a simple time-based data plot using amcharts with has 5 values, its working great but every time there is 2 or more readings with the same value it stack up and only 1 bullet is visible, i tried to create a custom bullet but still no luck.
Is there a way to separate the bullets individually just to make it presentable.
Below is my code.
{
"bullet": "round",
"bulletBorderAlpha": 1,
"bulletColor": "#2980b9",
"bulletSize": 19,
"customBulletField": "bullet",
"id": "reading_4",
"lineThickness": 0,
"title": "reading_4",
"showHandOnHover": true,
"valueField": "column-8",
"balloonText": "<div style='margin:5px; font-size:12px;'>Reading 4: <b>[[value]]</b></div>",
"visibleInLegend": false,
},
Is there away to make it like below

File System data

So i'm starting to make a little widget that watches your filesystem for changes and I'm using npm's watch module, but a lot of the data is kind of obscured and I was hoping that someone could give me a good description of each of the parameters that are being returned by the module i'm using since there isn't much documentation about it.
{
"dev": 16777223,
"mode": 33204,
"nlink": 1,
"uid": 501,
"gid": 20,
"rdev": 0,
"blksize": 4096,
"ino": 23354217,
"size": 4038,
"blocks": 8,
"atime": "2014-11-05T09:08:32.000Z",
"mtime": "2014-11-05T09:08:51.000Z",
"ctime": "2014-11-05T06:52:48.000Z",
"birthtime": "2014-11-05T06:52:47.000Z"
}
{
"dev": 16777223, //The device number containing the file.
"mode": 33204, //The mode of the file. This is an integer which incorporates file type information and file permission bits. See also stat:type and stat:perms below.
"nlink": 1, //The number of hard links to the file.
"uid": 501, //The user ID of the file’s owner.
"gid": 20, //The group ID of the file.
"rdev": 0, //Device ID; this entry is defined only for character or block special files.
"blksize": 4096, //The optimal block size for reading or writing the file, in bytes.
"ino": 23354217, //The file serial number, which distinguishes this file from all other files on the same device.
"size": 4038, //The size of a regular file in bytes.
"blocks": 8, //The amount of disk space that the file occupies measured in units of 512 byte blocks.
"atime": "2014-11-05T09:08:32.000Z", //The last access time for the file.
"mtime": "2014-11-05T09:08:51.000Z", //The last modification time for the file.
"ctime": "2014-11-05T06:52:48.000Z", //The last modification time for the attributes of the file.
"birthtime": "2014-11-05T06:52:47.000Z" //The date where the file was created
}
Hope it helps!

Dojo's OnDemandGrid and JsonRest Producing Erratic Order

I've been using dgrid's OnDemandGrid with dojo.store.JsonRest rather successfully after a bumpy start, but while implementing caching noticed a glitch: if I do a long swipe of my trackpad (i.e. I scroll rather unscientifically a "long way") and then scroll back, dgrid seems to become confused about where I am at. For example, say I am near row 1609 and then swipe down and find myself looking at row 500. If I then scroll back up towards the top, I'll find the id's of the rows may look something like this 1609, 1608, 1607, 503, 502, 501, 500... If I scroll downward father, it will pick up with the missing rows 499, 498, 497, 1606, 1605, etc.
var store = Observable(Cache(JsonRest({
target: "/cgi-bin/safari/safari_retrv.pl?action=front&format=json",
sortParam: "sort",
idProperty: "queryId"
}),Memory()));
var grid = new declare([OnDemandGrid, Keyboard, Selection, DijitRegistry])({
store: store,
query: {aid: "1604" },
bufferRows: 40,
loadingMessage: "Loading...",
columns: {
aid: "AID",
title: "Title",
poster: "Poster",
postTime: "Posting Date",
commentCount: "Comments"
},
}, "grid");
The problem occurs even if the store is just JsonRest without the Cache store.