how to show two spaces at the end of a sentence (redux) - html

Ok, deep breath.
Suppose one is using a monospace font and has three requirements. This may or may not be wise; that's not what I'm asking.
Show two spaces at the end of each sentence in a web page, provided the sentence ends in midline.
But if the sentence ends in mid-paragraph but happens to approach the right margin, the final character (typically ".") should be able to nestle as close to that right margin as any other character in any other line. That is, carefully tweaking the window width while viewing the test results ought to be able to squeeze out any space following the pre-gap text.
Similarly, no extraneous space must be introduced after the line break.
To be able to justify the text is not a requirement.
A similar question has already been asked here. But that thread has two problems (for me):
It was rightly closed, because the discussion bogged down in whether the requirement was wise in the first place. I do not assert the wisdom of the above requirements; I simply ask the question.
The initiator did not seem to worry about requirement 2 above, so the discussion did not fully address it.
I have tried placing each of the following between two sentences. Each of them either did not fulfill one of the requirements, or completely failed to allow a line break between the two sentences. As you read this list, add semicolons where they seem appropriate; when I added them to the actual list, I got real spaces and stuff, not the names of the entities.
(space)(space)
&emsp&emsp
(space)&emsp
&emsp(space)
&ensp&ensp
(space)&ensp
&ensp(space)
&nbsp&nbsp
(space)&nbsp
&nbsp(space)
(space)(space-within-span)
(space-within-span)(space)
(space-within-span)(space-within-span)
In addition, I tried the white-space: pre-wrap idea, which failed requirement 2.
What do you suggest? In my tests, the stylesheet is this:
P.intro
{
font-family: Courier, monospace;
}
P.prewrap
{
font-family: Courier, monospace;
white-space: pre-wrap;
}
... and the web page is this:
<HTML><HEAD>
<link rel="stylesheet" href="style.css">
</HEAD><BODY>
<P class=intro>
01 alpha spacespace omega spacespace<BR>
<BR>
02 alpha &emsp;&emsp;  omega &emsp;&emsp;<BR>
03 alpha space&emsp;  omega space&emsp;<BR>
04 alpha &emsp;space  omega &emsp;space<BR>
<BR>
05 alpha &ensp;&ensp;  omega &ensp;&ensp;<BR>
06 alpha space&ensp;  omega space&ensp;<BR>
07 alpha &ensp;space  omega &ensp;space<BR>
<BR>
08 alpha &nbsp;&nbsp; omega &nbsp;&nbsp;<BR>
09 alpha space&nbsp; omega space&nbsp;<BR>
10 alpha &nbsp;space omega &nbsp;space<BR>
<BR>
11 alpha space-spanspace <SPAN> </SPAN>omega space-spanspace<BR>
12 alpha spanspace-space<SPAN> </SPAN> omega spanspace-space<BR>
13 alpha spanspace-spanspace<SPAN> </SPAN><SPAN> </SPAN>omega spanspace-spanspace<BR>
<BR>
0 2 4 6 8 0 2 4 6 8 0 2 4 6 8 0 2 4 6 8 0 2 4 6 8 0 2 4 6 8 0 2
<BR>
01 3 5 7 9 1 3 5 7 9 1 3 5 7 9 1 3 5 7 9 1 3 5 7 9 1 3 5 7 9 1 3
</P>
<P class=prewrap>Lorem ipsum. Dolor sit amet.</P>
</BODY></HTML>

Include this in your css file:
SPAN.eos
{
word-spacing: 0.625em
}
Do this at the end of each midparagraph sentence:
finalword<SPAN class=eos>. B</SPAN>eginning

Related

altair bar chart text issue

this is my code ...please correct so that label will show correct count.
tool tip is showing correct count.
bars =alt.Chart(r).transform_fold(
['Reservation_count', 'ON_ACCOUNT'],
as_=['column', 'value']
).mark_bar().encode(
x='month:N',
y='value:Q',
color=alt.Color('column:N', scale=alt.Scale(range=["#f50520", "#bab6b7"])),
tooltip=alt.Tooltip(['ON_ACCOUNT','Reservation_count']),
)
text = bars.mark_text(
align='left',
color='black',
baseline='middle',
dx=0,dy=-8 # Nudges text to right so it doesn't appear on top of the bar
).encode(
text=alt.Text('ON_ACCOUNT:Q', format='.0f')
)
rule = alt.Chart(r).mark_rule(color='red').encode(
y='mean(Reservation_count):Q'
)
(bars+text+rule).properties(width=490,height=310)
below is my data:
month ON_ACCOUNT Reservation_count
0 1 22 134
1 2 32 137
2 3 22 135
3 4 21 113
4 5 18 120
5 6 17 90
6 7 26 83
7 8 11 86
8 9 11 102
9 10 2 68
please help me with this altair bar chart..two columns are there Reservation_count and ON_ACCOUNT LABEL IS showing the same number for both ...
Thanks
for example last bar showing 2,2 both labels it should be top 2 and bottom 68
The short version answer to your question is to use text=alt.Text('value:Q', format='.0f').
But there are a few more issues with your code:
You are expanding your text layer from the bar plot, which already has the color parameter set. This will ignore the color setting of the text layer.
You can use a data encoding free from any color specification. You can then use this encoding to build your bar and text layers with their color settings.
I encountered the text ordering issue discussed here, and none of the given solutions worked out. However, changing the plot from vertical bar to horizontal bars seem to resolve the issue. This is potentially a bug.
Since you are plotting the mean of Reservation_count parameter on a stacked plot, the information might be misleading. I would suggest a layered bar instead of a stacked one. Surprisingly, this seems to solve the issue of text order.
Here is the code:
base =alt.Chart(r).transform_fold(
['Reservation_count', 'ON_ACCOUNT'],
as_=['column', 'value']
)
bars = base.mark_bar().encode(
x='month:N',
y=alt.X('value:Q', stack=None), # stack =None enables layered bar
color=alt.Color('column:N', scale=alt.Scale(range=["#f50520", "#bab6b7"])),
tooltip=alt.Tooltip(['ON_ACCOUNT','Reservation_count']),
#order=alt.Order('color_Category_sort_index:Q'),
)
text = base.mark_text(
align='center',
color='black',
baseline='middle',
dx=0,dy=-8, # Nudges text to right so it doesn't appear on top of the bar
#order=alt.Order('color_Category_sort_index:Q'),
).encode(
x='month:N',
y='value:Q',
text=alt.Text('value:Q', format='.0f')
)
rule = alt.Chart(r).mark_rule(color='red').encode(
y='mean(Reservation_count):Q'
)
(bars+text+rule).properties(width=490,height=310)

Sequence of content changed while using multiple columns css3 in safari

Kindly find my code here I got content sequence like as 1 3 2 4 in safari whereas it is fine in all other browsers.I used multiple column css3.
For example, I am having content as
சென்னை, மதுரை என 30-க்கும் மேற்பட்ட இடங்களில்
நடைபெற்ற
Below is my output (after column division) in chrome,firefox,ie,edge
1 2 3 4
சென்னை, மதுரை | என 30-க்கும் |மேற்பட்ட| இடங்களில்
In ipad safari and mac safari
1 3 2 4
சென்னை, மதுரை |இடங்களில்| என 30-க்கும்| மேற்பட்ட
Can anyone please help me to fix it.
Thanks

How to add a list in front of current list in Sublime Text

I need to add a list of names in front of a current list of number in sublime and having a hard time figuring out how to do it.
Basically if I have list 1
Tom
Jerry
Mary
Sue
and
12
34
45
39
I need the final text file to read
12 Tom
34 Jerry
45 Mary
39 Sue
I would do it by hand, but its around 800 entries each with about 25 sets of numbers after it.
Thanks!
select list 1
press Ctrl + Shift + L to split the selection into lines
cut the selected lines
select list 2
press Ctrl + Shift + L to split the selection into lines
press End to go to the end of each line & add a space character
paste the previously copied text
Note:
This only works if both selections have the same number of lines.

Report with combined fields

I need to create report to render like image below:
So, for each question, I have several answers (4 or 5 answers), and every question have belonging image.
DATASET:
QuestionId QuestionName Image AnswerId AnswerText
1 Question 1 Image 1 Answer 11
1 Question 1 Image 1 Answer 12
1 Question 1 Image 1 Answer 13
1 Question 2 Image 1 Answer 21
1 Question 2 Image 1 Answer 22
1 Question 2 Image 1 Answer 23
1 Question 3 Image 1 Answer 31
1 Question 3 Image 1 Answer 32
1 Question 3 Image 1 Answer 33
To do this I have made the following assumption
You want each Question Text to appear as a new question with it's own associated answers
I would implement this using a List in SSRS
Add a new List item, and set it's DataSetName to your Dataset. (I have also set the BorderStyle to Solid in the example below)
Right click the Row Header, and select Row Group -> Group Properties, then Group on QuestionName
Within the body of the list item, draw a textbox for the Question name, and Create a Placeholder in it with the value =Fields!QuestionName.Value
Add a new image box, and set it to use the image =Fields!Image.Value
Finally add a new table, and set the data to be =Fields!AnswerText.Value. (You may also want to remove the header row)
The final layout should be something like this
And when run will render as
Hopefully this is the sort of thing you are after. If not then let us know to provide further assistance.

Minimum expected length of a message

A bag contains 16 balls of following colors: 8 red, 4 blue, 2 green, 1 black and 1 white. Anisha picks a ball randomly from the bag and messages Babu its color using a string of zeros and ones. She replaces the ball in the bag and repeats this experiment many times. What is the minimum expected length of the message she has to convey to Babu per experiment?
(a)3/2
(b)log 5
(c)15/8
(d)31/16
(e)2
According to me, since the ball is taken out with replacement. At any time, there are 16 balls of 5 different colors in the bag. To encode 5 colors, ceiling of log5 (base 2) i.e. 3 bits should be needed but the answer given is (15/8). Can someone point out my mistake and provide some hint for the correct solution?
using static huffman compression you can encode the more common colours in fewer bits than the rare colours, that being the case on can expect that common colours will usually be chosen.
eg:
red 1
blue 01
green 001
white 0001
black 0000
on average from 16 draws there will be
8 reds = 8 bits
4 blues = 8 bits
2 greens = 6 bits
1 white = 4 bits
1 black = 4 bits
for a total of 30/16 bits on average
Your answer is right as the maximum value needed for encoding. But consider the following coding scheme 1 - red (1/2 prob), 01 - blue (1/4 prob), 00 - green (1/8 prob), 001 - black (1/16 prob), 000 - white (1/16 prob) multiply message length by probability and you should have 1 + 5/8 ( not 15/8 ... though)