Search Results

Search found 88095 results on 3524 pages for 'code droid'.

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

  • Emphasize Some Comments - but not Dirty the Code

    - by Jon Sandness
    I'm having trouble structuring my comments at the moment. I have major sections of the code that, when scrolling through the document, I want to be able to see those stand out. Examples: This is a normal comment: int money = 100; //start out with 100 money - This is a comment to emphasize a certain part of the code: /****** Set up all the money ******/ But I don't like that this isn't very clean. Is there a standard way of setting up this type of a comment?

    Read the article

  • What's the best language combo for code generation?

    - by Peter Turner
    I read through Code Generation in Action but never bothered to make anything of it because Ruby just doesn't fit with my lifestyle at this juncture. The book came out more on the cusp of the C# revolution, and it said that C# "was a language designed to be generated", apparently using Ruby as the generator language. In your experience, what is the ideal combination of languages to generate the most useful code?

    Read the article

  • Need Help in Pointing to focus on the Key elements in Code Review Phase?

    - by Sankar Ganesh
    Hi Friends, Let us share your views on the Code Review process, If someone gave a code snippet and ask you to review that code, then what are the major things you will focus on that code Review process. For Instance: I will check any dead code is available in that code, other than Checking Dead Code, what are the key elements to be focused on CODE REVIEW PROCESS. Thanks For Sharing Your Views Sankar Ganesh.S

    Read the article

  • Quality of Code in unit tests?

    - by m3th0dman
    Is it worth to spend time when writing unit tests in order that the code written there has good quality and is very easy to read? When writing this kinds of tests I break very often the Law of Demeter, for faster writing and not using so many variables. Technically, unit tests are not reused directly - are strictly bound to the code so I do not see any reason for spending much time on them; they only need to be functionaly.

    Read the article

  • What should come first: testing or code review?

    - by Silver Light
    Hello! I'm quite new to programming design patterns and life cycles and I was wondering, what should come first, code review or testing, regarding that those are done by separate people? From the one side, why bother reviewing code if nobody checked if it even works? From the other, some errors can be found early, if you do the review before testing. Which approach is recommended and why? Thank you!

    Read the article

  • Why 32-bit color EGL configurations fail with EGL_BAD_MATCH on Moto Droid?

    - by Gilead
    I'm trying to figure out why certain EGL configurations cause eglMakeCurrent() call to return EGL_BAD_MATCH on Motorola Droid running Android 2.1u1. This is a full list of hardware-accelerated EGL configurations (those with EGL_CONFIG_CAVEAT == EGL_NONE) as there's a few others with EGL_CONFIG_CAVEAT == EGL_SLOW_CONFIG but those are backed by PixelFlinger 1.2 meaning they're using software renderer. ID: 0 RGB: 8, 8, 8 Alpha: 8 Depth: 24 Stencil: 8 // BAD MATCH ID: 1 RGB: 8, 8, 8 Alpha: 8 Depth: 0 Stencil: 0 // BAD MATCH ID: 2 RGB: 8, 8, 8 Alpha: 8 Depth: 24 Stencil: 8 // BAD MATCH ID: 3 RGB: 8, 8, 8 Alpha: 8 Depth: 24 Stencil: 8 // BAD MATCH ID: 4 RGB: 8, 8, 8 Alpha: 8 Depth: 0 Stencil: 0 // BAD MATCH ID: 5 RGB: 8, 8, 8 Alpha: 8 Depth: 24 Stencil: 8 // BAD MATCH ID: 6 RGB: 5, 6, 5 Alpha: 0 Depth: 24 Stencil: 8 ID: 7 RGB: 5, 6, 5 Alpha: 0 Depth: 0 Stencil: 0 ID: 8 RGB: 5, 6, 5 Alpha: 0 Depth: 24 Stencil: 8 Clearly, all configurations with 32-bit color depth fail and all 16-bit ones are OK but: 1. Why? 2. WHY?! :) 3. How do I tell which ones would fail before actually trying to use them? The code below is as simple as it can get. I put if (v[0] == 6) there to check different configs, normally they're chosen by half-clever config matcher :) private void createSurface(SurfaceHolder holder) { egl = (EGL10)EGLContext.getEGL(); eglDisplay = egl.eglGetDisplay(EGL10.EGL_DEFAULT_DISPLAY); egl.eglInitialize(eglDisplay, null); int[] numConfigs = new int[1]; egl.eglChooseConfig(eglDisplay, new int[] { EGL10.EGL_NONE }, null, 0, numConfigs); EGLConfig[] configs = new EGLConfig[numConfigs[0]]; egl.eglChooseConfig(eglDisplay, new int[] { EGL10.EGL_NONE }, configs, numConfigs[0], numConfigs); int[] v = new int[1]; for (EGLConfig c : configs) { egl.eglGetConfigAttrib(eglDisplay, c, EGL10.EGL_CONFIG_ID, v); if (v[0] == 6) { eglConfig = c; } } eglContext = egl.eglCreateContext(eglDisplay, eglConfig, EGL10.EGL_NO_CONTEXT, null); if (eglContext == null || eglContext == EGL10.EGL_NO_CONTEXT) { throw new RuntimeException("Unable to create EGL context"); } eglSurface = egl.eglCreateWindowSurface(eglDisplay, eglConfig, holder, null); if (eglSurface == null || eglSurface == EGL10.EGL_NO_SURFACE) { throw new RuntimeException("Unable to create EGL surface"); } if (!egl.eglMakeCurrent(eglDisplay, eglSurface, eglSurface, eglContext)) { throw new RuntimeException("Unable to make EGL current"); } gl = (GL10)eglContext.getGL(); }

    Read the article

  • How does an optimizing compiler react to a program with nested loops?

    - by D.Singh
    Say you have a bunch of nested loops. public void testMethod() { for(int i = 0; i<1203; i++){ //some computation for(int k=2; k<123; k++){ //some computation for(int j=2; j<12312; j++){ //some computation for(int l=2; l<123123; l++){ //some computation for(int p=2; p<12312; p++){ //some computation } } } } } } When the above code reaches the stage where the compiler will try to optimize it (I believe it's when the intermediate language needs to converted to machine code?), what will the compiler try to do? Is there any significant optimization that will take place? I understand that the optimizer will break up the loops by means of loop fission. But this is only per loop isn't it? What I mean with my question is will it take any action exclusively based on seeing the nested loops? Or will it just optimize the loops one by one? If the Java VM complicates the explanation then please just assume that it's C or C++ code.

    Read the article

  • Code formatter for SSMS

    - by blakmk
      I was searching recently for a code formatter for T-Sql and I came accross this nice little utility that I wanted to share: http://www.wangz.net/cgi-bin/pp/gsqlparser/sqlpp/sqlformat.tpl I've been dealing with a lot of legacy code latley and there is nothing I find more infuriating than unformatted code. This tool seems to work quite well. Just one click and it formats everything nicely. There is also a free web version.                                           This Web Page Created with PageBreeze Free HTML Editor

    Read the article

  • Demonstrate bad code to client?

    - by jtiger
    I have a new client that has asked me to do a redesign of their website, an ASP.NET Webforms application that was developed by another consultant. It seemed straight-forward (it never is) but I took a look at the code to make sure I knew what I was in for. This application was not written well. At all. It is extremely vulnerable to SQL Injection attacks, business logic is spread throughout the entire application, a lot of duplication, and dead end code that does nothing. On top of that, it keeps throwing exceptions that are being smothered, so it all appears to be running smoothly. My job is to simply update the html and css, but much of the html is being generated in business logic and would be a nightmare for me to sort everything out. My estimates on the redesign were longer than the client was aiming for, and they are asking why so long. How can I explain to my client just how bad this code is? In their mind, the application is running great and the redesign should be a quick one-off. It's my word against the previous consultant, so how can I actually give simple, concrete examples that a non-technical client would understand?

    Read the article

  • Code structure for multiple applications with a common core

    - by Azrael Seraphin
    I want to create two applications that will have a lot of common functionality. Basically, one system is a more advanced version of the other system. Let's call them Simple and Advanced. The Advanced system will add to, extend, alter and sometimes replace the functionality of the Simple system. For instance, the Advanced system will add new classes, add properties and methods to existing Simple classes, change the behavior of classes, etc. Initially I was thinking that the Advanced classes simply inherited from the Simple classes but I can see the functionality diverging quite significantly as development progresses, even while maintaining a core base functionality. For instance, the Simple system might have a Project class with a Sponsor property whereas the Advanced system has a list of Project.Sponsors. It seems poor practice to inherit from a class and then hide, alter or throw away significant parts of its features. An alternative is just to run two separate code bases and copy the common code between them but that seems inefficient, archaic and fraught with peril. Surely we have moved beyond the days of "copy-and-paste inheritance". Another way to structure it would be to use partial classes and have three projects: Core which has the common functionality, Simple which extends the Core partial classes for the simple system, and Advanced which also extends the Core partial classes for the advanced system. Plus having three test projects as well for each system. This seems like a cleaner approach. What would be the best way to structure the solution/projects/code to create two versions of a similar system? Let's say I later want to create a third system called Extreme, largely based on the Advanced system. Do I then create an AdvancedCore project which both Advanced and Extreme extend using partial classes? Is there a better way to do this? If it matters, this is likely to be a C#/MVC system but I'd be happy to do this in any language/framework that is suitable.

    Read the article

  • Need help eliminating dead code paths and variables from C source code

    - by Anjum Kaiser
    I have a legacy C code on my hands, and I am given the task to filter dead/unused symbols and paths from it. Over the time there were many insertions and deletions, causing lots of unused symbols. I have identified many dead variables which were only being written to once or twice, but were never being read from. Both blackbox/whitebox/regression testing proved that dead code removal did not affected any procedures. (We have a comprehensive test-suite). But this removal was done only on a small part of code. Now I am looking for some way to automate this work. We rely on GCC to do the work. P.S. I'm interested in removing stuff like: variables which are being read just for the sake of reading from them. variables which are spread across multiple source files and only being written to. For example: file1.c: int i; file2.c: extern int i; .... i=x;

    Read the article

  • How to tell whether Code Access Security is allowed in library code

    - by Sander Rijken
    In .NET 4 Code Access Security (CAS) is deprecated. Whenever you call a method that implicitly uses it, it fails with a NotSupportedException, that can be resolved with a configuration switch that makes it fall back to the old behavior. We have a common library that's used in both .NET 3.5 and .NET 4, so we need to be able to tell whether or not we should use the CAS method. For example, in .NET 3.5 I should call: Assembly.Load(string, Evidence); Whereas in .NET 4 I want to call Assembly.Load(string); Calling Load(string, Evidence) throws a NotSupportedException. Of course this works, but I'd like to know if there's a better method: try { asm = Assembly.Load(someString, someEvidence); } catch(NotSupportedException) { asm = Assembly.Load(someString); }

    Read the article

  • How to tell wether Code Access Security is allowed in library code

    - by Sander Rijken
    in .NET 4 Code Access Security (CAS) is deprecated. Whenever you call a method that implicitly uses it, it fails with a NotSupportedException, that can be resolved with a configuration switch that makes it fall back to the old behavior. We have a common library that's used in both .NET 3.5 and .NET 4, so we need to be able to tell wether or not we should use the CAS method. For example, in .NET 3.5 I should call: Assembly.Load(string, Evidence); Whereas in .NET 4 I want to call Assembly.Load(string); Calling Load(string, Evidence) throws a NotSupportedException. Ofcourse this works, but I'd like to know if there's a better method: try { asm = Assembly.Load(someString, someEvidence); } catch(NotSupportedException) { asm = Assembly.Load(someString); }

    Read the article

  • Decision Tree code golf

    - by Chris Jester-Young
    In Google Code Jam 2009, Round 1B, there is a problem called Decision Tree that lent itself to rather creative solutions. Post your shortest solution; I'll update the Accepted Answer to the current shortest entry on a semi-frequent basis, assuming you didn't just create a new language just to solve this problem. :-P Current rankings: 107 Perl 121 PostScript (binary) 136 Ruby 154 Arc 160 PostScript (ASCII85) 170 PostScript 192 Python 199 Common Lisp 214 LilyPond 222 JavaScript 273 Scheme 280 R 312 Haskell 314 PHP 339 m4 346 C 406 Fortran 462 Java 476 Java (well, kind of) 718 OCaml 759 F# 1741 sed C++ not qualified for now

    Read the article

  • Array Searching code challenge

    - by RCIX
    Here's my (code golf) challenge: Take two arrays of bytes and determine if the second array is a substring of the first. If it is, output the index at which the contents of the second array appear in the first. If you do not find the second array in the first, then output -1. Example Input: { 63, 101, 245, 215, 0 } { 245, 215 } Expected Output: 2 Example Input 2: { 24, 55, 74, 3, 1 } { 24, 56, 74 } Expected Output 2: -1 Edit: Someone has pointed out that the bool is redundant, so all your function has to do is return an int representing the index of the value or -1 if not found.

    Read the article

  • How can a code editor effectively hint at code nesting level - without using indentation?

    - by pgfearo
    I'm writing an XML text editor that provides 2 view options for the same XML text, one indented (virtually), the other left-justified. The motivation for the left-justified view is to help users 'see' the whitespace characters they're using for indentation of plain-text or XPath code without interference from indentation that is an automated side-effect of the XML context. I want to provide visual clues (in the non-editable part of the editor) for the left-justified mode that will help the user, but without getting too elaborate. I tried just using connecting lines, but that seemed too busy. The best I've come up with so far is shown in a mocked up screenshot of the editor below, but I'm seeking better/simpler alternatives (that don't require too much code). [Edit] Taking the heatmap idea (from: @jimp) I get something like this: or even these alternates:

    Read the article

  • MUD source code

    - by Tchalvak
    I haven't been able to find a lot of the old, open source mud source codes. I find the way they did things very applicable to text-based/browser based games, and I'd love to be able to skim through parts of 'em for inspiration. For instance, we have this huge list of muds and the relationships between them, but little by way of access to source code. http://en.wikipedia.org/wiki/MUD_trees Often (I'm looking at you, dikumud, http://www.dikumud.com/links.aspx ) the sites of the mud itself doesn't even have a working link to the source. https://github.com/alexmchale/merc-mud has a copy of merc that I found, which certainly contains other works within it's history, but the pickings seems sparse. Does anyone have better resources for gaining access to MUD source code than these?

    Read the article

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