Is there any good way of truncating text with plain HTML and CSS, so that dynamic content can fit in a fixed-width-and-height layout?
I've been truncating server-side by logical width (i.e. a blindly-guessed number of characters), but since a 'w' is wider than an 'i' this tends to be suboptimal, and also requires me to re-guess (and kee...
I have a table in a SQL Server 2005 Database that is used a lot. It has our product on hand availability information. We get updates every hour from our warehouse and for the past few years we've been running a routine that truncates the table and updates the information. This only takes a few seconds and has not been a problem, until no...
Hi,
I am trying to come up with an efficient method for truncating Ruby Time objects according to a given resolution.
class Time
def truncate resolution
t = to_a
case resolution
when :min
t[0] = 0
when :hour
t[0] = t[1] = 0
when :day
t[0] = t[1] = 0
t[2] = 1
when :month
t[0] ...
What's the best way to truncate a datetime value (as to remove hours minutes and seconds) in SQL Server 2008?
For example:
declare @SomeDate datetime = '2009-05-28 16:30:22'
select trunc_date(@SomeDate)
-----------------------
2009-05-28 00:00:00.000
Thanks
...
This should be a simple one, but my brains are a bit hazy today:
I have an NSString * myOldString = @"This is a string (and this part is between brackets)"
Now, I want to truncate the string in such a way, that basically everything between the brackets, including the brackets, is truncated.
More precisely: I don't care what is happen...
I'm looking for a query (or series of) to TRUNCATE all tables in my schema (which has a few hundred tables) EXCEPT for a 4 specific ones. How might I go about doing that? Thanks!
...
Hi, I've looked around but wasn't able to find what I was looking for. I'm looking for a way to automatically create short URLs displayed in the browser, not using a URL shortener. Basically I would like to re-create something like this:
idzr.org/1ptb
I upload screenshots to my server with "GrabUp" on a regular basis but it creates r...
How can truncate an input like 315.15321531321
I want to truncate all the values after the hundredths position so it becomes 315.15
how do i do that?
...
For example, I might want to:
tail -f logfile | grep org.springframework | <command to remove first N characters>
I was thinking that 'tr' might have the ability to do this but I'm not sure.
Thanks in advance stackoverflow geniuses!
--
LES
...
A 'truncate words' would take a string of words and return only the first, let's say, 10 words.
In dojo (javascript library) they have such a function, whose code is this:
truncatewords: function(value, arg){
// summary: Truncates a string after a certain number of words
// arg: Integer
// Number of words to tru...
I have a process that's writing a lot of data to stdout, which I'm redirecting to a log file. I'd like to limit the size of the file by occasionally copying the current file to a new name and truncating it.
My usual techniques of truncating a file, like
cp /dev/null file
don't work, presumably because the process is using it.
Is th...
I am having problems running a query without either truncating the note field in NotesTbl or returning repeated entries.
UID is not unique for AccessTbl. When I leave out "distinct" notes will return multiple times because I am joining with AccessTbl on a non-distinct condition. When I use distict, the note field is trunctated because...
I would like to take the original URL, truncate the query string parameters, and return a cleaned up version of the URL. I would like it to occur across the whole application, so performing through the global.asax would be ideal. Also, I think a 301 redirect would be in order as well.
ie.
in: www.website.com/default.aspx?utm_source=twi...
Hi,
I've got truncated parameters when passing very long file paths. I need to start a program and pass it everything via command params - sometimes it just truncates the command. It does it globally - so it's not only a problem for each parameter but for whole.
edit:
The problem is probably the limit on the command line length as monk...
I am pulling timestamps from a file that I want to create a new DateTime for, but I want to create the DateTime at the floor of the hour (or any Joda Period will do).
How Can I do this?
...
What is the recommended way to truncate a table using hibernate/hql?
I've tried this:
Query query = session.createQuery("truncate table MyTable");
query.executeUpdate();
But it didn't work (truncate doesn't seem do be documented anywhere in hql...)
...
I wonder if there's a plugin to enable a sort of smart truncation. I need to truncate my text with a precision of a word or of a sentence.
For example:
Post.my_message.smart_truncate(
"Once upon a time in a world far far away. And they found that many people
were sleeping better.", :sentences => 1)
# => Once upon a time in a w...
I'd like to truncate a dynamically loaded string using straight javascript. It's a url, so there are no spaces, and I obviously don't care about word boundaries, just characters.
Here's what I got:
var pathname = document.referrer; //wont work if accessing file:// paths
document.getElementById("foo").innerHTML = "<a href='" + pathna...
Hi,
I have a user control in my asp.net web project.
It displays the title of a blog post. If the title is too long, it will stretch the wrapped table and ruin the page layout.
Is there a way I can chop the text after 40 characters IF the text doesn't contain a space in it?
How would I check for the existance of a space anywhere, an...
We are about to deploy some code that truncates tables in our mysql 4 database. We are doing this to get around some replication 'weirdness' that we are seeing (and is widely known) with temp tables. My knee-jerk reaction when I saw this in a code review was "no", but I'm having trouble backing it up.
So, the question is: am I just ov...