File System data - json

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!

Related

Autodesk Forge PDF Viewer and Measuring

I am working on an app that needs to calculate measures like areas and length etc. Lucky today by using Autodesk Forge viewer we can do that. I had looked into this blog post [enter link description here][1]
and as well to the docs [enter link description here][2]
[1]: https://aps.autodesk.com/blog/fast-pdf-viewingmarkup-inside-forge-viewer
[2]: https://aps.autodesk.com/en/docs/viewer/v7/reference/Extensions/MeasureExtension/
I am looking for a way to insert the measure values into my database, where I can view it again when I want or reload the page (not lose it) similarly with Markup with callouts and text.
Lastly, I am wondering about how much does it costs to translate the pdfs files using Forge?
thanks
You can retrieve the array with objects related with the measurements done with the line:
NOP_VIEWER.getExtension('Autodesk.Measure').measureTool.getMeasurementList()
You can store the result in your DB, together with viewstate and additional info such as urn and viewable guide.
To restore it, you can first activate the tool
NOP_VIEWER.getExtension('Autodesk.Measure').activate()
Then set the measurement list using the values you read from the DB
NOP_VIEWER.getExtension('Autodesk.Measure').measureTool.setMeasurements(listMeasurements)
Where listMeasurements will be something like:
var listMeasurements = [
{
angle: "0.0 °",
arc: "0.0 mm",
area: "0.0 mm²",
deltaX: "1569.7 mm",
deltaY: "6463.7 mm",
deltaZ: "162.0 mm",
distance: "6653.6 mm",
from: "Vertex",
location: "X: 0.0 mm\nY: 0.0 mm\nZ: 0.0 mm",
picks: [
{intersection: {x:43.5168342590332,y:-60.37924575805664,z: 8.858267784118652}, modelId: 2, viewportIndex2d: null, snapNode: 2587},
{intersection: {x: 38.367037573210276,y: -39.17272345572108,z: 8.32677173614502}, modelId: 2, viewportIndex2d: null, snapNode: 3521}
],
precision: 1,
text: "",
to: "Vertex",
type: "Distance",
unitType: "mm"
}
]
Now, you can deactivate it with one line of code
NOP_VIEWER.getExtension('Autodesk.Measure').deactivate()
Instead of using NOP_VIEWER, refer to your viewer instance through the variable defined in your code

Query all the users in a specific BIM 360 account

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.

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

Query on feature layer and draw a point on feature with matching OBJECTID

I have a JSON file with data as:
[{
"data": [{
"assetID": 1,
"colorCode": 3
}, {
"assetID": 2,
"colorCode": 1
}, {
"assetID": 3,
"colorCode": 4
}, {
"assetID": 4,
"colorCode": 2
}, {
"assetID": 5,
"colorCode": 3
}, {
.
.
.
"assetID": 1000,
"colorCode": 2
}]
}]
where,
assetID is unique (upto 1000)...
colorCode is a random number between 1 to 4... and each colorCode corresponds to any unique color.Like,
colorCode 1, color Green...
colorCode 2, color Orange...
colorCode 3, color Yellow...
colorCode 4, color Red...
I have created a simple webmap in ArcGIS online with one tile layer and one feature layer. Now, I have to write a code in JS where when the feature's OBJECTID matches the assetID, a point should be drawn there in the color corresponding to the colorCode on the map.
Like, for assetID 1 colorCode is 3, so at feature with OBJECTID 1 on the map, a point should be drawn there in green color and so on.
I have created the JSON file and the webmap, but I am really new to all this ArcGIs and dojo and I am really at a loss where to proceed next.
How are you hosting the application. Is it just a webmap in ArcGIS online or you using WebAppBuilder or you have a custom web application. All these factor determine whether you can customize your map or not.
Also, your layer is it a FeatureLayer or a Map Service. or just graphic data. If it is graphic data its lot easier to make the customization. Let me know more details so that I can provide you with specific answer.
Take a look at this post https://gis.stackexchange.com/questions/50558/customizing-arcgis-online-application-template-and-uploading-it-back-to-arcgis-o
it provides information on how you can customize webmap.
Hope this was helpful.

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.