This is a simple javascript function that will take a string and truncate it based on the number of characters while taking words into consideration. Its a pretty easy way to implement a JavaScript Preview Text function.
function PreviewText(length, text) { //mmccann.com
text = String(text);
var result = " ";
var charcount = 0;
length = Number(length);
var tokens = text.split(" ");
for (var i =...
I ran into an issue with random number seeding in C#. I was trying to generate random numbers for a restful web service. C# was generating seeds that were creating a similar string of random numbers if you accessed it close together, it would seed the same way. I couldn’t increment the seed on each access [well, I could -- but that would be a lot of pointless overhead]. Instead I seeded...
Yeah. I’m not into Poetry, but I like this poem — and no, I didn’t realize that it was about that until I already liked it.
Goblin Market
by Christina Rosetti
(more…)
Recent Comments