Web Analytics

Technically Impossible

Lets look at the weak link in your statement. Anything "Technically Impossible" basically means we haven't figured out how yet.

Check the effective battery capacity on iPad - or as we say on the iPhone, battery health

Like iPhone, the iPad's battery also degrades over time.  Many users probably replace their iPhones every few years, but I think fewer users replace their iPads as frequently.  Furthermore, compared to iPhones, iPads are used for longer periods and more frequently, so users are likely more sensitive about the battery condition.

iPhones have a "Battery Health & Charging" feature*1, which displays the current effective battery capacity in "Maximum Capacity." For some reason, this feature is not provided on iPads.

Although it is not possible to use the same feature, there are ways to check the battery condition. This post will introduce how to check the iPad's effective battery capacity.

  • Acquiring Log Files
  • Viewing Log Files
  • Reference
  • Analytics-YYYY-MM-DD-######.ips.ca.synced
続きを読む

Memorization in F# - closures, thread-safety, and handling Multiple Arguments

A classic topic often mentioned along with recursive processing in F# is memoization.  A common discussion is about memoizing the function itself, rather than the process of calculating Fibonacci numbers.  Yesterday's topic *1 referred to the former. Today's topic is about the latter.

If you write code to calculate Fibonacci numbers straightforwardly according to the logic, the process will contain unnecessary duplicate calculations. By reusing the calculated results of Fibonacci numbers that have already been computed once, rather than recalculating them, the process can be made more efficient. This is memoization of the process.

Similarly, for functions that are called multiple times, efficiency can be improved by memoizing the output results of the function along with the combination of arguments at that time, and reusing them. This is function memoization, which is today's topic.

  • Function Memoization, Memoized Function
    • Closure
    • Thread Safety
    • Handling Multiple Arguments
  • Code
  • References
続きを読む

Fibonacci sequence in F# - recursion, memoized recursion, and tail recursion

Computing Fibonacci numbers is a classic example of recursive processing. As I mentioned previously *1, the logic inherently creates numerous redundant calculations. There are 2 typical approaches to efficiently handle these redundancies:

Memoization Cache previously calculated results
Tail recursion Optimization by the interpreter or compiler

The former works universally but is memory-inefficient due to caching. The latter depends not only on how the logic is written but also on the interpreter and compiler, so it's not universally applicable. However, it can provide better performance.

This is a common topic in programming languages, but specifically for F#, I couldn't find posts discussing memoization of the Fibonacci calculation itself. Most posts only mention general methods for memoizing functions.

In this post, I've summarized 3 approaches to calculating the nth Fibonacci number: standard recursion, memoized recursion, and tail recursion.

  • Standard Recursion
  • Memoized Recursion
  • Tail Recursion
  • Performance Comparison
  • Code
  • References
続きを読む