Search Results

Search found 11178 results on 448 pages for 'syntax checking'.

Page 79/448 | < Previous Page | 75 76 77 78 79 80 81 82 83 84 85 86  | Next Page >

  • Converting Generic Type into reference type after checking its type using GetType(). How ?

    - by Shantanu Gupta
    i am trying to call a function that is defined in a class RFIDeas_Wrapper(dll being used). But when i checked for type of reader and after that i used it to call function it shows me error Cannot convert type T to RFIDeas_Wrapper. EDIT private List<string> GetTagCollection<T>(T Reader) { TagCollection = new List<string>(); if (Reader.GetType() == typeof(RFIDeas_Wrapper)) { ((RFIDeas_Wrapper)Reader).OpenDevice(); // here Reader is of type RFIDeas_Wrapper //, but i m not able to convert Reader into its datatype. string Tag_Id = ((RFIDeas_Wrapper)Reader).TagID(); //Adds Valid Tag Ids into the collection if(Tag_Id!="0") TagCollection.Add(Tag_Id); } else if (Reader.GetType() == typeof(AlienReader)) TagCollection = ((AlienReader)Reader).TagCollection; return TagCollection; } ((RFIDeas_Wrapper)Reader).OpenDevice(); , ((AlienReader)Reader).TagCollection; I want this line to be executed without any issue. As Reader will always be of the type i m specifying. How to make compiler understand the same thing.

    Read the article

  • Checking if a touch is within a UIButton's bounds.

    - by Joshua
    I am trying to make an if statement which will check whether the users touch is within a UIButton's bounds. I thought this would be an easy affair as UIButton is a subclass of UIView, however my code doesn't seem to work. This is the code I have been using. - (void)touchesMoved:(NSSet *)touches withEvent:(UIEvent *)event { NSArray *array = [touches allObjects]; UITouch *specificTouch = [array objectAtIndex:0]; currentTouch = [specificTouch locationInView:self.view]; if (CGRectContainsPoint(but.bounds, currentTouch)) { //Do something is in bounds. } //Else do nothing. }

    Read the article

  • How to code feature on checking visitor IP address in PHP ?

    - by justjoe
    i still confused on this subject And ask for any help and reference on how to check visitor IP address via PHP. i'm know it seem lazy to ask something before attempt to code something to show. but right now, i also googling to find it. hopefully someone can give general broad answer or some link to read. btw, what to be consider when we had to code some feature like this ?

    Read the article

  • Does a program exist for checking two similar directories for file differences?

    - by John Sullivan
    Is there a program to compare one folder and all subfolders to another folder and all subfolders for differences in the files contained therein (presence, absence of files, size and list of filenames)? Example of usage: I have 100 DLL files from environment 1 and I want to check if any of them are different (in size and date modified) from the 100 DLL files in environment 2. So I copy and paste all the DLLs in environment 1 into directory A, and all the DLLs in environment 2 into directory B. I then run my "directory comparison" program on directories A and B and find out that, aha, here is a list of 7 DLLs that have different modified dates and times between the two directories. EDIT: OS is windows XP

    Read the article

  • Checking for reciprocal relationships in mysql. A trivial one table problem.

    - by calumbrodie
    I have a mysql table that stores relationships. Items can be related to another item in one direction, or both items can be related to each other. I want to return all items related to my primary item - but I also want to check to see if the related item has a 'reverse relationship' to the current item and show this as a boolean |--------------|---------------| | SKU | related_SKU | |--------------|---------------| | 0001 | 0099 | | 0002 | 0099 | | 0099 | 0001 | |--------------|---------------| If I want to get all relationships for SKU=0001 SELECT related_SKU from relationships where SKU='0001' returns |--------------| | related_SKU | |--------------| | 0099 | |--------------| but what I want is |--------------|---------------| | related_SKU | reciprocal | |--------------|---------------| | 0099 | 1 | |--------------|---------------| or SELECT related_SKU from relationships where SKU='0002' |--------------|---------------| | related_SKU | reciprocal | |--------------|---------------| | 0099 | 0 | |--------------|---------------| What's the best way to do this?

    Read the article

  • Develop an ASP.NET Website using WebMatrix

    The following article explains how to install and develop a website using WebMatrix and add ASP.NET web pages to the website. One of the positive features of websites developed with WebMatrix is that the ASP.NET Helper Library and Razor Syntax can be used to provide enhanced features and dynamic content to the site. Razor Syntax is a simple and effective programming language that works well on the WebMatrix platform. As a result, a brief introduction to ASP.NET helper dynamic content and Razor Syntax is provided at the end of this article along with resources to assist in web development using Razor Syntax.

    Read the article

  • Cannot install Oracle Application server

    - by ziftech
    After succesfull installation of database 10g server, I cannot run install file for application server - it closed unexpectly. How can be problem investigated? Log file contains: Checking installer requirements... Checking operating system version: must be 5.0, 5.1 or 5.2. Actual 5.2 Passed Checking monitor: must be configured to display at least 256 colors. Actual 4294967296 Passed Checking swap space: must be greater than 1535 MB. Actual 4092MB Passed Checking Temp space: must be greater than 150 MB. Actual 5083 MB Passed All installer requirements met.

    Read the article

  • what's the difference between Routed Events and Attached Events?

    - by vverma01
    I tried to find through various sources but still unable to understand difference between routed events and attached events in WPF. Most of the places of reference for attached event following example is used: <StackPanel Button.Click="StackPanel_Click"> <Button Content="Click Me!" Height="35" Width="150" Margin="5" /> </StackPanel> Explained as: stack panel do not contain Click event and hence Button.Click event is attached to Stack Panel. Where as msdn says: You can also name any event from any object that is accessible through the default namespace by using a typename.event partially qualified name; this syntax supports attaching handlers for routed events where the handler is intended to handle events routing from child elements, but the parent element does not also have that event in its members table. This syntax resembles an attached event syntax, but the event here is not a true attached event. Instead, you are referencing an event with a qualified name. According to MSDN information as pasted above, the above example of Buttons and StackPanel is actually a routed event example and not true attached event example. In case if above example is truly about usage of attached event (Button.Click="StackPanel_Click") then it's in contradiction to the information as provided at MSDN which says Another syntax usage that resembles typename.eventname attached event syntax but is not strictly speaking an attached event usage is when you attach handlers for routed events that are raised by child elements. You attach the handlers to a common parent, to take advantage of event routing, even though the common parent might not have the relevant routed event as a member. A similar question was raised in this Stack Overflow post, but unfortunately this question was closed before it could collect any response. Please help me to understand how attached events are different from routed events and also clarify the ambiguity as pointed above.

    Read the article

  • checking whether 4 points in a plane define a square ??

    - by osabri
    how to check whether 4 points in the plane define a square? what's the function which given a point and a value of the area of a square as input parameters returns four squares(define a corresponding type) with sides parallel to the x axis and y axis this how i start: #include <stdio.h> #include<math.h> struct point{ float x; float y; } typedef struct point POINT; struct square{ struct point p1; struct point p2; struct point p3; struct point p4; } typedef struct square SQUARE; int main() { int point; printf("point coordinate"); printf("\n\n"); printf("enter data\n");

    Read the article

  • Codeigniter/mySQL question. Checking if several inserts are possible before actual insertion.

    - by Ethan
    Hey SO, So I'm trying to perform a couple inserts at once that are kind of co-dependent on each other. Let's say I'm doing a dog rating website. Anyone can add a dog to my database, but in doing so they also need to add a preliminary rating of the dog. Other people can then rate the dog afterwards. The dogs to ratings is a many to one relationship: a dog has many ratings. This means for my preliminary add, since I have the person both rate and add the dog, I need to take the rating, and set a foreign key to the dog's primary key. As far as I know, this means I have to actually add the dog, then check what that new addition's primary key is, and then put that in my rating before insertion. Now suppose something were to go wrong with the rating's insert, be it a string that's too long, or something that I've overlooked somehow. If the rating's failed, the dog has already been inserted, but the rating has not. In this case, I'd like the dog to not have been added in the first place. Does this mean I have to write code that says "if the rating fails, do a remove for the dog," or is there a way to predict what the key will be for the dog should everything go as planned. Is there a way to say "hold that spot," and then if everything works, add it? Any help would be greatly appreciated. Thanks!!

    Read the article

  • Is there an example of checking on if a WCF Service is online?

    - by apolfj
    I will have a client application using a proxy to a WCF Service. This client will be a windows form application doing basicHttpBinding to N number of endpoints at an address. The problem I want to resolve is that when any windows form application going across the internet to get my web server that must have my web server online will need to know that this particular WCF Service is online. I need an example of how this client on a background thread will be able to do a polling of just "WCF Service.., Are You There?" This way our client application can notify clients before they invest a lot of time in building up work client-side to only be frustrated with the WCF Service being offline. Again I am looking for a simple way to check for WCF Service "Are You There?"

    Read the article

  • What are the differences between programming languages? [closed]

    - by Omega
    Once upon a time, I heard from someone the only difference between programming languages is the syntax I wanted to deny it - to say that there are other fundamental aspects that truly set a language apart from others than just syntax. But I couldn't... So, can you? Whenever I search Google for something like "differences between programming languages", the results tend to be debates between two specific languages (I'd like something more general) - however, some of the aspects that people seemed to debate the most were: Object-Oriented Method/Operator overloading (I actually see this rather related to syntax) Garbage-Collection (While it seems like a good difference, for some reason it doesn't seem that "fundamental") What important aspects other than syntax can you think of?

    Read the article

  • More useful Sql Server Serivce Broker Queries

    - by ChrisD
    SELECT 'Checking Broker Service Status...' IF (select Top 1 is_broker_enabled from sys.databases where name = 'NWMESSAGE')=1     SELECT ' Broker Service IS Enabled'  -- Should return a 1. ELSE     SELECT '** Broker Service IS DISABLED ***' /* If Is_Broker_enabled returns 0, uncomment and run this code ALTER DATABASE NWMESSAGE SET SINGLE_USER WITH ROLLBACK IMMEDIATE GO Alter Database NWMESSAGE Set enable_broker GO ALTER DATABASE NWDataChannel SET MULTI_USER GO */ SELECT 'Checking For Disabled Queues....' -- ensure the queues are enabled --  0 indicates the queue is disabled. Select '** Receive Queue Disabled: '+name from sys.service_queues where is_receive_enabled = 0 --select [name], is_receive_enabled from sys.service_queues; /*If the queue is disabled, to enable it alter queue QUEUENAME with status=on; – replace QUEUENAME with the name of your queue */ -- Get General information about the queues --select * from sys.service_queues -- Get the message counts in each queue SELECT 'Checking Message Count for each Queue...' select q.name, p.rows from sys.objects as o join sys.partitions as p on p.object_id = o.object_id join sys.objects as q on o.parent_object_id = q.object_id join sys.service_queues sq on sq.name = q.name where p.index_id = 1 -- Ensure all the queue activiation sprocs are present SELECT 'Checking for Activation Stored Procedures....' SELECT  '** Missing Procedure:  '+q.name  From sys.service_queues q Where NOT Exists(Select * from sysobjects where xtype='p' and name='activation_'+q.name) and q.activation_procedure is not null DECLARE @sprocs Table (Name Varchar(2000)) Insert into @sprocs Values ('Echo') Insert into @sprocs Values ('HTTP_POST') Insert into @sprocs Values ('InitializeRecipients') Insert into @sprocs Values ('sp_EnableRecipient') Insert into @sprocs Values ('sp_ProcessReceivedMessage') Insert into @sprocs Values ('sp_SendXmlMessage') SELECT 'Checking for required stored procedures...' SELECT  '** Missing Procedure:  '+s.name  From @sprocs s Where NOT Exists(Select * from sysobjects where xtype='p' and name=s.name) GO -- Check the services Select 'Checking Recipient Message Services...' Select '** Missing Message Service:' + r.RecipientName +'MessageService' From Recipient r Where not exists (Select * from sys.services s where  s.name  COLLATE SQL_Latin1_General_CP1_CI_AS= r.RecipientName+'MessageService') DECLARE @svcs Table (Name Varchar(2000)) Insert into @svcs Values ('XmlMessageSendingService') SELECT  '** Missing Service:  '+s.name  From @svcs s Where NOT Exists(Select * from sys.services where name=s.name COLLATE SQL_Latin1_General_CP1_CI_AS) GO /*** To Test a message send Run: sp_SendXmlMessage  'TSQLTEST', 'CommerceEngine','<Root><Text>Test</Text></Root>' */ Select CAST(message_body as XML) as xml, * From XmlMessageSendingQueue /*** clean out all queues declare @handle uniqueidentifier declare conv cursor for   select conversation_handle from sys.conversation_endpoints open conv fetch next from conv into @handle while @@FETCH_STATUS = 0 Begin    END Conversation @handle with cleanup    fetch next from conv into @handle End close conv deallocate conv ***********************

    Read the article

  • What is a good way of checking to see if a particular user may access a particular file?

    - by Rising Star
    I am working on application which runs as a special unprivileged user. I would like to be able to easily check to see if the user can read a given file. It seems like this should be easy, even when I go into the file in Windows Explorer and see that the read permission is checked, it sometimes seems that there is still something preventing the user from reading the file (such as a parent directory that the user cannot browse) when I try to read it as the user programmatically. The user has no console logon permission, so I can't just log in as the user and try to read the file. So... If I want to know, "Does UserBob have access to file c:\specialPath\specialFile, what is an easy way to find out? BTW, my environment is Windows Server 2003.

    Read the article

  • Two collections and a for loop. (Urgent help needed) Checking an object variable against an inputted

    - by Elliott
    Hi there, I'm relatively new to java, I'm certain the error is trivial. But can't for the life of me spot it. I have an end of term exam on monday and currently trying to get to grips with past papers! Anyway heregoes, in another method (ALGO_1) I search over elements of and check the value H_NAME equals a value entered in the main. When I attempt to run the code I get a null pointer exception, also upon trying to print (with System.out.println etc) the H_NAME value after each for loop in the snippet I also get a null statement returned to me. I am fairly certain that the collection is simply not storing the data gathered up by the Scanner. But then again when I check the collection size with size() it is about the right size. Either way I'm pretty lost and would appreciate the help. Main questions I guess to ask are: from the readBackground method is the data.add in the wrong place? is the snippet simply structured wrongly? oh and another point when I use System.out.println to check the Background object values name, starttime, increment etc they print out fine. Thanks in advance.(PS im guessing the formatting is terrible, apologies.) snippet of code: for(Hydro hd: hydros){ System.out.println(hd.H_NAME); for(Background back : backgs){ System.out.println(back.H_NAME); if(back.H_NAME.equals(hydroName)){ //get error here public static Collection<Background> readBackground(String url) throws IOException { URL u = new URL(url); InputStream is = u.openStream(); InputStreamReader isr = new InputStreamReader(is); BufferedReader b = new BufferedReader(isr); String line =""; Vector<Background> data = new Vector<Background>(); while((line = b.readLine())!= null){ Scanner s = new Scanner(line); String name = s.next(); double starttime = Double.parseDouble(s.next()); double increment = Double.parseDouble(s.next()); double sum = 0; double p = 0; double nterms = 0; while((s.hasNextDouble())){ p = Double.parseDouble(s.next()); nterms++; sum += p; } double pbmean = sum/nterms; Background SAMP = new Background(name, starttime, increment, pbmean); data.add(SAMP); } return data; } Edit/Delete Message

    Read the article

  • Scanning, Checking, Converting, Copying values ... How to ? -- C --

    - by ZaZu
    Hi there, Its been a while now and im still trying to get a certain code to work. I asked some question about different commands etc. before, but now I hope this is the final one (combining all questions in one code). I basically want to : *Scan an input (should be character ? ) *Check if its a number *If not, return error *Convert that character into a float number *Copy the value to another variable ( I called it imp here) Here is what I came up with : #include<stdio.h> #include<stdlib.h> #include<ctype.h> main(){ int digits; float imp=0; int alpha; do{ printf("Enter input\n\n"); scanf("\n%c",&alpha); digits=isdigit(alpha); if(digits==0){ printf("error\n\n"); } imp=atof(alpha); }while(digits==0); } The problem is this code does not work at all ... It gives me that atof must be of a const char and whenever I try changing it around, it just keeps failing. I am frustrated and forced to ask here, because I believe I have tried alot and I keep failing, but I wont be relieved until I get it to work xD So I really need your help guys. Please tell me why isnt this code working, what am I doing wrong ? I am still learning C and really appreciate your help :)

    Read the article

  • Checking if a file is a directory or just a file.

    - by Jookia
    I'm writing a program to check if something is a file or is a directory. Is there a better way to do it than this? #include <stdio.h> #include <sys/types.h> #include <dirent.h> #include <errno.h> int isFile(const char* name) { DIR* directory = opendir(name); if(directory != NULL) { closedir(directory); return 0; } if(errno == ENOTDIR) { return 1; } return -1; } int main(void) { const char* file = "./testFile"; const char* directory = "./"; printf("Is %s a file? %s.\n", file, ((isFile(file) == 1) ? "Yes" : "No")); printf("Is %s a directory? %s.\n", directory, ((isFile(directory) == 0) ? "Yes" : "No")); return 0; }

    Read the article

  • How do we name test methods where we are checking for more than one condition?

    - by Sandbox
    I follow the technique specified in Roy Osherove's The Art Of Unit Testing book while naming test methods - MethodName_Scenario_Expectation. It suits perfectly well for my 'unit' tests. But,for tests that I write in 'controller' or 'coordinator' class, there isn't necessarily a method which I want to test. For these tests, I generate multiple conditions which make up one scenario and then I verify the expectation. For example, I may set some properties on different instances, generate an event and then verify that my expectation from controller/coordinator is being met. Now, my controller handles events using a private event handler. Here my scenario is that, I set some properties, say 3 condition1,condition2 and condition3 Also, my scenario includes an event is raised I don't have a method name as my event handler is private. How do I name such a test method?

    Read the article

< Previous Page | 75 76 77 78 79 80 81 82 83 84 85 86  | Next Page >