Programming :: Array Creation At Run-time In C++?

Apr 4, 2010

I have a text file from which i read a number of names with their lengths at the run-time.Now i want to created a char array having the length and name as already read from the text file at the run-time. There is no compilation involved. Every thing is happening at the run-time. I tried using STL like map along with malloc but i am unable to name an array at run-time. I can keep some type of mapping with previously created arrays

View 3 Replies


ADVERTISEMENT

Ubuntu Servers :: Creation Of RAID-0 Array In Disk Utility Resulting In Smaller Than Expected Array?

Sep 27, 2010

I have a NETGEAR ReadyNAS NV+ with four 1TB drives in a RAID-5 array. This is our primary file storage. This has previously been backed up to a hardware RAID-0 array directly attached to our Windows server. The capacity of this backup array is no longer sufficient. So the plan was, take a bunch of 200GB to 320GB drives (And a 750) I had kicking around, chuck them in a couple of old SCSI drive enclosures I have collecting dust, attach them via IDA/SATA-to-USB adaptors to a USB hub, attach that to the server, create a JBOD array spanning the disks, and back up the NAS to that. Performance is not an issue as this is just to be used for backup, with the idea being as near to zero cost as possible (Spend so far = NZ$100�ish).

The first hurdle I struck was Windows not supporting Dynamic Disks on USB drives (Required to create a spanned volume). At first I resisted using another machine (i.e. a machine running Ubuntu) as I didn't want to dedicate a piece of hardware to backing up the NAS. I then decided it would be acceptable to do this via a VM, which is what I've done.So I have 10.04 running under VMWare Server 2.0.2 under Windows Server 2008 R2. The disks are all presented to the VM. I wasn't sure if I was going to end up creating the array under LVM or something else, but I noticed Disk Utility has an option to create an array, so I tried that. When I add two 250GB drives, the array size is 500GB. When I then add a 160GB drive, the array size drops to 480GB. Huh? If I keep adding disks (Regardless of order) the final array size comes out at 1.8 TB, as per the attached screenshot. Now with the following drives, I expected something more like:

160 + 250 + 250+ 750 + 250 +200 + 200 + 250 + 320 + 250 + 320 = 3.2TB

Am I missing something or making a false assumption somewhere?

View 4 Replies View Related

Programming :: Get The Creation Time Of A Process Via Pid In C++

Mar 22, 2010

Scenario: ( in C++ code)

I need a process A to be able to get the start time of process B. I have the PID of the process B.

I would have thought there would be a simple system call to make by passing in the pid of Process B, but I don't thing there is??!!

So my other thought is to create a script that will be passed the pid and either I can read the file creation of /proc/<PID>/stat or I could also parse the start time of ps on the <PID>. This script can be ran from the C++ code. My difficulty is capturing this information in the C++ code. If I run exec ( or system if not a script) I need the results in a program variable....not stdout.

My only solution is write it to a tmp file and read it back into the program variable. Seems rather arguious but a least it would work.

Background - I need to port Windows code ( GetProcessTimes(creationtime,...))

View 4 Replies View Related

General :: Change The Creation Time Of All A Folder's Files To The Current Time?

Jun 19, 2011

Under a Linux shell, how can I change the creation time of all a folder's files to the current time?

View 2 Replies View Related

Programming :: C Realloc Resize Array / Delete And Add Information Into The Array?

Mar 6, 2011

I am trying to dynamically delete and add information into the array "blah"

Code:
int blahsize = 1;
char** blah = (char**) calloc(blahsize+1,sizeof(char*));
Adding information:
Code:
blah[1]=stuff1;
blah[2]=stuff2;
code....

View 2 Replies View Related

Programming :: Convert Short Array To Char Array?

Jun 7, 2010

I have trouble converting a short array to a char array

Code:

short pShort[4] = { 0x41, 0x42, 0x43, 0x44 };

How to convert this to a char array?

View 4 Replies View Related

General :: Extract The File Creation Time?

Nov 23, 2010

I want to extract the file creation time. How to get it. I am using fedora core 4

View 3 Replies View Related

General :: Assigning New Creation File Time On Tar Extraction?

Nov 19, 2010

How I can tell tar to assign a new creation date to extracted files? Let's say I have an archive filled with old files of varying ages. Upon extraction I want all files to have the same time stamp (that of the time of the extraction).

View 1 Replies View Related

General :: Real Time File Creation In Terminal?

Aug 2, 2010

I was wondering if there is a command to show a real-time creation of files. I basically executed a command that will created thousands of files and takes a long time. I want to check if it is still creating additional files or if ti got frozen.

View 3 Replies View Related

Software :: Get File Creation Time (Ext4, Ntfs-3g)?

Jun 14, 2010

I know newer filesystems support crtime values, even to nanoseconds granularity. Ext4 does it, and NTFS mounted via ntfs-3g should expose it. Still, what is the command to get these values??

getfattr -d <some file>

gives me zero results, and as far as I know ls does not have means to access creation time.

getfattr -n ntfs_crtime /mnt/<some ntfs fs> gives me "Operation not opermitted"..?

I know about the difference between ctime=inode change time and crtime=creation time/file birth time. I want to migrate a NTFS partition to Ext4 without losing the creation dates...

View 10 Replies View Related

Software :: Way To Sort A Files Based On Creation Time

Jul 7, 2010

Code...

But I want to get the files in order which they created like file, file1 and file2

Any way to obtain this?

View 6 Replies View Related

Programming :: Converting A PHP Array Into An HTML Array?

Aug 9, 2009

I'm writing a PHP program. I've encountered a problem; in the following code I try to pass $_POST['delete'] which is an array as the value of a hidden input to some form, but it doesn't do so.there's something wrong with converting PHP array into HTML array. I'm sure that $_POST['delete'] is not null and is a real array.

echo '<input type="hidden" name="delete[]" value="'.$_POST['delete'].'" />';

View 4 Replies View Related

Software :: Default Creation Time User Home Directory Permissions.

Jan 8, 2011

When I am creating a user (say sandy) on my FC14 system, I find that the default permissions for her home directory (/home/sandy) are 700.Can I somehow set up my system so that these permissions are 711 in place of 700.

View 3 Replies View Related

Programming :: Filling 2D Array With 1D Array In C?

May 26, 2010

(I am using vector() and matrix() functions from "Numerical recipes in C".)There are 100 numbers to be stored in 2D array of 10 rows and 10 columns.100 numbers are stored in a 1D array.I get "segmentation fault" at the line indicated in the segment of my code below:

Code:

:
:
#define size 100
#define nl 1

[code]....

View 12 Replies View Related

Programming :: Bash Array Add Function Example Using Indirect Array Reference As Function Argument?

Jun 20, 2010

I looked on the net for such function or example and didin't find anything, thus after having made one i guess it would be legitimate to drop it to see what others thinks of it.

#!/bin/bash
addelementtoarray()
{
local arrayname=$1

[code]....

View 10 Replies View Related

Ubuntu :: Desktop Icons Creation And Panel Content Creation After Login Getting Slower

Nov 17, 2010

I've been running 10.04 since September on my new MSi i3 notebook and about two weeks ago I noticed that when I login after system boot, propagation of icons on my desktop and the content of my Panel have become slower and slower.If I logout and login again the propagations are not slow.

View 1 Replies View Related

Hardware :: Installing New SCSI Card And Array For First Time?

May 11, 2010

I'm installing my first new Dell SCSI controller card (PERC 6) and storage array (MD1000) into my first RHEL server. I've done this plenty of times in a Windows world, but never in Linux. I know the BIOS will pick up the SCSI card and I can go into that during the boot screen to set up how i want the array (RAID5), but once Linux comes up, will it automatically find and mount the drives, or do I have to do something?

View 9 Replies View Related

Programming :: Graph Creation Software (Graphviz / NetworkX)?

Apr 15, 2011

I am going to be creating some graph representations of neural networks for my thesis. I am trying to find a good method for drawing them, preferably in a scripting manner. I like NetworkX since I know python, but am also curious about GraphViz (though the documentation is sparse) or any other solutions anyone may know of. It is important that there is a decent ability to interface with LaTeX.

View 2 Replies View Related

Programming :: Get A Password In A Bash Script For Mysql User Creation?

Apr 25, 2010

I'm trying to get a password in a bash script for mysql user creation. But sometimes a get a non-alphanumeric character(s) in the password, and mysql failes with that. I tryed with apg -EO0Il1`~!@#$%^&*()_+-=[];./{}|:"'<>? but failed. I tryed with sed 's/[^a-zA-Z2-9]//g' , but at that moment the minimum password lenght failed. I'm also fine when there is a better alternative then apg.

View 2 Replies View Related

Programming :: Arrays In The C Programming Language Are Pointers To The First Element Of The Array?

Mar 27, 2010

I wonder why arrays in the C programming language are pointers to the first element of the array, not the first element of the array itself?

View 14 Replies View Related

Programming :: Writing Unix Shell Script To Pass File Name/path/creation Date?

Oct 7, 2009

I'm new to UNIX scripting; I�m stuck with the following I have an Oracle SQL script that takes three parameters

1- File Name
2- File Path
3- File creation date

Under UNIX I have a folder where files will be placed frequently and I need to upload those files to Oracle, what I need is a UNIX script that can do the following

Loop through Directory "/home/applmgr/snktmp"
Picks only files
Pass the file name to parameter &1

[code]....

Is the above possible? I already knows how to call the Oracle Script from UNIX Im only stuck on writing the UNIX part where it List the files attribute(name,path,date) and store them to parameters ,Looping until the last file in the directory If the above is not possible,then how can I create the below from the command line

Filename{concatenation Mark}filePath{concatenation Mark}creationdate
Filename{concatenation Mark}filePath{concatenation Mark}creationdate
Filename{concatenation Mark}filePath{concatenation Mark}creationdate
Filename{concatenation Mark}filePath{concatenation Mark}creationdate

View 4 Replies View Related

Programming :: Function Handler Is Called One Time Only Instead 2 Times If The 2 Timers Expires At A Time

Mar 2, 2011

I am using Debian linux. I have 100 timers running. If a timer expired which will generate a signal and it was mapped to a same function handler. All the timers are mapped to one function handler. The problem is if the timer expires one at a time, the function handler called at a time. But if the 2 timers expires at a time, the function handler is called one time only instead 2 times. Is it possible to invoke the function handler as many times based on timer expirary happens simultaneoulsy?

View 14 Replies View Related

Programming :: Get The Current Time As Provided From NTP (not The Currently Set Time On The Server)?

Jun 9, 2010

Is there a way to get the current time as provided from NTP (not the currently set time on the server)?

View 4 Replies View Related

Programming :: Set Time Using Settimeofday But It Sets Local Time?

Jan 12, 2010

I am trying to set time using settimeofday in linux. But it sets local time. i.e works like SetLocalTime in windows. But I want to set system time(like SetSystemTime in windows). I could'nt find no other api in linux. What should i do? I had tried with mktime/gmtime apis

View 3 Replies View Related

Programming :: Array Containing Words In C?

Sep 24, 2010

This array is supposed to contain 12 elements (names of the month) What I want to achieve is that depending on some user input (a number 1-12) a full name of one of the months will be displayed, eg.

Code:
scanf("%d", &month);
printf("The month is %c", months_names[month]);

View 6 Replies View Related

Programming :: How To Do An Array Of Characters

Feb 18, 2010

I am trying to create an array containing all ASCII characters, how do I create one:

Code:
#!/bin/bash
CHARLIST=( a b c d e f g h i j k l m n o p q r s t u v w x y z

[code]...

View 6 Replies View Related

Programming :: Getting String Value From Array?

Oct 29, 2009

I've got a problem...

a[0] = 22
echo $[a[0]]
echoes 22 - that works fine

[code]...

View 5 Replies View Related

Programming :: Convert String To Int Array?

May 9, 2010

I've searched around and can't find out how to convert a string ( like "12345" ) into an int array ( x[ 5 ] = { 1, 2, 3, 4, 5 } ; ).

View 4 Replies View Related

Programming :: Represent Alphabet Into A Array?

Jul 9, 2010

i am trying to represent alphabet into a array, and then i can count the frequency

for example
array[a]=0
array[b]=0

but i find the index of the array seems to be

array[1]=0
array[2]=0

I was try this way get the ascii for them, actually I have done this in java and it is simple.

something like this format
array[ascii{a}-ascii{a}]=0
array[ascii{b}-ascii{a}]=0

I have done a lot of searching , but cannot get what I want.'%d' "'$char" like this would not work.

View 2 Replies View Related

Programming :: Sorting 2 Dimension Array?

Aug 5, 2010

how to sort the 2 dimensional array below by column 1 then by column 2?

22 55
2222 2230
33 66
44 58
222 240

[Code].....

this is a small part in my awk script. the input data is not in file, but it was manipulated in my script.

View 6 Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved