Correct sentence and paragraph casing - mysql

I have a database full of descriptions in all lower case. This doesn't look very nice. I am trying to figure out a way to correct the casing, ie., capitalize the first letter after every period, and after every Paragraph or new line. Something along the lines of,
UPDATE table_name SET description = REPLACE(description, '. a','. A')
but of course looping through all possible cases, etc.
EDIT: Here is an example.
I need to change,
this sentence needs to be properly capitalized. and this sentence too. there could be multiple sentences in this paragraph.
a new paragraph should be capitalized as well. so it looks nicer.
to this,
This sentence needs to be properly capitalized. And this sentence too. There could be multiple sentences in this paragraph.
A new paragraph should be capitalized as well. So it looks nicer.
Also, new lines are in the form of '\n'. I hope that clarifies things.

Related

What's the semantically correct way to represent one sentence that contains a multi-line quote?

I have a sentence which includes a quote of a multi-line poem. I'm wondering what's the correct way to express it in HTML.
Example
Yesterday the poem
Would it be ok if I took some of your time?
Would it be ok if I wrote you a rhyme?
kept bouncing in my head.
I believe this whole example should live in a <p> tag, since it wouldn't make sense to split "Yesterday the poem" or "kept bouncing in my head." away from the rest: they're not valid independently. The whole example together is one sentence.
For a poem represented this way I would normally use a <blockquote>. However you can't nest a blockquote inside a p, thus I need to change something.
What's the semantically correct way to represent my sentence?

HTML tag or technique like <wbr> but for a line break?

I often find I wish to control how a sentence breaks/wraps, e.g.:
Hello there Mr Nemesis X, welcome to the interwebs!
If the viewport is narrow, I would like it to wrap after the comma, so the two logical lines are together:
i.e. GOOD: Only if the viewport is too narrow to show the whole screen
Hello there Mr Nemesis X, |<----- viewport width
welcome to the interwebs!
BAD:
Hello there Mr Nemesis X, welcome to the |<----- viewport width
interwebs!
At the moment I place the two sentences in two <span>s, and use flex to ensure they wrap together, what a mission for something I often do. I learnt about <wbr>, which sounds like it could work if I replace all the spaces with say , but its not what it was defined for. Theres <br>, but that always breaks. So I am looking for something like a "line break", say <lbr> (doesnt exist), which if the line needs to wrap, it says hey, heres a good place to break the line.
You maybe can use \n after the coma.
The way your code is breaking right now is accurate to a break. The <wbr> is used to break a long word up hence why you would need to add that HTML entity to break up your lines.
For what I think you want, going for that specific design aesthetic, breaking at a comma, you would need to pre-process your strings before they get written, and as the view-port updates as to add breaks where you deem necessary.
You can use a <br> html tag to break a line!
Inserting the line break tag after the comma.
Or you can use the /n after the comma.

What is Run-level content in python-docx?

I am a bit confused about the concept of 'Run-level content' in python-docx.. I get that if I wanna check whether a paragraph is in bold or not, I need to check the run.bold, but what exactly is it?
The official definition is: A run is the object most closely associated with inline content; text, pictures, and other items that are flowed between the block-item boundaries within a paragraph.
So, is it singular character level content in the paragraph? am I missing anything here?
A simple way to understand a run in Word is a sequence of characters that all share the same character formatting.
So if you have a sentence like this and want a bold word to appear, you can't tell the sentence to be bold (that would bold too much) and you don't want to tell each individual character to be bold (that would bold too-little at a time).
So you group the characters into runs and apply character formatting to the run (and that is juuuust right :).
The example sentence would need three runs. One before the bold word, one for the bold word itself, and one for after the bold word. The middle run would be set bold; the other two would have no special formatting.
There are more things to know about runs, like they are subordinate to a paragraph (so the same run can't start in one paragraph and end in another), but this is the main gist of the concept.

What causes Zalgo text to do this?

Before jumping the gun on anything, yes, I have looked at this Q/A already.
I've recently discovered the Twitter user '#Glitchr_', and have been looking through some of his tweets and some of the "art" he makes. Something that caught my eye as I was scrolling down the page were these two things:
Now, you may think, wow, backwards text. The title must be formatted like that.
But if you look into the HTML, here's what you find (Highlighted Text):
The second thing I found was this:
Some of the zalgo text also messed up the dates and somehow reversed it as shown.
So as stated in the title, What causes Zalgo text to do this?
The text contains U+202E (RIGHT-TO-LEFT OVERRIDE), which indicates that the text should be rendered from right-to-left.
For example:
U+0041 U+0042 U+0043
ABC
U+202E U+0041 U+0042 U+0043
‮ABC
In this case, the character is in #glitchr_'s name: "Glitcher<U+0020><U+202E>".

Close tags dropping below highlighted line

I have minimal experience with HTML script so this may all go horribly wrong here.
Alright so I have a very simple yet very time consuming task of taking complete papers and converting them into HTML script. I'm using Sublime Text 3 with Emmet plugin.
Basically,
This is the first header
This is the first paragraph that needs to be tagged
This is the second header
This is the second paragraph that needs to be tagged
So super simple I need to put header tags on the headers and paragraph tags on the paragraphs.
What I have been doing is holding Ctrl and manually highlighting the desired text as it is all rather random. Problem is that takes forever to manually highlight the text like that.
I am aware of other ways to highlight such as Ctrl + L for the line. Problem is my close tags end up under the highlighted line.
Example:
<h2>This is the first header
</h2><p>This is the first paragraph that needs to be tagged
</p>
It's not a big deal but it makes the code harder to go through later and really chaotic.
The same problem persists if I click the corresponding number of the line.
Seeing as I have hundreds of pages to enter and even more headers, paragraphs, and pictures to properly tag; I'm looking for a solution to the tag dropping below the line or a faster method to entering text.
So, is there a fast method for entering text from a word document to Sublime text and quickly get the corresponding tags? e.g. <h2>,<h3>,<p>,<ul>,<li> and so on.
Any help will save my sanity, thanks.
When you select a line with CtrlL, it automatically selects the entire line, and moves the cursor down to the first position on the following line. There are two ways around this. The first is to place the cursor in the first position on the line you want to select, then just hit ShiftEnd and the line will be selected, with the cursor now sitting in the last position on that same line. Alternatively, use CtrlL, then hit Shift← (left arrow) to move the cursor from the first position on the next line to the last position on the selected line. Either way, you can now hit the key combo in Emmet for inserting a tag pair, and you're all set.