Search Results

Search found 8959 results on 359 pages for 'bad decisions'.

Page 77/359 | < Previous Page | 73 74 75 76 77 78 79 80 81 82 83 84  | Next Page >

  • Ignoring (serious) errors to keep the program alive?

    - by SQuirreL bites
    One of the main things I wanted to achieve in my experimental programming language was: When errors occur (Syntax, Name, Type, etc.) keep the program running, no matter how serious or devastating it is. I know that this is probably very bad, but I just wanted something that doesn't kill itself on every error - I find it interesting what happens when a serious error occurs but the program continues. Does this "paradigm" have a name? I mean expect for How bad is it to do the above? Are there programs in use out there that just follow: "Hey, this is a fatal, unexpected error - but you know what? I don't care!"?

    Read the article

  • Improve SQL strategy - denormalize in object-children-images case

    - by fesja
    Hi, I have a Tour object which has many Place objects. For the list of tours, I want to show some info of the tour, the number of places of the tour, and three Place's images. Right one my SQL queries are (i'm using Doctrine with Symfony on MySQL) get Tour get Tour 1 places get Tour 2 places get Tour 3 places ... get Tour n places If I have a three Tour list, it's not so bad; but I'm sure it can get bad if I do a 10-20 tour-list. So, thinking on how to improve the queries I've thought of several measures: Having a place count cache Storing the urls of three images on a new tour field. The problem with 2. is that if I change the image, I have to check all the tours to update that image for another one. What solution do you think is best to scale the system in a near future? Any other suggestion. thanks!

    Read the article

  • Links in rounded boxes? In ALL browsers (yep included IE8)

    - by raffaello123
    I tried maaaany script but every time I get stuck in something bad. My goal is to create rounded boxes for links. You can see an example of I'm talking about here in the read more link (effects not necessary). Very common I know, but I want to make it work in eeeevery browsers at least safari, FF, chrome and most important IE7+ (IE6 not necessary...). The script that took me closest to the solution is Cornerz but I can't fix a very bad issue on IE8. Does anybody knows a way to get rid of this or to achieve my goal? Thank you I appreciate every support. Cheers

    Read the article

  • When a tech document states that something is IP-Aware was does that specifically mean?

    - by Mike
    I need a class room definition for IP-aware for a research assignment. I.E. something that would be used, lets say, in a dictionary. Does anyone know or provide me with a link to a defintiion, I am having no luck with searches. Are IP-Aware devices only devices that can read/find/make decisions based on IP addresses. For example a router would be one, but a network printer would not?

    Read the article

  • Double use of variables?

    - by Vaccano
    I have read that a variable should never do more than one thing. Overloading a variable to do more than one thing is bad. Because of that I end up writing code like this: (With the customerFound variable) bool customerFound = false; Customer foundCustomer = null; if (currentCustomer.IsLoaded) { if (customerIDToFind = currentCustomer.ID) { foundCustomer = currentCustomer; customerFound = true; } } else { foreach (Customer customer in allCustomers) { if (customerIDToFind = customer.ID) { foundCustomer = customer; customerFound = true; } } } if (customerFound) { // Do something } But deep down inside, I sometimes want to write my code like this: (Without the foundCustomer variable) Customer foundCustomer = null; if (currentCustomer.IsLoaded) { if (customerIDToFind = currentCustomer.ID) { foundCustomer = currentCustomer; } } else { foreach (Customer customer in allCustomers) { if (customerIDToFind = customer.ID) { foundCustomer = customer; } } } if (foundCustomer != null) { // Do something } Does this secret desires make me an evil programmer? (i.e. is the second case really bad coding practice?)

    Read the article

  • In which situation is the c++/c# namespace approach better than the Java approach?

    - by mike g
    The reason I ask this is that c# could easily have copied the java convention, or a variation of it, but opted for the more flexible approach of explicitly declaring namespaces inside files. As a Java programmer often there are things that I wish I could do differently, but namespaces is not one of them. The flexbility has a certain overhead (extra braces, extra decisions for developers, making it harder to view a projects contributions to the namespace, at least without a specialist IDE). So what practical examples are there when this flexiblity is advantageous?

    Read the article

  • Function to identify problematic datatypes

    - by Zach
    I just spent several hours debugging some R code, only to discover that the error was due to an Inf that had sneaked in during my calculations. I had checked for NA, but hadn't thought to check for Inf. I wrote the following function to help prevent this situation in the future: is.bad <- function(x){ is.na(x) | is.nan(x) | is.infinite(x) } > is.bad(c(NA, NaN, Inf, -Inf, 0, 1, 1000, 1e6)) [1] TRUE TRUE TRUE TRUE FALSE FALSE FALSE FALSE Are there any other special data types in R I should be aware of?

    Read the article

  • What should I use to replace the WinAPI Beep() function?

    - by Jon Cage
    I've got a Visual C++/CLI app which uses beeps to signify good and bad results (used when the user can't see the screen). Currently I use low pitched beeps for bad results and high pitched beeps for good results: if( goodResult == true ) { Beep(1000, 40); } else { Beep(2000, 20); } This works okay on my Vista laptop, but I've tried it on other laptops and some seem to play the sounds for less time (they sound more like clicks than beeps) or the sound doesn't play at all. So I have two questions here: Is there a more reliable beep function? Is there a (simple) way I can play a short .wav file or something similar instead (preferred solution).

    Read the article

  • Is there anything wrong with taking immediate actions in constructors?

    - by pestaa
    I have classes like this one: class SomeObject { public function __construct($param1, $param2) { $this->process($param1, $param2); } ... } So I can instantly "call" it as some sort of global function just like new SomeObject($arg1, $arg2); which has the benefits of staying concise, being easy to understand, but might break unwritten rules of semantics by not waiting till a method is called. Should I continue to feel bad because of a bad practice, or there's really nothing to worry about? Clarification: I do want an instance of the class. I do use internal methods of the class only. I initialize the object in the constructor, but call the "important" action-taker methods too. I am selfish in the light of these sentences.

    Read the article

  • Unity and web service

    - by zachary
    I had this awesome idea... but I am afraid maybe it is actually a bad idea.... we use unity for dependency injection. I make interfaces from my web services using partial classes for the purpose of mocking and web services.... What I want to do is put my web services into unity and get them via dependency injection... What do you think? Is there too much overhead somewhere? Memory leaks? Is this a bad idea?

    Read the article

  • Building a decision-making game in jQuery? Where would I store data....

    - by redconservatory
    I built a slideshow/decision-making game in Flash but would like to try to redo it using jQuery. The slideshow part seems simple enough, however I have a series of user decisions that I'm not sure how to approach. In flash, if the user makes a decision, I would just store this in a variable or shared local objects, is this the same for jQuery? i.e. mix regular javascript variables with the jQuery?

    Read the article

  • Read from file into pointer to struct

    - by cla barzu
    I need help with pointers in C. I have to read from a file, and fill an array with pointers to struct rcftp_msg . Since now I did the next things: struct rcftp_msg { uint8_t version; uint8_t flags; uint16_t len; uint8_t buffer[512]; }; struct rcftp_msg *windows [10]; pfile = fopen(file,"r"); // Open the file I have to read from the file into the buffer, but I don't know how to do it. I tried the next: for (i = 0; i <10; i++){ leng=fread (**windows[i]->buffer**,sizeof(uint8_t),512,pfile); } I think windows[i]-buffer is bad, cuz that don't work. Sorry for my bad English :(

    Read the article

  • the use of private keyword

    - by LAT
    Hi everyone I am new to programming. I am learning Java now, there is something I am not really sure, that the use of private. Why programmer set the variable as private then write , getter and setter to access it. Why not put everything in public since we use it anyway. public class BadOO { public int size; public int weight; ... } public class ExploitBadOO { public static void main (String [] args) { BadOO b = new BadOO(); b.size = -5; // Legal but bad!! } } I found some code like this, and i saw the comment legal but bad. I don't understand why, please explain me.

    Read the article

  • Need help in sorting the programming buzz-words

    - by cwap
    How do you sort out the good buzz from the bad buzz? - I really need your help here :) I see a lot of buzz-words nowadays, both here on SO and in school. For example, we had a teacher who everyone respected, who said "be careful about gold-plating and death-by-interfacing". Now, everyone and their mama cries whenever I'm creating an interface.. Another example would be here on SO where lately "premature optimization is the root of all evil", so everytime someone asks a perfomance question, he'll get that sentence thrown in his face. A few months ago I remember it was all about NHibernate in here, etc., etc... These things comes and goes, but only the good buzz stays. Now, how do you seperate the good from the bad? By reading blogs from respected persons? By trying to come to a conclusion on your own, and then try to convince others that you're right? By simply ignoring it?

    Read the article

  • Failing faster when URL content is not found, howto

    - by Jam
    I have a thread pool that loops over a bunch of pages and checks to see if some string is there or not. If String is found, or not found response is near instant, however if server is offline or application is not running getting a rejection seems to take seconds How can I change my code to fail faster? for (Thread thread : pool) { thread.start(); } for (Thread thread : pool) { try { thread.join(); } catch (InterruptedException e) { e.printStackTrace(); } } Here is my run method @Override public void run() { for (Box b : boxes) { try { connection = new URL(b.getUrl()).openConnection(); scanner = new Scanner(connection.getInputStream()); scanner.useDelimiter("\\Z"); content = scanner.next(); if (content.equals("YES")) { } else { System.out.println("\tFAILED ON " + b.getName() + " BAD APPLICATION STATE"); } } catch (Exception ex) { System.out.println("\tFAILED ON " + b.getName() + " BAD APPLICATION STATE"); } } }

    Read the article

  • Do you employ any tools for managing technical debt?

    - by Phil.Wheeler
    The site I work with on a day-to-day basis has its share of shortcomings and we often make design decisions to "get us by right now" with the intention of fixing those up later. I've found that making the time to actually go back and fix them, let alone remembering what the full list of to-do items is can be challenging at best. Can you recommend any tools, resources or tricks that help you effectively manage your technical debt?

    Read the article

  • Fake Template Engine php

    - by user1464822
    i got an idea for making php template engine fast and user friendly but i'm not sure if it's good or bad. the idea is to create a fake template engine: creating a template editor in control panel that let user see something like this: <html> <head> <title>{title}</title> </head> <body> {content} </body> </html> what the editor actually does is to replace all php code like <?php echo $this->title; ?> to user friendly {title} but it's not really replacing it just in the view when the user save the template the template actually saved as fast pure php template. the question is this a good idea or bad ? your answers is highly appreciated.

    Read the article

  • Is there an efficient way to figure out the headers, cookies, and get/post data being passed to a si

    - by kryptobs2000
    More specifically I'm looking for something, perhaps an add-on for firefox, once enabled it logs all of this information as it's passed to and from the server. I'm doing some web scripting and this would be really handy. If anyone is wondering specifically what I'm doing currently I'm trying to make a script to repost my craigslist ad every 2 days since I handle a few things on there. Might even go so far as to make a simple gui to manage the submissions. I do suspect this goes against the ToS, for that reason I don't plan to release the code. Besides cl is already bad enough with spam, I'm not trying to contribute further to it, figured I'd say what I'm doing for the sake of being honest though. I don't have any bad intentions with this, just some things I've been trying to sell an ad for my pc repair business. I've been reposting some things for months now and so often I just forget to do it.

    Read the article

  • render json data returned from mvc controller

    - by user1765862
    I'm having js function which calls mvc controller action method which return list of data as json. function FillCountryCities(countryId) { $.ajax({ type: 'GET', url: '/User/FillCityCombo', data: { countryId: countryId }, contentType: 'application/json', success: function (data) { alert(data[0].Name); } error: function () { alert('something bad happened'); } .... format of data which sent back from controller is Name (string) and Id (Guid) Now I just want to alert Name on success first item from collection. Double checked controller sends 20 records, so it should alert first from collection but I'm getting error something bad happened update: public JsonResult FillCityCombo(Guid countryId) { var cities = repository.GetData() .Where(x = x.Country.Id == countryId).ToList(); if (Request.IsAjaxRequest()) { return new JsonResult { Data = cities, JsonRequestBehavior = JsonRequestBehavior.AllowGet }; } else { return new JsonResult { Data = "Not Valid Request", JsonRequestBehavior = JsonRequestBehavior.AllowGet }; } }

    Read the article

  • Performance effect of using print statements in Python script

    - by Sudar
    I have a Python script that process a huge text file (with around 4 millon lines) and writes the data into two separate files. I have added a print statement, which outputs a string for every line for debugging. I want to know how bad it could be from the performance perspective? If it is going to very bad, I can remove the debugging line. Edit It turns out that having a print statement for every line in a file with 4 million lines is increasing the time way too much.

    Read the article

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