Search Results

Search found 492 results on 20 pages for 'gaurav gupta'.

Page 9/20 | < Previous Page | 5 6 7 8 9 10 11 12 13 14 15 16  | Next Page >

  • Ques: Which method will be called and y?

    - by Gaurav
    Ques: Which method will be called and y? public class Test { public void method(Object o){ System.out.println("object"); } public void method(String s) { System.out.println("String"); } public void method() { System.out.println("blank"); } /** * @param args */ public static void main(String[] args) { // TODO Auto-generated method stub Test test=new Test(); test.method(null); } }

    Read the article

  • Adding custom fields to users in django

    - by Gaurav
    I am the create_user() function that Django provides to create my users. Also I want to store additional information about the users. So I tried following the instructions given at http://docs.djangoproject.com/en/dev/topics/auth/#storing-additional-information-about-users but I cannot get it to work for me. Is there a step-by-step guide that I can follow to get this to work for me? Also, once I have added these custom fields, I would obviously need to add / edit / delete data from them. I cannot seem to find any instructions on how to do this.

    Read the article

  • Django - problem with {% url facebook_xd_receiver %}

    - by Gaurav
    I'm using {% url facebook_xd_receiver %} in one of my HTML files. This works just fine when I run my project using the command python manage.py runserver But the same project stops running and gives me a "TemplateSyntaxError" at the line {% url facebook_xd_receiver %} Can anyone please tell me what could be the difference between the dev server run through the command line and the apache server. Is there anything I'm missing out on while configuring the Apache server? Or is it a Django problem?

    Read the article

  • how to write to an xml file using flex

    - by Gaurav
    Hi all, I have an application which takes live data from internet, I want to develop another application which reads data from the internet and writes it to an XML file (i.e. I want to save the state in an XML file). THE ONLY THING I NEED IS HOW TO WRITE THIS DATA IN AN XML FILE. FOR EXAMPLE say I have a combo box which takes top 10 fifa world cup watching sites, now I want to write this information (i.e. whatever the data this combo box takes as input into an xml file). I want the answer in flex only. And I don't want answer in AIR. Thankyou in advance.

    Read the article

  • Magento - Change Customer Group on purchase of specific product

    - by Gaurav
    Hi, I am developing a purchasable video website having different videos in different categories. It needs membership functionality in which if customer purchase membership then he/she will have all videos free for one year. For that I can create a membership product and if any customer purchase this membership product he/she will fall/switch into ‘Members Customer Group’ and then I can give 100% discount for all products for customers that are in group ‘Members Customer Group’. But I have no idea how I can achieve this? Can anyone please guide me how I can change the customer group on purchase of membership product? Thanks

    Read the article

  • using same ids for many tags?

    - by gaurav rathor
    here is the example code that i was testing and i got confused that every one says that we can use or we should use only one time per id but i have testes using using it multiple times but its giving me the correct output. so what should i do. it is kinda working same like class for me in this example code: <html> <head> <style> #exampleID1 { background-color: blue; } #exampleID2 { text-transform: uppercase; } </style> </head> <body> <p id="exampleID1">This paragraph has an ID name of "exampleID1" and has a blue CSS defined background.</p> <p id="exampleID2">This paragraph has an ID name of "exampleID2" and has had its text transformed to uppercase letters.</p> <address id="exampleID1"> Written by W3Schools.com<br /> <a href="mailto:[email protected]">Email us</a><br /> Address: Box 564, Disneyland<br /> Phone: +12 34 56 78 </address> <blockquote id="exampleID1"> Here is a long quotation here is a long quotation here is a long quotation here is a long quotation here is a long quotation here is a long quotation here is a long quotation here is a long quotation here is a long quotation. </blockquote> </body> </html> please see the above code and answer me that why we should not use id selector two times in a page while its working fine.

    Read the article

  • Call a method on Browser closure [X]

    - by Gaurav
    I am facing an issue in my application user directly clicked on browser close [X] button. Browser can be IE, Chrome, Mozilla, Firefox and many more. What I want to do : 1. as soon as User hits [X] button of browser, need to set there status as logged off in database for which we have a method in Login.aspx file which is within the masterpage. 2. We do not have any Logoff feature in the application I will be thanlful if anyone suggest a solution to call the method which sets the user status as logged off from master page. Thanks in advance.

    Read the article

  • selecting delimiter in regex while selecting portion between lines in case of perl

    - by Gaurav S
    The message has detection report: <detection_report> Test 1 Test 2 Test 3 </detection_report> --------------------------------------------- Have a nice day I want to select portion between <detection_report> tags, including these two tags. I have written following code. The message has detection report\:((.|\n|\r)+)(\<\/detection_report\>) but its not working. Can anyone help me with this.

    Read the article

  • "Enumeration yielded no results" When using Query Syntax in C#

    - by Shantanu Gupta
    I have created this query to fetch some result from database. Here is my table structure. What exaclty is happening. DtMapGuestDepartment as Table 1 DtDepartment as Table 2 Are being used var dept_list= from map in DtMapGuestDepartment.AsEnumerable() where map.Field<Nullable<long>>("GUEST_ID") == DRowGuestPI.Field<Nullable<long>>("PK_GUEST_ID") join dept in DtDepartment.AsEnumerable() on map.Field<Nullable<long>>("DEPARTMENT_ID") equals dept.Field<Nullable<long>>("DEPARTMENT_ID") select dept.Field<string>("DEPARTMENT_ID"); I am performing this query on DataTables and expect it to return me a datatable. Here I want to select distinct department from Table 1 as well which will be my next quest. Please answer to that also if possible.

    Read the article

  • Trouble Deploying .Net Framework 4 Website on IIS7

    - by Cyril Gupta
    Okay, I am trying to deploy a .Net framework 4 website on IIS7 server. I have already changed the application-pool's target framework to .Net 4, but the app is still showing me the error: "The configuration section 'system.web.extensions' cannot be read because it is missing a section declaration" I am guessing that has something to do with the new feature of .Net4 that lets me have a compact Web config file. I think for some reason IIS7 is not happy with this. What can I do to deploy this app successfully or do I have to scale back to v3.5? I am sure there is a solution out there. Do you have any suggestions?

    Read the article

  • FaultException<T>() exception thrown by the service is not caught by the client catch(FaultException

    - by Ashish Gupta
    Ok, I know I am missing something here. I have the following operation contract: public double DivideByZero(int x, int y) { if (y == 0) { throw new FaultException<ArgumentException> (new ArgumentException("Just some dummy exception") ,new FaultReason("some very bogus reason"), new FaultCode("007")); } return x / y; } And following is taken from the client:- Console.WriteLine("Enter the x value"); string x = Console.ReadLine(); Console.WriteLine("Enter the Y value"); string y = Console.ReadLine(); try { double val = client.DivideByZero(Convert.ToInt32(x), Convert.ToInt32(y)); Console.WriteLine("The result is " + val.ToString()); } catch(FaultException<ArgumentException> exp) { Console.WriteLine("An ArgumentException was thrown by the service "+ exp.ToString()); } catch (Exception exp) { Console.WriteLine(exp.ToString()); } In the above case catch(FaultException exp) (the first catch block with ArgumentException in the client code) block does not get executed. However, when I remove ArgumentException to have catch(FaultException exp), the same catch block gets executed. I am not sure about this as I am throwing FaultException from my operation contract. Am I missing anything here. Appreciate your help, Ashish

    Read the article

  • C# export to excel from sql server

    - by Manish Gupta
    In my C# windows application, I am exporting sql server data to excel on remote drive. But it is too slow. However, if I export data to excel in the local drive, it is fast. How can I increase the time if I want to export data to remote drive? Thanks in advance...

    Read the article

  • Sending mail using SmtpClient in .net

    - by Manish Gupta
    I am unable to send the mail using smtp client. here is the code: SmtpClient client=new SmtpClient("Host"); client.Credentials=new NetworkCredential("username", "password"); MailMessage mailMessage = new MailMessage(); mailMessage.from="[email protected]"; mailMessage.To.Add("[email protected]"); mailMessage.body="body"; mailMessage.subject="subject"; client.Send(mailMessage); The problem is that when I use this code in ASP.NET application, I do not recieve any mails. When in asp.net I change the from mail address to username given in NetworkCredential, I recieve mails. But in C# windows application, I can get emails, even if sender's email address is not valid. Thanks in advance....

    Read the article

  • getting an embedded resource in a single dll made up of multiple class libraries

    - by Rahul Gupta
    my solution has multiple projects and in one of them I have the code to get the embedded resource (an xml file) from another project. All this works fine when all the projects are seperate. However when all the class libraries are embedded into a single dll, the code to get the resource file does not work i.e. it cannot get the emebedded resource. I was wondering if the references to the emebedded resource get mixed up when they are combined together in a single dll?? I use the method Assembly.GetCallingAssembly().GetManifestResourceStream("namespace..filename");

    Read the article

  • iphone basic game loop

    - by Mrigank Gupta
    I am little confused with my Opengl game loop. as I am skipping touch events some times. My game loop is some thing like this.. I have ScreenManager which draw and update all game screens who so ever has control.In update I am checking input of all screen also. if input state changes, then whichever screen has control, consume touches. EaglView draw update | | ScreenManager.draw ScreenManager.update -> handle input stack ___________ ___________ of ___________ ___________ screen ___________ ___________ Problem comes.. I am changing input state as touch begun and end methods called. but sometimes In my game loop both touchbegun/end methods get called between two updates and I am missing events. I guess approach is not good. can you guys share your approach to this problem.

    Read the article

  • Here i m sending my code for presentmodelViewController

    - by aman-gupta
    Hi Please help me out i want to switch to first view from third view directly here is my code:-where i m using presentModelViewcontroller // // ExperimentAppDelegate.h // Experiment // // Created by Aman on 4/20/10. // Copyright __MyCompanyName__ 2010. All rights reserved. // #import <UIKit/UIKit.h> @class ExperimentViewController; @class SecondView; @class ThirdView; BOOL parentScreenNo; @interface ExperimentAppDelegate : NSObject <UIApplicationDelegate> { UIWindow *window; ExperimentViewController *viewController; SecondView *ptrSecond; ThirdView *ptrThird; } @property (nonatomic, retain) IBOutlet UIWindow *window; @property (nonatomic, retain) IBOutlet ExperimentViewController *viewController; @property (nonatomic, retain) IBOutlet SecondView *ptrSecond; @property (nonatomic, retain) IBOutlet ThirdView *ptrThird; @end ///////////////////////////////////// // // ExperimentAppDelegate.m // Experiment // // Created by Aman on 4/20/10. // Copyright __MyCompanyName__ 2010. All rights reserved. // #import "ExperimentAppDelegate.h" #import "ExperimentViewController.h" @implementation ExperimentAppDelegate @synthesize window; @synthesize viewController,ptrThird,ptrSecond; - (void)applicationDidFinishLaunching:(UIApplication *)application { parentScreenNo = NO; // Override point for customization after app launch [window addSubview:viewController.view]; [window makeKeyAndVisible]; } - (void)dealloc { [viewController release]; [window release]; [super dealloc]; } @end ///////////////////////////////////////// // // ExperimentViewController.h // Experiment // // Created by Aman on 4/20/10. // Copyright __MyCompanyName__ 2010. All rights reserved. // #import <UIKit/UIKit.h> @interface ExperimentViewController : UIViewController { } -(IBAction)second:(id)sender; @end /////////////////////////////// // // ExperimentViewController.m // Experiment // // Created by Aman on 4/20/10. // Copyright __MyCompanyName__ 2010. All rights reserved. // #import "ExperimentViewController.h" #import "ExperimentAppDelegate.h" @implementation ExperimentViewController /* // The designated initializer. Override to perform setup that is required before the view is loaded. - (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil { if (self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil]) { // Custom initialization } return self; } */ -(IBAction)second:(id)sender { ExperimentAppDelegate *app = (ExperimentAppDelegate *)[[UIApplication sharedApplication]delegate]; [self presentModalViewController:app.ptrSecond animated:YES]; } /* // Implement loadView to create a view hierarchy programmatically, without using a nib. - (void)loadView { } */ /* // Implement viewDidLoad to do additional setup after loading the view, typically from a nib. - (void)viewDidLoad { [super viewDidLoad]; } */ /* // Override to allow orientations other than the default portrait orientation. - (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation { // Return YES for supported orientations return (interfaceOrientation == UIInterfaceOrientationPortrait); } */ - (void)didReceiveMemoryWarning { // Releases the view if it doesn't have a superview. [super didReceiveMemoryWarning]; // Release any cached data, images, etc that aren't in use. } - (void)viewDidUnload { // Release any retained subviews of the main view. // e.g. self.myOutlet = nil; } - (void)dealloc { [super dealloc]; } @end ///////////////////////////////// // // SecondView.h // Experiment // // Created by Aman on 4/20/10. // Copyright 2010 __MyCompanyName__. All rights reserved. // #import <UIKit/UIKit.h> @interface SecondView : UIViewController { } -(IBAction)third:(id)sender; -(void)down; @end //////////////////////////////////////////// // // SecondView.m // Experiment // // Created by Aman on 4/20/10. // Copyright 2010 __MyCompanyName__. All rights reserved. // #import "SecondView.h" #import "ExperimentAppDelegate.h" @implementation SecondView /* // The designated initializer. Override if you create the controller programmatically and want to perform customization that is not appropriate for viewDidLoad. - (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil { if (self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil]) { // Custom initialization } return self; } */ // Implement viewDidLoad to do additional setup after loading the view, typically from a nib. - (void)viewDidLoad { [super viewDidLoad]; } -(void)viewWillAppear:(BOOL)animated { if(parentScreenNo == YES) { [self performSelector:@selector(down) withObject:nil]; } [super viewWillAppear:YES]; } -(IBAction)third:(id)sender { ExperimentAppDelegate *app = (ExperimentAppDelegate *)[[UIApplication sharedApplication]delegate]; [self presentModalViewController:app.ptrThird animated:YES]; } -(void)down { [self dismissModalViewControllerAnimated:YES]; } /* // Override to allow orientations other than the default portrait orientation. - (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation { // Return YES for supported orientations return (interfaceOrientation == UIInterfaceOrientationPortrait); } */ - (void)didReceiveMemoryWarning { // Releases the view if it doesn't have a superview. [super didReceiveMemoryWarning]; // Release any cached data, images, etc that aren't in use. } - (void)viewDidUnload { // Release any retained subviews of the main view. // e.g. self.myOutlet = nil; } - (void)dealloc { [super dealloc]; } @end ////////////////////////////////// // // ThirdView.h // Experiment // // Created by Aman on 4/20/10. // Copyright 2010 __MyCompanyName__. All rights reserved. // #import <UIKit/UIKit.h> @interface ThirdView : UIViewController { } -(IBAction)back:(id)sender; @end ////////////////////////////////// // // ThirdView.m // Experiment // // Created by Aman on 4/20/10. // Copyright 2010 __MyCompanyName__. All rights reserved. // #import "ThirdView.h" #import "ExperimentAppDelegate.h" @implementation ThirdView /* // The designated initializer. Override if you create the controller programmatically and want to perform customization that is not appropriate for viewDidLoad. - (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil { if (self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil]) { // Custom initialization } return self; } */ /* // Implement viewDidLoad to do additional setup after loading the view, typically from a nib. - (void)viewDidLoad { [super viewDidLoad]; } */ -(IBAction)back:(id)sender { [self dismissModalViewControllerAnimated:YES]; parentScreenNo = YES; } /* // Override to allow orientations other than the default portrait orientation. - (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation { // Return YES for supported orientations return (interfaceOrientation == UIInterfaceOrientationPortrait); } */ - (void)didReceiveMemoryWarning { // Releases the view if it doesn't have a superview. [super didReceiveMemoryWarning]; // Release any cached data, images, etc that aren't in use. } - (void)viewDidUnload { // Release any retained subviews of the main view. // e.g. self.myOutlet = nil; } - (void)dealloc { [super dealloc]; } @end Above is my code for calling other view please tell how i can call my first view by using dismismodelViewController from third screen Please help me out

    Read the article

  • how to rethrow same exception in sql server

    - by Shantanu Gupta
    I want to rethrow same exception in sql server that has been occured in my try block. I am able to throw same message but i want to throw same error. BEGIN TRANSACTION BEGIN TRY INSERT INTO Tags.tblDomain (DomainName, SubDomainId, DomainCode, Description) VALUES(@DomainName, @SubDomainId, @DomainCode, @Description) COMMIT TRANSACTION END TRY BEGIN CATCH declare @severity int; declare @state int; select @severity=error_severity(), @state=error_state(); RAISERROR(@@Error,@ErrorSeverity,@state); ROLLBACK TRANSACTION END CATCH RAISERROR(@@Error, @ErrorSeverity, @state); This line will show error, but i want functionality something like that. This raises error with error number 50000, but i want erron number to be thrown that i am passing @@error, I want to capture this error no at frontend i.e. catch (SqlException ex) { if ex.number==2627 MessageBox.show("Duplicate value cannot be inserted"); } I want this functionality. which can't be achieved using raiseerror. I dont want to give custom error message at back end.

    Read the article

  • Why I am getting Null from this statement. Query Syntax in C#

    - by Shantanu Gupta
    This is not working. Returns Null to dept_list. var dept_list = ((from map in DtMapGuestDepartment.AsEnumerable() where map.Field<Nullable<long>>("Guest_Id") == 174 select map.Field<Nullable<long>>("Department_id")).Distinct())as IEnumerable<DataRow>; DataTable dt = dept_list.CopyToDataTable(); //dept_list comes null here This works as desired. var dept_list = from map in DtMapGuestDepartment.AsEnumerable() where map.Field<Nullable<long>>("Guest_Id") == 174 select map; DataTable dt = dept_list.CopyToDataTable(); //when used like this runs correct. What mistake is being done by me here. ?

    Read the article

  • How to get skin tone color pixel in iPhone?

    - by aman-gupta
    Hi In my application I m using following way to get red pixel in a image // // PixelsAccessAppDelegate.h // PixelsAccess // // Created by Fortune1 on 14/04/10. // Copyright MyCompanyName 2010. All rights reserved. // import @class clsPixelAccess; NSUInteger numberOfRedPixels; NSUInteger numberOfRedPixels1; NSUInteger numberOfRedPixels2; NSUInteger numberOfRedPixels3; NSUInteger numberOfRedPixels4; NSUInteger numberOfRedPixels5; NSUInteger numberOfRedPixels6; NSUInteger numberOfRedPixels7; NSUInteger numberOfRedPixels8; NSUInteger numberOfRedPixels9; NSUInteger numberOfRedPixels10; NSUInteger numberOfRedPixels11; NSUInteger numberOfRedPixels12; NSUInteger numberOfRedPixels13; NSUInteger numberOfRedPixels14; NSUInteger numberOfRedPixels15; NSUInteger numberOfRedPixels16; NSUInteger numberOfRedPixels17; NSUInteger numberOfRedPixels18; NSUInteger numberOfRedPixels19; NSUInteger numberOfRedPixels20; NSUInteger numberOfRedPixels21; NSUInteger numberOfRedPixels22; NSUInteger numberOfRedPixels23; NSUInteger numberOfRedPixels24; NSUInteger numberOfRedPixels25; NSUInteger numberOfRedPixels26; NSUInteger numberOfRedPixels27; NSUInteger numberOfRedPixels28; NSUInteger numberOfRedPixels29; NSUInteger numberOfRedPixels30; NSUInteger numberOfRedPixels31; @interface PixelsAccessAppDelegate : NSObject { UIWindow *window; clsPixelAccess *obj; } @property (nonatomic, retain) IBOutlet UIWindow *window; -(IBAction)processImage:(id)sender; @end //////////////////// // // PixelsAccessAppDelegate.m // PixelsAccess // // Created by Fortune1 on 14/04/10. // Copyright MyCompanyName 2010. All rights reserved. // import "PixelsAccessAppDelegate.h" import "clsPixelAccess.h" @implementation PixelsAccessAppDelegate @synthesize window; (IBAction)processImage:(id)sender { NSUInteger retVal; obj = [[clsPixelAccess alloc] init]; NSInteger imageSend =[obj processImage1:[UIImage imageNamed:@"s.jpg"]]; NSInteger iamgeCall =[obj getPixelData:retVal]; NSUInteger *numberOfRedPixels = retVal; //lblPixelCount.text = [NSString stringWithFormat: @"There are %d red pixels in the image", numberOfRedPixels]; } (void)applicationDidFinishLaunching:(UIApplication *)application { // Override point for customization after application launch [window makeKeyAndVisible]; } (void)dealloc { [window release]; [super dealloc]; } @end /////////////// // // clsPixelsAccess.h // PixelsAccess // // Created by Fortune1 on 14/04/10. // Copyright 2010 MyCompanyName. All rights reserved. // import @interface clsPixelAccess : NSObject { } -(NSInteger) processImage1: (UIImage*) image; -(NSInteger)getPixelData:(NSUInteger *)pixelCount; @end ///////// // // clsPixelsAccess.m // PixelsAccess // // Created by Fortune1 on 14/04/10. // Copyright 2010 MyCompanyName. All rights reserved. // import "clsPixelAccess.h" import "PixelsAccessAppDelegate.h" @implementation clsPixelAccess struct pixel { //unsigned char r, g, b,a; Byte r, g, b, a; int count; }; -(NSInteger)getPixelData:(NSUInteger *)pixelCount { *pixelCount =numberOfRedPixels; return 1; } // Process the image and return the number of pure red pixels in it. (NSInteger) processImage1: (UIImage*) image { // Allocate a buffer big enough to hold all the pixels struct pixel* pixels = (struct pixel*) calloc(1, image.size.width * image.size.height * sizeof(struct pixel)); if (pixels != nil) { // Create a new bitmap CGContextRef context = CGBitmapContextCreate( (void*) pixels, image.size.width, image.size.height, 8, image.size.width * 4, CGImageGetColorSpace(image.CGImage), kCGImageAlphaPremultipliedLast ); //NSLog(@"1=%d, 2=%d, 3=%d", CGImageGetBitsPerComponent(image), CGImageGetBitsPerPixel(image),CGImageGetBytesPerRow(image)); if (context != NULL) { // Draw the image in the bitmap CGContextDrawImage(context, CGRectMake(0.0f, 0.0f, image.size.width, image.size.height), image.CGImage); NSUInteger numberOfPixels = image.size.width * image.size.height; NSMutableArray *numberOfPixelsArray = [[[NSMutableArray alloc] initWithCapacity:numberOfPixelsArray] autorelease]; NSLog( @"Pixel data %d", numberOfPixelsArray); /* NSMatrix *newMatrix = [[NSMatrix alloc] initWithFrame:NSMakeRect(138.0f, 85.0f, 0.0f, 0.0f) mode:NSRadioModeMatrix prototype:prototypeButtonCell numberOfRows: numberOfColumns:]; */ while (numberOfPixels &gt; 0) { if (pixels-&gt;r &gt; 0 &amp;&amp; pixels-&gt;r &lt;= 7) { numberOfRedPixels++; } NSLog( @"Red pixel data %d",numberOfRedPixels); if (pixels-&gt;r &gt;= 8 &amp;&amp; pixels-&gt;r &lt;= 15) { numberOfRedPixels1++; } NSLog( @"Red pixel data1 %d",numberOfRedPixels1); if (pixels-&gt;r &gt;= 16 &amp;&amp; pixels-&gt;r &lt;=23 ) { numberOfRedPixels2++; } NSLog( @"Red pixel data2 %d",numberOfRedPixels2); if (pixels-&gt;r &gt;= 24 &amp;&amp; pixels-&gt;r &lt;=31 ) { numberOfRedPixels3++; } NSLog( @"Red pixel data3 %d",numberOfRedPixels3); if (pixels-&gt;r &gt;= 32 &amp;&amp; pixels-&gt;r &lt;= 39) { numberOfRedPixels4++; } NSLog( @"Red pixel data4 %d",numberOfRedPixels4); if (pixels-&gt;r &gt;= 40 &amp;&amp; pixels-&gt;r &lt;= 47) { numberOfRedPixels5++; } NSLog( @"Red pixel data5 %d",numberOfRedPixels5); if (pixels-&gt;r &gt;= 48 &amp;&amp; pixels-&gt;r &lt;= 55) { numberOfRedPixels6++; } NSLog( @"Red pixel data6 %d",numberOfRedPixels6); if(pixels-&gt;r &gt;= 56 &amp;&amp; pixels-&gt;r &lt;= 63) { numberOfRedPixels7++; } NSLog( @"Red pixel data7 %d",numberOfRedPixels7); if (pixels-&gt;r &gt;= 64 &amp;&amp; pixels-&gt;r &lt;= 71) { numberOfRedPixels8++; } NSLog( @"Red pixel data8 %d",numberOfRedPixels8); if (pixels-&gt;r &gt;= 72 &amp;&amp; pixels-&gt;r &lt;= 79) { numberOfRedPixels9++; } NSLog( @"Red pixel data9 %d",numberOfRedPixels9); if (pixels-&gt;r &gt;= 80 &amp;&amp; pixels-&gt;r &lt;= 87) { numberOfRedPixels10++; } NSLog( @"Red pixel data10 %d",numberOfRedPixels10); if (pixels-&gt;r &gt;= 88 &amp;&amp; pixels-&gt;r &lt;= 95) { numberOfRedPixels11++; } NSLog( @"Red pixel data11 %d",numberOfRedPixels11); if (pixels-&gt;r &gt;= 96 &amp;&amp; pixels-&gt;r &lt;= 103) { numberOfRedPixels12++; } NSLog( @"Red pixel data12 %d",numberOfRedPixels12); if (pixels-&gt;r &gt;= 104 &amp;&amp; pixels-&gt;r &lt;= 111) { numberOfRedPixels13++; } NSLog( @"Red pixel data13 %d",numberOfRedPixels13); if (pixels-&gt;r &gt;= 112 &amp;&amp; pixels-&gt;r &lt;= 119) { numberOfRedPixels14++; } NSLog( @"Red pixel data14 %d",numberOfRedPixels14); if (pixels-&gt;r &gt;= 120 &amp;&amp; pixels-&gt;r &lt;= 127) { numberOfRedPixels15++; } NSLog( @"Red pixel data15 %d",numberOfRedPixels15); if (pixels-&gt;r &gt; 128 &amp;&amp; pixels-&gt;r &lt;= 135) { numberOfRedPixels16++; } NSLog( @"Red pixel data16 %d",numberOfRedPixels16); if (pixels-&gt;r &gt;= 136 &amp;&amp; pixels-&gt;r &lt;= 143) { numberOfRedPixels17++; } NSLog( @"Red pixel data17 %d",numberOfRedPixels17); if (pixels-&gt;r &gt;= 144 &amp;&amp; pixels-&gt;r &lt;=151) { numberOfRedPixels18++; } NSLog( @"Red pixel data18 %d",numberOfRedPixels18); if (pixels-&gt;r &gt;= 152 &amp;&amp; pixels-&gt;r &lt;=159 ) { numberOfRedPixels19++; } NSLog( @"Red pixel data19 %d",numberOfRedPixels19); if (pixels-&gt;r &gt;= 160 &amp;&amp; pixels-&gt;r &lt;= 167) { numberOfRedPixels20++; } NSLog( @"Red pixel data20 %d",numberOfRedPixels20); if (pixels-&gt;r &gt;= 168 &amp;&amp; pixels-&gt;r &lt;= 175) { numberOfRedPixels21++; } NSLog( @"Red pixel data21 %d",numberOfRedPixels21); if (pixels-&gt;r &gt;= 176 &amp;&amp; pixels-&gt;r &lt;= 199) { numberOfRedPixels22++; } NSLog( @"Red pixel data22 %d",numberOfRedPixels22); if(pixels-&gt;r &gt;= 184 &amp;&amp; pixels-&gt;r &lt;= 191) { numberOfRedPixels23++; } NSLog( @"Red pixel data23 %d",numberOfRedPixels23); if (pixels-&gt;r &gt;= 192 &amp;&amp; pixels-&gt;r &lt;= 199) { numberOfRedPixels24++; } NSLog( @"Red pixel data24 %d",numberOfRedPixels24); if (pixels-&gt;r &gt;= 200 &amp;&amp; pixels-&gt;r &lt;= 207) { numberOfRedPixels25++; } NSLog( @"Red pixel data25 %d",numberOfRedPixels25); if (pixels-&gt;r &gt;= 208 &amp;&amp; pixels-&gt;r &lt;= 215) { numberOfRedPixels26++; } NSLog( @"Red pixel data26 %d",numberOfRedPixels26); if (pixels-&gt;r &gt;= 216 &amp;&amp; pixels-&gt;r &lt;= 223) { numberOfRedPixels27++; } NSLog( @"Red pixel data27 %d",numberOfRedPixels27); if (pixels-&gt;r &gt;= 224 &amp;&amp; pixels-&gt;r &lt;= 231) { numberOfRedPixels28++; } NSLog( @"Red pixel data28 %d",numberOfRedPixels28); if (pixels-&gt;r &gt;= 232 &amp;&amp; pixels-&gt;r &lt;= 239) { numberOfRedPixels29++; } NSLog( @"Red pixel data29 %d",numberOfRedPixels29); if (pixels-&gt;r &gt;= 240 &amp;&amp; pixels-&gt;r &lt;= 247) { numberOfRedPixels30++; } NSLog( @"Red pixel data30 %d",numberOfRedPixels30); if (pixels-&gt;r &gt;= 248) { numberOfRedPixels31++; } NSLog( @"Red pixel data31 %d",numberOfRedPixels31); pixels++; numberOfPixels--; } CGContextRelease(context); } free(pixels); } return 1; } @end My problem is I want skin Tone Pixel how it could be possible Please help me out. Thanks in Advance

    Read the article

  • Cannot use standard android color attribute in custom color selector

    - by Manish Gupta
    So, android defines the following in themes.xml: <style name="Theme"> ... <item name="colorPressedHighlight">@color/legacy_pressed_highlight</item> </style> and: <style name="Theme.Holo"> ... <item name="colorPressedHighlight">@color/holo_blue_light</item> </style> I want to use this colorPressedHighlight as the background color for my custom Button when it is pressed. So I defined the following in res/color/app_button_background.xml: <?xml version="1.0" encoding="utf-8"?> <selector xmlns:android="http://schemas.android.com/apk/res/android" > <item android:state_pressed="true" android:drawable="?android:colorPressedHighlight"/> <item android:drawable="@android:color/transparent" /> </selector> Finally, I define my custom ImageButton style: <style name="App_ImageButtonStyle" parent="@android:style/Widget.ImageButton"> <item name="android:gravity">center</item> <item name="android:background">@color/app_button_background</item> </style> I crash on app launch with the following call stack: 06-27 20:24:41.954: E/AndroidRuntime(532): Caused by: org.xmlpull.v1.XmlPullParserException: Binary XML file line #6: <item> tag requires a 'drawable' attribute or child tag defining a drawable 06-27 20:24:41.954: E/AndroidRuntime(532): at android.graphics.drawable.StateListDrawable.inflate(StateListDrawable.java:178) 06-27 20:24:41.954: E/AndroidRuntime(532): at android.graphics.drawable.Drawable.createFromXmlInner(Drawable.java:867) 06-27 20:24:41.954: E/AndroidRuntime(532): at android.graphics.drawable.Drawable.createFromXml(Drawable.java:804) 06-27 20:24:41.954: E/AndroidRuntime(532): at android.content.res.Resources.loadDrawable(Resources.java:1920) I know that directly accessing @color/legacy_pressed_highlight or @color/holo_blue_light instead of accessing them through the colorPressedHighlight fixes the crash but it does not solve the problem. Themes can vary, hence I need to access it through the colorPressedHighlight attribute. PS: I had a similar problem to which I haven't found an answer yet. Can someone please help!

    Read the article

  • Validate a string in a table in SQL Server - CLR function or T-SQL

    - by Ashish Gupta
    I need to check If a column value (string) in SQL server table starts with a small letter and can only contain '_', '-', numbers and alphabets. I know I can use a SQL server CLR function for that. However, I am trying to implement that validation using a scalar UDF and could make very little here...I can use 'NOT LIKE', but I am not sure how to make sure I validate the string irrespective of the order of characters or in other words write a pattern in SQL for this. Am I better off using a SQL CLR function? Any help will be appreciated.. Thanks in advance Thank you everyone for their comments. This morning, I chose to go CLR function way. For the purpose of what I was trying to achieve, I created one CLR function which does the validation of an input string and have that called from a SQL UDF and It works well. Just to measure the performance of t-SQL UDF using SQL CLR function vs t- SQL UDF, I created a SQL CLR function which will just check if the input string contains only small letters, it should return true else false and have that called from a UDF (IsLowerCaseCLR). After that I also created a regular t-SQL UDF(IsLowerCaseTSQL) which does the same thing using the 'NOT LIKE'. Then I created a table (Person) with columns Name(varchar) and IsValid(bit) columns and populate that with names to test. Data :- 1000 records with 'Ashish' as value for Name column 1000 records with 'ashish' as value for Name column then I ran the following :- UPDATE Person Set IsValid=1 WHERE dbo.IsLowerCaseTSQL (Name) Above updated 1000 records (with Isvalid=1) and took less than a second. I deleted all the data in the table and repopulated the same with same data. Then updated the same table using Sql CLR UDF (with Isvalid=1) and this took 3 seconds! If update happens for 5000 records, regular UDF takes 0 seconds compared to CLR UDF which takes 16 seconds! I am very less knowledgeable on t-SQL regular expression or I could have tested my actual more complex validation criteria. But I just wanted to know, even I could have written that, would that have been faster than the SQL CLR function considering the example above. Are we using SQL CLR because we can implement we can implement lot richer logic which would have been difficult otherwise If we write in regular SQL. Sorry for this long post. I just want to know from the experts. Please feel free to ask if you could not understand anything here. Thank you again for your time.

    Read the article

  • Using LINQ to fetch result from nested SQL queries

    - by Shantanu Gupta
    This is my first question and first day in Linq so bit difficult day for me to understand. I want to fetch some records from database i.e. select * from tblDepartment where department_id in ( select department_id from tblMap where Guest_Id = @GuestId ) I have taken two DataTable. i.e. tblDepartment, tblMap Now I want to fetch this result and want to store it in third DataTable. How can I do this. I have been able to construct this query up till now after googling. var query = from myrow in _dtDepartment.AsEnumerable() where myrow.Field<int>("Department_Id") == _departmentId select myrow; Please provide me some link for learning Linq mainly for DataTables and DataSets. EDIT: I have got a very similar example here but i m still not able to understand how it is working. Please put some torch on it.

    Read the article

  • Reading bmp file for steganography

    - by Shantanu Gupta
    I am trying to read a bmp file in C++(Turbo). But i m not able to print binary stream. I want to encode txt file into it and decrypt it. How can i do this. I read that bmp file header is of 54 byte. But how and where should i append txt file in bmp file. ? I know only Turbo C++, so it would be helpfull for me if u provide solution or suggestion related to topic for the same. int main() { ifstream fr; //reads ofstream fw; // wrrites to file char c; int random; clrscr(); char file[2][100]={"s.bmp","s.txt"}; fr.open(file[0],ios::binary);//file name, mode of open, here input mode i.e. read only if(!fr) cout<<"File can not be opened."; fw.open(file[1],ios::app);//file will be appended if(!fw) cout<<"File can not be opened"; while(!fr) cout<<fr.get(); // error should be here. but not able to find out what error is it fr.close(); fw.close(); getch(); } This code is running fine when i pass txt file in binary mode

    Read the article

< Previous Page | 5 6 7 8 9 10 11 12 13 14 15 16  | Next Page >