How to make a finite state machine when input sequence is given 00010101 and output for this sequence is given is 011001110

A three-state finite machine has {0,1} as its input and output alphabets. Given the following input sequence and its corresponding output sequence , determine the machine

Input Sequence : 00010101

Output Sequence : 011001110

I am a beginner in Finite state machine topic, I can draw only simple FSM, but don’t have any idea about this , Any type of answer will be appreciate.

visas – Need to apostille my background check via US Department of State; what are the steps after digital fingerprinting at USPS?

For a visa, I am required to have an FBI background check, and to additionally apostille it (is that even a verb i haven’t heard of this word until this process). I have to do it through the US Department of State according to the visa instructions.
http://overseas.mofa.go.kr/us-sanfrancisco-en/wpge/m_20623/contents.do says:

“① FBI criminal background check ② apostilled by U.S. Department of State, Office of Authentications
① Fill out the application form electronically at https://www.edo.cjis.gov/#/ and get finger print at USPS (Appointment only) ② Federal documents such as FBI clearances are authenticated by U.S. Department of State, Office of Authentications https://travel.state.gov/content/travel/en/records-and-authentications/authenticate-your-document/office-of-authentications.html”

But two things: I still haven’t gotten my email results back from the USPS / FBI and it’s been 2 weeks, and second, am I supposed to print it out and send it or do i need to have it officially be printed as an official document?
Thanks in advance.

Which option better communicates the default state for a search box as “everything.”

tl;dr The default setting for a search box is ‘include everything’. Which of the following gifs presents a better option to convey this?

Context:

We’re redesigning a reporting interface for a dataset with dozens of possible filter options. Our current system is very difficult to use, so this version is leaning heavily on defensive design.

The goal is for no possible filter combination to return a nonsensical dataset. As such, the “default” state for each filter has been carefully made mutually exclusive from any associated options.

This is the first time in this project I’ve come across a search box.

The current implementation of the box is something like this. Where ’empty’ state means “include any reference”:
enter image description here

According to consistency with every other filter so far in this new design, the search box should look something like this:
enter image description here

I have reservations about either of these options. To me, the first option doesn’t seem to communicate the default state as clearly and mutually-exclusively as the second option. But the second option requires many more clicks than the first.

Please help!

State machine to convert from base 2 to base 10?

Is there a state machine which can convert base 2 decimals to base 10 decimals in a streaming fashion? Integers?

javascript – update state delay in checkbox, React

i have to objects sizes and newProduct , i want to set the available sizes using a checkboxes, it works fine but : when i check two boxes, the state updates only in the first box , then when pushing the sizes object to the newProduct object , the state on the newProduct did not update until i check the third box (update only the value of the first box) ! can someone please help , thanks in advance .

here is my code :

function Products(){

const (sizes, setSizes) = useState({
    s: false, m: false, l: false, xl: false, xxl: false, xxxl: false
})
const (newProduct, setNewProduct) = useState({
    productType : "", name : "", price : "", photo : "", sizes : sizes
})

const manageSizes = (e) => {
    
    const { name, checked} = e.target
    
    setSizes({...sizes, (name) : checked}) // late (1)
    
    setNewProduct({...newProduct, sizes : sizes}) // late (2)
    
}
return (
      {Object.keys(sizes).map((item, index) => (
            <label key={index} htmlFor={item}>{item}
                    <input 
                    type="checkbox"
                    checked={sizes(item)}
                    name={item} 
                    onChange={manageSizes}
                    />
            </label>        
      ))}
)
}

architectural patterns – How to construct a model state dependent context menu in a MVP GUI application

Lets say I have a GUI application which tries to adhere to Model-View-Presenter (MVP) as best as possible.
In this application I have a list box with items. One should be able to interact with these items via a context menu. But: Which entries in the context menu are shown depend on the state of the item.
For example: I have a list box of data sources whose context menu shall show “connect” or “disconnect”, depending on whether its already connected or not.

This is where I don’t know how to correctly implement this with the MVP architecture.

How can I fill the context menu with state dependent items while the view does not know about the state and the presenter does not know about where to put a context menu?

My thoughts so far:

The view receives the framework event for opening the context menu. Now it must populate the menu but has no info on the state of the underlying model.
It could just call a corresponding presenter method (the original framework event object would not be passed to the view, see assumptions). The presenter could query the model and get the state, but how does the info get to the view?
If the view had a method like “show_context_menu” then how would the view know where to put the context menu. This information would only be available in the method handing the original context menu event and I don’t think something like coordinates should be passed to the presenter. Or should it?

This is a general question and not framework or language dependent.

My Assumptions (Which might be wrong):

  • Presenter should be independent from GUI framework (QT in my case), so no GUI framework objects used in presenter.
  • View should not access model data directly (adhering to MVP)

measure theory – There is no dispersion free quantum state on $B(H)$

Let $H$ be a Hilbert space and $P(H)$ denotes the lattice of all orthogonal projections on $H$. The famous generalized Gleason theorem states that if $mu:P(H) to mathbb{R}$ is a finitely additive function then $mu$ extends to a state on whole $B(H)$. If we assume that $mu$ is completely additive then the corresponding state turns out to be normal. This second part is the original Gleason theorem: one consequence of the original Gleason theorem is that there is no dispersion-free quantum state i.e. completely additive $mu$ as above such with values in the two element set ${0,1}$.

How to prove (using the generalized Gleason theorem) that there is also no dispersion free quantum finitely additive measure, i.e. finitely additive $mu$ as above with values in ${0,1}$?

differential equations – Solution of a system of nonlinear ODE in the form of a state space with nonzero initial conditions

I have a system of differential equations like this:

$begin{cases} frac{dx}{dt} = hpf_1 cdot alpha cdot sin(omega t) + frac{d}{dt}(alpha cdot sin(omega t))
\ frac{dhpf_1}{dt} + hpf_1 = frac{d}{dt}(extr(t)) end{cases}$

where:
$extr(t)$ – Any function that has one extreme (minimum or maximum). For example $extr(t) = e^{-(x(t))^2}$

$x$ and $hpf_1$ – variables of the system of differential equations.

I’m trying to get solution, but transforming the system into a state-space form. How to set nonzero initial conditions?

pars = {(Alpha) = 0.1, h = 1, (Omega) = 2 Pi 0.5, (Beta) = 1}

extr = Exp(-(x(t))^2)

AffineStateSpaceModel({x'(t) == 
   hpf1(t) (Alpha) Sin((Omega) t) + u(t), 
  hpf1'(t) + h hpf1(t) == D(extr, t)}, {x(t), hpf1(t)}, u(t), x(t), t)

Plot(OutputResponse(%, D((Alpha) Sin((Omega) t), t), {t, 0, 3}) // 
  Evaluate, {t, 0, 3}, PlotRange -> Full)

fraud – How does a fraudulent credit card charge to a Department of State work?

First of all, we don’t know if the charge really came from the NY Department of State. This could be a company using a similar name to make it look like NY Department of State and thus get away with it, for some time, as it might be overlooked by NY residents.

Second, assuming the charge was indeed done by NY Department of State I see a few possibilities.

NY DoS might have a platform which allows paying with one credit card, then reversing it by crediting another one. It doesn’t seem a good idea for the malfeasants to use a Government Agency for committing fraud, but I guess this would be an option.

A second possibility would be the following. Let’s suppose John Doe owes them $200. Instead of paying, he goes to a criminal Alphonse Gabriel which agrees to pay their debt of $200 in exchange of receiving only $100. Alphonse Gabriel pays the sum with a stolen credit card, and receives 100 legit US dollars. John Doe manages to only pay half the sum.

This wouldn’t be very bright for John Doe, either, as he would be located when investigating the credit card fraud, and -if found- he would have a much bigger problem that such $200 debt. But Alphonse Gabriel may not care about that.

A third option would be that a payment gateway have some unsecured system which allows a merchant to get payments stating as sender a different company (by changing some merchant id, perhaps). If then the charge-backs go to the NY Department of State, which might not scrutiny much the charge-backs it gets, that could be profitable. Or, if it was the result of a misconfiguration (e.g. a small shop which is charging everyone as the NY Department of State) this could be similar to the first case.

If there was a small company appearing as “NYS DOS CORP 518 473 8 ALBANY NY”, it may not be much noticed by the people who knows what that charge is for, and only raise suspicion when they receive some fraudulent purchases which end up on completely random people statements.

A fourth possibility would be that it somehow was legitimate (maybe some proceeding that is handled out-of-state? or a contractor of several states that issued your charge with the wrong sender?)

Finally, remember that you can dispute the charge at your bank, and have it reversed. Given that someone seems to have been able to use it, I would recommend getting a new one issued.

fraud – How does a frauulent credit card charge to a Department of State work?

I looked at my Credit card statement, and noticed a fraudulent charge to what turned out to be the NY Department of State. This was especially odd to me, since I don’t live in NY (and so was obvious fraud), but I also couldn’t understand how a criminal could monetize this.

Some Googling reveals that other people have had the same form of fraud for over 4 years, as seen here. My limited understanding of credit card fraud is that it normally involves purchasing a physical product, and then selling, or just using that product.

This form of monetizing fraud seems different, since presumably there’s no physical product you’re ordering from the NY Department of State. How does this work? How would someone make a charge of over $200 to the New York Department of State and profit in some way from that?