How to use 2 variables for getStyle in Phpexcel - phpexcel

I am having trouble getting this to work, I think it is a pretty easy fix. The standard way of formatting your code is like
$spreadsheet->getActiveSheet()->getStyle('C3:C6')
However when I try to add a variable for each of the numbers I can not get it to work, here is what I have tried:
$spreadsheet->getActiveSheet()->getStyle('C'.$var1.':C'.$var2)
but this needs a trailing '
$spreadsheet->getActiveSheet()->getStyle('C'.$var1.':C'.$var2."'")
Also doesn't seem to work.

Related

How to bold mathematic symbol in plt.text($E_{m}$)?

I am having difficulty to bold the symbol in plt.text although i have tried using the method as \boldmath and weight="bold" but still cannot work. (Refer to the screenshot) Hence, I would like to seek you all advice on this.
I have tried using \boldmath and weight="bold" command and expect it works but end up did not work

When does pressing the Enter (Return) key matter when creating a regex matching expression?

I want to search for multiple codes appearing in a cell. There are so many codes that I'd like to write parts of the code in succeeding lines. For example, let's say I am looking for "^a11","^b12", "^c67$" or "^d13[[:blank:]]". I am using:
^a11|^b12|^c67$|^d13[[:blank:]]
This seems to work. Now, I tried:
^a11|^b12|
^c67$|^d13[[:blank:]]
That also seemed to work. However when I tried:
^a11|^b12|^c67$|
^d13[[:blank:]]
It did not count the last one.
Note that my code is wrapped into a function. So the above is an argument that I feed the function. I'm thinking that's the problem, but I still don't know why one truncation works while the other does not.
I realized the answer today. The problem is that since I am feeding the regex argument, it will count the next line in the succeeding code.
Thus, the code below was only "working" because ^c67$ is empty.
^a11|^b12|
^c67$|^d13[[:blank:]]
And the code below was not working because ^d13 is not empty but also this setup looks for (next line)^d13[[:blank:]] instead of just ^d13[[:blank:]]
^a11|^b12|^c67$|
^d13[[:blank:]]
So an inelegant fix is:
^a11|^b12|^c67$|
^nothinghere|^d13[[:blank:]]
This inserts a burner code that is empty which is affected by the line break.

How to preserve white space at the start of a line in .Rd documentation?

I need to indent some math stuff in the \details section of my .Rd documentation to enhance its readability. I am using mathjaxr. Is there any way to indent without installing roxygen2 or similar?
The math stuff is inline, so simply setting to display using \mjdeqn won't solve this.
I seem to have a reasonable "cheating" work around for indenting the first line using mathjaxr, at least for the PDF and HTML output.
We need to do two things:
Use the mathjax/LaTeX phantom command. phantom works by making a box of the size necessary to type-set whatever its argument is, but without actually type-setting anything in the box. For my purposes, if I want to indent, say, about 2 characters wide, I would start the line with a \mjeqn{\phantom{22}}{ } and following with my actual text, possibly including actual mathy bits. If I want an indent of, say, roughly 4 characters wide, I might use \mjeqn{\phantom{2222}}{ }.
Because mathjaxr has a problem with tacking on unsolicited new lines when starting a line with mjeqn, we need to prefix the use of phantom in 1 above with an empty bit of something non-mathjaxr-ish like \emph{}.
Putting it all together, I can indent by about 2 characters using something like this:
\emph{}\mjeqn{\phantom{22}}Here beginneth mine indented line…
I need to explore whether the { } business actually indents for ASCII output, or whether I might accomplish that using or some such.

Set decimal separator to dot in PHPExcel

I need to have a dot as decimal seperator for my currency values.
Unfortunately in my excel file, I keep getting a comma instead. I can't figure out how to fix this.
I have tried several ways to format the cells thanks to a couple of other similar posts on here, but the output is the same.
I am using this now:
$excel->getActiveSheet()->getStyle('F1:F'.$i)->getNumberFormat()->setFormatCode('0.00');
I had found a variable that returned the decimal character, but I can't find that anymore, sorry. I have been looking for so long, that I can't find that specific post anymore. It returned a dot. That is why it is so strange that I keep getting a comma in the generated excel file.
Also tried to force the locale to en_us. Even though it should already be that.
Does anyone have any idea what else I could be checking?

SQLite 3 substract in update query gives near "–": syntax error

I am trying to execute update query with subtraction inside:
UPDATE categories_ns
SET
nsright = nsright – 10
WHERE
nsright > 9
And I am getting [Err] 1 - near "–": syntax error.
Could you please help me to understand why its happens ?
Thanks!
And yet again someone is having issues with Unicode having so many similar symbols and some of them getting into code by accident.
– and - are different symbols. The former is not a valid minus, the latter is.
The difference in dashes' lengths is often unclear in many monospaced fonts. You can view your code in a non-monospaced one so the difference becomes obvious. But first and foremost, avoid copying code that may not be what it looks like.
Some document processors and websites out there, for instance:
Replace quotes with fancier ones (like ˝)
Replace << and >> with « and »
Replace a "minus" constructs like - with a proper dash (–, —?)
...all of which make sense for prose or poems, but not code.

Resources