macos – On Mac, are there keyboard shortcuts to create a new Space? Or at least any way to automate this process with keyboard shortcuts?

macos – On Mac, are there keyboard shortcuts to create a new Space? Or at least any way to automate this process with keyboard shortcuts? – Ask Different

development process – Choosing the technology for a software vendor and manufacturer of vending machines

development process – Choosing the technology for a software vendor and manufacturer of vending machines – Software Engineering Stack Exchange

development – calling C++ dll from renderer process using node ffi-napi electron

I am creating a windows application using electron. I want to call C++ .dll method using ffi-napi. for that I have written below code(sharing C++ and electron code). I have stuck on the “Passing_Dll.js” file which is not updating the label with id =”GenName” on click of start and stop button. I mean ces.start() or ces.stop() function is not working in “Passing_Dll.js” file.

I tried to put this line document.getElementById(‘GenName’).innerHTML = “Dummy string” after line var ffi =require(“ffi-napi”) in “Passing_Dll.js” file and realize it is not displaying even dummy string also in GUI.
but if I put same line document.getElementById(‘GenName’).innerHTML = “Dummy string” in start and stop function in “Passing_Dll.js” file before ces.start(() and ces.stop() then it is displaying the “Dummy string”.

Can somebody suggest me what I am doing wrong? why it is not executing “Passing_Dll.js” correctly. do we need to do something with main.js or something with package.json files. please suggest. it would be much apricated if you can send some a working code snippet.

dll.h

#ifdef DLL1_EXPORTS
#define DLL1_API __declspec(dllexport)
#else
#define DLL1_API __declspec(dllimport)
#endif

enum GUIENUM
{
    START = 0,
    STOP,
    DEBUG,
    STATUS,
};

typedef bool(*Callback)(bool, const char*);
extern "C" DLL1_API BOOL Connect(const char *userName, const char *password, Callback callback);

typedef void(*callbackMethod)(int statustype, const char* status);
extern "C" DLL1_API void GetCallMethod(callbackMethod callback);

extern "C" DLL1_API void Start();
extern "C" DLL1_API void Stop();

dll.cpp

#include "pch.h"
#include "framework.h"
#include "Dll1.h"
callbackMethod m_callback;

// This is an example of an exported variable
DLL1_API BOOL Connect(const char *userName, const char *password, Callback callback)
{
    callback(true, "User is connected");

    return true;
}

DLL1_API void GetCallMethod(callbackMethod callback)
{
    m_callback = callback;
    m_callback(START, "Initializaition is done");
}

DLL1_API void Start()
{
    m_callback(STATUS, "Start is pressed");
}

DLL1_API void Stop()
{
    m_callback(DEBUG, "stop is pressed");
}

index.html

<html>
 <head>
 <meta charset="UTF-8">
 <title>SIMS_R 5.2.10.2 GEN1.2 -AppFLR</title>
 </head>
 <body>
    <label for="name" id ="GenName">R 16_31_80D7_99</label><br>
    <button type="button" onclick="startFunction()" value="Display" >Start</button><br>
    <button type="button" onclick="stopFunction()" value="Display2">Stop</button><br>   
    <script src="Passing_Dll.js"></script>
 </body>
 </html>

main.js

const{BrowserWindow} =require("electron");
const app=require('electron').app;

function createWindow() {
    // Create the browser window.
   mainWindow = new BrowserWindow({width:600, height: 650});
  
   // Disable menu
   mainWindow.setMenu(null)
    
   // and load the index.html of the app.
   mainWindow.loadURL('file://'+__dirname+'/index.html')
}
app.on('ready',createWindow);

Passing_Dll.js

var ffi =require("ffi-napi");
var ref =require("ref-napi");
var Enum = require('enum')
var constString = ref.types.CString;
var bool = ref.types.bool;
var int = ref.types.int;
var enumCallback = new Enum({  'START': 0,
  'STOP': 1,
  'DEBUG': 2,
  'STATUS': 3
}); 

var callback = ffi.Callback(bool, (bool, constString), function (sec, data) {
    console.log(sec)
    console.log(data);
  
  });

var callback2 =ffi.Callback(ref.types.void, (int, constString), function (sec, data) {
    switch(sec)
    {
      case enumCallback.START.value: 
       console.log(sec);
       console.log(data);
       document.getElementById('GenName').innerHTML = data;
       break;
       case enumCallback.STOP.value: 
       console.log(sec);
       console.log(data);
       document.getElementById('GenName').innerHTML = data;
       break;
       case enumCallback.STATUS.value: 
       console.log(sec);
       console.log(data);
       document.getElementById('GenName').innerHTML = data;
       break;
       case enumCallback.DEBUG.value: 
       console.log(sec);
       console.log(data);
       document.getElementById('GenName').innerHTML = data
       break;
       default:
        console.log(sec);
        console.log(data);
        document.getElementById('GenName').innerHTML = data
        break;
    }
});

var libloc = "./Dll1.dll";
  
const ces = ffi.Library(libloc, {
  'Connect': (bool, (constString, constString, 'pointer')),
  'GetCallMethod':(ref.types.void, ('pointer')),
  'Start': (ref.types.void,( )),
  'Stop': (ref.types.void,( )),
  
});

module.exports = ces;

var maxLength = 200;
var nameBuffer1 = Buffer.alloc(maxLength);
nameBuffer1.fill(0); 
nameBuffer1.write("user", 0, "utf-8"); 


var nameBuffer2 = Buffer.alloc(maxLength);
nameBuffer2.fill(0); 
nameBuffer2.write("password", 0, "utf-8");

ces.Connect(nameBuffer1,nameBuffer2,callback)
ces.GetCallMethod(callback2)
  
function startFunction()
{
    ces.Start()
}
  
function stopFunction()
{
    ces.Stop()
}

pr.probability – Bounding Browian motion and an Ito process simultaneously

Let $(W_t)_{tgeq0}$ be a standard Brownian motion in $mathbb{R}^n$ and $(A_t)_{tgeq0}$ be an adapted matrix-valued process such that $A_t$ is a positive symmetric matrix with bounded operator norm : for all $t>0$, $vertvert A_t vertvert_{op} leq a$ for some constant $a$. That is $$0preceq A preceq aI_n $$
Define, for all time $tgeq0$ the martingale $M_t=int_0^sA_sdW_s$.

Is it true that both processes can be simultaneously confined ? That is for all $T>0$ and all $R>0$,
$$mathbb{P}(forall t in (0,T), W_t in B(0,R) text{ and }forall t in (0,T), M_t in B(0,R)) > 0 quad? $$
For my purpose I would actually need the slightly weaker :

$$mathbb{P}(W_T in B(0,R) text{ and }forall t in (0,T), M_t in B(0,R)) > 0 $$
Fix some $T>0$. I tried to work on the event $E_R = {forall t in (0,T), W_t in B(0,R)}$ but it is unclear to me how $M_t$ conditionned to that event behaves, as there could be cancellations assuring that $W_t$ is small that might be destroyed in the stochastic integral right ? On the other hand it looks plausible to me that $omega in E_R implies M_t(omega) in B(0,lambda R) $ for some $lambda$ potentially large but I might be wrong ?

performance – Monitor disk activity by process and by file in linux like windows ressource monitor

I have multiple disks in my system sometimes I have a heavy read usage on my root partition. I know that there are some processes reading a lot of data, but from all disks. How can I find out which process is accessing which file?

I’ve tried htop, dstat or iotop. However these seem not to be able to show activity by process and file. In windows ressource monitor does this job perfect:

enter image description here

I can’t imagine that there isn’t a similar console tool for linux.

domain driven design – Where does a Process Manager live with a Hexagonal/Ports and Adapters Architecture?

Context: I initially asked this question. I lacked some understanding and phrasing to ask the actual question I wanted to ask. The answer though helped me understand the friction points a bit better to ask this question.


I have three separate Bounded Contexts, and have a new feature requirement that states that, based on an Event from the Upstream Context, two different Commands must be sent to the two Downstream Contexts. This is more appropriately described as a Process Manager (not a Saga, where one operation failure rolls back all operations).

In the book Implementing Domain-Driven Design, a number of packages are described.

  • root.package.(application)
  • root.package.(application.subconcept)
  • root.package.(domain.model)
  • root.package.(domain.model.subconcept)
  • root.package.(domain.service)
  • root.package.(infrastructure)
  • root.package.(infrastructure.persistence)

It also describes Hexagonal Architecture/Ports and Adapters with a pretty straightforward flow.

  • Adapters live in the Infrastructure Layer, and are the clients of the Application Layer/Services
  • Application Services are the clients of the Domain Model

So the code in the *.application package calls the code in the *.domain.* package (model or service).
The code in the *.infrastructure package calls the code in the *.application package.

I noticed a pattern, mechanically (not conceptually), between Aggregates, Projections, and Process Managers.

Projections

  • Consume Events to Produce Current State

Aggregates

  • Consume Events to Produce Current State (Event Sourcing), and
  • Consume Commands to Produce Events (modify Event Stream)

Process Managers

  • Consume Events to Produce Current State (Event Sourcing), and
  • Consume Events to Produce Commands (for other Applications/Aggregates/Contexts)

All three consume Events published by the Domain Model. The Aggregate (Command Model), lives inside the Domain Model, and is sourced from Domain Events. The Projections (Query Model), lives next to the Domain Model (*.projections), and is sourced from Domain Events. The Process Manager lives somewhere, and is sourced from Domain Events.


Based on this, where do the Process Managers live? Do they also live next to the Domain Model (in a *.process package)? Does it exist as an output Adapter, which might place it inside the *.infrastructure package? Remember that this particular Process Manager is not required for the Upstream Context to work, nor is it required for the Downstream Context to work; it is entirely an optional integration between the Upstream, and the two Downstream Contexts.

  • Do optional integrations exist in a separate Bounded Context, in a *.process package, as an Adapter in the Infrastructure?
  • Do required integrations that are sourced from Upstream Events belong in the Upstream Domain Model?
  • Do required integrations that are sourced from multiple Upstream Events, but interact only with one Downstream Context, belong in the Downstream Domain Model, maybe as an input Adapter?

javascript – Knockout js implementation with phtml ReferenceError: Unable to process binding

after a lot of search in this forum I’ve decided to write a question by myself.

I’m trying to integrate my knockout page into a phtml file in way to update the input layout after a file has been uploaded, but when I try to load the page I face this error:

ReferenceError: Unable to process binding "event: function(){return {change:myFunction} }"
Message: myFunction is not defined

Actually I’m sure that the JS file is actually loaded.

Following you can find the code:

<MODULE_NAME>/widget/pending_page.phtml

<form method="post" action="" enctype="multipart/form-data">
       <div class="container">
           <div class="well" data-bind="fileDrag: fileData">
               <div class="form-group row">
                   <div class="col-md-6">
                   </div>
                   <div class="col-md-6">
                       <input type="file" name="file" id="file" accept="image/*" data-bind="event: {change : myFunction }">
                   </div>
               </div>
           </div>
           <button class="btn btn-default" type="submit">Submit</button>
       </div>
   </form>

<MODULE_NAME>/js/pending_page

    (
        'ko',
        'jquery',
        'uiElement'
    ),
    function(
        ko,
        $,
        Component
    ){
    "use strict";

        return Component.extend({

            defaults: {
                template: '<MODULE>/widget/pending_page'
            },

            initObservable: function () {
                this._super()
                    .observe({
                        files: ()
                    })

                this.files.subscribe(function() {}, this);
            },

            myFunction: function(){
                console.log("i'm hereeeeeeeeeeeeeeeee")
            },
        })

});

can someone help me? I’m going crazy about that.

Thanks!

alt process – Is taking photos with the back side of a film roll a real technique?

Yes, this technique is known as redscale. You can find a decent amount of information by googling using that term, and see example photos on Flickr. As @MichaelC notes in the comments, on 35mm you’d have to figure out a way of extracting the film from the canister, invert it, and put it back.

You can even do this on B&W film, and there will be an effect, since the light will now be passing through the anti-halation layer first.

I don’t want to waste an entire film roll and realise it didn’t work.

It will work, in the sense that you will get some results out of it, but as with any alternative technique, you pretty much have to be prepared to waste rolls of film (more than one) as you experiment. 🙂 Plus, things can go wrong when unloading and reloading the film into the cartridge.

On the other hand, Lomography makes a redscale film that you load in the normal way – perhaps worth a try as a first approximation to see if you like the results.

2013 – Steps in a Process & Coloring them (SP2013)

I came across an example of a process with a current stage image (should be attached to the thread).

Sample Workflow

Basically there would be 4 or 5 stages: Initial / Assigned / Being Processed / Completed.

Each of the stages would have (almost like a flowchart diagram) a progress image with an arrow showing the current state and they would be colored.

For example:
Current Stage – White box / Green Outline
Completed Stage – Green Box / Black Outline
Pending – Yellow Box / Gold Outline
Cancelled – Red Box / Red Outline
etc.

As the list item gets updated, the workflow images would get marked and colored for the stages.

How could this be accomplished? Would it be as simple as having a column for each stage? And if so then would the coloring of each stage come from CSS?

Thanks

digital signature – Why are LMS and XMSS no candidates in the Post-Quantum Cryptography Standardization process?

Why are Leighton-Micali Signature Scheme (LMS) and eXtended Merkle Signature Scheme (XMSS) no candidates in the NIST Post-Quantum Cryptography Standardization process?
Both are mentioned in the final draft of Recommendation for Stateful Hash-Based Signature Schemes.

I was expecting that both algorithms are candidates in the standardization process as well, but it seems that they weren’t even submitted. Can anyone explain why? If they are not considered as candidates for a new standard why does the Recommendation for Stateful Hash-Based Signature Schemes exist and mention exactly those two algorithms?

Is the recommendation just a temporary standard until the standardization process is finished?

DreamProxies - Cheapest USA Elite Private Proxies 100 Private Proxies 200 Private Proxies 400 Private Proxies 1000 Private Proxies 2000 Private Proxies ExtraProxies.com - Buy Cheap Private Proxies Buy 50 Private Proxies Buy 100 Private Proxies Buy 200 Private Proxies Buy 500 Private Proxies Buy 1000 Private Proxies Buy 2000 Private Proxies ProxiesLive Proxies-free.com New Proxy Lists Every Day Proxies123