textures – How to create a modular environment that doesn’t repeat itself?

I am creating a modular environment for a game so I have walls repeating quite often. What I want to achieve is to have the same walls with a different look, even though they are the same mesh sharing the same UV map. I took a screenshot of what I would like to achieve, the same walls repeating but with different stains across them. I should specify that I dont’ want to use unique materials but only tileable materials for optimization reasons.

enter image description here


I thought of using decals but i don’t like them too much, is there an alternative?

textures – How to create a modular enviroenment that doesn’t repeat itself?

I am creating a modular environment for a game so I have walls repeating quite often. What I want to achieve is to have the same walls with a different look, even though they are the same mesh sharing the same UV map. I took a screenshot of what I would like to achieve, the same walls repeating but with different stains across them. I should specify that I dont’ want to use unique materials but only tileable materials for optimization reasons.

enter image description here


I thought of using decals but i don’t like them too much, is there an alternative?

taproot – Why tagged hash repeat the tag twice?

I noticed that the hash message for the tagged hash in BIP340 is prefixed with SHA256(tag) || SHA256(tag), which also describes the reason

Because this is a 64-byte long context-specific constant and the SHA256 block size is also 64 bytes, optimized implementations are possible (identical to SHA256 itself, but with a modified initial state). Using SHA256 of the tag name itself is reasonably simple and efficient for implementations that don’t choose to use the optimization.

But I have some confusions

  1. “optimized implementations are possible”: What specifically is the optimization being talked about here, is it caused by the prefix being the same size as the block size of SHA-256? If so, can this conclusion be generalised to all block hashing algorithms? i.e. the same size of the prefix and the block of the algorithm can lead to optimization.
  2. “Using SHA256 of the tag name itself is reasonably simple and efficient for implementations that don’t choose to use the optimization.”: Does this mean that if the implementation does not intend to adopt optimization, then it can not repeat the tag? i.e. the tagged hash would be SHA256( SHA256(tag) || msg).

plotting – How can I ask Mathematica to repeat a part of the given plot over the domain?

Another way, adapting this:

periodify(list_List) := Append(list, First@list);
pf = Interpolation(
     Transpose@{#("Grid"), periodify@Most@#("ValuesOnGrid"), 
       periodify@Most@Derivative(1)(#)("ValuesOnGrid")}, 
     PeriodicInterpolation -> True) &(
   NDSolveValue({y''(x) == D((10 x^2 - 5 x + 2), {x, 2}), 
     y(0) == y(0.5) == 2}, y, {x, 0., 0.5}));
Plot(pf(x), {x, 0, 2.2}, PlotRange -> {1, 2.2}, 
 AspectRatio -> Automatic)

enter image description here

❕NEWS – Bitcoin’s price chart is becoming a repeat of the past price chart 2017? | Proxies-free

Earnings Disclaimer:  All the posts published herein are merely based on individual views, and they do not expressly or by implications represent those of Proxies-free or its owner. It is hereby made clear that Proxies-free does not endorse, support, adopt or vouch any views, programs and/or business opportunities posted herein. Proxies-free also does not give and/or offer any investment advice to any members and/or it’s readers. All members and readers are advised to independently consult their own consultants, lawyers and/or families before making any investment and/or business decisions. This forum is merely a place for general discussions. It is hereby agreed by all members and/or readers that Proxies-free is in no way responsible and/or liable for any damages and/or losses suffered by anyone of you.

The Don’t Repeat Yourself (DRY) principle in documentation

Dave Thomas, the author of the Don’t Repeat Yourself principle said:

DRY says that every piece of system knowledge should have one
authoritative, unambiguous representation. Every piece of knowledge in
the development of something should have a single representation. A
system’s knowledge is far broader than just its code. It refers to
database schemas, test plans, the build system, even documentation.

I have difficulty to understand how it applies to programming code documentation.

Java API has the java.util.Arrays class with the copyOf method that is overloaded 7 times. The 8 methods can be documented in two ways containing the same information. The first way describes all overloaded methods using a single description, highlighting the differences between overloads. The second way describes each overloaded method using a separate description. Below are both ways – I bolded the differences in the content. The second way was literally copied from the API documentation of the java.util.Arrays class. Is the second way compliant with the DRY principle? In my opinion it isn’t, because it contains text which was copied multiple times, then, additionally, minor modifications were made to each copy. The same information can be provided in one text, which is almost eight times shorter.

public static byte()    copyOf​(byte()    original, int newLength)
public static short()   copyOf​(short()   original, int newLength)
public static int()     copyOf​(int()     original, int newLength)
public static long()    copyOf​(long()    original, int newLength)
public static float()   copyOf​(float()   original, int newLength)
public static double()  copyOf​(double()  original, int newLength)
public static char()    copyOf​(char()    original, int newLength)
public static boolean() copyOf​(boolean() original, int newLength)

Copies the specified array, truncating or padding with the default values (if necessary) so the copy has the specified length. For all indices that are valid in both the original array and the copy, the two arrays will contain identical values. For any indices that are valid in the copy but not the original, the copy will contain the default value. Such indices will exist if and only if the specified length is greater than that of the original array.

The following table lists default values for given type of array elements:

type the default value of type
byte, short, int, long 0
float, double 0.0
char null character (‘u0000’)
boolean false

Parameters:

  • original – the array to be copied
  • newLength – the length of the copy to be returned

Returns: a copy of the original array, truncated or padded with the default values to obtain the specified length

Throws:

  • NegativeArraySizeException – if newLength is negative
  • NullPointerException – if original is null

Since: 1.6

public static byte() copyOf​(byte() original, int newLength)

Copies the specified array, truncating or padding with zeros (if necessary) so the copy has the specified length. For all indices that are valid in both the original array and the copy, the two arrays will contain identical values. For any indices that are valid in the copy but not the original, the copy will contain (byte)0. Such indices will exist if and only if the specified length is greater than that of the original array.

Parameters:

  • original – the array to be copied
  • newLength – the length of the copy to be returned

Returns: a copy of the original array, truncated or padded with zeros to obtain the specified length

Throws:

  • NegativeArraySizeException – if newLength is negative
  • NullPointerException – if original is null

Since: 1.6

public static short() copyOf​(short() original, int newLength)

Copies the specified array, truncating or padding with zeros (if necessary) so the copy has the specified length. For all indices that are valid in both the original array and the copy, the two arrays will contain identical values. For any indices that are valid in the copy but not the original, the copy will contain (short)0. Such indices will exist if and only if the specified length is greater than that of the original array.

Parameters:

  • original – the array to be copied
  • newLength – the length of the copy to be returned

Returns: a copy of the original array, truncated or padded with zeros to obtain the specified length

Throws:

  • NegativeArraySizeException – if newLength is negative
  • NullPointerException – if original is null

Since: 1.6

public static int() copyOf​(int() original, int newLength)

Copies the specified array, truncating or padding with zeros (if necessary) so the copy has the specified length. For all indices that are valid in both the original array and the copy, the two arrays will contain identical values. For any indices that are valid in the copy but not the original, the copy will contain 0. Such indices will exist if and only if the specified length is greater than that of the original array.

Parameters:

  • original – the array to be copied
  • newLength – the length of the copy to be returned

Returns: a copy of the original array, truncated or padded with zeros to obtain the specified length

Throws:

  • NegativeArraySizeException – if newLength is negative
  • NullPointerException – if original is null

Since: 1.6

public static long() copyOf​(long() original, int newLength)

Copies the specified array, truncating or padding with zeros (if necessary) so the copy has the specified length. For all indices that are valid in both the original array and the copy, the two arrays will contain identical values. For any indices that are valid in the copy but not the original, the copy will contain 0L. Such indices will exist if and only if the specified length is greater than that of the original array.

Parameters:

  • original – the array to be copied
  • newLength – the length of the copy to be returned

Returns: a copy of the original array, truncated or padded with zeros to obtain the specified length

Throws:

  • NegativeArraySizeException – if newLength is negative
  • NullPointerException – if original is null

Since: 1.6

public static char() copyOf​(char() original, int newLength)

Copies the specified array, truncating or padding with null characters (if necessary) so the copy has the specified length. For all indices that are valid in both the original array and the copy, the two arrays will contain identical values. For any indices that are valid in the copy but not the original, the copy will contain ‘u0000’. Such indices will exist if and only if the specified length is greater than that of the original array.

Parameters:

  • original – the array to be copied
  • newLength – the length of the copy to be returned

Returns: a copy of the original array, truncated or padded with null characters to obtain the specified length

Throws:

  • NegativeArraySizeException – if newLength is negative
  • NullPointerException – if original is null

Since: 1.6

public static float() copyOf​(float() original, int newLength)

Copies the specified array, truncating or padding with zeros (if necessary) so the copy has the specified length. For all indices that are valid in both the original array and the copy, the two arrays will contain identical values. For any indices that are valid in the copy but not the original, the copy will contain 0f. Such indices will exist if and only if the specified length is greater than that of the original array.

Parameters:

  • original – the array to be copied
  • newLength – the length of the copy to be returned

Returns: a copy of the original array, truncated or padded with zeros to obtain the specified length

Throws:

  • NegativeArraySizeException – if newLength is negative
  • NullPointerException – if original is null

Since: 1.6

public static double() copyOf​(double() original, int newLength)

Copies the specified array, truncating or padding with zeros (if necessary) so the copy has the specified length. For all indices that are valid in both the original array and the copy, the two arrays will contain identical values. For any indices that are valid in the copy but not the original, the copy will contain 0d. Such indices will exist if and only if the specified length is greater than that of the original array.

Parameters:

  • original – the array to be copied
  • newLength – the length of the copy to be returned

Returns: a copy of the original array, truncated or padded with zeros to obtain the specified length

Throws:

  • NegativeArraySizeException – if newLength is negative
  • NullPointerException – if original is null

Since: 1.6

public static boolean() copyOf​(boolean() original, int newLength)

Copies the specified array, truncating or padding with false (if necessary) so the copy has the specified length. For all indices that are valid in both the original array and the copy, the two arrays will contain identical values. For any indices that are valid in the copy but not the original, the copy will contain false. Such indices will exist if and only if the specified length is greater than that of the original array.

Parameters:

  • original – the array to be copied
  • newLength – the length of the copy to be returned

Returns: a copy of the original array, truncated or padded with false elements to obtain the specified length

Throws:

  • NegativeArraySizeException – if newLength is negative
  • NullPointerException – if original is null

Since: 1.6

google sheets – How to copy column but repeat cell content in new column

I stumped on how to copy a column with unique cell contents into another column but with repeated N entries of each row with Google Sheets.

In sheet 1:

A1:A

A2:AA

A3:AAC

A4:AACQ

A5:AAIC

A6:AAL

A7:AAN

A8:AAON

A9:AAP

A10:AAPL

A11:AAU

A12:AAWW

A13:ABB

This is what I did in sheet 2:

A1:=sheet1!A1 result is A (desired result)

A2:=sheet1!A1 result is A (desired result)

A3:=sheet1!A1 result is A (desired result)

A4:=sheet1!A2 result is AA (desired result)

A5:=sheet1!A2 result is AA (desired result)

A6:=sheet1!A2 result is AA (desired result)

I then highlight cells A1:A6 and drag down but my result is:

A1:A

A2:A

A3:A

A4:AA

A5:AA

A6:AA

A7:AAN =sheet1!A8 (want this to be =sheet1!A3)

A8:AAN =sheet1!A8 (want this to be =sheet1!A3)

A9:AAN =sheet1!A8 (want this to be =sheet1!A3)

A10:AAON =sheet1!A9 (want this to be =sheet1!A4)

A11:AAON =sheet1!A9 (want this to be =sheet1!A4)

A12:AAON =sheet1!A9 (want this to be =sheet1!A4)

A13:ABB =sheet1A14 (want this to be =sheet1!A5)

A14:ABB =sheet1!A14 (want this to be =sheet1!A5)

A15:ABB =sheet1!A14 (want this to be =sheet1!A5)

Is there a way to get my desired result without scripting?