My vscode always format js code on save, here is my settings, but it didn't work:
"editor.insertSpaces": true,
"editor.renderWhitespace": "none",
"typescript.check.workspaceVersion": false,
"window.zoomLevel": 1,
"editor.cursorStyle": "block",
"typescript.check.tscVersion": false,
"editor.cursorBlinking": "blink",
"editor.lineNumbers": "relative",
"workbench.activityBar.visible": false,
"vim.useCtrlKeys": false,
"files.trimTrailingWhitespace": false,
"editor.trimAutoWhitespace": false,
"eslint.autoFixOnSave": false,
"editor.formatOnSave": false
Something wrong?
Related
The editor auto-complete functionality of NEO4J is not working although the config setting is set to "true"
config editorAutocomplete:true
{
"maxHistory": 30,
"theme": "auto",
"initCmd": ":play start",
"playImplicitInitCommands": true,
"initialNodeDisplay": 300,
"maxNeighbours": 100,
"showSampleScripts": true,
"browserSyncDebugServer": null,
"maxRows": 1000,
"maxFieldItems": 500,
"autoComplete": true,
"scrollToTop": true,
"maxFrames": 15,
"codeFontLigatures": true,
"useBoltRouting": false,
"editorLint": false,
"enableMultiStatementMode": true,
"connectionTimeout": 30000,
"showPerformanceOverlay": false,
"allowCrashReports": true,
"allowUserStats": true,
"showWheelZoomInfo": true,
"useCypherThread": true,
# **"editorAutocomplete": true**
This is set to true by default for the NEO4J browser, however it is not working in NEO4J 4.4 as it did in NEO4J 3.2.
I tried to change the setting, but it had no effect. I refreshed the browser and still nothing.
I am trying to use Dart alongside a api for a school system i have reverse engineered and I'm trying to implement it in a library, when using dio to send a request it is converted to a map (the output of the api is json i think) but it is nested and I’m not sure on how to work with them.
This is the code i have written
class StudentClient{
String sessionID;
StudentClient(this.sessionID);
Future<Map> basicInfo() async {
var dio = Dio();
dio.options.headers["Authorization"] = "Basic $sessionID";
Response loginRequest = await dio.get(
'https://www.classcharts.com/apiv2student/ping',
options: Options(contentType: Headers.formUrlEncodedContentType),
);
assert(loginRequest.data is Map);
Map<dynamic, dynamic> request = loginRequest.data;
return request;
}
and the (censored) output
{success: 1, data: {user: {id: 696969, name: Foo Bar, first_name: Foo, last_name: Bar, avatar_url: https://asdsdsdsd/26.0.0/img/faces/default.png, display_behaviour: true, display_parent_behaviour: false, display_homework: true, display_rewards: true, display_detentions: true, display_report_cards: true, display_classes: false, display_announcements: true, display_attendance: false, display_attendance_type: none, display_attendance_percentage: true, display_activity: true, display_mental_health: false, display_mental_health_no_tracker: false, display_timetable: true, is_disabled: false, display_two_way_communications: true, display_absences: false, can_upload_attachments: false, display_event_badges: false, display_avatars: false, display_concern_submission: false, display_custom_fields: false, pupil_concerns_help_text: , allow_pupils_add_timetable_notes: false, detention_alias_plural_uc: Detentions, announcements_count: 0, messages_count: 0, pusher_channel_name: Pupil_dfghfghhghfghfghfghfghfghfghfghfghfgh, has_birthday: true, has_new_survey: false, survey_id: null}}, meta: {version: 26.0.0}}
Any help would be appreciated!
I need to just get the twin of a device using the Azure device sdk for node.js.
I did used the Client clode as below:-
import { Client } from 'azure-iot-device';
import { Mqtt } from 'azure-iot-device-mqtt';
await client.setOptions(options);
await client.open();
const twin = await client.getTwin();
The issue is the twin returned doesn't have the device twin fields but other fields like below:-
{
_events: [Object: null prototype] { newListener: [Function: bound ] },
_eventsCount: 1,
_maxListeners: undefined,
_transport: Mqtt {
_events: [Object: null prototype] {
error: [Function],
connected: [Function],
disconnect: [Array],
message: [Function],
twinDesiredPropertiesUpdate: [Function: bound ]
},
_eventsCount: 5,
_maxListeners: undefined,
_mid: '',
_firstConnection: false,
_authenticationProvider: X509AuthenticationProvider { type: 0, _credentials: [Object] },
_mqtt: MqttBase {
_events: [Object: null prototype],
_eventsCount: 2,
_maxListeners: undefined,
mqttProvider: [Object],
_onTheWirePublishes: [OnTheWireMessageContainer],
_fsm: [constructor],
_options: [Object],
_config: [Object],
_mqttClient: [MqttClient],
[Symbol(kCapture)]: false
},
_twinClient: MqttTwinClient {
_events: [Object: null prototype],
_eventsCount: 1,
_maxListeners: undefined,
_pendingTwinRequests: {},
_mqtt: [MqttBase],
_topicFsm: [BehavioralFsm],
_responseTopic: [Object],
_desiredPropertiesUpdatesTopic: [Object],
[Symbol(kCapture)]: false
},
_fsm: constructor {
initialState: 'disconnected',
states: [Object],
eventListeners: [Object],
namespace: 'fsm.2',
useSafeEmit: false,
hierarchy: {},
pendingDelegations: {},
_stamped: true,
inputQueue: [],
targetReplayState: 'connected',
state: 'connected',
priorState: 'connecting',
priorAction: 'connected.getTwin',
currentAction: '',
currentActionArgs: undefined,
inExitHandler: false
},
_topicTelemetryPublish: 'devices/amidha/messages/events/',
_topics: { method: [Object], message: [Object] },
_userAgentString: 'azure-iot-device/1.17.1 (node v12.18.0; Ubuntu 18.04; x64)',
[Symbol(kCapture)]: false
},
_retryPolicy: ExponentialBackOffWithJitter {
_errorFilter: DefaultErrorFilter {
ArgumentError: false,
ArgumentOutOfRangeError: false,
DeviceMaximumQueueDepthExceededError: false,
DeviceNotFoundError: false,
FormatError: false,
UnauthorizedError: false,
NotImplementedError: false,
NotConnectedError: true,
IotHubQuotaExceededError: false,
MessageTooLargeError: false,
InternalServerError: true,
ServiceUnavailableError: true,
IotHubNotFoundError: false,
IoTHubSuspendedError: false,
JobNotFoundError: false,
TooManyDevicesError: false,
ThrottlingError: true,
DeviceAlreadyExistsError: false,
DeviceMessageLockLostError: false,
InvalidEtagError: false,
InvalidOperationError: false,
PreconditionFailedError: false,
TimeoutError: true,
BadDeviceResponseError: false,
GatewayTimeoutError: false,
DeviceTimeoutError: false,
TwinRequestError: false
},
immediateFirstRetry: true,
normalParameters: ExponentialBackoffWithJitterParameters {
c: 100,
cMin: 100,
cMax: 10000,
ju: 0.25,
jd: 0.5
},
throttledParameters: ExponentialBackoffWithJitterParameters {
c: 5000,
cMin: 10000,
cMax: 60000,
ju: 0.25,
jd: 0.5
}
},
_maxOperationTimeout: 240000,
desiredPropertiesUpdatesEnabled: false,
properties: {
reported: { update: [Function: update], '$version': 1 },
desired: { '$version': 1 }
},
[Symbol(kCapture)]: false
}
I don't want to listen the twin change events that I can do easily by using above object using twin.on. I need to just get the current twin of the device. Is it possible?
After reading your comments it seems you are expecting some values to be there that just aren't available to the device (when you use the device SDK). The device can read and receive updates on desired properties and read/write to reported properties, the rest is unavailable.
In a comment, you mentioned you want to find the deviceScope in the twin, but that isn't available to the device SDK. You would need the service SDK for that.
When you print the result of const twin = await client.getTwin();, what you see is an object with helper methods to subscribe to desired property changes and patching new reported properties. Like Mark stated in his question, the properties of your twin are included in this object as well.
The current twin is in the JSON you posted. See the section properties:
properties: {
reported: { update: [Function: update], '$version': 1 },
desired: { '$version': 1 }
},
The twin you posted is empty.
Above is not feasible to get the whole twin not just the desired and reported properties from device IoT sdk and that has been confirmed by Azure too. Check here.
The link also has a solution to assign parent child relationship between the leaf and the edge device.
using declerative pipeline syntax in a Jenkinsfile and publishing coverage report using cobertura as follows
cobertura(
coberturaReportFile: 'coverage/cobertura-coverage.xml',
enableNewApi: true,
autoUpdateHealth: true,
autoUpdateStability: true,
failUnstable: true,
failUnhealthy: true,
failNoReports: true,
onlyStable: false
)
also tried using code coverage api as follows:
publishCoverage(
failUnhealthy: true,
calculateDiffForChangeRequests: true,
failBuildIfCoverageDecreasedInChangeRequest: true,
failNoReports: true,
adapters: [
coberturaAdapter(path: 'coverage/cobertura-coverage.xml')
]
)
looking at all the documentation i could find, i wasn't able to figure out what are the instructions to fail the build if coverage drops without using hard-coded thresholds.
would appreciate a reference or a code snippet.
enabling autoUpdateHealth in conjunction with hard-coded threshold would do the trick
cobertura(
coberturaReportFile: 'coverage/cobertura-coverage.xml',
enableNewApi: true,
autoUpdateHealth: true,
autoUpdateStability: true,
failUnstable: true,
failUnhealthy: true,
failNoReports: true,
onlyStable: false
conditionalCoverageTargets: '80, 0, 0',
fileCoverageTargets: '80, 0, 0',
lineCoverageTargets: '80, 0, 0',
methodCoverageTargets: '80, 0, 0',
packageCoverageTargets: '80, 0, 0',
)
My understanding is that setting nodeIntegration to false will block access to Node modules in the renderer process. But I'm able to do require('path') in spite of having nodeIntegration set to false.
Is my understanding not correct?
If my understanding is correct but path is given an exception, I wonder if there are other modules given the same exception?
Here's my BrowserWindow options
mainWindow = new BrowserWindow({
webPreferences: {
// The below configurations are set to achieve the maximum
// security possible in Electron
contextIsolation: true,
webSecurity: true,
enableRemoteModule: false,
nodeIntegration: false,
nodeIntegrationInSubFrames: false,
nodeIntegrationInWorker: false,
allowRunningInsecureContent: false,
sandbox: true,
preload: join(__dirname, "preload.js"),
},
center: true,
title: "Orange",
minWidth: 800,
minHeight: 600,
});