samsung – Scale entire display down a couple pixels due to replacement screen?

I’m not familiar with Android Stack Exchange so apologies in advance if I am asking this in the wrong place or word something wrong.

Recently I replaced a damaged screen with a new one on my Samsung A8 2018. I noticed pretty quickly that the screen digitizer seems to go over the display itself by a couple pixels on both the top and the bottom. This is pretty annoying as it cuts off some of the information I need to read that is located there (such as notification bar).

I think that the solution to this would be to scale the screen down vertically just by a couple pixels on either end but do not know how to do this. I have tried this , but the scaling starts underneath the notification bar which does not help me. The phone is not rooted (but I do plan to root it in the near future so any solutions that involve rooting are still helpful) and I do use adb for super basic things once in a while.

Does anyone know of any apps or of an adb command that could scale down the entire length of the display and leaving the empty areas of the screen black?

replacement – Pattern matching involving a sum of wildcards

I am trying to implement the following substitution to an expression in Mathematica:

ti den(a-ti) -> -1 + a den(a-ti) 

where ti can be t1, t2, …, and den is an undefined function. The variable ti can also be a sum of t1, t2, …. The expression is part of a larger expression.

Now, it works when one variable is involved:

t1 den(s1 + s2 - t1) /. t_ den(q_ - t_) -> (-1 + q den(q - t))

returns

-1 + (s1 + s2) den(s1 + s2 - t1)

However, if ti is a sum of multiple terms, e.g. (t1-t2), the replacement breaks down. I’ve tried to implement a rule with the combination of ReplaceRepeated.

rule = {t_ den(q_ - t_) :> (-1 + q den(q - t))}
(t1 - t2) den(s1 - s12 + s2 - t1 + t2) //. rule

but that doesn’t seem to work, because it just returns

(t1 - t2) den(s1 - s12 + s2 - t1 + t2)

My guess is that Mathematica cannot recognize den(s1 - s12 + s2 - t1 + t2) as den(s1 - s12 + s2 - (t1 - t2)) and that my substitution rule is wrongly formulated.

Does anybody know how to fix this?

Replace Condition in Replacement Rules

In finding an answer to my other question, I’m finding myself needing to manipulate the conditions imposed on replacement rules, but this is proving to be a little difficult. In particular, how should I go about removing instances of Condition and PatternTest?

Using the code from my other answer (slightly adjusted):

f(x_?InexactNumberQ) := x^2;
g(x_) /; FooQ(x) := x^3;

Attributes(ExpandValues) = {HoldAll};
ExpandValues(symbol_) := Join @@ Through(
  {OwnValues, DownValues, UpValues, SubValues, DefaultValues, NValues}(symbol)
);
ExpandValues(symbol_, symbols__) := Join(ExpandValues(symbol), ExpandValues(symbols));

then the replacement rules that need to be modified are:

{
  HoldPattern(f((x_)?InexactNumberQ)) :> x^2,
  HoldPattern(g(x_) /; FooQ(x)) :> x^3
}

I would like these to be modified to not have any conditions on the arguments, but trying to replace the condition and pattern test is proving difficult. This for example does not work:

{
  HoldPattern(Condition(p_, q_)) :> p,
  HoldPattern(PatternTest(p_, q_)) :> p
}

I’ve also tried using Verbatim which the documentation suggests is useful to transform other transformation rules, but I have not gotten them to work. I’m also thinking that the use of Verbatim won’t work generally because it is too literal.

I’ve had partial success with

{
  Condition -> (#1 &),
  Patterntest -> (#1 &)
}

but when the replacement appears within a HoldPattern, the resulting rule after replacement does not work.

macbook pro – Fresh battery replacement already showing degradation

I have a 2019 MacBook Pro 15 inch running MacOS Catalina (10.15.6) which had the top case (battery) replaced in July 2020 due to significant battery degredation over the 1 year I had owned it. The battery health went from 100 % to 84% in just over 12 months.

Since having that replaced, I noticed that the battery health of the new battery had decreased from 100% to 89% over just 53 charge cycles. I called apple support since it still has apple care and they ran their diagnostics on it (Shut Down Mac, power on, hold option + D). The agent said the diagnostic report showed my battery was at 97% health which was within spec. I am just curious why system report would be saying my max charge capacity was at 6502/7336 (89%) yet his diagnostic (which apparently bypasses any operating system measurements) is saying 97%?

I thought this might be an SMC issue and reset that earlier this week but no improvements. Is there some other system that needs calibrating?

Replacement for _drush_file_private_path() in Drush 9

I’m trying to get File Permissions working in Drupal 8.9 with Drush 9. The old code calls _drush_file_private_path(), which doesn’t exist anymore, and _drush_file_public_path() is probably a no-go as well.

What is the proper way to do the following in Drush 9?

define('DS', DIRECTORY_SEPARATOR);

// Define default paths and variables.
$default = 'sites' . DS . 'default';
$private = $default . DS . 'private';
$files = $default . DS . 'files';
$directories = array();

// Check for Private Files subdirectory.
$private_directory = _drush_file_private_path();
if (empty($private_directory)) {
  $private_directory = $private;
}
$directories() = $private_directory;

// Check for Public Files subdirectory.
$public_directory = _drush_file_public_path();
if (empty($public_directory)) {
  $public_directory = $files;
}
$directories() = $public_directory;

8 – Replacement for Link Checker module in D8?

I have a client who is looking for the function provided by the Link Checker module, i.e. something that will scan for broken links. Link Checker doesn’t yet have a stable version for D8. The closest thing I’ve found is Node Link Report, which I am testing now, but the dearth of D8 options for this function is making me wonder whether I’m even going in the right direction. Is it more standard now to outsource this job to cloud-based tools? Or am I missing something entirely?

applications – Sony Xperia mail replacement

In the unified mail view for the sony xperia mail client, there is a small colored bar on the left hand side to show what address it was sent to. I have yet to find another client that allows me to distinguish the true address that easily.
What apps are on the market right now that offer this feature, now that my preferred app has been discontinued?
(It’d be great if it also had those horizontal bars between days of receipt :))

replacement – Problem with /. not assigning value

If I run:

NSolve(Sqrt(2)*Sqrt(x - Exp(x) + 10000) == 10, x)

{{x -> -9950.}, {x -> 9.20625}}

As expected. However to assign the values to x I tried running:

var1 = x /. (NSolve(Sqrt(2)*Sqrt(x - Exp(x) + 10000) == 10, x))

But there is no output, nor any error messages. I also tried running it without assigning it to var1 (ie just started at x/. …).

What am I doing wrong?

Thanks

Kevin