How to style the titles of archival articles … but only articles with comments?

How can I style the titles of archive articles only for articles that have comments?

style guide – Styleguides: In which category do the menus of the Ariane thread fall?

I'll put breadcrumbs as part of interactive user interface design in the category interaction, or even more deeply navigation. See rational explanation and overview of the example below:

Taxonomy of elements

All the elements contained in the style guide have their characteristics and their function. Some are characterized by static properties such as font and color. They serve a broad common purpose like corporate identity. Others are dynamic in nature and serve a dedicated use case like menu navigation or data entry via forms.

They have a scope ranging from common applicability to specific use cases. Size and typography can be commonly used in specific items such as buttons and titles.

Thus, a taxonomy or a schematic separation into categories depends on important characteristics or on a scope of use unique to your context.

An example of a plan

  • Visual styles: colors, fonts, sizes, spacing, logos, icons
  • Content items:
    • media (image, video, sound)
    • text (headers, body, footnotes)
  • Elements of interaction:
    • Navigation elements: menus, breadcrumb trail, links
    • Input elements: forms, fields, buttons

This taxonomy can be nested, because content items can use a defined visual style (font, spacing), or buttons or links (to unfold, jump).
On the other hand, different styles can apply to the interaction elements. For example, an Ariadne thread that has less spacing or a border of a different shape than that defined in the general visual style.

Important to note: interactive elements are not only characterized by their visual style, but also by a coherent and visually changing behavior depending on their state (for example, hover, click). This dynamic should also be covered by a style guide.

The structure depends on the use

There is no golden rule for describing or organizing user interface elements in a style guide. Rather, the structure depends on the target readers and their needs to use it:

As stated in the post from Toptal:

it is important to understand that there is no single approach

These tips suggest asking your style guide users about their tasks and needs. What are they looking for? How do they hope to be guided? What questions do they ask about user interface style and design?

The references

Integration ux – How to collaborate and define a new style guide for an existing business design?

As a naïve designer, I have a hard time defining a style guide. There is a style guide created with Adobe XD. As a team effort, we would like to improve and manage the style guide. A reasonable and productive solution is to use Frontify. Unfortunately, the company is running out of budget and we have to look for an alternative that can provide the same functionality as Frontify.

Anyone facing the same problem?

self-study – Is my teaching style sufficient to learn mathematics alone?

Just to simplify my request.

I started learning math at the age of 22 using textbooks without a teacher, essentially using a book pedagogy.

So I started with elementary math for college as preparation for my next 2 years of learning in maintenance of automated systems.

After having acquired some elementary notions of mathematics, I started my learning with real teachers. So I discovered new pedagogies from these teachers.

So my question is:

Can I continue to learn advanced mathematics on my own using these acquired pedagogies? I mean the teacher and the book.

shell – Linux console text editor with text selection with Windows / Mac style change arrow, cut, exit and save

I have a base of novice terminal users who need to make extremely light text changes from a console (creating git commits, etc.). I would like to set EDITOR to something that keyboard binding looks as much as possible to a standard "web browser text box" with ctrl-s and ctrl-q to save / exit.

I have tried jed, ne, joe, nano and micro, but none of them have all the features that I would like:

  1. Block selection: Shift-Arrow should expand the cursor in the appropriate direction to select a block, just like on Windows / Mac / Gnome / etc.
  2. Copy / Cut / Paste: Must be Ctrl-C, Ctrl-X, Ctrl-V
  3. Save: should be Ctrl-S
  4. Exit: should be Ctrl-Q

  5. Nice to have: an ncurses (ala ne) menu bar that appears when they press Esc

  6. Nice to have: Ctrl-F to find, Ctrl-G to find next

Any suggestion?

style – Alternative background color per line in a grid in the presence of SpanFromAbove

I have a few lines that I want to put in a Grid:

rows = {{a, "foo"}, {b, "bar"}, {c, SpanFromAbove}, 
  {d, "baz"}, {e, SpanFromAbove}, {f, SpanFromAbove}, 
  {g, "quux"}};

In order to make it easier to read, I want to use alternate background colors, which I have tried to do in the standard way:

Grid[rows, Alignment -> {{Automatic, Left}, Center}, 
 Background -> {Automatic, {{LightYellow, LightBlue}}}]

However, what I get is this ugly mess:

a nasty mess

What I want looks like this:

a less ugly mess

To achieve this, however, I had to resort to a rather complicated solution which explicitly inserts Items around the elements to color them.

Module[{except = Except[SpanFromAbove], 
  colors = {LightYellow, LightBlue}, split, item}, 

 split = SequenceCases[rows, 
    seq:{{_, except}, {_, SpanFromAbove}...} :> 
     Map[Replace[x:except :> item[x]], seq, {2}]]; 

 Grid[Catenate[MapThread[
     #1 /. item[x_] :> Item[x, Background -> #2] & , 
     {split, PadRight[{}, Length[split], colors]}]], 
   Alignment -> {{Automatic, Left}, Center}]]

I could probably make this a little less complicated with a little elbow grease, but it would be really nice if I could somehow tell the grill to have alternate colors based on groups of extended rows and let the hard work.

Is there a way to do this?

If not, is there a very simple way to get the Items where i want them to go?

coding style – Is it wrong to get out of a labeled block in Java?

I sometimes write Java code that looks like:

success: {
    fail: {
        if (...) break fail;
        // some code
        if (...) break fail;
        // some code
        if (...) break fail;
        // some code
        break success;
    }
    // failure handling code
}

Is it bad practice? I could extract this from a method that returns a Optional, and then call this method from the main method, but I'm afraid it will be bad for performance.

coding style – Python Scripts: using the class or not – which is the best practice?

I'm looking for the community (Python) opinion on style and maintainability. Please consider the sample script below declaratively solves a certain problem:

Script v1

def take_path_a(param_1, param_2):

    # the full implementation is irrelevant
    pass


def take_path_b(param_1, param_2):

    # the full implementation is irrelevant
    pass


def start(path_decision_factor_1, path_decision_factor_2):

    path_a_is_optimal = path_decision_factor_1 is "whatever"

    take_path_a(path_decision_factor_1, path_decision_factor_2) if path_a_is_optimal else take_path_b(path_decision_factor_1, path_decision_factor_2)


if __name__ == "__main__":

    start("param_1", "param_2")

The actual script which is modeled by the above example will ultimately deploy cloud resources with varying characteristics depending on which path is taken during script execution.

Questions:

  1. Is the above script readable?

  2. Where there is indeed no agreed style or paradigm, and considering that contributors have mentioned that there is no need to adhere to a particular style, I do so feel that the script would be significantly improved if wrapped in a class. Honestly, I usually feel comfortable with the lessons, but I also see that the design param_1 and param_2 because object states that can be shared between potentially more methods of the prospective class have more meaning or feel good. Are these perceptions not a valid reason to block the PR?

  3. Python is an object oriented language, is it a good practice to accept scripts that go beyond standards like the one above?

Here's how I would rather accept the script:

Script v2

class ActionTaker:

    def __init__(self, param_1, param_2):

        self.param_1 = param_1
        self.param_2 = param_2

    def _take_path_a(self):

        # the full implementation is irrelevant
        pass


    def _take_path_b(self):

        # the full implementation is irrelevant
        pass


    def start(self):

        if self.param_1 is "whatever":
            self._take_path_a()
        else:
            self._take_path_b()

if __name__ == "__main__":

    action_taker = new ActionTaker("param_1", "param_2")
    action_taker.start()

How can I convince a developer to stop writing with style Script v1 because it doesn't seem standard?

Create MacOS style screenshots with drop shadow using Imagemagick

How to add the drop shadow to an image with imagemagick to create the same effect as the screenshot on MacOS adds to the screenshots when the screenshot shadow is true?

The before and after photos should clarify the effect I am looking for.

Source image

Target image

r – Are there style guides with opinions on using the missing () function to detect optional arguments without failing?

I am personally opposed to the use of missing() to handle optional arguments (i.e. function(x) if(missing(x)) do_this() else do_that()).

It is opaque to the user, as it forces them to read the documentation or source code to find out what arguments are actually needed. It seems more advisable to declare the default values ​​and then manage them correctly (i.e. function(x = NULL) if(is.null(x)) do_this() else do_that()). However, neither tidyverse nor Google style guides mention this feature.

Is it because this opinion is so obvious, that it shouldn't need to be expressed, or because there are good reasons to use such a form?


To be clear, I used missing() multiple times in my code, usually when an optional argument can contain names that I want to evaluate in another context (i.e. passing unlisted data.frame column names). But even in such cases, I declare the argument with a defect cols = NULL. In such cases, I cannot use if (is.null(cols)) since this evaluates the argument (which if given does not exist in this context), so I am rather forced to use missing(). However, by setting a default value for the argument, it becomes clear to the user that it is optional.

I am asking here the specific case of not declaring a default value for an argument, then of using missing() to calmly handle the case where this argument is not given. So given that, are there any style guides with opinions on this issue?