Does bash reset SIG_IGN before executing something in Ubuntu 16.04?

I am using systemd version 229 on Ubuntu 16.04.5.

By default systemd sets IgnoreSIGPIPE to true. So this affects not only the program started by systemd itself but leaks into other child processes as well as discussed in this link.

Can someone let me know does /bin/bash in Ubuntu resets the SIG_IGN before executing anything as suggested as an answer in the above link?

Attention something went wrong – default view original state erorrs

Getting a lot of errors recently and finally found something in the logs but not able to solve it. Already saw other post with clearing the ui_bookmark table and changing FulltextFilter.php file but no result.

enter image description here

Terminated request GET x.hypernode.io/index.php?namespace=sales_order_view_rma_list_grid&search=&filters%5Bplaceholder%5D=true&paging%5BpageSize%5D=20&paging%5Bcurrent%5D=1&isAjax=true because client at 213.127.64.175 is already gone

Could someone help me in writing a list of outcomes on a d20 to show what happenes to a player when attempting something?

I am a new DM, just started getting into the world of D&D. I am confused with the outcomes of a d20. Example, A player roles a d20 to check out a stone carving in the wall, she roles a 4. What would happen with this result? Does she trip over? Does she lose his shoe? Does a Goblin jump out of a bush behind her? I dont know how to dictate d20 outcomes without a list. Could someone please help me with a list of outcomes? Any help will be greatly appreciated.

Something went wrong


Something went wrong If the problem persists, contact the site administrator and give them the information in Technical Details. Technical Details [SPLoaderError.loadComponentError]: ***Failed to load component “dbf30785-4408-4d27-8f13-5d3646cc2996” (ReactCrudWebPart). Original error: ***Failed to load URL ‘https://localhost:4321/lib/webparts/reactCrud/loc/en-us.js’ for resource ‘ReactCrudWebPartStrings’ in component ‘dbf30785-4408-4d27-8f13-5d3646cc2996’ (ReactCrudWebPart). There was a network problem. Make sure that you are running ‘gulp serve’ and you have run ‘gulp trust-dev-cert’.

***INNERERROR: ***Failed to load URL ‘https://localhost:4321/lib/webparts/reactCrud/loc/en-us.js’ for resource ‘ReactCrudWebPartStrings’ in component ‘dbf30785-4408-4d27-8f13-5d3646cc2996’ (ReactCrudWebPart). There was a network problem. Make sure that you are running ‘gulp serve’ and you have run ‘gulp trust-dev-cert’. ***CALLSTACK: Error    at t (https://spoprod-a.akamaihd.net/files/sp-client-prod_2019-06-28.010/sp-pages-assembly_en-us_58b7c40f4bd58ad5ab7bf6346056c4a9.js:45:29725)    at t (https://spoprod-a.akamaihd.net/files/sp-client-prod_2019-06-28.010/sp-pages-assembly_en-us_58b7c40f4bd58ad5ab7bf6346056c4a9.js:169:74245)    at e.buildErrorWithVerboseLog (https://spoprod-a.akamaihd.net/files/sp-client-prod_2019-06-28.010/sp-pages-assembly_en-us_58b7c40f4bd58ad5ab7bf6346056c4a9.js:169:86497)    at e.buildLoadComponentError (https://spoprod-a.akamaihd.net/files/sp-client-prod_2019-06-28.010/sp-pages-assembly_en-us_58b7c40f4bd58ad5ab7bf6346056c4a9.js:169:82522)    at Anonymous function (https://spoprod-a.akamaihd.net/files/sp-client-prod_2019-06-28.010/sp-pages-assembly_en-us_58b7c40f4bd58ad5ab7bf6346056c4a9.js:169:103919)

How can I represent something good for user and bad for the business in a graphical way?

I have this interface which is a stepper that asks user for several medical conditions. Based on the results, we have 2 final options:

  • if result are bad, user will benefit from the business’ service
  • if result are good, user won’t need the services

There is no complication at all in the algorithm, it’s quite straightforward

However, all screens for each step have graphics: mostly illustrations, but also some infographics. They add delight, information and hopefully will increase engagement -still untested, but I’m quite sure it will-.

The problem comes with the final screen when results are good. Client’s marketing department gave us the text, which starts as follows:

Thank you for your interest in XXXXXXXXX. Based on what you have told us, our program doesn’t seem appropriate for your condition at this time. (….)

Now, this is good news for the user or maybe bad: condition could be so bad user requires really expensive treatment, we recommend checking with a doctor at the bottom of the marketing messaging, but bad news for the business.

So my problem is: how can I conceptually represent something that is good for user (or maybe really bad!) and bad for the business without looking phony. I mean: business might be legitimally happy that the user is in good health, but it can’t be happy about losing business.

My approach right now is to end this screen with some abstract shapes, but I would like to know if there’s some kind of concept we can illustrate in order to keep the whole interface consistent

Data structure to know if something was calculated

There’s the typical interview question about how to create a distributed and scalable URL shortener. One of the issues is to know if a URL was shortened already or not. There’s a special data structure that tells you if no or maybe. So it can have negatives or false positives but at least you know it wasn’t calculated and you spare the visit do the database. The question is: what’s the name of that structure? I forgot it and searched a lot but can’t find it. Thanks!

Do stock image owners hide something in the image information (either in pixels or in exif info) to stop theft?

enter image description here

Please see the image. Is watermarked image of Shutterstock.

Now, if you reverse search (not this one) similar images from Shutterstock, in Google, you find high resolution images without watermark that are used by different websites for their designs.

Doubt 1: When you drop a similar image in Google image search, it fills the search text box automatically with a relevant text like this:

enter image description here

Where does this text come from? Is it hidden in pixels or image information? It exists even when you remove all image information and search again.

Doubt 2 (Actual query):

When I find the high resolution image as told above, open in Photoshop and export as new image (it removes all exif information), does Shutterstock still know that the image was actually downloaded from Shutterstock? I mean have they put something hidden in pixels/image itself?

A more simpler version of this question: If I have the image bought from Shutterstock, but I intentionally use the image downloaded from other sources, can Shutterstock identify that I’m not using the actually bought image?

PS: The intention of this question is not to support piracy or theft. I’m just curious. For professional use, we use paid images.

Using enum for singleton implementations to choose way of doing something

I have this service that reads emails from a mailbox as they come and I want to extract its contents in a map structure. For now I am interested only in the actual email (no images or attachments).

I started by using an enum when I wanted something simple and then extended the enum to implement an interface when I noticed that I needed some complexity and at the end because the method extracting the content was a few lines long and the enum was getting hard to read I extracted the implementation to their own interface implementations and just assigned an instance of each in the enum.

It doesn’t feel wrong, I actually think that this is what Spring looks like (very simply for conceptual purposes) when it creates singletons for autowiring but wanted to get an opinion by the community and if this is a valid approach, is there something I missed or something to consider

This is the interface of the extractor with a default method for something that is common to the implementations

public interface ContentExtractor {     Map<String, String> extract(Message mimeMessage) throws IOException, MessagingException;      default String extract(BodyPart bodyPart) {         try {             return (String)bodyPart.getContent();         }         catch (IOException | MessagingException e) {             LOGGER.warn("Couldn't cast part to a String. It's either a multipart body part or probably a content type that resolves to a stream.");             return null;         }     } } 

The abstract class for a base. I am actually divided on whether I need this, I don’t actually remember why I added it…

@Getter public abstract class MimeContentExtractor implements ContentExtractor {     private final String mimeType;     MimeContentExtractor(String mimeType) {this.mimeType = mimeType;}      static String getContentType(Part part) {         try {             return part.getContentType();         } catch (MessagingException e) {             LOGGER.warn("Couldn't get the content type of the part");             return "N/A";         }     } } 

The enum

@Getter public enum MimeType {     MULTIPART(new MultipartContentExtractor("multipart/")),     TEXT(new TextContentExtractor("text/plain")),     HTML(new TextContentExtractor("text/html"));      private final MimeContentExtractor contentExtractor;      MimeType(MimeContentExtractor contentExtractor) {         this.contentExtractor = contentExtractor;     }      public static Optional<MimeContentExtractor> getExtractor(Part part) {         return determineMimeType(part)                 .map(MimeType::getContentExtractor);     }      private static Optional<MimeType> determineMimeType(Part part) {         return Arrays.stream(values())                 .filter(ct -> ct.matchesContentType(part))                 .findFirst();     }      private boolean matchesContentType(Part part) {         try {             return part.getContentType().startsWith(getMimeType());         } catch (MessagingException e) {             LOGGER.warn("Failed to determine content type of {}", part);             return false;         }     }      public String getMimeType() {         return contentExtractor.getMimeType();     } } 

I have two implementations for content. The text/plain and text/html just override extract and return the content forcing it to be a string (Java mail, this is how it works) and the multipart/mixed is a bit more complex but basically goes through the parts, and uses the enum again to determine what extractor to use. For now it will recognise the text and use the aforementioned implementations.

public class MultipartContentExtractor extends MimeContentExtractor {     MultipartContentExtractor(String mimeType) {         super(mimeType);     }      @Override     public Map<String, String> extract(Message mimeMessage) throws IOException, MessagingException {         Multipart content = (Multipart)mimeMessage.getContent();         return extract(content);     }      private Map<String, String> extract(Multipart content) throws MessagingException {         int numberOfBodyParts = content.getCount();         LOGGER.info("The content has {} parts", numberOfBodyParts);          Map<String, String> bodyPartContents = new HashMap<>();         IntStream.range(0, numberOfBodyParts)                 .boxed()                 .peek(i -> LOGGER.info("Attempting to get body part {}", i))                 .map(wrapWithOptional(content::getBodyPart))                 .peek(bp -> LOGGER.info("Body part was {} retrieved", bp.isPresent() ? "" : "not"))                 .filter(Optional::isPresent)                 .map(Optional::get)                 .forEach(bodyPart -> {                     LOGGER.info("Content type of body part is {}", getContentType(bodyPart));                     MimeType.getExtractor(bodyPart)                             .ifPresent(ce -> bodyPartContents.put(ce.getMimeType(), ce.extract(bodyPart)));                 });         return unmodifiableMap(bodyPartContents);     } }  @Getter public class TextContentExtractor extends MimeContentExtractor {     TextContentExtractor(String mimeType) {         super(mimeType);     }      @Override     public Map<String, String> extract(Message mimeMessage) throws IOException, MessagingException {         return singletonMap(getMimeType(), (String)mimeMessage.getContent());     } } 

Finally this is how it is used

@Component public class BackofficeMailProcessor implements Processor {     ...     @Override     public void process(Exchange exchange) {         MailMessage mailMessage = (MailMessage)exchange.getMessage();          Map<String, String> contents = getContents(mailMessage);         if (contents.isEmpty()) {             throw new BackofficeMailProcessorException("Couldn't get any of the contents of the email. Stopped processing!");         }         ...     }      private Map<String, String> getContents(MailMessage mailMessage) {         final Message mailMessageBody = mailMessage.getMessage();         Optional<MimeContentExtractor> extractor = MimeType.getExtractor(mailMessageBody);         if (extractor.isPresent()) {             try {                 return extractor.get().extract(mailMessageBody);             }             catch (IOException | MessagingException e) {                 LOGGER.error("Failed to extract contents of email", e);             }         }          return emptyMap();     }     ... } 

The fact that is an enum doesn’t make it optimal for unit testing. This is part of a larger project and I did something similar for extracting reply for different kind of email clients (yahoo, gmail, etc) but there I also made a factory where I used the enum in the supplier (not a static one) and wired the factory where I would use the Enum in the above example.