Search Results

Search found 1014 results on 41 pages for 'trim'.

Page 2/41 | < Previous Page | 1 2 3 4 5 6 7 8 9 10 11 12  | Next Page >

  • What's the best way to trim std::string

    - by Milan Babuškov
    I'm currently using the following code to right-trim all the std::strings in my programs: std::string s; s.erase(s.find_last_not_of(" \n\r\t")+1); It works fine, but I wonder if there are some end-cases where it might fail? Of course, answers with elegant alternatives and also left-trim solution are welcome.

    Read the article

  • How should I configure TRIM Support for LVM logical volumes?

    - by Zack Perry
    I am setting up a notebook for software demo purpose. The machine has a Intel Core i7 CPU, 8GB RAM, a 128GB SSD, and runs Ubuntu 12.04 LTS 64bit desktop. As it is, the SSD is configured to have a single volume group, with /boot, /swap, and / all in their respective logical volumes. They collectively consume 30GB space. I plan to use the remaining for logical volumes for KVM guests, all run Ubuntu 12.04 Server I would like to ensure that the SSD is utilized optimally. Although on this site, there are some great info about setting up TRIM support for file system setups that do not involve LVM, I have not found explicit guide regarding my planned setup. I did found this page which talks about adding issue_discards in /etc/lvm/lvm.conf. But in said file on my machine, I didn't find the cited content. I double-checked man lvm.conf(5), didn't see any mentioning of this option either. Thus, I'm not sure what to do. Furthermore, even say adding the option is the right thing to do, should I in my machine's /etc/fstab still add mount options such as noatime etc? Any tips, pointers, and/or further guidance are greatly appreciated.

    Read the article

  • Does having TRIM enabled affect other hard drives on a computer (and how do you know when Windows is using it)?

    - by Breakthrough
    I recently purchased a solid state drive (an OCZ Vertex 2 (80 GB)) to use as my primary operating system partition. I also have three other SATA hard drives of assorted sizes. I successfully installed Windows 7 Professional onto the SSD (works awesome, great response time and transfer rate), and used the other three HDDs for data storage. I was browsing through the Bible of OCZ SSDs, and noticed the following in Section 60-76 - Tweaks and TRIM: Q. How do I know if TRIM is enabled on my OCZ SSD? A. In Windows 7, go to start/run/cmd), type the following: fsutil.exe behaviour query DisableDeleteNotify It should respond back with: DisableDeleteNotify=0 if TRIM support is ready and active. If it's not, then type: fsutil.exe behavior set DisableDeleteNotify 0 After a bit of searching on Google, I found similar results elsewhere (set DisableDeleteNotify to 0, which makes sense since for TRIM to work, the solid-state drive needs to be notified when deletes occur (for the garbage collector) unlike a normal hard drive). When I run the query on fsutil, I get the following result: DisableDeleteNotify = 48 Following the instructions I found, I set this to 0 instead of 48. However, I am beginning to wonder. Is this all the proof I really need that the OS is using TRIM? Also, since this applies globally for the computer, is TRIM data being sent to the other hard drives connected to the computer? And if so, would this cause any degradation in disk performance?

    Read the article

  • Writing String.trim() in C

    - by Phoenix
    Hi guys, I was writing the String trim method in c and this is the code I came up with. I think it does the job of eliminating leading and trailing whitespaces however, I wish the code could be cleaner. Can you suggest improvements. void trim(char *String) { int i=0;j=0; char c,lastc; while(String[i]) { c=String[i]; if(c!=' ') { String[j]=c; j++; } else if(lastc!= ' ') { String[j]=c; j++; } lastc = c; i++; } Does this code look clean ??

    Read the article

  • Need Help on JavaScript to Trim

    - by MacpaLtd
    I am facing some problems with my server space. The images are using all the space from the server, making it slow. As it is an eCommerce website, it cannot be slow or we lose customers. If I have the following: SKU's : ABC123-001 > catName > Phone ABC753-851 > catName > MAC AT1233-098 > catName > PC How can I use trim to make it the following: SKU's : 123 > catName > Phone 753 > catName > MAC 1233 > catName > PC Which I would use in the following script: <script type="text/javascript"> $(function(){ var sku = $("#ProductBreadcrumb ul li:last").text(); $(".ProductThumbImage img").attr('src','http://img.example.com/images/'+catName+'/'+sku+'.jpg'); }); </script> So, basically, the output for the picture link would be: http://img.example.com/images/phone/123.jpg http://img.example.com/images/mac/753.jpg http://img.example.com/images/pc/1233.jpg So yeah, first problem I have to face is.. How can I trim it? I am not familiar with JavaScript so any help would be really appreciated :D

    Read the article

  • compare a string and trim in vb.net

    - by referr
    I have this string that shall come in from another file. The string has maximum length of 102 digits. I need to compare the string with numbers in a pair and delete those form that string. e.g - 6125223659587412563265... till 102 numbers that compare with this string- first set - 61 new string = 25223659587412563265 second set - 36 new string = 252259587412563265 and so on. the set of numbers shall go to maximum of 51 pairs = 102, which shall give an end result of string = "" How can i achieve this in a loop?

    Read the article

  • Trim characters from RSS feed

    - by egr103
    I'm calling in a RSS feed to my website using PHP. Currently my code below is calling in the entire contents for pubDate: <pubDate>Thu, 12 Sep 2013 07:23:59 +0000</pubDate> How do I just display the day and month from the above example i.e. 12 Sep? EDIT I should clarify, the above line of code is an example output I currently get but as I'm calling the latest 3 posts from an RSS feed, this date and time will vary. I therefore need the code to be more dynamic (if that's the right term!) This code is my full code that fetches the contents of an RSS feed: <?php $counter = 0; $xml=simplexml_load_file("http://tutorial.world.edu/feed/"); foreach ($xml->channel->item as $item) { $title = (string) $item->title; // Title Post $link = (string) $item->link; // Url Link $pubDate = (string) $item->pubDate; // date $description = (string) $item->description; //Description Post echo '<div class="display-rss-feed"><a href="'.$link.'" target="_blank" title="" >'.$title.' </a><br/><br/>'; echo $description.'<hr><p style="background-color:#e4f;">'.$pubDate.'</p></div>'; if($counter == 2 ) { break; } else { $counter++; } } ?>

    Read the article

  • Is TRIM supported on RAID 0 configurations for SSD drives in windows 7?

    - by John Sonmez
    I know this question has probably been asked at some point in the past, but I am trying to figure out if Windows 7 supports passing TRIM commands through RAID controllers yet. I am trying to decide between buying a single SSD drive and utilizing TRIM or Buying two SSD drives and putting them in RAID 0 configuration What is the fastest current configuration I can set up? I want my development machine to be BLAZING fast.

    Read the article

  • Possible to get SSD TRIM (discard) working on ext4 + LVM + software RAID in Linux?

    - by Don MacAskill
    We use RAID1+0 with md on Linux (currently 2.6.37) to create an md device, then use LVM to provide volume management on top of the device, and then use ext4 as our filesystem on the LVM volume groups. With SSDs as the drives, we'd like to see the TRIM commands propagate through the layers (ext4 - LVM - md - SSD) to the devices. It looks like recent 2.6.3x kernels have had a lot of new SSD-related TRIM support added, including lots more coverage of Device Mapper scenarios, but we still can't seem to get it to cascade down properly. Is this possible yet? If so, how? If not, is any progress being made?

    Read the article

  • Possible to get SSD TRIM (discard) working on ext4 + LVM + software RAID in Linux?

    - by Don MacAskill
    We use RAID1+0 with md on Linux (currently 2.6.37) to create an md device, then use LVM to provide volume management on top of the device, and then use ext4 as our filesystem on the LVM volume groups. With SSDs as the drives, we'd like to see the TRIM commands propagate through the layers (ext4 - LVM - md - SSD) to the devices. It looks like recent 2.6.3x kernels have had a lot of new SSD-related TRIM support added, including lots more coverage of Device Mapper scenarios, but we still can't seem to get it to cascade down properly. Is this possible yet? If so, how? If not, is any progress being made?

    Read the article

  • What is the recommended way to empty a SSD?

    - by Lekensteyn
    I've just received my new SSD since the old one died. This Intel 320 SSD supports TRIM. For testing purposes, my dealer put malware, err, Windows on it. I want to get rid of it and install Kubuntu on it. It does not have to be a "secure wipe", I just need the empty the disk in the mosy healthy way. I believe that dd if=/dev/zero of=/dev/sda just fills the blocks with zeroes and thereby taking another write (correct me if I'm wrong). I've seen the answer How to enable TRIM, but it looks like it's suited for clearing empty blocks, not wiping the disk. hdparm seems to be the program to do it, but I'm not sure if it clears the disk OR cleans empty blocks. From its manual page: --trim-sector-ranges For Solid State Drives (SSDs). EXCEPTIONALLY DANGEROUS. DO NOT USE THIS OPTION!! Tells the drive firmware to discard unneeded data sectors, destroying any data that may have been present within them. This makes those sectors available for immediate use by the firmware's garbage collection mechanism, to improve scheduling for wear-leveling of the flash media. This option expects one or more sector range pairs immediately after the option: an LBA starting address, a colon, and a sector count, with no intervening spaces. EXCEPTIONALLY DANGEROUS. DO NOT USE THIS OPTION!! E.g. hdparm --trim-sector-ranges 1000:4 7894:16 /dev/sdz How can I make all blocks appear as empty using TRIM?

    Read the article

  • How to install the TRIM RAID update for the Intel storage controller?

    - by Mike Pateras
    I just found this article, that says that Intel now supports TRIM for SSDs when the Intel storage controller is in RAID mode. It links to this download page. I'm pretty excited about that, but I'm a little confused. There seem to be two sets of drivers, an executable and something that's bootable. I ran the executable. Is that just to apply the drivers to my system now, and are the bootable drivers so that if I re-format, I won't have to re-run everything? Do I need to do both? And is there a way to check if it worked? I'm running an i7 in Windows 7 (ASUS P6T Deluxe Motherboard) with RAID 0, if that's significant.

    Read the article

  • SSD on Vmware ESXI 4 (TRIM? Good Idea?)

    - by nextgenneo
    Hi, I just posted about finding bottle necks and have narrowed it down to having way too many VMs on my machine on one 15K SAS drive. I have plenty of cores and plenty of ram. So I am planning on putting 6 VMs on one drive (so 5 drives for 30 VMs). I am thinking of using a 60GB Vertex 2 SSD. Each of my VMs will only need about 6GB of HDD space so this isn't a big deal. My questions are: does ESXI support Trim and do I really need it if I leave 25% of the drive as free space? If I need it should I get a diff drive that handles garbage collection differently? I have a RAID controller w/ write caching. I will still benefit from this? Will this effect my setup differently? Is there anything I need to consider regarding SSD's in virtualized environments. Thanks for any and all help!

    Read the article

  • Should a Trim method generally in the Data Access Layer or with in the Domain Layer?

    - by jpierson
    I'm dealing with a database that contains data with inconsistencies such as white leading and trailing white space. In general I see a lot of developers practice defensive coding by trimming almost all strings that come from the database that may have been entered by a user at some point. In my oppinoin it is better to do such formating before data is persisted so that it is done only once and then the data can be in a consistent and reliable state. Unfortunatley this is not the case however which leads me to the next best solution, using a Trim method. If I trim all data as part of my data access layer then I don't have to concern myself with defensive trimming within the business objects of my domain layer. If I instead put the trimming responsibility in my business objects, such as with set accessors of my C# properties, I should get the same net results however the trim will be operating on all values assigned to my business objects properties not just the ones that come from the inconsistent database. I guess as a somewhat philisophical question that may determine the answer I could ask "Should the domain later be responsible for defensive/coercive formatting of data?" Would it make sense to have a set accessor for a PhoneNumber property on a business object accept a unformatted or formatted string and then attempt to format it as required or should this responsibility be pushed to the presentation and data access layers leaving the domain layer more strict in the type of data that it will accept? I think this may be the more fundamental question. Update: Below are a few links that I thought I should share about the topic of data cleansing. Information service patterns, Part 3: Data cleansing pattern LINQ to SQL - Format a string before saving? How to trim values using Linq to Sql?

    Read the article

  • Run fstrim from LiveCD

    - by CharlesW
    A few years ago I installed Ubuntu 10.04 with LVM + LUKS on a system with SSD, TRIM was not enabled. Now I want to install Ubuntu 12.04 on the same SSD. I have found a guide explaining how to enable TRIM on Ubuntu 12.04 with LVM + LUKS, but before installing the new system, I want to clean out all the "marked for deletion" data generated under Ubuntu 10.04, to make the disk fast as new. My plan is to boot a Ubuntu 12.04 LiveCD and create a new ext4 filesystem on the SSD, then mount the filesystem and run fstrim on it. After rebooting the LiveCD I will install the system as normal, and enable TRIM. Can anybody say if this will work?

    Read the article

  • Hardware RAID Controller Support for SSD TRIM

    - by dss539
    Do any hardware RAID controllers available today support TRIM? If not, do any manufacturers have target dates for supporting TRIM? Should I even care about TRIM for SSDs installed in performance-sensitive workstations? Before you suggest it, yes software RAID would sidestep the issue, but my requirements do not allow software RAID. edit: The answer appears to be "no RAID controllers support TRIM" at the current date.

    Read the article

  • Installing Ubuntu via Wubi - about SSDs and HDDs

    - by A Person
    I read the question in regards to installing Ubuntu with Wubi on an SSD ( How do I enable Trim on an SSD in a Wubi install under Windows 7? ). My Windows installation is on an SSD (C: drive). My question is, if I choose to let Wubi install Ubuntu on my D: drive (HDD), thus creating the root.disk-file on D:, would I need to worry about TRIM in any way? I would assume not, but I just want to be sure.

    Read the article

< Previous Page | 1 2 3 4 5 6 7 8 9 10 11 12  | Next Page >