What do “patterns, which separately match parts of a page” and “interactions between patterns” mean?

Database System Concepts says

Information extraction using simple patterns, which separately match parts of a page, is relatively error prone. Machine-learning techniques can perform much more sophisticated analysis, based on interactions between patterns, to minimize errors in the information extracted, while maximizing the amount of information extracted.

What do “patterns, which separately match parts of a page” and “interactions between patterns” respectively?

What design patterns are used to design software which are update-able, plugin-able, like adobe illustrator?

I want to know how to design software which have modules which can be enabled or disabled. I have been developing software like HRMS,etc, but my approach is mostly structural and just event driven code blocks. I want to learn how to write modular easily editable code. I have read the design patterns book but am confused as to which pattern should be used in which situation. Now i understand illustrator is mega complex but my question is regarding the modular design of the software not the specialized application of illustrator. You can replace illustrator with corel etc. but all of them have a contextual modular design. how do i begin to write some software like those?

Content system patterns repository

Does a pattern library for content systems exist?

I think that content systems for group interaction like wikis, forums (Reddit-styled or traditional), message feeds, chats (Slack), blogs, link directories (Yahoo/DMOZ), and Q&A’s (like StackExchange) are not fundamentally different from each other.

They can be modelled as composed of shared “classes” of objects (post, comments, likes, etc.) with various relationships connecting them.

Architecture + Design: design patterns to handle order processing

I apologise for the long post but I wanted to put as much detail into it as possible. I really want some constructive criticism on what I did here and what I could have done.

I recently had to refactor a process that was grossly flawed, I only had a little bit of time to spend on it and was never fully satisfied with the solution I came up with at the time.

It is an order processing system in which one table on its own server/database would serve as the source for “orders”, the order would subsequently be processed and then inserted into the destination table which is again in a different server/database.

enter image description here

The process in question is a C# windows service that utilises both Entity Framework and Reactive Extensions. To read in orders we use an EF context inside an observable that polls it for data in batches, the context is kept alive (I know this bad), subsequently we process the order then insert it into the destination table using a new context.

There is another observable that uses a context like previously described but for processed orders, the idea is that it helps build up an internal cache of processed orders.

During processing of new orders we first remove any that are included in the internal cache of processed orders, with the most minimal list we can have we then perform a check on a new context instance of processed orders to make sure we are not inserting duplicates, then the orders validated as new are inserted enter image description here The system processes around 200,000 orders a day, we can also have orders beyond the previous day so the process needs to be able to find new orders from the source table for some days behind, this can results of a collection of +1,000,000 orders.

To help with determining what order are new I added a new column and trigger to the table to indicate the order is “new”, when the order is processed inside the service we also update the source table, this insure we only receive new orders which helps the input from the source table.

It must be able to process orders in realtime as they are inserted into the source table, it also be able to process large amount of orders if there is backlog (think service died for 24 hours and orders piled up)

Possible patterns for Registering event listeners of game entities with an event queue

I’m trying to integrate the idea of an event queue with a game loop that creates entities and responds to input. Is it better practice to submit entity reaction functions to the queue during input processing, or is there a way to generically broadcast events like text submission to the event queue? What would the class structures of entity and event queue look like to support the latter?

Specifically I’m looking for a response that includes code (any language) or pseudo code. Similar answers lack the specificity I need to make sense of how fields on the structs or classes enable registration of listeners, broadcasting, and handling of events. pending function array approach

Function to extract float from different price patterns

I’ve got a project where I get product data and need to get the prices which come in, in different formats.

Some examples would be: US$ 17, USD17.00, 17,00€, 17€, GBP17, Only 17,-€, 17.000,00€, 17,000.00$ etc.

So at the beginning I started with one specific string to float function and kept on adding code for specific use cases. I’m sure the code looks horrible and I can see already ways to improve it, but I wanted to get your opinions in the first place.

def convertPriceIntoFloat ( myString ):     myString = myString.strip()      # 1.298,90 €     if "€" in myString and "." in myString and "," in myString:         myString = (myString.replace('€', '')).strip()         myString = (myString.replace('.', '')).strip()         float_price = float(myString.replace(',', '.'))         return(float_price)     if "€" in myString and "*" in myString and "ab" in myString:         myString = (myString.replace('€', '')).strip()         myString = (myString.replace('*', '')).strip()         myString = (myString.replace('ab', '')).strip()         float_price = float(myString.replace(',', '.'))         return(float_price)     if "€" in myString and "ab" in myString:         myString = (myString.replace('€', '')).strip()         myString = (myString.replace('ab', '')).strip()         if re.match('^\d{1,3}\.\d{3}\,\d{2}$  ', myString) is not None:             # thousand EURO or more             myString = (myString.replace('.', '')).strip()             float_price = float(myString.replace(',', '.'))         else:                 float_price = float(myString.replace(',', '.'))         return(float_price)      # 599,- €     if ",-" in myString and "€" in myString:         myString = (myString.replace('€', '')).strip()         myString = (myString.replace(',-', '.00')).strip()         if re.match('^\d{1,3}\.\d{3}\,\d{2}$  ', myString) is not None:             # thousand EURO or more             myString = (myString.replace('.', '')).strip()             float_price = float(myString.replace(',', '.'))         else:                 float_price = float(myString.replace(',', '.'))         return(float_price)      # ↵179,89 €↵*↵     if "€" in myString and "*" in myString:         myString = (myString.replace('€', '')).strip()         myString = (myString.replace('*', '')).strip()         if re.match('^\d{1,3}\.\d{3}\,\d{2}$  ', myString) is not None:             # thousand EURO or more             myString = (myString.replace('.', '')).strip()             float_price = float(myString.replace(',', '.'))         else:                 float_price = float(myString.replace(',', '.'))         return(float_price)      # ab 223,90 EUR     if "EUR" in myString and "ab" in myString:          myString = (myString.replace('EUR', '')).strip()         myString = (myString.replace('ab', '')).strip()         if re.match('^\d{1,3}\.\d{3}\,\d{2}$  ', myString) is not None:             # thousand EURO or more             myString = (myString.replace('.', '')).strip()             float_price = float(myString.replace(',', '.'))         else:                 float_price = float(myString.replace(',', '.'))         return(float_price)      if "EUR" in myString:          # GB Pound         myString = (myString.replace('EUR', '')).strip()         if re.match('^\d{1,3}\.\d{3}\,\d{2}$  ', myString) is not None:             # thousand EURO or more             myString = (myString.replace('.', '')).strip()             float_price = float(myString.replace(',', '.'))         else:                 float_price = float(myString.replace(',', '.'))         return(float_price)      if "CHF" in myString:          # CHF Schweiz         myString = (myString.replace('CHF', '')).strip()         if re.match('^\d{1,3}\.\d{3}\,\d{2}$  ', myString) is not None:             # thousand Franks or more             myString = (myString.replace('.', '')).strip()             float_price = float(myString.replace(',', '.'))         else:                 float_price = float(myString.replace(',', '.'))         return(float_price)      if re.match('^\d{1,3}\.\d{3}\,\d{2}$  ', myString) is not None:         # thousand EURO or more, coming in as a float already         myString = (myString.replace('.', '')).strip()         float_price = float(myString.replace(',', '.'))         return(float_price)      # 122,60 £     if "£" in myString:          # remove GB Pound sign         myString = (myString.replace('£', '')).strip()          if re.match('^\d{1,3}\.\d{3}\,\d{2}$  ', myString) is not None:             # thousand GB Pounds or more             myString = (myString.replace('.', '')).strip()             float_price = float(myString.replace(',', '.'))         # 122,60 £         if re.match('^\d{1,3}\,\d{2}$  ', myString) is not None:             #              myString = (myString.replace('.', '')).strip()             float_price = float(myString.replace(',', '.'))         return(float_price)     if  "$  " in myString:          # GB Pound         myString = (myString.replace('$  ', '')).strip()         float_price = float(myString.replace(',', ''))         return(float_price)     if ",-" in myString:          float_price = float(myString.replace(',-', '.00'))         return(float_price)     if re.match('^\d{1,3}\,\d{2}$  ', myString) is not None:         float_price = float(myString.replace(',', '.'))         return(float_price)     if " " in myString and "&#8364" in myString:         return ( getPriceFromCommaString ( myString ) )     # UVP: 44,95 EURO     if "UVP:" in myString and "EURO" in myString:         myString = (myString.replace('UVP:', '')).strip()         myString = (myString.replace('EURO', '')).strip()         float_price = float(myString.replace(',', '.'))         return(float_price)     # 22,99 €     # € 1.199,99     if "€" in myString:         myString = (myString.replace('€', '')).strip()         if re.match('^\d{1,3}\.\d{3}\,\d{2}$  ', myString) is not None:             # thousand EURO or more             myString = (myString.replace('.', '')).strip()             float_price = float(myString.replace(',', '.'))         else:                 float_price = float(myString.replace(',', '.'))         return(float_price)     else:         return(myString) 

If anybody knows a Python library that does the same thing, I’d be happy to flip as well.

Realistic channel noise patterns

I’m setting up a playful coding challenge for our programmers. It’s about coding theory. There are source, channel and sink. The task will be to implement an encoder for the source and a decoder for the sink. The encoded information will be transmitted over a channel with simulated garbling.

Now my question:

What common noise patterns do we encounter in real settings and how would their transformations look like?

What people talk about are for example:

  • band tapes (stressed at start and end)
  • defect memory (some bits are always off)
  • lightning strike
  • meteor shower

But they never mention how these patterns would look like.

Open and Close Signalr connections and performance patterns

I want to minimize the amount of connections I’m using with SignalR to reduce server resources and browser connection limit issues. Would it be a bad practice to always post requests to my rest api, but if the task is known to be a long running task, or a task which will want to communicate status changes over time, return a command to the web client that it should listen on a signalr connection, and then establish a signalr connection until the task completes?

My signalr backend is associated to the rest api through connection id to session id mappings and I can have the client re-use the same signalr connection if ones spawns multiple tasks and hold open until the last task completes.

I understand the type of traffic that uses these services will dictate how many sessions need the signalr connection at the same time, but if I know that say, only 30-40% of my traffic is going to use the long running / reporting type tasks, and maybe for only 30% of their sessions, is it worth the design in terms of performance to use some sort of on demand open/close pattern signalr/sockets vs a rest polling pattern?