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
[Tue Aug 09 2022 16:57:01] [LOG] Final response is: undefined | |
[Tue Aug 09 2022 16:57:01] [ERROR] Trace: Error: XML-RPC fault: Traceback (most recent call last): | |
File "/usr/lib/python3/dist-packages/odoo/addons/base/controllers/rpc.py", line 93, in xmlrpc_2 | |
response = self._xmlrpc(service) | |
File "/usr/lib/python3/dist-packages/odoo/addons/base/controllers/rpc.py", line 73, in _xmlrpc | |
result = dispatch_rpc(service, method, params) | |
File "/usr/lib/python3/dist-packages/odoo/http.py", line 141, in dispatch_rpc | |
result = dispatch(method, params) | |
File "/usr/lib/python3/dist-packages/odoo/service/model.py", line 41, in dispatch | |
res = fn(db, uid, *params) |
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
SELECT | |
`station`.`station_ID` AS `station_ID`, | |
`charge`.`station_ID` AS `evse_ID`, | |
`charge`.`charge_ID`, | |
`charge`.`start_time`, | |
`charge`.`stop_time`, | |
`charge`.`duration`, | |
`charge`.`watt_hour`, | |
`charge`.`chargeprice`, | |
`charge`.`customer_ID`, |
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
select | |
`station`.`station_ID` as `station_ID`, | |
`charge`.`station_ID` as `evse_ID`, | |
`charge`.`charge_ID`, | |
`charge`.`start_time`, | |
`charge`.`stop_time`, | |
`charge`.`duration`, | |
`charge`.`watt_hour`, | |
`charge`.`chargeprice`, | |
`charge`.`customer_ID`, |
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
explain SELECT | |
`station`.`station_ID` AS `station_ID`, | |
`charge`.`station_ID` AS `evse_ID`, | |
`charge`.`charge_ID`, | |
`charge`.`start_time`, | |
`charge`.`stop_time`, | |
`charge`.`duration`, | |
`charge`.`watt_hour`, | |
`charge`.`chargeprice`, | |
`charge`.`customer_ID`, |
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
<html> | |
<head> | |
<meta charset="UTF-8" /> | |
<title>Browser - concurrency using workerpool</title> | |
<script src="node_modules/workerpool/dist/workerpool.js"></script> | |
</head> | |
<body> | |
<h1>Javascript multi-threading on browser</h1> |
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
const { Worker } = require("worker_threads"); | |
let nums = [21, 33, 15, 40]; | |
const size = Int32Array.BYTES_PER_ELEMENT * nums.length; | |
const sharedBuffer = new SharedArrayBuffer(size); | |
const sharedArray = new Int32Array(sharedBuffer); | |
nums.forEach((num, index) => { | |
Atomics.store(sharedArray, index, num); |
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
const { Worker } = require('worker_threads'); | |
async function runOnNewThread(data) { | |
return new Promise((resolve, reject) => { | |
const worker = new Worker('./worker-thread-runner.js', { | |
workerData: data | |
}); | |
worker.on('message', resolve); | |
worker.on('error', reject); | |
worker.on('exit', (code) => { |
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
const cluster = require('cluster'); | |
const http = require('http'); | |
const numCPUs = require('os').cpus().length; | |
const process = require('process'); | |
// This variable is cloned for all worker processes. | |
// Its value isn't shared between processes. | |
let localNumReqs = 0; | |
if (cluster.isPrimary) { |
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
// Reference: https://www.freecodecamp.org/news/node-js-child-processes-everything-you-need-to-know-e69498fe970a/ | |
// `spaw`: create a new process with the command to execute | |
// No *shell* is creaetd by default options. | |
const { spawn } = require('child_process'); | |
const childProcess = spawn('ls', ['-lh', '/usr']); | |
childProcess.stdout.on('data', (data) => { | |
console.log(`stdout: ${data}`); | |
}); | |
childProcess.stderr.on('data', (data) => { |
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
package com.tanbui; | |
public class WaitNotify { | |
public static void main(String[] args) throws InterruptedException { | |
String msgLock = "my message"; | |
Carrier c = new Carrier(msgLock); | |
new Thread(() -> { | |
try { | |
c.send(); | |
} catch (InterruptedException e) { |
NewerOlder