Software :: Set A Size String Format To Show That In Megabytes + "MB"?
May 13, 2011How to set a size string format so that it will show size in megabytes + "MB"?
For example not code...
How to set a size string format so that it will show size in megabytes + "MB"?
For example not code...
In C++ as subjected, can anyone throw me some light on how I can generic-ly format an integer value of 1 to a string value of 0001? 11 to 0011? and 111 to 0111? simply by just appending 0 in front and limiting the length of the string to 4?
View 4 Replies View RelatedI need to manually convert an string ( like with echo ) to a DES crypt format to be inserted inside a /etc/shadow file, does anybody knows how can I do that?
Maybe there are some little tool that could handle that operation, well.. I don't know, hope someone can give me a hint on that.
I am using C. I have a fuction that returns a string
Code:
I need to format this string so that I can create a text file like so:
So I'm trying:
Code:
But I get errors like:
trying to compile and install wxGTK-2.4.2,i configure with the line-./configure --with-gtk --enable-gtk2 --enable-unicode but when i go to make and make install i get the format not a string literal error, how can I fix this? really need wxGTK2.4 for some old apps.
View 1 Replies View RelatedI have here a Network Monitoring tool that should monitor the Apache (httpd) 2.0 on CentOS 4.3, but I didnt have any background in using linux, I tried CentOS 5.5 with Apache (httpd)2.2 and it works, but whenever I tried it on Centos 4.3, it doesnt work at all, it has an error Testing on node localhost.localdomain: failed with Undefined status, Script execution failed. Input string was not in a correct format.
View 10 Replies View RelatedI'm in the process of debugging and compiling about sixty FORTRAN 95 programs and could use a little bit of your help before my brain is fried and fingers are cramped. Thanks for your time!
I receive the following errors:
Here is my code:
I'm trying to split a string, to later iterate using a for loop like
Code:
for (( i=0; i<5; i++))
But, my script returns an array with the size 1.
Here's the script:
Code:
aver=$(grep "avg" A.txt | awk '{ print $2 }');
a=$(echo $aver | tr " " "
");
[Code]....
how I can format a drive to a different size to its original? I wanna create a partition table of 512 megabytes on my 1GB pendrive. So I want it to be seemed of 512MB drive by any partitioner programs.
View 10 Replies View Relatedcopy string a to string b and change string b with toupper() and count the chars
View 3 Replies View RelatedHere's the line from my fstab that auto mounts my NTFS Windows drive:
/dev/sda1 /media/disk ntfs-3g defaults,umask=007,gid=46,noatime 0 0
When writing to the drive the max speed I get is 5 megabytes per second. I Googled it and tried some other posted Fstab lines but all disabled my write access for some reason even without "RO" in the line. Can someone please give me some guidance as to how I get the normal Sata HD transfer speed which is more like 55-75 megs or more per second or so?
Code:
FILE_SIZE=`find /var/logs/ -type f -mtime +5 | wc -c`
im trying to convert FILE_SIZE into megabytes
[code]....
I was attempting to reformat a 16GB MicroSD card in my camera when the battery died mid-way. After that, any time I try to read the card in my camera, it gives me a "Card Error" and does not allow me to reformat it in my camera.
So, I thought I would plug the camera in to the laptop with it set to host the card as media when plugged in as USB, in an attempt to fix the formatting issue.
However, when I plug it in to my linux machine, it does not register as a device (e.g., /dev/sda) due to some errors, therefore I cannot reformat it. Essentially, I think I need to fix the partition table but I'm not sure how to when it doesn't register as a device. code...
I know these folders each have >80gb of files. Yet, they only show 4.0K in ls -lah? How can I have ls show size including the contents?
[root@aapsan01 aapxen01]# ls -lah
total 48K
drwxrwxrwx 6 root root 4.0K Sep 29 03:45 .
drwxrwxrwx 15 root root 4.0K Sep 27 09:15 ..
[Code]....
I'm trying to find a command or program to show what files and folders are taking up the most space on the hard drive, much like tree size view on windows, is there and equivalent on linux?
View 2 Replies View RelatedI am running Ubuntu 10.04LTS (64bit) and the drives are formatted as EXT3. I have a Raid5 that had 4 x 1TB drives. It is mounted as my /home. I added a 5th Drive and used the Disk Utility to Expand the array. In the Disk Utility it shows as 4.0TB RAID5 Array, however when I open a console and type df -h it still only shows at 2.8TB (Which is the size of the 3TB array I had previously.) What do I have to do to have the 4TB array show up properly? I'm obviously missing something, but I'm not sure what it is.
View 6 Replies View RelatedI have a issue in that my 30gb creative zen is showing up fine as a media device, I can delete and add files. It is showing up as z 3.9gp partition. I formatted inside the Zen I formatted inside Windows Vista It showed 28,800ish megs free and it still showed up at a 3.9 gig partition There is no .trash folder How can I fix this? Qlix installed don't know if that matters.
View 1 Replies View RelatedI have a first generation iPod Shuffle (yes, I know it's old) with 512 megabytes of space (feel free to laugh). I also have arch linux installed on my computer, with a music folder containing about 30 folders full of music. This totals to about 2 gigabytes of music.
What I want to do is: create a script that moves no more than 512 megabytes (it can be slightly under this amount, but NOT over) of random songs from my music folder (and it's subsequent artist/album folders) to a separate folder. I will then use gtkpod to move those random songs in the new folder to my iPod Shuffle.
Im trying to install ubuntu with windows xp, but I only have 1 disk. People at irc told me i Could make a new partition in this same disk without having to format the whole drive.. and this option should appear at the setup, but i dont have that option, it only show the option to format the drive or "do something else", And here i cant see anything that let me use the free space i have in the windows partition to make a new one...
my ntfs partition has at least 35gb contiguous free space of 200gb free so i thought i could use this to make a new partition, but idk how,
I am newer to Linux ( using Ubuntu 10.04) : I have noticed that during replacement of a file , no date and size of the new and old files are shown in the dialogue box so how to show that ( like the one in windows)
I know that it is easy question , but i really don't know how to do that , by the way I have checked folder preferences and system --> preferences but i did not find something for that
Is there anyway to show package size that comes up in the search so you don't have to apt-get install package individually and wait for the installation initiation and then reject to install after it gives u the [y/N] confirmation thing?
View 2 Replies View RelatedI've been trying to understand pthread in C a little better. So I made a simple program that takes in a string from the command line and creates a thread to print the string. I've looked online and copied the basic concepts but there are something things I'm confused about. The programs works just fine, but I have questions. Here's what I have so far.
[Code]....
One thing I'd like to know is why the 3rd argument in the pthread_create function which is my SendMessage function needs to be typecasted to a void pointer and then send the address of the function. Also as for the 4th argument, I would see typecasting to void pointer in some of the pthread examples I saw online, but in my case I'm passing a char pointer, would this be correct? In which case would I ever want to pass a void pointer?
Do I need a pthread_exit(NULL) in my main and in the SendMessage function? If so, why? I added the sleep() function so that I could let the pthread_exit function in my SendMessage function execute first. I simply saw that the online examples on pthread had pthread_exit() in both locations.
I have a line in a text file that has 40 random characters within a tag and i want to change the characters to a new set of 40 random characters (alphanumeric a-z 0-9 etc)
The line in the text file looks like this:
Quote:
How would i go about doing that?
Also second question same as the above but how would i remove them instead of replacing them?
it should be simple, but i don`t get it: if i search for stuff, i may pipe it to grep to "filter" it:
Code:
ls /usr/bin | grep ice
but how would i say grep not to show the ones containing "term"/"string" example would be with locate
Code:
locate fluxbox | -> but not the ones in /home
If I have a word in a text file and I need to replace it by another word (for example, i need to replace abc by fff) so what is the command I can type it?
I am using vi editor.
I have a String that I would like to sign using a given RSA Private key. I thought this would be relatively easy but I have not been able to find out how to do it, unless I'm looking to far into a simple problem. Do i have to put the string into a file, and sign the file, or can i just sign the string/message?
View 7 Replies View RelatedI have a set of lines as ahown below:
Leon went to school
Leon came back from school..
Leon had dinner...
I have to replace the line containing "dinner" by a single string LUNCH...
I need to creates string suffixes out of a Reference string. for eg. suffixes of abcdefg will be
1)bcdefg
2)cdefg
3)defg
and so on...
create an array of pointers to point to the first few characters and then use that pointer to print the rest of the string.But when i print using the pointer i get GARBAGE values! shudn't std::cout<<ptr[w] print the string following the char it is pointing to? why do i get garbage values?
I want to replace a string of directory path in a string to empty:
Code:
But this doesnt seem to give me the desired thing:
Code:
This gives the desired outcome, but its specific, i need a variable in the sed not a string. And if I replace STRING="/mnt/sda1/record/$dd/" then I cant use it for something else, cause its has all the weird backslashes now.
So if I'm given a location of a file like:
How can I just take the type of the file at the end? I know I can use strrchr() for a period to get the pointer to the period just before file type. Is there a build in string function that will just take the rest of the string from a certain point on forward in the string? I know it wouldn't be much work to make it myself, but I figured I would find out if it already existed before doing it.