Search Results

Search found 2714 results on 109 pages for 'mike cooper'.

Page 15/109 | < Previous Page | 11 12 13 14 15 16 17 18 19 20 21 22  | Next Page >

  • Why does C's "fopen" take a "const char *" as its second argument?

    - by Chris Cooper
    It has always struck me as strange that the C function "fopen" takes a "const char *" as the second argument. I would think it would be easier to both read your code and implement the library's code if there were bit masks defined in stdio.h, like "IO_READ" and such, so you could do things like: FILE* myFile = fopen("file.txt", IO_READ & IO_WRITE); Is there a programmatic reason for the way it actually is, or is it just historic? (i.e. "That's just the way it is.")

    Read the article

  • What does it mean for an OS to "execute within user processes"? Do any modern OS's use that approach

    - by Chris Cooper
    I have recently become interested in operating system, and a friend of mine lent me a book called Operating Systems: Internals and Design Principles (I have the third edition), published in 1998. It's been a very interesting book so far, but I have come to the part dealing with process control, and it's using UNIX System V as one of its examples of an operating system that executes within user processes. This concept has struck me as a little strange. First of all, does this mean that OS instructions and data are stored in each user of the processes? Probably not, because that would be an absurdly redundant scheme. But if not, then what does it mean to "execute within" a user process? Do any modern operating systems use this approach? It seems much more logical to have the operating system execute as its own process, or even independently of all processes, if you're short on memory. All the inter-accessiblilty of process data required for this layout seems to greatly complicate things. (But maybe that's just because I don't quite get the concept ;D) Here is what the book says: "Execution within User Processes: An alternative that is common with operation systems on smaller machines is to execute virtually all operating system software in the context of a user process. ... "

    Read the article

  • How do I serialise a graph in Java without getting StackOverflowException?

    - by Tim Cooper
    I have a graph structure in java, ("graph" as in "edges and nodes") and I'm attempting to serialise it. However, I get "StackOverflowException", despite significantly increasing the JVM stack size. I did some googling, and apparently this is a well known limitation of java serialisation: that it doesn't work for deeply nested object graphs such as long linked lists - it uses a stack record for each link in the chain, and it doesn't do anything clever such as a breadth-first traversal, and therefore you very quickly get a stack overflow. The recommended solution is to customise the serialisation code by overriding readObject() and writeObject(), however this seems a little complex to me. (It may or may not be relevant, but I'm storing a bunch of fields on each edge in the graph so I have a class JuNode which contains a member ArrayList<JuEdge> links;, i.e. there are 2 classes involved, rather than plain object references from one node to another. It shouldn't matter for the purposes of the question). My question is threefold: (a) why don't the implementors of Java rectify this limitation or are they already working on it? (I can't believe I'm the first person to ever want to serialise a graph in java) (b) is there a better way? Is there some drop-in alternative to the default serialisation classes that does it in a cleverer way? (c) if my best option is to get my hands dirty with low-level code, does someone have an example of graph serialisation java source-code that can use to learn how to do it?

    Read the article

  • Is "for(;;)" faster than "while (TRUE)"? If not, why do people use it?

    - by Chris Cooper
    for (;;) { //Something to be done repeatedly } I have seen this sort of thing used a lot, but I think it is rather strange... Wouldn't it be much clearer to say while (TRUE), or something along those lines? I'm guessing that (as is the reason for many-a-programmer to resort to cryptic code) this is a tiny margin faster? Why, and is it REALLY worth it? If so, why not just define it this way: #DEFINE while(TRUE) for(;;)

    Read the article

  • How are two-dimensional arrays formatted in memory?

    - by Chris Cooper
    In C, I know I can dynamically allocate a two-dimensional array on the heap using the following code: int** someNumbers = malloc(arrayRows*sizeof(int*)); for (i = 0; i < arrayRows; i++) { someNumbers[i] = malloc(arrayColumns*sizeof(int)); } Clearly, this actually creates a one-dimensional array of pointers to a bunch of separate one-dimensional arrays of integers, and "The System" can figure you what I mean when I ask for: someNumbers[4][2]; But when I statically declare a 2D array, as in the following line...: int someNumbers[ARRAY_ROWS][ARRAY_COLUMNS]; ...does a similar structure get created on the stack, or is it of another form completely? (i.e. is it a 1D array of pointers? If not, what is it, and how do references to it get figured out?) Also, when I said, "The System," what is actually responsible for figuring that out? The kernel? Or does the C compiler sort it out while compiling?

    Read the article

  • If free() knows the length of my array, why can't I ask for it in my own code?

    - by Chris Cooper
    I know that it's a common convention to pass the length of dynamically allocated arrays to functions that manipulate them: void initializeAndFree(int* anArray, int length); int main(){ int arrayLength = 0; scanf("%d", &arrayLength); int* myArray = (int*)malloc(sizeof(int)*arrayLength); initializeAndFree(myArray, arrayLength); } void initializeAndFree(int* anArray, int length){ int i = 0; for (i = 0; i < length; i++) { anArray[i] = 0; } free(anArray); } but if there's no way for me to get the length of the allocated memory from a pointer, how does free() "automagically" know what to deallocate? Why can't I get in on the magic, as a C programmer? Where does free() get its free (har-har) knowledge from?

    Read the article

  • How to write a custom control, which can auto resize just like TextBox in a grid cell?

    - by Cooper.Wu
    I have tried to override MeasureOverride, but the available size will not change when i resize a grid. which contains my control. class MyFrameworkElement : FrameworkElement { override Size MeasureOverride(Size available) { this.Width = available.Width; this.Height = available.Width this.UpdateLayout(); // do something... } } This works only when application start. How to implement a auto resize control, just like a TextBox in a grid cell. The TextBox will auto resize to fill grid cell if grid resized.

    Read the article

  • How does Python store lists internally?

    - by Mike Cooper
    How are lists in python stored internally? Is it an array? A linked list? Something else? Or does the interpreter guess at the right structure for each instance based on length, etc. If the question is implementation dependent, what about the classic CPython?

    Read the article

  • "Easiest" way to track unique visitors to a page, in real time?

    - by Cooper
    I need to record in "real time" (perhaps no more than 5 minute delay?) how many unique visitors a given page on my website has had in a given time period. I seek an "easy" way to do this. Preferably the results would be available via a database query. Two things I've tried that failed (so far): Google Analytics: Does the tracking/reporting, but not in real time - results are delayed by hours. Mint Analytics ( http://www.haveamint.com/ ): Tracks in real time, but seems to aggregate data in a way that prevents reporting of unique visitors to a single page over an arbitrary time frame. So, does anyone know how to make Mint Analytics do what I want, or can anyone recommend an analytics package or programmed approach that will do what I need?

    Read the article

  • What can you do in C without "std" includes? Are they part of "C," or just libraries?

    - by Chris Cooper
    I apologize if this is a subjective or repeated question. It's sort of awkward to search for, so I wasn't sure what terms to include. What I'd like to know is what the basic foundation tools/functions are in C when you don't include standard libraries like stdio and stdlib. What could I do if there's no printf(), fopen(), etc? Also, are those libraries technically part of the "C" language, or are they just very useful and effectively essential libraries?

    Read the article

  • Specifying $(this).val() for two different elements (by class)

    - by Chaya Cooper
    What would be the correct syntax for specifying 2 elements by class to evaluate their values when they have different classes? This snippet adds and/or removes values from "increase_priority1" when the user has selected both a complaint and ranked the importance level of the issue, however when I added the 2nd element (".complaint select") to the If Statement it stopped working properly and only accepts input from the 2nd item (Waist) after the 1rst item (Shoulders) has been selected. I believe the problem is that it's unable to determine which ".complaint select" to use, but I haven't been able to figure out how to use (this) for the 2nd element, or another similar approach. The complete function includes apx. 20 similar pairs of If Statements to set & unset other elements, and a working example with 4 pairs is available at http://jsfiddle.net/chayacooper/vWLEn/168/ I'm trying to avoid using ID's because that becomes pretty cumbersome to do for 25 Select elements and each of their values (ID's were also problematic because it stopped working when I added a 2nd element to the If Statement for removing/unsetting a value) Javascript var $increase_priority1 = $(".increase_priority1"); // If value is "Shoulders", complaint was Shoulders too small (select name=Shoulders value=Too_small) and it was assigned a level 1 priority (select class="ranking shoulders" value=1). // var's for other issues and priority levels go here $(".ranking, .complaint select").change(function() { var name = $(this).data("name"); //get priority name if ($(".complaint select").val() === "Too_small" && $(this).val() == 1 && !$(this).data("increase_priority1")) { //rank is 1, and not yet added to priority list $("<option>", {text:name, val:name}).appendTo($increase_priority1); $(this).data("increase_priority1", true); //flag as a priority item } if ($(this).data("increase_priority1") && ($(this).val() != 1 || $(".complaint select").val() != "Too_small")) { //is in priority list, but now demoted $("option[value=" + name + "]", $increase_priority1).remove(); $(this).removeData("increase_priority1"); //no longer a priority item } // Similar If Statements to set & unset other elements go here }); HTML <div> <label>To Increase - 1rst Priority <select name="modify_increase_1rst[]" class="increase_priority1" multiple> </select></label> </div> <div> <span class="complaint"> <label>Shoulders</label> <select name=Shoulders> <option value="null">Select</option><option value="Too_small">Too Small</option><option value="Too_big">Too Big</option><option value="Too_expensive">Too expensive</option> </select> </span> <label>Ranking</label> <select name="importance_bother_shoulders" class="ranking shoulders" data-name="Shoulders"> <option value="Null">Select</option><option value="1">1</option><option value="2">2</option><option value="3">3</option><option value="4">4</option> <option value="5">5</option> </select> </div> <div> <span class="complaint"> <label>Waist</label> <select name=Waist> <option value="null">Select</option><option value="Too_small">Too Small</option><option value="Too_big">Too Big</option><option value="Too_expensive">Too expensive</option> </select> </span> <label>Ranking</label> <select name="importance_bother_waist" class="ranking waist" data-name="Waist"> <option value="Null">Select</option><option value="1">1</option><option value="2">2</option><option value="3">3</option><option value="4">4</option> <option value="5">5</option> </select> </div>

    Read the article

  • Problem enabling OpenGL ES depth test on iPhone. What steps are necessary?

    - by Chris Cooper
    I remember running into this problem when I started using OpenGL in OS X. Eventually I solved it, but I think that was just by using glut and c++ instead of Objective-C... The lines of code I have in init for the ES1Renderer are as follows: glEnable(GL_DEPTH_TEST); glDepthFunc(GL_LEQUAL); Then in the render method, I have this: glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); I assume I'm missing something specific to either the iPhone or ES. What other steps are required to enable the depth test? Thanks

    Read the article

  • PrintingPermissionLevel, SafePrinting, and restrictions

    - by Steve Cooper
    There is a PrintingPermission attribute in the framework which takes a PrintingPermissionLevel enumeration with one of these values; NoPrinting: Prevents access to printers. NoPrinting is a subset of SafePrinting. SafePrinting: Provides printing only from a restricted dialog box. SafePrinting is a subset of DefaultPrinting. DefaultPrinting: Provides printing programmatically to the default printer, along with safe printing through semirestricted dialog box. DefaultPrinting is a subset of AllPrinting. AllPrinting: Provides full access to all printers. The documentation is really sparse, and I wondered if anyone can tell me more about the SafePrinting option. What does the documentation mean when it says "Provides printing only from a restricted dialog box." I have no idea what this means. Can anyone shed any light? This subject is touched in the MS certification 70-505: TS: Microsoft .NET Framework 3.5, Windows Forms Application Development and so I'm keen to find out more.

    Read the article

  • Page Entirely Blank Despite Having Source Code! (TinyMCE, FireFox)

    - by Chris Cooper
    Alright guys, here's a tough one... In reference to this page. The page will seemingly randomly not display the output of server when using Firefox (version 3.5). I have not seen this problem occur in Safari or IE. The best way to have the problem occur is just reload the page about 10 times and it ought to have happened by then, and once it does - it'll continue on subsequent refreshes until you change the page. The problem is literally the browser not displaying the output (code). Viewing the source shows all the appropriate code yet the browser displays a blank white page. The web developer and firebug plugins don't show any errors that would indicate the problem. I have tested this on a separate system and OS and it occurs in Firefox on that system as well. The problem did not occur until after TinyMCE (A Rich Text Editor JavaScript library for textareas) was added to the project. TinyMCE works however, where it should. I know this is a confusing problem, but I am completely lost as to what could be causing this significant issue. Thanks in advance. EDIT: If it's any help... I've noticed that if I cause a css file error by changing a stylesheet source to something non-existant (xxx.css), the page will continuously display without a problem (besides whatever related css not showing due to the src change). I've also noticed that causing any simple javascript error with some bad code will cause the page to load properly continuously (besides of course javascript not running on the page). EDIT#2: Moving all <script> tags down at the tail of the <body> 'fixes' (well, hides) this error and the page shows normally. A band-aid.

    Read the article

  • Selenium : Handling Loading screens obscuring the web elements. (Java)

    - by Sheldon Cooper
    I'm writing an automated test case for a web page. Here's my scenario. I have to click and type on various web elements in an html form. But, sometimes while typing on a text field, an ajax loading image appears , fogging all elements i want to interact with. So, I'm using web-driver wait before clicking on the actual elements like below, WebdriverWait innerwait=new WebDriverWait(driver,30); innerwait.until(ExpectedConditions.elementToBeClickable(By.xpath(fieldID))); driver.findelement(By.xpath(fieldID)).click(); But the wait function returns the element even if it is fogged by another image and is not clickable. But the click() throws an exception as Element is not clickable at point (586.5, 278). Other element would receive the click: <div>Loading image</div> Do I have to check every time if the loading image appeared before interacting with any elements?.(I can't predict when the loading image will appear and fog all elements.) Is there any efficient way to handle this? Currently I'm using the following function to wait till the loading image disappears, public void wait_for_ajax_loading() throws Exception { try{ Thread.sleep(2000); if(selenium.isElementPresent("id=loadingPanel")) while(selenium.isElementPresent("id=loadingPanel")&&selenium.isVisible("id=loadingPanel"))//wait till the loading screen disappears { Thread.sleep(2000); System.out.println("Loading...."); }} catch(Exception e){ Logger.logPrint("Exception in wait_for_ajax_loading() "+e); Logger.failedReport(report, e); driver.quit(); System.exit(0); } } But I don't know exactly when to call the above function, calling it at a wrong time will fail. Is there any efficient way to check if an element is actually clickable? or the loading image is present? Thanks..

    Read the article

  • Difficulty Inserting from HTML form into MySQL (created in Workbench)

    - by Chaya Cooper
    I created a MySQL database in Workbench 5.2.35 for purposes of storing and using information submitted in html forms but I'm having difficulty inserting records from the html form. The relevant SQL script was saved as Demo2.sql, the schema is C2F, and the table is customer_info. I wasn't sure if that was the problem, so I tried replacing the database name (Demo2) with the schema name, but that didn't work either. My html file includes: form action="insert.php" method="post" The insert.php file states: ?php $con = mysql_connect("localhost","root","****"); if (!$con) { die('Could not connect: ' . mysql_error()); } mysql_select_db("Demo2", $con); $sql="INSERT INTO customer_info(fname, lname, user, password, reminder, answer) VALUES ('$_POST[fname]','$_POST[lname]','$_POST[user]','$_POST[password]','$_POST[reminder]','$_POST[answer]')"; if (!mysql_query($sql,$con)) { die('Error: ' . mysql_error()); } echo "1 record added"; mysql_close($con) ? I've also tried INSERT INTO c2f.customer_info(fname, lname, etc. and INSERT INTO 'c2f'.'customer_info'

    Read the article

  • Ado.net dataservices BeginExecuteBatch call works on development fails on production server with Obj

    - by Mike Morley
    We have an ado.net dataservices 1.0 call that is being passed to a [WebGet] service operation as a batch through BeginExecuteBatch. Everything works perfectly on our development server - we have the project configured to use IIS instead of the cassini web server to make it as close to our production server as we can. When we publish to the production server, all the service operations work perfectly except the batch call, which fails with Object does not match target type. . I have not been able to find any cause for this. I can even run a single non-batch style GET operation against the [WebGet] service by copying the URL used in the batch and pasting it in a browser. I have not been able to find any information to help me solve this - any guidance would be most appreciated. Thanks, Mike M. Error message From Fiddler: HTTP/1.1 500 Internal Server Error Content-Type: application/xml DataServiceVersion: 1.0; An error occurred while processing this request. Object does not match target type. System.Reflection.TargetException at System.Reflection.RuntimeMethodInfo.CheckConsistency(Object target) at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture, Boolean skipVisibilityChecks) at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture) at System.Data.Services.RequestUriProcessor.CreateFirstSegment(IDataService service, String identifier, Boolean checkRights, String queryPortion, Boolean& crossReferencingUrl) at System.Data.Services.RequestUriProcessor.CreateSegments(String[] segments, IDataService service) at System.Data.Services.RequestUriProcessor.ProcessRequestUri(Uri absoluteRequestUri, IDataService service) at System.Data.Services.DataService`1.BatchDataService.HandleBatchContent(Stream responseStream)

    Read the article

  • JSF html component on WebSphere 7.0

    - by Mike Schall
    We are in the process of upgrading to WebSphere 7.0 on Windows 2008 R2. Our applications currently run on WebSphere 6.1 on Windows 2003. We use custom controls we wrote using JSF 1.1 in our applications. Our controls seem to render and interact fine, however whenever we use a JSF HTML component such as: <%@ taglib uri="http://java.sun.com/jsf/html" prefix="h"%> ... <h:graphicImage url="#{MenuBean.bannerImagePath}" /> We get the following error: com.ibm.ws.jsp.JspCoreException: Unable to convert string '#{MenuBean.bannerImagePath}' to class javax.el.ValueExpression for attribute url: java.lang.IllegalArgumentException: Property Editor not registered with the PropertyEditorManager com.ibm.ws.jsp.JspCoreException: Unable to convert string '#{MenuBean.bannerImagePath}' to class javax.el.ValueExpression for attribute url: java.lang.IllegalArgumentException: Property Editor not registered with the PropertyEditorManager at org.apache.jasper.runtime.JspRuntimeLibrary.getValueFromPropertyEditorManager(JspRuntimeLibrary.java:939) at com.ibm._jsp._dashboard._jspx_meth_h_graphicImage_0(_dashboard.java:136) at com.ibm._jsp._dashboard._jspx_meth_f_view_0(_dashboard.java:436) at com.ibm._jsp._dashboard._jspService(_dashboard.java:109) at com.ibm.ws.jsp.runtime.HttpJspBase.service(HttpJspBase.java:98) at javax.servlet.http.HttpServlet.service(HttpServlet.java:831) at com.ibm.ws.webcontainer.servlet.ServletWrapper.service(ServletWrapper.java:1583) at com.ibm.ws.webcontainer.servlet.ServletWrapper.service(ServletWrapper.java:1523) I have found an article on IBM's website giving a possible fix: http://www-01.ibm.com/support/docview.wss?uid=swg21318801 However I have removed the specified jars and am still receiving the error message. Again our custom controls seem to work fine under WebSphere 7's JSF 1.2. Thanks for any help you can provide. Mike

    Read the article

  • How to handle ViewModel and Database in C#/WPF/MVVM App

    - by Mike B
    I have a task management program with a "Urgency" field. Valid values are Int16 currently mapped to 1 (High), 2 (Medium), 3 (Low), 4 (None) and 99 (Closed). The urgency field is used to rank tasks as well as alter the look of the items in the list and detail view. When a user is editing or adding a new task they select or view the urgency in a ComboBox. A Converter passes Strings to replace the Ints. The urgency collection is so simple I did not make it a table in the database, instead it is a, ObservableCollection(Int16) that is populated by a method. Since the same screen may be used to view a closed task the "Closed" urgency must be in the ItemsSource but I do not want the user to be able to select it. In order to prevent the user from being able to select that item in the ComboBox but still be able to see it if the item in the database has that value should I... Manually disable the item in the ComboBox in code or Xaml (I doubt it) Change the Urgency collection from an Int16 to an Object with a Selectable Property that the isEnabled property of the ComboBoxItem Binds to. Do as in 2 but also separate the urgency information into its own table in the database with a foreign key in the Tasks table None of the above (I suspect this is the correct answer) I ask this because this is a learning project (My first real WPF and first ever MVVM project). I know there is rarely one Right way to do something but I want to make sure I am learning in a reasonable manner since it if far harder to Unlearn bad habits Thanks Mike

    Read the article

  • Problem adding Contact with new API

    - by Mike
    Hello, I am trying to add a new contact to my contact list using the new ContactContract API via my application. I have the following method based on the Contact Manager example on android dev. private static void addContactCore(Context context, String accountType, String accountName, String name, String phoneNumber, int phoneType) throws RemoteException, OperationApplicationException { ArrayList<ContentProviderOperation> ops = new ArrayList<ContentProviderOperation>(); //Add contact type ops.add(ContentProviderOperation.newInsert(ContactsContract.RawContacts.CONTENT_URI) .withValue(ContactsContract.RawContacts.ACCOUNT_TYPE, accountType) .withValue(ContactsContract.RawContacts.ACCOUNT_NAME, accountName) .build()); //Add contact name ops.add(ContentProviderOperation.newInsert(ContactsContract.Data.CONTENT_URI) .withValueBackReference(ContactsContract.Data.RAW_CONTACT_ID, 0) .withValue(ContactsContract.Data.MIMETYPE, ContactsContract.CommonDataKinds.StructuredName.CONTENT_ITEM_TYPE) .withValue(ContactsContract.CommonDataKinds.StructuredName.DISPLAY_NAME, (!name.toLowerCase().equals("unavailable") && !name.equals("")) ? name : phoneNumber) .build()); //Add phone number ops.add(ContentProviderOperation.newInsert(ContactsContract.Data.CONTENT_URI) .withValueBackReference(ContactsContract.Data.RAW_CONTACT_ID, 0) .withValue(ContactsContract.Data.MIMETYPE, ContactsContract.CommonDataKinds.Phone.CONTENT_ITEM_TYPE) .withValue(ContactsContract.CommonDataKinds.Phone.NUMBER, phoneNumber) .withValue(ContactsContract.CommonDataKinds.Phone.TYPE, phoneType) .build()); //Add contact context.getContentResolver().applyBatch(ContactsContract.AUTHORITY, ops); } In one example I have the flowing values for the parameters. accountType:com.google accountName:(my google account email) name:Mike phoneNumber:5555555555 phoneType:3 The call to the function returns normally without any exception being thrown however the contact is no where to be found in the contact manager on my phone. There is also no contact with that information on my phone already. Does anyone have any insight into what I might be doing wrong?

    Read the article

  • .NET assembly cache / ngen / jit image warm-up and cool-down behavior

    - by Mike Jiang
    Hi, I have an Input Method (IME) program built with C#.NET 2.0 DLL through C++/CLI. Since an IME is always attaching to another application, the C#.NET DLL seems not able to avoid image address rebasing. Although I have applied ngen to create a native image of that C#.NET 2.0 DLL and installed it into Global Assembly Cache, it didn't improved much, approximately 12 sec. down to 9 sec. on a slow PIII level PC. Therefore I uses a small application, which loads all the components referenced by the C#.NET DLL at the boot up time, to "warm up" the native image of that DLL. It works fine to speed up the loading time to 0.5 sec. However, it only worked for a while. About 30 min. later, it seems to "cool down" again. Is there any way to control the behavior of GAC or native image to be always "hot"? Is this exactly a image address rebasing problem? Thank you for your precious time. Sincerely, Mike

    Read the article

  • Filtering log4net on method name - can't quite get it

    - by Mike Kingscott
    I'm using log4net to log my web app's progress, using Log4PostSharp to AOP-injectify all methods. This has the desired effect of logging (almost) everything and is fine. I now have a requirement to log JUST Page_Load methods to a file / console. I can obviously hamstring the log4postsharp class to do that, but then I'd be losing all the other logging. I've been looking at filters in log4net, starting with the StringMatch filter, but that only looks at the message being logged, and I'm after the method name. This put me onto the PropertyFilter, but still with no joy. My log4net.config snippet is thus: <appender name="RollingLogFileAppender" type="log4net.Appender.RollingFileAppender"> <filter type="log4net.Filter.PropertyFilter"> <key value="LocationInfo.MethodName"/> <stringToMatch value="Page_Load"/> </filter> <file value="d:\\xxxx\\yyyyy\\zzzzLog"/> As you can see, I'm trying to key into the MethodName of the logging event via LocationInfo, but I'm still getting everything logged. Can anyone assist? Thank you, Mike K.

    Read the article

  • Should an Event that has no arguments define its own custom EventArgs or simply use System.EventArgs

    - by Mike Rosenblum
    I have an event that is currently defined with no event arguments. That is, the EventArgs it sends is EventArgs.Empty. In this case, it is simplest to declare my Event handler as: EventHandler<System.EventArgs> MyCustomEvent; I do not plan on adding any event arguments to this event, but it is possible that any code could need to change in the future. Therefore, I am leaning towards having all my events always create an empty event args type that inheretis from System.EventArgs, even if there are no event args currently needed. Something like this: public class MyCustomEventArgs : EventArgs { } And then my event definition becomes the following: EventHandler<MyCustomEventArgs> MyCustomEvent; So my question is this: is it better to define my own MyCustomEventArgs, even if it does not add anything beyond inheriting from System.EventArgs, so that event arguments could be added in the future more easily? Or is it better to explicitly define my event as returning System.EventArgs, so that it is clearer to the user that there are no extra event args? I am leaning towards creating custom event arguments for all my events, even if the event arguments are empty. But I was wondering if others thought that making it clearer to the user that the event arguments are empty would be better? Much thanks in advance, Mike

    Read the article

  • What are basic programs like, recursion, Fibonacci, small trick programs?

    - by Mike
    This question may seem daft (I'm a new to 'programming' and should probably stop if this is the type of question I'm required to ask)... What are: "basic programs like, recursion, fibonacci, factorial, string manipulation, small trick programs"? I've recently read Coding Horror - the non programmer and followed the links to Kegel and How to get hired. Then I delved through some similar questions here (hence the block quote) and I realised that as a fully fledged non-programmer I probably wouldn't know if I knew recursion (or any of the others) because I wouldn't know what it looked like, or why it was used, and what the results would look like after it was used. I suppose I'm trying to get a picture of "the basics". What the principles are and why we learn them - where they'll be used and what result/s your looking for. If they'll be used as an interview question during my first interview sometime in 2020 I would like to look less ignorant than those 199 out of 200 who just don't know the how, or the why, of programming. As always...I'll get my coat. Thanks Mike

    Read the article

< Previous Page | 11 12 13 14 15 16 17 18 19 20 21 22  | Next Page >