[Solved] Generating sets of array in perl

Loop over @nobreak? my $s=”MALWMRLLPLLALLALWGPDPAAAFVNQHLCGSHLVEALYLVCGERGFFYTPKTRREAEDLQVGQVELGGGPGAGSLQPLALEGSLQKRGIVEQCCTSICSLYQLENYCN”; print “Results of 1-Missed Cleavage:\n\n”; my @nobreak = (37,45,57,59); for my $nobreak (@nobreak) { substr($s, $nobreak-1, 1) = “\0”; my @a = split(/E(?!P)/, $s); substr($s, $nobreak-1, 1) = ‘E’; $_ =~ s/\0/E/g foreach (@a); $result = join (“E,”, @a); @final = split(/,/, $result); print “@final\n”; } solved Generating sets of … Read more

[Solved] array that accepts a number only once(code doesn’t work) [closed]

it is observed from your code that given array must be filled but it should not contain redundant values. following code iterates until the array is filled with no redundant value, once the array is filled it terminates. int a[5],i=1,k=0,p; int num; scanf(“%d”,&num); a[0]=num; while(i<5) { scanf(“%d”,&num); for(p=0;p<=k;p++) { if(a[p]==num) { break; } if(p==(k)) { … Read more

[Solved] c – What is a correct way of defining array? [closed]

The correct way to define and initialize your array is char Lookup[][3] = {“00”, “01”, “02”, “03”, “04”, “05”, “06”, “07”, “08”}; Each element of the array Lookup is itself another array of 3 bytes. Counting with the zero terminator, that’s enough space for strings 2 chars long. The number of elements in the array … Read more

[Solved] Undefined offset:1, 2 3 etc

$csv_array[1];, $csv_array[2]; and $csv_array[3]; don’t exists inside your $csv_array. As suggested, do a var_dump($csv_array) below $csv_array = explode(“,”, $csv_data[$i]); and see what is in there! 0 solved Undefined offset:1, 2 3 etc

[Solved] Concept of creating Array of structures in C with three properties [closed]

Hi You can Implement a three dimensional array to store the RGB values and then do the operation you want. The dummy code looks some thing like this: #define TOTAL_NO_OF_PIXEL 1080 //For example total 1080 no of pixels are there int RGBcolor[3][TOTAL_NO_OF_PIXEL]; int main() { for(int cnt=0;cnt<TOTAL_NO_OF_PIXEL;cnt++) { RGBcolor[0][cnt] = RED; RGBcolor[1][cnt] = GREEN; RGBcolor[2][cnt] … Read more

[Solved] PHP arrays, getting to loop index information

I’m making an assumption about the true layout of your array, the following will create a $weekDays array to map an integer and a day of the week (I define the keys so you can shift them at any time): $weekDays = (1=>’Monday’, 2=>’Tuesday’, 3=>’Wednesday’, 4=>’Thursday’, 5=>’Friday’, 6=>’Saturday’, 7=>’Sunday’); // loop through each week-day in … Read more

[Solved] Javascript object in array

You can proceed like this: var products = {a:”b”, c:”d”, e:”f”}; var arrList = []; for(var key in products) { // iterates over products key (e.g: a,c,e) arrList.push([key, products[key]]); }; solved Javascript object in array

[Solved] Label Array in VB.net [closed]

If you have the timer set up and working already, try something like this for your array: ‘These will be your labels: Dim oLabel As New Label Dim oLabel2 As New Label ‘Create the array from your labels: Dim aLabels() As Label = {oLabel, oLabel2} ‘loop through your array: For each oLabel as Label in … Read more

[Solved] How to generate dynamic IF statement

I found my answer with my self. It’s look like this. $abc=””; foreach($setLogic2 as $key => $value){ $abc.= $value[‘Conj’].’ ‘.(int)$value[‘Topic’].’ ‘; } //$abc = “0 And 1 And 1”; if(eval(“return $abc;”) == true) { echo ‘true boolean’; } else if(eval(“return $abc;”) == false){ echo ‘false boolean’; } else{ echo ‘none’; } 1 solved How to … Read more