graphic user interface design: user interface to enlarge the image, which shows the following image

I have a website that shows items. Each element can have several images, but only one is displayed at a time, along with the text of the element. The user can click anywhere in an image to display the next image. You can touch, touch, touch all the images, while remaining in the element.

I also want to add an enlargement function that shows the full size image. Tap seems the obvious choice for this. Not sure how to fit everything? Swipe is to swipe through elements.

On tablets, there are thumbnails of each image, but I'm not sure I want to take up so much vertical space on the phone.

python: adapt the algorithm to the interface created in Tkinter

He developed this very simple algorithm that filters the answer by search term on the site


from bs4 import BeautifulSoup
import requests
import time

while True:

    buscar = input('33(6;32;1mDigite o Termo de Buscar:33(m ')
    print('Buscando Repostas ....')
    data = ({"operationName": "SearchQuery", "variables": {"query":buscar, "after": None, "first": 90},
         "query": "query SearchQuery($query: String!, $first: Int!, $after: ID) {n  questionSearch(query: $query, first: $first, after: $after) {n    countn    edges {n      node {n        idn        databaseIdn        author {n          idn          databaseIdn          isDeletedn          nickn          avatar {n            thumbnailUrln            __typenamen          }n          rank {n            namen            __typenamen          }n          __typenamen        }n        contentn        answers {n          nodes {n            thanksCountn            ratesCountn            ratingn            __typenamen          }n          hasVerifiedn          __typenamen        }n        __typenamen      }n      highlight {n        contentFragmentsn        __typenamen      }n      __typenamen    }n    __typenamen  }n}n"})
    r ="", json=data).json()

    for item in r(0)('data')('questionSearch')('edges'):

    for ele in p:
        r = requests.get(ele).text
        soup = BeautifulSoup(r,'html.parser')

        for n in soup.find_all('div', attrs={'class': 'brn-content-image'}):
            ty = (n.find('h1').text)
            print("33(37;31;1m(Title):33(m {0}".format(ty))

            for t in soup.find_all('div', attrs={'class': 'sg-text js-answer-content brn-rich-content'}):
                print("33(6;33;1mResposta: n 33(m{0}".format(u))

And to deal with this algorithm, I created a very basic interface made in Tkinter:

from tkinter import *
def resposta():
    b('text') = '  Aguarde! , Procurando Respostas ....  '
    b('fg') = 'green'
    b('bg') = 'white'
    b('font') = ('Verdana','9','bold')

i = Tk()

i.title('Respostas Brainly')

t = Label(i, text = 'Buscador de Respostas Brainly : ',fg = 'red', font = ('Arial','13','bold'),padx=0, pady=10)
e = Entry(i)
b =Button(i, text = '   Clique   ',font = ('Verdana','10','bold'), fg = 'grey', command = resposta,bg = 'black')

And I need my algorithm to interact with the interface:

Example: I write some search term in the field and activate the algorithm and print the answers on the interface screen. Tkinter.

How to pass in the console:

Design patterns – Composition of objects: how can I apply an interface to each component?

My goal was to be able to create an object that is composed of other objects without having to know in advance what these objects were, then make checks to see if they really exist, then add them to my collection and so on; Avoid all that scandal. And then, the Composite The pattern was born.

It occurred to me from here: to scale by inserting optional objects related to your collection

However, there is a problem that appears in this process: because it is PHP, I cannot imply that the members of an array must be of a certain type, ComposableInterface in my case.

My employer has achieved the "syntactic smoothness of sugar", even if I honestly believe that it is over-designed and its objectives were met:

  1. Point out to the outside world that it is dynamic: it is composed of a dynamic number of behaviors (objects).
  2. Facilitate the insertion so that you no longer have to name each component in the constructor, as well as add it manually as in my original question.

Each element that can be within a Composite it's called a Component and must respect the following interface:

interface ComposableInterface
    public function getComposableName();

We identify it by getComposableName. Now, who ingests all this Composableyes It is, as I said, the Composite:

interface CompositeInterface
    public function getComponents();

Let's build the Composite:

 * An object which can be composed of multipel behaviors.
class Composite implements CompositeInterface
     * @var array
    private $components = ();

    public function __construct( $components = () )
        foreach( $components as $component ) {
            $this->components($component->getComposableName()) = $component;

     * Retrieve the components.
     * @return array
    public function getComponents()
        return $this->components;

Let's try using it by first creating some Composables components / behaviors that our main object may have:

interface Style extends ComposableInterface{}
 * A component / behavior that can be part of a composite.
class StyleOne implements Style
    public function getComposableName()
        return 'style';

interface Markup extends ComposableInterface{}
 * A component / behavior that can be part of a composite.
class MarkupOne implements Markup
    public function getComposableName()
        return 'markup';

interface Categories extends ComposableInterface{}
 * A component / behavior that can be part of a composite.
class CategoriesOne implements Categories
    public function getComposableName()
        return 'categories';

Sweet, we have 3 our behaviors Composite may have, let's try to initialize it:

$composite = new Composite((
    new StyleOne,
    new MarkupOne,
    //new CategoriesOne -- not needed, but it can be added!

… and voila. In this way, we can eliminate or add as many behaviors as we want.

So what exactly did we do and are we over-engineering? I simply want to build a dynamic system (in the number of behaviors) that I can reuse and not have to verify if a Composable exists every time I have to work with a Composite object.

With that in mind, we completely avoid having to insinuate our possible components and we no longer have to manually verify whether Composable It exists, then get your name, then add it to our collection.

It looks cleaner. But he still has that problem. How can I tell the system that inside of me Composite, I want the array of arguments to be of type ComposableInterface without having to do a manual verification of each component that is passed?

What are the benefits of using the factory method pattern when the user interface is already sufficient?

I have the idea of ​​the factory method pattern, but I feel that it is not really necessary to use this pattern.

For example, below is a code I saw (C #) that uses the factory method:

public interface IAnimal
   void Speak();

public class Dog : IAnimal
   public void Speak()
      Console.WriteLine("Dog says: Bow-Wow.");

public class Tiger : IAnimal
   public void Speak()
      Console.WriteLine("Tiger says: Halum.");

public abstract class IAnimalFactory
   public abstract IAnimal CreateAnimal();

public class TigerFactory : IAnimalFactory
   public override IAnimal CreateAnimal()
      return new Tiger();

public class DogFactory : IAnimalFactory
   public override IAnimal CreateAnimal()
      return new Dog();

and the client can invoke:

IAnimalFactory tigerFactory = new TigerFactory();
IAnimal aTiger = tigerFactory.MakeAnimal();
aTiger.Speak();  //3 lines of code, plus needing of extra factory classes

But the customer can also do as:

IAnimal aTiger = new Tiger();
aTiger.Speak();  //only 2 lines of code

we can see that only 2 lines of code are needed, and we don't need to define factory classes.
So why do you take additional measures to define and use factories?

interface – Alternative to right-clicking on the mobile

I am working on a web application that is a recreation of a talent maker for a mobile game. It is a typical game talent tree, where you click to assign / delete points on a node, rinse and repeat to build the entire tree. In the example below, I have assigned 1 point to the previous node, and now when I mouse over the next node I get information about tools that indicates that I have assigned 0/3 to the suspended node (and some text description of the node)

enter the description of the image here

I have been testing this on the desktop and have implemented the left mouse click to assign a point, and the right mouse click to delete a point. All this works well and is quite intuitive.

The problem (s) I am encountering is how to handle the assignment / removal of points if the user loads the web page on a mobile device:

  1. There is no "scrolling" in the mobile. Scrolling actions occur when clicking, which means that the user will not see the tooltip before clicking (which currently also assigns a point)
  2. Clicking with the right button to remove a point is very cumbersome on the mobile, since it must touch and hold, which is not as intuitive or natural. This is the main problem that I want to solve

What would be a natural and intuitive way to assign / delete points to a node in a mobile environment and, at the same time, be able to display information about tools before any real assignment (i.e., the user must first be able to read and understand what they are about to assign a point)

A couple of important points:

  • I want to use the same method of assigning / deleting both on the desktop and on the mobile device, so any solution I can think of for the mobile environment should not be unnatural / not intuitive in a desktop environment when I use a real mouse
  • Since this is a recreation of a game that is already on mobile devices, it would make sense to imitate the behavior within the game as the solution. Nevertheless, the game doesn't really allow you to eliminate points. The only option they provide is a complete reset of the entire tree with a button, which is not a great design, but it is what it is.

The solution I have in mind is:

  1. Click to display tooltips
  2. Add Assign Y Remove buttons to the tooltip, which by clicking on the assign / delete point

This solution is not so good because, although it may make sense to mobile users, it adds an unnecessary step for desktop users. Is there a more elegant solution, besides dividing the functionality?

Is the Microsoft Ribbon user interface really that good, from a usability perspective?

In this response, I will only consider the ability to detect the characteristics and I will not discuss mere graphic design or aspects such as the size occupied (since they are very specific to the implementation).

In my opinion, there are two aspects in the ability to detect features:

The first is Discovery by the user without any external information: Simply by visually scanning a tape, one may or may not be able to recognize a particular feature. Without knowing on which tape a certain characteristic is placed, one has to change through each tab, just like what could be done with the menus.

A small disadvantage of the tapes in this regard could be that the buttons are "everywhere"; they come in different sizes and their design is (although rectangular), consequently "chaotic" (for example, take a look at the Slideshow group in this screenshot). This contrasts with the menus, which have two clear columns (one for the icons and one for the title of the command).

In addition, some of the icons in Ribbons lack the text, which is not useful if you are looking for a command and have a certain idea of ​​what it is called, but you have no idea what your icon would look like. In this way, commands can be hidden "with the naked eye" on tapes, which is never the case in menus.

The second aspect is User-based discovery based on instructions: In my opinion, this is where the tapes are incredibly weak compared to traditional menus.

The first problem in this regard is related to tapes that do not show any text for some of the commands. For a menu structure, textual instructions (in a tutorial website, in a book, in a chat window or spoken by phone …) can easily convey where to find a particular command in a menu (example found in many applications with this wording, although not necessarily MS Office): "Click Edit -> to import -> From the archive -> Via plugin. The same is rarely possible for tapes, as some icons do not show any text and texts are displayed in different locations. For an example, see the screenshot mentioned once again: some texts are to the right of the icons, some below, group headers are below, tape headers above.

Essentially, it is the same reason why, with traditional menus, such instructions generally refer to the menu instead of the toolbar.

In addition, in the menus, moving to the next hierarchy level is a simple activity that works in the same way at each hierarchy level: place the cursor over / click on a menu item and a nested submenu appears. In Ribbons, on the other hand, each level of hierarchy works differently. Sometimes it is a tab, sometimes a group (in the case of groups, no input is required, just visual scanning), sometimes you must click on a group's header to open the "group dialog box "(and even that is not uniform, since some groups do not have a dialog box and their headings cannot be clicked), sometimes, you must open a drop-down menu from a button, which makes the whole process very confusing.

P.S .: Many answers seem to confuse what is and what is not part of the "ribbon interface" as such. One of the most controversial properties that is often cited in the answers here and elsewhere seems to be the reorganization of a variety of options. Those who praise Ribbons sometimes praise them because they perceive that the grouping in Ribbons is more logical, while those who don't like Ribbons (and also those who talk about users who don't like Ribbons) often point out that users accustomed to the old menu structure are used to the above. command grouping and, therefore, gets upset because they have to relearn where to find the commands.

Nevertheless, that change simply coincided with the introduction of Ribbons in MS Office, it is not inherent to the ribbon interface. The same reorganization could have been carried out in the old menu structure.

The same applies to a reallocation of keyboard shortcuts. Some keyboard shortcuts for certain commands were changed at the same time as the tapes were introduced, but they could also have been changed at any other time. Again, different shortcuts are not an inherent feature of the user interface of the ribbon.

Thus, the commands are grouped in a more logical way Y users are reluctant to change and have to relearn they may be true and valid points, but they are not related to the user interface of the ribbon.

Prototype voice interface creation without the need to "click" or "keep" a microphone button

General sound – no, it won't work – it will react to any sound wave (conversation, impact, etc.)

For example:
You talk to coworkers and the interface is activated (when it shouldn't).

The specific voice command seems like a better solution, like "Hello Siri."

It is possible to work on a specific wave of voice (of the person) or sound.
(the interface can only react to the owner's voice tone)

Instagram works as you mentioned – after clicking and holding (2s)

enter the description of the image here

Of course, you can dial your voice interface:
enter the description of the image here

I want to create an instance of a game object that should be accelerated by clicking on a user interface button

(four buttons for each x / y direction) until it crashes and is destroyed.
I used "Player.cs" and "PlayerButton.cs" of the Hellium response in the following post

Unity3d Move player with UI buttons

It seems legitimate, but the method does not appear in onClick / EventTrigger in the inspector. I just changed Rigidbody to Rigidbody2D.
Thank you!

magento2.3 – How can you pass the default value for a text area in the Magento 2 user interface form component?

Is there a way to provide a dynamic default value for the textarea field in a user interface form?

I have a situation in which the default value can change. In this case, I was thinking that the value could be stored in a file that could be updated by hand when necessary. Then I would use a class to retrieve the contents of the file to use as the default value of the textarea field when a new record is displayed. If the value was updated, the updated value should be saved and displayed when editing the record.

Any thoughts on how to handle this requirement?

mojave – Assign a computer name to each network interface

Currently, my computer is connected to both the LAN interface and WiFi:

enter the description of the image here

but traffic is routed through the LAN.

My router has assigned each one an IP address:

enter the description of the image here

Why is the name of the computer associated (System Preferences> Share> Computer Name) with the WiFi (, instead of the LAN ( Does it have something to do with the remaining lease time?

Is there any way to create / assign a computer name for each interface?