Search Results

Search found 9 results on 1 pages for 'amal'.

Page 1/1 | 1 

  • Conversion to grayscale using emguCV in C#

    - by Amal
    Hi. I am new to EmguCV. I want to convert an rgb image into gray scale. For the conversion I have used the code Image grayImage = ColordImage.Convert(); Now when i compile this code in C# it gives no error,but when i run it then after a few seconds it gives me the exception at this line of code that this type of conversion is not supported by OpenCV. Now can any one help me solve this problem. Regards Amal

    Read the article

  • UITableView not rotating even after using autoresize mask and shouldAutororateForInterfaceOrientatio

    - by Amal
    I have a UIView, that contains a navigation bar, and UITableView. I implemented a UIViewController that implements a UITableViewDelegate. I over-rided the shouldAutorotateForInterfaceOrientation for the UIView to return YES for landscape and portrait mode. But the View does not seem to rotate. I did a similar thing without the Navigation bar and the Tableview and the view rotates. Is is something i am missing.

    Read the article

  • Custom UIButton for Iphone.

    - by Amal
    I have an view in my App which has a number of buttons based on the number of items returned by the server. So if the server returns say 10 items, there should be 10 buttons and clicking on each button should call a different person. For the above purpose I created a custom button class deriving from UIButton. @implementation HopitalButton @synthesize index; @synthesize button_type; - (id)initWithFrame:(CGRect)frame { if (self = [super initWithFrame:frame]) { UIImage* img = [UIImage imageNamed:@"dr_btn.png"]; [img stretchableImageWithLeftCapWidth:10 topCapHeight:10]; [self setBackgroundImage:img forState:UIControlStateNormal]; [self setTitleColor:[UIColor colorWithRed:0.698 green:0.118 blue:0.376 alpha:1] forState:UIControlStateNormal] ; [self setFont:[UIFont fontWithName:@"Helvetica Bold" size:13]]; self.titleLabel.textColor = [UIColor colorWithRed:178 green:48 blue:95 alpha:1]; self.adjustsImageWhenHighlighted = YES; } return self; } - (void)dealloc { [super dealloc]; } @end Now the problem with the above code is that it does not create buttons that look similar to the buttons created by default in Interface builder. The borders are missing. And I create buttons of the above type by the following code: HopitalButton* hb = [[HopitalButton alloc] init]; hb.button_type = @"call"; hb.frame = CGRectMake(50, 50 + i * 67, 220, 40); [self.scroll_view addSubview:hb]; [hb setTitle:[[[self.office_full_list objectAtIndex:i] objectForKey:@"Staff" ]objectForKey:@"FullName"] forState:UIControlStateNormal]; hb.index = [NSNumber numberWithInt:[self.button_items count]]; [self.button_items insertObject:hb atIndex:[self.button_items count]]; [hb addTarget:self action:@selector(buttonClicked:) forControlEvents:UIControlEventTouchUpInside]; I am not finding a way to set the button type for this custom button. Is there a way i can do it ? Or is there a better way to design the code.

    Read the article

  • Pinterest Gridview implementation on iOS

    - by Amal
    I want to implement a grid view like the one in Pinterest I thought about implementing as 3 table views. But I was not able to scroll them together well. When I implemented the scrollViewDidScroll and set the contentOffset for the table views other the scrollView , the scrolling became slow and unusable. Another implementation I did was of was having a set of images to load and calling the viewDraw function in scrollViewDidScroll. THe ViewDraw function just draws the necessary images and removes the rest of the images from the memory which were already drawn but wont be visible . this too makes the ScrollView Scrolling slow. And another issue with it is that there are white(background color) patches before the images are drawn. What should be the best way to implement this grid view ?

    Read the article

  • Merge n files using a C program

    - by Amal
    I am writing a download Accelerator. So I download a file from the webserver into n parts. Now I want to merge the files into 1 single file. So I use the following code. And the file names are in the correct order. But the output file I am getting is different from the original download file. Can you tell me where could the error be ?C int cbd_merge_files(const char** filenames, int n, const char* final_filename) { FILE* fp = fopen(final_filename, "wb"); if (fp == NULL) return 1; char buffer[4097]; for (int i = 0; i < n; ++i) { const char* fname = filenames[i]; FILE* fp_read = fopen(fname, "rb"); if (fp_read == NULL) return 1; int n; while ((n = fread(buffer, sizeof(char), 4096, fp_read))) { int k = fwrite(buffer, sizeof(char), n, fp); if (!k) return 1; } fclose(fp_read); } fclose(fp); return 0; }

    Read the article

  • Adapt beginner C# SQL Server INSERT example to work with my database

    - by Mike Bertelsen
    I have read TONS of tutorials, articles and whatever regarding my issue and honestly, due to my lack of experience I can't twist my fingers around this one so I hope some of you guys can help me out :) I am working on a project (simply to learn how to program so it's probably very basic), but I have this "News" page where I can update and delete data using a GridView. Now I would like to INSERT something into my database using 3 textboxes and 1 submit button. I have 3 rows that has to be inserted: Headline Date Content/the news itself. Which are stored under NyhedTB from the connectionstring: BoligStjernenConnectionString My query looks like this: INSERT INTO [NyhedTB] ([NyhedDato], [NyhedTitel], [NyhedTekst]) VALUES (@NyhedDato, @NyhedTitel, @NyhedTekst) I read on the internet that this code should do the magic for me (I will have to insert my own values ofc.): static void Insert() { try { string connectionString = "server=.;" + "initial catalog=employee;" + "user id=sa;" + "password=sa123"; using (SqlConnection conn = new SqlConnection(connectionString)) { conn.Open(); using (SqlCommand cmd = new SqlCommand("INSERT INTO EmployeeDetails VALUES(" + "@Id, @Name, @Address)", conn)) { cmd.Parameters.AddWithValue("@Id", 1); cmd.Parameters.AddWithValue("@Name", "Amal Hashim"); cmd.Parameters.AddWithValue("@Address", "Bangalore"); int rows = cmd.ExecuteNonQuery(); //rows number of record got inserted } } } catch (SqlException ex) { //Log exception //Display Error message } } I looked at this code and thought it should be easy enough but really, I can't figure it out.

    Read the article

  • what is the problem in ATM machine program

    - by Have alook
    in this prigramm when the account number is uncorrect it should display a message to write a gain but when i wrote a gain by corrrect account number always it diplay the result of first account also there is aproblem in PIN number ,the use have only three time to try if he enter wrong numbe and if enter three times wrong it should stop the program but it complete to the last part I dont know why pleas help me this is my proram import java.util.*; class assignment2_70307{ public static void main(String args[]){ Scanner m=new Scanner(System.in); int i; i=0; int [] accountNo =new int[7] ;//declear the Accont number array accountNo [0] =1111; accountNo [1] =2222; accountNo [2] =3333; accountNo [3] =4444; accountNo [4] =5555; accountNo [5] =6666; accountNo [6] =7777; int [] PINno =new int[7]; //declear the PIN number array PINno [0] =1234; PINno [1] =5678; PINno [2] =9874; PINno [3] =6523; PINno [4] =1236; PINno [5] =4569; PINno [6] =8521; String [] CusomerNm =new String[7]; //dclear the customer name CusomerNm [0] ="Ali"; CusomerNm [1] ="Ahmed"; CusomerNm [2] ="Amal"; CusomerNm [3] ="Said"; CusomerNm [4] ="Rashid"; CusomerNm [5] ="Fatema"; CusomerNm [6] ="Mariam"; double [] Balance =new double[7]; //declear the Balane array Balance [0] =100.50; Balance [1] =5123.00; Balance [2] =12.00; Balance [3] =4569.00; Balance [4] =1020.25; Balance [5] =0.00; Balance [6] =44.10; System.out.println("Wellcome to mini ATM Machine"); int accountno,pino; accountno=0; pino=0; System.out.println("Please Enter your account number: or -1 to stop" ); accountno=m.nextInt(); if (accountno==accountNo[0]) System.out.print("Customer Name: "+CusomerNm [0]+ "\n" ); else if (accountno==accountNo[1]) System.out.print("Customer Name: "+CusomerNm [1]+ "\n" ); else if (accountno==accountNo[2]) System.out.print("Customer Name: "+CusomerNm [2]+ "\n" ); else if (accountno==accountNo[3]) System.out.print("Customer Name: "+CusomerNm [3]+ "\n" ); else if (accountno==accountNo[4]) System.out.print("Customer Name: "+CusomerNm [4]+ "\n" ); else if (accountno==accountNo[5]) System.out.print("Customer Name: "+CusomerNm [5]+ "\n" ); else if (accountno==accountNo[6]) System.out.print("Customer Name: "+CusomerNm [6]+ "\n" ); // else if (accountNo[0]==-1) //break; else { System.out.println("The account dose not exist,please try again"); //accountNo[i]=m.nextInt(); accountno=m.nextInt(); if(accountNo[i]==accountno) System.out.println("Customer Name: "+CusomerNm[i] ); else System.out.println("The account dose not exist,please try again"); accountno=m.nextInt(); System.out.println("Customer Name: "+CusomerNm[i] ); } System.out.print("Enter your PIN number:"); PINno[i]=m.nextInt(); if(PINno[i]==1234) { System.out.println(PINno[i]); System.out.println("Balance:"+Balance [0]+ "Rial"); //return 0; } else if(PINno[i]==5678) { System.out.println(PINno[i]); System.out.println("Balance:"+Balance [1]+ "Rial"); // return 1; } else if(PINno[i]==9874) { System.out.println(PINno[i]); System.out.println("Balance:"+Balance [2]+ "Rial"); // return 2; } else if(PINno[i]==6523) { System.out.println(PINno[i]); System.out.println("Balance:"+Balance [3]+ "Rial"); // return 3; } else if(PINno[i]==1236) { System.out.println(PINno[i]); System.out.println("Balance:"+Balance [4]+ "Rial"); // return 4; } else if(PINno[i]==4569) { System.out.println(PINno[i]); System.out.println("Balance:"+Balance [5]+ "Rial"); // return 5; } else if(PINno[i]==8521) { System.out.println(PINno[i]); System.out.println("Balance:"+Balance [6]+ "Rial"); // return 6; } else {System.out.println("try again"); //return 7; //if its wrong u can enter PIN number three times only for( i=0;i<2;i++) { System.out.println("enter pin again"); PINno[i]=m.nextInt(); String ss; //ss = "MAnal"; // goto ss ; } } //ss = "m"; int x; x=0; System.out.println("Enter the option from the list /n 1.Deposit /n 2.Withdraw /n 3.Balance"); x=m.nextInt(); double balance,amount; balance=0; amount=0; double deposit ,Withdraw; deposit=0; Withdraw=0; if (x==1){ System.out.println("Enter the amont you want to deposit:"+amount); amount=m.nextDouble(); Balance [i]=Balance [i]+amount; System.out.println("your balance ="+Balance [i]); } else if (x==2) { System.out.println("Enter the amont to withdraw:"); amount=m.nextDouble(); System.out.print(amount); if(Withdraw<=Balance [i]) { Balance [i]=Balance [i]-amount; System.out.println("your balance ="+Balance [i]); } else { System.out.println("sorry,please enter the amont less or equal your balance"); System.out.println(Balance [i]); } } else { if(x==1) { Balance [i]=Balance [i]+deposit; System.out.println("your current balance is :" +Balance [i]); } else { Balance [i]=Balance [i]-Withdraw; System.out.println("your current balance is :"+Balance [i]); } System.out.println("Thank you"); // err() } } }

    Read the article

1