This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// appstudio-detect-internet.qml | |
// | |
// Detects an active internet connection (LAN, WiFI or MobileData) | |
// For use with AppStudio for ArcGIS | |
// | |
// Notes: | |
// This uses AppStudio's Networking plugin which is a wrapper for | |
// Qt's QNetworkConfigurationManager and QNetworkConfiguration classes. | |
// | |
// This application works by using BearerType for all platforms except for iOS. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import QtQuick 2.7 | |
import QtQuick.Controls 2.1 | |
import ArcGIS.AppFramework 1.0 | |
import ArcGIS.AppFramework.Networking 1.0 | |
Item { | |
Flickable { | |
anchors.fill: parent | |
contentWidth: textArea.width | |
contentHeight: textArea.height |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
QT -= gui | |
CONFIG += c++11 console | |
CONFIG -= app_bundle | |
# The following define makes your compiler emit warnings if you use | |
# any feature of Qt which as been marked deprecated (the exact warnings | |
# depend on your compiler). Please consult the documentation of the | |
# deprecated API in order to know how to port your code away from it. | |
DEFINES += QT_DEPRECATED_WARNINGS |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Convert AAMVA string to JSON | |
function aamva_decode(data) { | |
var m = data.match(/^@\n\u001e\r(ANSI )(\d{6})(\d{2})(\d{2})(\d{2})/); | |
if (!m) { | |
return null; | |
} | |
var obj = { | |
header: { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import json, sys | |
def combine(attr, prefix): | |
return attr if prefix == "" else prefix + "." + attr | |
def flatjson(obj, prefix = ""): | |
if isinstance(obj, list): | |
print combine("len", prefix) + "\t" + str(len(obj)) | |
for i, row in enumerate(obj): | |
flatjson(obj[i], prefix + "[" + str(i) + "]") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import QtQuick 2.9 | |
import QtQuick.Controls 2.4 | |
import QtQuick.Layouts 1.3 | |
import QtQuick.Window 2.2 | |
import Qt.Test 1.0 | |
Window { | |
visible: true | |
width: 640 | |
height: 480 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import QtQuick 2.9 | |
import QtQuick.Controls 2.2 | |
import QtQuick.Layouts 1.3 | |
import QtQuick.Window 2.2 | |
Window { | |
visible: true | |
width: 640 | |
height: 480 | |
title: qsTr("Evaluator") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash -xe | |
portal_url=https://www.arcgis.com | |
cache_dir=/tmp/cache | |
rest_json=${cache_dir}/rest.json | |
token_json=${cache_dir}/token.json | |
user_json=${cache_dir}/user.json | |
content_json=${cache_dir}/content.json | |
item_json=${cache_dir}/item.json |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdio.h> | |
#include <stdlib.h> | |
#include <iostream> | |
#include <QObject> | |
#include <QVariant> | |
#include <QDebug> | |
using namespace std; | |
template <typename A> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function consoleTrace() { console.log(new Error()).stack.split("\n")[1]; } |