truncate

Using JavaScript to truncate text to a certain size (8 KB)

I'm using the Zemanta API, which accepts up to 8 KB of text per call. I'm extracting the text to send to Zemanta from Web pages using JavaScript, so I'm looking for a function that will truncate my text at exactly 8 KB. Zemanta should do this truncation on its own (i.e., if you send it a larger string), but I need to shuttle this text a...

ActiveMQ message content is truncated

We have an ActiveMQ topic into which a Java program inserts messages, where a C# client retrieves them. This has been working fine for a long time, with most of our messages around 1 - 2K. Recently we had a message closer to 10K (9,910 bytes); we take the message, wrap it with some XML, and send it to the topic. When the C# application ...

Truncate Table Within Transaction

Can the SQL "truncate table" command be used within a transaction? I am creating an app and my table has a ton of records. I want to delete all the records, but if the app fails I was to rollback my transaction. Deleting each record takes a very long time. I'm wondering if I use truncate table, can I still rollback the transaction an...

SQL Mass deletes

I'm trying to shrink some databases down so that my developers can load them to their local machines. I've identified several tables that hold historical data (10+ years worth) that would dramatically reduce the overall database size (50% or more) if I remove records older than X days. The delete statement that I'm using is demonstrate...

mysql insert nested select from other db truncates double values

I have a table in one database, call this db x. I have another database, call it y. I want to copy data from x.some_table to y.some_table. I don't want to do an exact copy of the table, because some columns don't make sense in database b. I use the following query: INSERT INTO y.some_table (a_field) SELECT a_field FROM x.some_table; a...

SQL rounding and truncation, needs a thorough explanation

Hello. I'm a novice when it comes to SQL and PHP, and I'm trying to round an average price result and take off the extra zeroes that currently appear. Currently my result turns up as: $3.005000 My code currently reads as follows: $result = mysql_query("SELECT AVG(price) FROM milk WHERE price > 0 "); $row = mysql_fetch_row ($result); ...

Truncate string on whole words in .Net C#

Hi, I am trying to truncate some long text in C#, but I don't want my string to be cut off part way through a word. Does anyone have a function that I can use to truncate my string at the end of a word? E.g: "This was a long string..." Not: "This was a long st..." Thanks, Tim ...

How to truncate all user tables?

How can I truncate all user table in oracle? I have problem with tables constraints. ...

sqlite3 is chopping/cutting/truncating my text columns

I have values being cut off and would like to display the full values. Sqlite3 -column -header locations.dbs " select n.namelist, f.state, t.state from names n left join locations l on l.id = n.id left join statenames f on f.st = l.st left join statenames t on t.st = l.stto where n.timing > 200601 and count(n.timing)<=15" Which gives ...

Truncating a placeholder and appending 3 dots (...)

I have a requirement to add serveral images to an asp:placeholder control on a webpage. The added images are displayed one after the other across the page. However if the browser is resized by the user and the width is less than the overall length of the added images then the placeholder should be truncated and 3 dots added to the end ...

SQL Server - bulk delete (truncate vs delete)

Hello folks, We have a table with a 150+million records. We need to clear/delete all rows. Delete operation would take forever due to it writing to the t-logs and we cannot change our recovery model for the whole DB. We have tested the truncate table option. What we realized that truncate deallocates pages from the table, and if I am...

How to left/right truncate numbers without strings (Euler #37)

As stated in problem 37 at Project Euler: The number 3797 has an interesting property. Being prime itself, it is possible to continuously remove digits from left to right, and remain prime at each stage: 3797, 797, 97, and 7. Similarly we can work from right to left: 3797, 379, 37, and 3. I already solved this problem (answer ends ...

How to find that the content is truncated?

I'm trying to build a blog app and the problem is when I use tag 'truncatewords_html' in my template to truncate posts longer than specified words, I need to link to complete post by some title like 'read more...' after truncation. So I should know that the post was truncated or not. P.S.: Is this a pythonic way to solve the problem? ...

Truncate a string with an ellipsis, making sure not to break any HTML entity

I have a database of items with XHTML content and I want to display the items with the HTML stripped off (done) and then truncate each item to a maximum length of 100 characters. If the string exceeds 100 characters, I cut it off and insert &hellip; (an ellipsis) at the end. The problem is that my program doesn't understand HTML entitie...

JQuery Truncate V2.3 issue

Hopefully this is a new question, if not, please point me to the answer. I am using jquery.truncate-2.3.js in a website. I am using the script to truncate/expand text in many stories, each in a div tag. The story text within the tags is coming from an RSS feed (using the RSSFeed ASP.NET server control), and dropped in like this: ...

Oracle truncate with / without drop storage

Tried to get a bit more info on this, but figured I'd just ask.... I attempted to perform a table truncate on Oracle 10g with the drop storage, however the results aren't entirely what I was expecting. Basically, the table in question had over 30 million records and over 3Gb allocated for it, but somehow the space allocated for it sti...

Scilab - limit to the number of digits

hello! my project is to create a program that will test whether a number is prime or not. the code is ready. but when i enter a 19 digit prime for example, the code immediately outputs "composite". i'm quite sure it is because it treats the last few digits of the number as zeroes. is there a way to store more than 16 digits in scilab? ...

Cocoa array to string truncated

I'm trying to join an array of objects into a string that will ultimately be used to populate the detail label of a table cell. if the text is too long it will automatcally truncate and add an elipse at the end. I want to avoid this by checking that the string is less than say 40 characters and adding an elipse in the middle instead. ...

jquery truncate plugin

Is there a jquery truncate plugin that doesn't have trouble with HTML in the content? For instance this plugin does not handle HTML well: http://www.reindel.com/truncate/ ...

Silverlight IsolatedStorage: Delete not working, Truncate leaving blank space

Hi, I'm using IsloatedStorage in a Silverlight app to log information on the client, and I added a function to clear the log file... However I have had problems with the two approaches I tried: Approach one: use IsolatedStorageFile.DeleteFile("log.log"); Result: This fails and returns an "[IsolatedStorage_DeleteFile]" error (No othe...