How can we use signature pad in touchscreen? - digital-signature

We used signature pad when customer takes order then we take signature in signature pad, now it is working fine in desktop but not working in touchscreen. Just dot dot clicking.
So any one tell me how we can run it in touchscreen.
We used signature pad when customer takes order then we take signature in signature pad, now it is working fine in desktop but not working in touchscreen. Just dot dot clicking.
So any one tell me how we can run it in touchscreen.

Related

Extract information from a string - What technique in ML can solve

I would like to know what kind of technique in Machine Learning domain can solve the problem below? (For example: Classification, CNN, RNN, etc.)
Problem Description:
User would input a string, and I would like to decompose the string to get the information I want. For example:
User inputs "R21TCCCUSISS", and after code decomposing, then I got the information: "R21" is product type, "TCC" is batch number, "CUSISS" is the place of origin
User inputs "TT3SUAWXCCAT", and after code decomposing, then I got the information: "TT3S" is product type, "SUAW" is batch number, "X" is a wrong character that user input , and "CCAT" is the place of origin
There are not fix string length in product type, batch number, and place of origin. Like product type may be "R21" or "TT3S", meaning that product type may comprise 2 or 3 character.
Also sometimes the string may contain wrong input information, like the "X" in example 2 shown above.
I’ve tried to find related solution, but what I got the most related is this one: https://github.com/philipperemy/Stanford-NER-Python
However, the string I got is not a sentence. A sentence comprises spaces & grammar, but the string I got doesn’t fit this situation.
Your problem is not reasonnably solved with any ML since you have a defined list of product type etc, since there may not be any actual simple logic, and since typically you are never working in the continuum (vector space etc). The purpose of ML is to build a regression function from few pieces of data and hope/expect a good generalisation (the regression fits all the unseen examples, past present and future).
Basically you are trying to reverse engineer the input grammar and generation (which was done by an algorithm, including possibly a random number generator). But in order to assert that your classifier function is working properly you need all your data to be also groundtruth, which breaks the ML principle.
You want to list all your list of defined product types (ground truth), and scatter bits of your input (with or without a regex pattern) into different types (batch number, place of origin). The "learning" is actually building a function (or few, one per type), element by element, which is filling a map (c++) or a dictionary (c#), and using it to parse the input.

Avoid impossible states with a data model for a card game in Haskell

I am trying to implement the Jass card game in Haskell and would like to make the game state as explicit as possible or avoiding impossible states with types.
The standard variant involves four players. The players opposite each other form a team.
In a game rounds are played until one team reaches the target score.
At the start of each round each player is dealt with 9 cards one player gets to choose the trump, and lead the first trick.
In a trick every player has to play one card. The cards are compared with respect to the leading suit and trump and the player with the highest card wins the trick. The points of the tricks are added to the score of the winner's team. The winner also is lead on the next trick. In a round tricks are played until each player has no cards left.
There is a more detailed explanation on wikipedia and a german explanation on jassa.at.
My data model for the player looks something like this
data Player = Player
{ playerID :: PlayerID
, name :: String
, cards :: Set Card
, sendMessage :: Message -> IO ()
, receiveAction :: IO Action
}
this way I can just use different send and receive functions for like command line or network players.
I would like the represent the game as a state machine with a pure update function, however in most states there is only one action from only one player that is valid and so i think that in the update function a big part is just handling invalid inputs.
I don't know what would be the best way to represent these parts of the game state.
The Players.
My first idea was to use a simple list and rotate this list every time so the current player is always the head. This is easy to do, but i also think it's easy for something to go wrong, like what if the list is empty, or there is only one player and so on...
Use an Array for the players and use the index for the current player. This has the advantage that to get to the next player I just have to increase the index. Somewhere i have to use mod to cycle the array but that's not really a problem. I also tried this with XDataKinds to have the size of the array on the type level and so the nextPlayer function can handel the mod. This also has the advantage that for the teams I can just use the even and odd player indices. But with this i have to store a extra Map from playerID or index to the cards of the players. So now the array and map can get out of sync.
Trick
I am not sure if i should store a list of played cards and who played them or just a record with the lead, highest card, winner and the value of the played cards and keep track of all played cards in a writer monad.
Rounds and Tricks
This is kinda the same for both, should i store a list with all played rounds and tricks or only the current round and trick and save the sum of the points from the previous rounds/tricks
There is temptation to have the type checker prove your program is perfect. However, that will become an endless pursuit. There really are not the hours in the day to spend teaching a computer how to be sure what you're sure is sure is for sure for every surety.
What I do is start with some way of solving the problem and then learn as I go what the pain points are. Which mistakes am I actually prone to making? In your case, I would implement the game (or part of) in some way I can figure out, and then from that experience I will know how to do it better.
cycle :: [a] -> [a] takes a list and repeats it forever. You can do this for your players and take the head of the list forever.
For non-empty lists there is Data.List.NonEmpty.
A way to only construct valid game states is to define an abstract data type. Rather than exporting the data constructors for a type, you only export functions of your own definition which can construct the type. That way, you can do whatever (runtime) checking or fixing you want.
Another tool is unit testing. Encoding propositions as types is difficult, especially in Haskell, and so the vast majority will not be. Instead, you can use property-based unit testing to recover a modicum of assurance.

How can I obtain device context (DC) in wxHaskell?

I am using wxHaskell to display GUI of simple Haskell game.
I have a problem: I am writing GUI part of the simple game. When game state is updated one of the functions of GUI module is being invoked and new game state parameters are passed. The gui must be updated now. GUI is few rectangles, update of GUI is simply draw some new rectangles over the old ones.
However, to draw the rectangle I need to pass the device context DC as an argument. First painting of the board is done as a result of "on paint" event generated by the panel that contains my rectangles. On Paint handler must have signature:
DC a -> Rect -> IO ()
When the event occurs the dc is passed and board is displayed.
My question: how can I obtain the DC?
Or alternate question: if event handler requires specific signature - how can I pass additional arguments to the handler?
Have a look at the function repaint :: w -> IO (). You pass in the frame/panel you want to get repainted and don´t need the dc. I found the function via the following pdf. Very good wx tutorial. The author is building a simple game as well. Might be helpful. http://web.archive.org/web/20120211184204/http://legacy.cs.uu.nl/daan/download/papers/wxhaskell.pdf

numeric field accepting character in cics map

can anyone suggest me how to do numeric data processing in cics? i have googled it already but still my concepts are not cleared. Can Any one share some link or any information related to the topic.
Thanks in advance
You cannot rely on the numeric attribute of a field in a BMS map to restrict input to just numeric digits...
Numeric-only
The effect of this designation depends on the keyboard type of the terminal. On a data entry keyboard, a numeric
shift occurs, so that the operator can key numbers without shifting.
On keyboards equipped with the “numeric lock” special feature, the
keyboard locks if the operator uses any key except one of the digits 0
through 9, a period (decimal point), a dash (minus sign) or the DUP
key. This prevents the operator from keying alphabetic data into the
field, although the receiving program must still inspect the entry to
ensure that it is a number of the form it expects. Without the numeric
lock feature, numeric-only allows any data into the field.
...as documented.
You must write code in your program to verify fields contain expected values.

how can I check if a specific mealy machine can generate a specific output?

if I have a mealy machine, and I have a large string, how can I check if the mealy machine can generate that string?
I thought about converting the mealy machine to a regexp, but I am not clear on how to do that either.
Thank you.
I would start at the end. Reverse all directions (yes, that means that a gate may now receive one value and output two), and use the string as input, in reverse order. whenever you reach some gate or black box element, you have it's output; figure out all possible inputs that would lead to that output, and continue going backwards non-deterministically.
If at the end of the string you reach some input (or a group of inputs), then that (or those) input is an input that produces the given string. Otherwise, the string isn't generate-able by that machine.
A different approach (sometimes simpler, sometimes not), would be to try and see what are all the strings that the machine generates, or try and find some attribute that all those strings must satisfy, and that the given string does not (e.g. if you don't know exactly what strings aer generated by the machine, but you know they all start with "A", and the given string doesn't).

Resources