Clarification question: When you press C-c C-c on the B block, what is sent to ChatGPT, only B or the whole previous conversation? If the latter, this would break Org Babel semantics. Not necessarily a dealbreaker, but something to be aware of.
It's the whole previous conversation prior to the top level headline containing the block.
Makes sense, I won't be changing it from the current way. I think chatgpt-shell works more idiomatically in the org way in that context so that can be an alternative for people who prefer the former variant.
Wait Im confused. Wouldnt the point of using the analytic approach be that i could start at any n besides 0? Because of course if im just taking the sums from 0 to n it'd be faster to do it the tail recursive way because thats just simple addition.
The post didn't go into this, but the sum has a lovely closed form as well. The sum of the (phi^n-psi^n) terms is the difference of two geometric series, so you can apply sum(r^i, i=0..n)=(r^(n+1)-1)/(r-1) to get a formula that evaluates the sum exactly.
That seems like a naming decision, I think it'd make more sense to have an equals selector than a not equals selector in objective c. Plus isEqualToString: is already part of NSString
Why does he use a vector for the C++ version, but an array for the java version. It seems like it'd be a lot more comparable to use an arraylist in java, (either that or just a standard array in C). Nonetheless, the having the time slowed by the call to cout has a pretty large effect as well. It seems like this was rather setup to favor the java version from the beginning
#+BEGIN_SRC ?
A
#+END_SRC
#+BEGIN_EXAMPLE
A-response
#+END_EXAMPLE
#+BEGIN_SRC ?
B
#+END_SRC
Where if you run Ctrl-c Ctrl-C on the block it sends the conversation to chatgpt:
User: A
Assistant: A-response
User: B
This enables notebook style development if you are tinkering with a prompt and want to see how the responses cascade based on further input.