Text comparison algorithm

Typically this is accomplished by finding the Longest Common Subsequence (commonly called the LCS problem). This is how tools like diff work. Of course, diff is a line-oriented tool, and it sounds like your needs are somewhat different. However, I’m assuming that you’ve already constructed some way to compare words and sentences.

jqgrid long text wrapping

In case of the test which you need to display has no blanks or other white-space you can’t use the CSS style described here and here. I would recommend you to use another CSS style: <style type=”text/css”> .ui-jqgrid tr.jqgrow td { word-wrap: break-word; /* IE 5.5+ and CSS3 */ white-space: pre-wrap; /* CSS3 */ white-space: … Read more

rotate x axis text in d3

If you set a transform of rotate(180), it rotates the element relative to the origin, not relative to the text anchor. So, if your text elements also have an x and y attribute set to position them, it’s quite likely that you’ve rotated the text off-screen. For example, if you tried, <text x=”200″ y=”100″ transform=”rotate(180)”>Hello!</text> … Read more

SVG: text inside rect

This is not possible. If you want to display text inside a rect element you should put them both in a group with the text element coming after the rect element ( so it appears on top ). <svg xmlns=”http://www.w3.org/2000/svg”> <g> <rect x=”0″ y=”0″ width=”100″ height=”100″ fill=”red”></rect> <text x=”0″ y=”50″ font-family=”Verdana” font-size=”35″ fill=”blue”>Hello</text> </g> </svg>