Different behaviour in twig file when debug is true [on hold]

something weird is happening with my Drupal site. I have some content and display them in unformatted view-rows. I use the core twig theme views-view-unformatted.html.twig.


{# /**  * @file  * Theme override to display a view of unformatted rows.  *  * Available variables:  * - title: The title of this group of rows. May be empty.  * - rows: A list of the view's row items.  *   - attributes: The row's HTML attributes.  *   - content: The row's content.  * - view: The view object.  * - default_row_class: A flag indicating whether default classes should be  *   used on rows.  *  * @see template_preprocess_views_view_unformatted()  */ #} {% if title %}   <h3>{{ title }}</h3> {% endif %} {% for row in rows %}   {%     set row_classes = [       default_row_class ? 'views-row',     ]   %}   <div{{ row.attributes.addClass(row_classes) }}>     {{ row.content }}   </div> {% endfor %} 

When the twig.config debug is true there is the following normally situation:

Each row is separated each other. with debug true

When the twig.config debug is false there is the following weird situation:

Each row is one inside the other. with debug false

Lamda Behaviour

I am trying to convert a JSON file to CSV using Lamda. I am using Pandas for this operation. Initially I started with the following configuration :

File Size : 5 MB
Memory : 128

It took me around 5 seconds to complete the conversion.

Then I increased the file size to 10 MB, but there is a weird behavior. It will be great if someone could help me to understand this. Basically I am trying to benchmark this operation Sometimes the file is getting processed successfully and sometimes it is getting timeout with message

REPORT RequestId: 28e55591-e6a7-4344-b5bc-321bd03422b6 Duration: 900089.03 ms Billed Duration: 900000 ms Memory Size: 128 MB Max Memory Used: 129 MB  

It can be clearly seen that this a memory issue, but I am not able to understand the root cause. It will be great if someone could help me to understand this behavior.

Strange behaviour in darktable – image inconsistent

I have used darktable previously and this just started the other day.

I imported a raw image and when I change anything (exposure, contrast, etc) temporarily the preview I get from darkroom is what resembles to the jpg photo. If I zoom in and out the image goes back to raw…

This is very strange as I cannot see what is the effect of whatever module I change.

I am using darktable 2.6 on windows 10. I haven removed and installed darktable

C# Class for handling Player Movement and / or similar behaviour

I am currently developing a unity-based multiplatform game (PC, IOS, Android) in a small team. This is the code we have created for the Character Actions inside the game. I am looking for feedback on the code itself as well as tips on how some Unity features could be used better. This is my first time developing a game with Unity.

The Game is also aimed for Mobile platforms as state above, so tips on optimization are welcome.

using AI.Enemy; using UnityEngine;  namespace Player.Script.Miru {     public class MiruScript : MonoBehaviour     {     public float Health;     public float MoveSpeed;     public float JumpHeight;      public float EvadeSpeed;     public float DefendCooldownTimer;     public float NormalDamage;     public float Cooldown;     public float Stamina;     public float HealthRegenerationRate;     public float StaminaRegenerationRate;      private bool _IsFacingForward;     private bool _IsGrounded;     private Rigidbody2D _RigidBody;     private RaycastHit2D _GroundDetector;     private RaycastHit2D _RightRayCast;     private RaycastHit2D _LeftRayCast;     private MinionScript _MinionScript;      private void Start() //Temporary values     {         MoveSpeed = 4f * Time.deltaTime;         JumpHeight = 10f;         EvadeSpeed = 5f;         DefendCooldownTimer = 0f;         NormalDamage = 50f;         Cooldown = 1f;         Stamina = 100f;         Health = 100f;         HealthRegenerationRate = 0.5f;         StaminaRegenerationRate = 10f;         _RigidBody = GetComponent<Rigidbody2D>();         _MinionScript = GetComponent<MinionScript>();     }      private void Update()     {         MoveRight(MoveSpeed);         MoveLeft(MoveSpeed);         Jump(JumpHeight);         Evade(EvadeSpeed);         Attack(NormalDamage);         DistanceFromObject();         AttackCooldown();         Defend();     }      private bool AttackCooldown()     {         if (Cooldown < 1f)         {             Cooldown += Time.deltaTime;             return true;         }          return false;     }      public int DamageDealt(float _damageDealt)     {         Health -= _damageDealt;          if (Health <= 0)             Destroy(gameObject);          return 0;     }      private int DistanceFromObject()     {         _RightRayCast = Physics2D.Raycast(transform.position, Vector2.right);         _LeftRayCast = Physics2D.Raycast(transform.position, Vector2.left);          if (_RightRayCast.distance < 1.5f && _LeftRayCast.distance < 1.5f)             return 3;          if (_RightRayCast.distance < 1.5f)             return 1;          if (_LeftRayCast.distance < 1.5f)             return 2;          return 0;     }      private int Attack(float _damageDealt)     {         if (_IsFacingForward && Input.GetKeyDown(KeyCode.X) && _RightRayCast.distance <= 1.5f && !AttackCooldown())         {             _MinionScript = _RightRayCast.collider.gameObject.GetComponent<MinionScript>();             _MinionScript.DamageDealt(_damageDealt);             Cooldown = 0;             return 1;         }          if (_IsFacingForward == false && Input.GetKeyDown(KeyCode.X) && _LeftRayCast.distance <= 1.5f && !AttackCooldown())         {             _MinionScript = _LeftRayCast.collider.gameObject.GetComponent<MinionScript>();             _MinionScript.DamageDealt(_damageDealt);             Cooldown = 0;             return 2;         }          return 0;     }      private int MoveRight(float _moveSpeed)     {         if (Input.GetKey(KeyCode.RightArrow) && Defend() == 0)         {             transform.Translate(_moveSpeed, 0, 0);             _IsFacingForward = true;             return 1;         }          return 0;     }      private int MoveLeft(float _moveSpeed)     {         if (Input.GetKey(KeyCode.LeftArrow) && Defend() == 0)         {             transform.Translate(-_moveSpeed, 0, 0);             _IsFacingForward = false;             return 1;         }          return 0;     }      private int Jump(float _height)     {         _GroundDetector = Physics2D.Raycast(transform.position, Vector2.down);          if (Input.GetKeyDown(KeyCode.Z) && _IsGrounded)         {             _RigidBody.AddForce(Vector2.up * _height, ForceMode2D.Impulse);             return 1;         }          if (_GroundDetector.distance > 0.6f)         {             _IsGrounded = false;             return 2;         }          _IsGrounded = true;         return 0;     }      private int Evade(float _evadeSpeed)     {         if (Input.GetKeyDown(KeyCode.Space) && _IsGrounded)             switch (DistanceFromObject())             {                 case 1:                     _RigidBody.AddForce(Vector2.up * _evadeSpeed, ForceMode2D.Impulse);                     _RigidBody.AddForce(Vector2.left * _evadeSpeed, ForceMode2D.Impulse);                     return 1;                  case 2:                     _RigidBody.AddForce(Vector2.up * _evadeSpeed, ForceMode2D.Impulse);                     _RigidBody.AddForce(Vector2.right * _evadeSpeed, ForceMode2D.Impulse);                     return 2;                  case 3:                     _RigidBody.AddForce(Vector2.up * _evadeSpeed * 3, ForceMode2D.Impulse);                     return 3;             }          return 0;     }      private int Defend()     {         if (Input.GetKey(KeyCode.Space) && _IsGrounded)         {             DefendCooldownTimer += Time.deltaTime;             if (DefendCooldownTimer >= 0.5f)             {                 return 1;             }         }         else             DefendCooldownTimer = 0f;          return 0;     } } } 

Reference/Known results on the singular behaviour of the fibres of a holomorphic map between compact Kähler manifolds

I have been interested in the following situation of late: Let $ X$ and $ Y$ be compact Kähler manifolds with $ \dim_{\mathbb{C}}(Y) < \dim_{\mathbb{C}}(X)$ and let $ f : X \to Y$ be a surjective holomorphic map with connected fibres. Let $ S = \{ s_1, …, s_k \}$ denote the critical values of $ f$ , which is a subvariety of $ Y$ .

I cannot find a detailed account of how bad the singular behaviour of the fibres of $ f$ can be. For example, do the fibres contain $ (-1)$ curves (i.e., curves with self-intersection number $ -1$ ) or $ (-2)$ curves?

If anyone can provide references where I can get a better understanding of this, that would be tremendously appreciated.

What kind of lenses with a “slightly different diffraction behaviour” were used in “large format photography in the 1980s”?

Referring to an interview with a lens expert (Krolop&Gerst Objektivreihe 17/32), discussing diffraction limits.

“Es gibt ein paar Spezialobjektive die haben ein bisschen anderes Beugungsverhalten, aber da möcht ich echt nicht drauf eingehen, also dass ist Grossformatfotografie aus den achtziger Jahren”

“There are a few special lenses which have a slightly different diffraction behaviour, but I do not want to go further into this, since that is specific to large format photography from the 1980s.”

What is the expert referring to here?

How to share the same behaviour in different Classes?

I have a class called Process, which is extended by some different process types called ProcessA, ProcessB, …

class Process{}  class ProcessA extends Process{} class ProcessB extends Process{} //... class ProcessN extends Process{} 

There is also another class related to the data of A, but not the Process. I call it TempA

Now, ProcessA has a method called calculate(), TempA needs to be calculated in the same way as ProcessA as well. As ProcessA extends Process (and Java doesn’t allow multiple inheritance), I can’t make an abstract class like AbstractA and put calculate() method to make these two classes (ProcessA and TempA) have same calculation method.

So how do I make these two classes have the same calculation behaviour/method without copy/paste-duplication of methods?

Different behaviour of links in site navigation

I’m working on a website for an IT firm. It is mostly a single page website with only two exceptions (Careers, Data Privacy).

Is it considered bad practice to have a navigation bar where some of the entries jump to parts on the same page (like About Us, Products, …) while the two exceptions jump to a different page?

And if so, what would be a clean approach to separate the two?

Is the full behaviour of textboxes documented anywhere?

PC games often have to build their own UI widgets (buttons, input textboxes, etc). Fortunately it’s relatively trivial to write one’s own textbox from scratch given only a 2D drawing API and user-input event messages:

  • State:

    • Current text buffer
    • Textbox dimensions
    • Current caret location and current text selection range
    • Simple options, e.g. is read-only, etc
  • Render:

    • Draw rectangle (maybe with an inset border look)
    • Draw line of text from the internal buffer within the dimensions
    • Draw caret and/or text selection
  • User input:

    • On key-press:
      • If character key was pressed, insert that character into the buffer at the caret’s location (often just appending to the end)
      • If control key was pressed (e.g. backspace) then handle each control key appropriately
      • If arrow keys, then move the caret accordingly, including up/down for multi-line text-boxes
    • On key-down
      • If key held down for > 3 seconds then repeat key-press until key-up

So far, so simple.

But I noticed that many games and even business software using custom widget toolkits (thank you, WPF…) don’t match the full set of functionality provided by the Microsoft Windows’ User32 textbox (formally, the Edit Control).

Examples of this functionality missing from other implementations includes multiple keystroke (key-chord?) commands and various kinds of system integration for example:

  • Ctrl + Arrow-keys to move the caret to the next word-boundary
  • Shift + Arrow-keys for selection
  • Ctrl + Shift + Arrow-keys for selection to the next word-boundary
  • Built-in spell-checker with red-squiggle underlines
  • Right-click context menu
  • Ctrl+A to select all
  • Automatically opening the system’s on-screen keyboard when the control gains focus
  • “Tab” focus highlighting

But I noticed that these keystrokes and shortcuts are also accepted by other standard textboxes present in other platforms, sparing minor differences (e.g. on macOS it’s Alt+Arrow-keys to move between word-boundaries).

But it’s not just keystrokes, also consider things like rendering Unicode correctly as Unicode includes rules on text layout (e.g. Zalgo text via Combining Marks) – granted this is more to do with the text rendering library being used than the textbox itself.

So I was wondering if there exists something like an “ISO standard for input textboxes” or something similar that sets out all standard behaviour of a textbox so that developers of a new platform know exactly the functionality they need to implement to build something like that on other systems – without needing to go through proprietary, platform-specific documentation that may hide undocumented features. I note that the documentation for Win32’s Edit Control doesn’t go into details about the user-facing functionality (which is exactly what I’m talking about) because that’s something you’d read in the User Manual, not the programming reference – especially because the functionality of the Edit Control is improved and extended in future versions of Windows without the original hosting application’s developers needing to do anything.