Search Results

Search found 27766 results on 1111 pages for 'bad idea jeans'.

Page 211/1111 | < Previous Page | 207 208 209 210 211 212 213 214 215 216 217 218  | Next Page >

  • PHP error handling : my code is not optimized

    - by Tristan
    Hello, I must warn you, this code will heart your eyes, so please don't judge me, i'm trying to improve the way I handle errors all my tests are like this : if ($something < 27) { $error_IP= '<div class="error_message">something bad</div> '; }else{ $erreur_IP=''; } and here's the ugliest thing : if( !isset($_POST) || ($erreur_captcha !='') || ($erreur_email !='') || ($erreur_hebergeurVide != '') || ($erreur_paysVide != '') || ($erreur_slotVide != '') || ($erreur_rconVide != '') || ($erreur_tick != '') + a lot more :d ) What do you suggest to me to optimize my errors handling ? Thank you

    Read the article

  • How to merge after reverting in mercurial?

    - by user281180
    I have had a bad merge. Now I want to start the merge all over again. I did a revert just before the merge. Now when im trying to add the bundle , im having the message and it can no more locate the changes. What is wrong? Why isn`t it finding any change? c:\Documents and Settings\Shamima\Desktop\New Folder\test_rev94_to_tip_hg\test_rev94_to_tip.hg searching for changes no changes found [command completed successfully Tue Apr 13 16:10:37 2010]

    Read the article

  • Java Interfaces Methodology

    - by Amir Rachum
    Hi all, I've been programming in Java for a few courses in the University and I have the following question: Is it methodologically accepted that every class should implement an interface? Is it considered bad practice not to do so? Can you describe a situation where it's not a good idea to use interfaces? Thanks.

    Read the article

  • Simple Ruby Command Line Question

    - by aronchick
    Um - I feel like an idiot, but.... ruby -e '3+5' Outputs nothing (Windows 7, Ruby 1.8.7, Cygwin or Git Bash). What am I missing? Extra credit - will this also allow the extra cool bundle (stolen from TextMate) Execute and Update # = markers to work properly? EDIT Ok that worked, and I'll accept the answer, but e-texteditor still doesn't work with that really cool bundle. Too bad.

    Read the article

  • Passing DataSource object from a servlet to a JavaBean

    - by Slavko
    I like the ease of using @Resource annotation to get a DataSource, but as far as I know, it's not possible to use it in a regular JavaBean. Would it be considered a bad practice if I pass the DataSource object from a servlet to a bean along with the other data to avoid having that lookup code in the bean?

    Read the article

  • Having duplicate enumerator values

    - by whirlwin
    I'm creating a Tetris clone in C++, and I have an enum GameProperty, which is specified as follows: enum GameProperty { NUM_OF_TETROMINOES = 7, NUM_OF_TILES = 4, TETROMINO_ROTATIONS = 4 }; In my case, I only use these values when looping through a tetromino's tiles, e.g: for (int i = 0; i < TETROMINO_TILES; i++) { } Is it under any circumstance considered bad practice to have multiple enumerators with the same value?

    Read the article

  • Free server solution for strict content photos with geotags

    - by Max Gontar
    Hi! I would like to create some kind of open free "group" posting of photos with geotags First I thought about Panoramio, but seems there is no API for photos upload. By now I can see only two ways: Flickr - there are groups but you have to approve group membership anyway, or use tags for grouping which is bad for maintenance Custom server solution which will cost efforts and hosting Can you suggest other free photo services with geotags functionality, or opensource solutions? Thank you!

    Read the article

  • How to check a file saving is complete using Python?

    - by indrajithk
    I am trying to automate a downloading process. In this I want to know, whether a particular file's save is completed or not. The scenario is like this. Open a site address using either Chrome or Firefox (any browser) Save the page to disk using 'Crtl + S' (I work on windows) Now if the page is very big, then it takes few seconds to save. I want to parse the html once the save is complete. Since I don't have control on the browser save functionality, I don't know whether the save has completed or not. One idea I thought, is to get the md5sum of the file using a while loop, and check against the previous one calculated, and continue the while loop till the md5 sum from the previous and current one matches. This doesn't works I guess, as it seems browser first attempts to save the file in a tmp file and then copies the content to the specified file (or just renames the file). Any ideas? I use python for the automation, hence any idea which can be implemented using python is welcome. Thanks Indrajith

    Read the article

  • Threads in C# [Question]

    - by blez
    Thread1/2: do TotalThreads-- on their exit int TotalThreads = 2; void AsyncFunc() { // run thread for Func() } void Func() { // run Thread1 // run Thread2 while(TotalThreads > 0) { /* do nothing */ } // some code } is that bad design?

    Read the article

  • Python vs all the major professional languages [closed]

    - by Matt
    I've been reading up a lot lately on comparisons between Python and a bunch of the more traditional professional languages - C, C++, Java, etc, mainly trying to find out if its as good as those would be for my own purposes. I can't get this thought out of my head that it isn't good for 'real' programming tasks beyond automation and macros. Anyway, the general idea I got from about two hundred forum threads and blog posts is that for general, non-professional-level progs, scripts, and apps, and as long as it's a single programmer (you) writing it, a given program can be written quicker and more efficiently with Python than it could be with pretty much any other language. But once its big enough to require multiple programmers or more complex than a regular person (read: non-professional) would have any business making, it pretty much becomes instantly inferior to a million other languages. Is this idea more or less accurate? (I'm learning Python for my first language and want to be able to make any small app that I want, but I plan on learning C eventually too, because I want to get into driver writing eventually. So I've been trying to research each ones strengths and weaknesses as much as I can.) Anyway, thanks for any input

    Read the article

  • Database class is not correctly connecting to my database.

    - by blerh
    I'm just venturing into the world of OOP so forgive me if this is a n00bish question. This is what I have on index.php: $dbObj = new Database(); $rsObj = new RS($dbObj); This is the Database class: class Database { private $dbHost; private $dbUser; private $dbPasswd; private $dbName; private $sqlCount; function __construct() { $this->dbHost = 'localhost'; $this->dbUser = 'root'; $this->dbPasswd = ''; $this->dbName = 'whatever'; $this->sqlCount = 0; } function connect() { $this->link = mysql_connect($this->db_host, $this->db_user, $this->db_passwd); if(!$this->link) $this->error(mysql_error()); $this->selection = mysql_select_db($this->db_name, $this->link); if(!$this->selection) $this->error(mysql_error()); } } I've shortened it to just the connect() method to simplify things. This is the RS class: class RS { private $username; private $password; function __construct($dbObj) { // We need to get an account from the db $dbObj->connect(); } } As you can probably see, I need to access and use the database class in my RS class. But I get this error when I load the page: Warning: mysql_connect() [function.mysql-connect]: Access denied for user 'ODBC'@'localhost' (using password: NO) in C:\xampp\htdocs\includes\database.class.php on line 22 The thing is I have NO idea where it got the idea that it needs to use ODBC as a user... I've read up on doing this stuff and from what I can gather I am doing it correctly. Could anyone lend me a hand? Thank you.

    Read the article

  • Is there a better way to keep track of session variable creation/access throughout different pages?

    - by Brandon
    Here's what I am working on. At my website I have multiple processes with each one containing multiple steps. Now in one of the processes, there is an error checking routine executed before proceeding to the next step of that process. A session var is set indicating the error status and it will either redirect back to the referrer or display the next page's contents. Now this kind of functionality, I believe, is common throughout web development. The issue that is occurring is that session vars are left around and are not being cleaned up properly. At times this introduces undesired behavior. My website is growing and I find that I am requiring more and more session vars to keep track of different system and error states. So I was thinking about creating a kind of "session variable keeper" to keep track of session var usage. The idea is fairly simple. It will have the notion of a context (e.g. registration process) and allow access to a predefined set of session vars within that context. In addition, the var and context will be paired with an action to proceed to some form of event handling. So if you haven't noticed I'm new to web development. Any thoughts or comments on the idea that I am proposing would be greatly appreciated. The back-end is written in PHP/MySQL.

    Read the article

  • Implimenting Zend MVC for my existing site-first step?

    - by Joel
    Hi guys, OK-newbie question here. I'll try not to bombard SO with lots of questions-and hopefully this first one will show me the method I'll need to follow for subsequent conversions. I have a web-based calendar system that I developed, but it was coded for me procedurally (using PHP). I'm now working on learning OO and wanting to integrate this site into my localhost Zend Framework and slowly start converting parts to OO and the Zend Framework MVC process in particular. As I've said before, I understand that this will be a slow process, and when I'm done, I still probably won't have anything as OO friendly as if I had rewritten it from scratch, but I'd like to use this as a learning experience. So, I have dropped the whole site into my localhose/zend/Public folder, and everything is showing up great and linking to the database, etc. My question is-what would be the easiest first component to switch over to the MVC model? This site has a bit of everything-forms, login, authentication, some jQuery, etc. Can anyone point to a tutorial that would address what I'm trying to do? If indeed, a form would be one of the simpler things to switch, can someone walk me through those changes? Another idea is changing over all the header info, etc? Thanks for any pointers on where to start! EDIT: Also, I understand that SO is mainly for specific coding questions-I'm happy to share specific code, once I have an idea about which section to tackle first...

    Read the article

  • Does Meta-refresh require a full url

    - by Roy Rico
    Does a meta refresh tag require a full url? I have code that looks like this, which seems to work just fine, but when I load it in lynx text browser, it says this is bad HTML. It seems to suggest that the full URL is required (http://mydomain.com/blah.htm).

    Read the article

  • How to configure Server Topology for exposing an internal application for external access?

    - by ronaldwidha
    Hi All, I guess this question is bordering to a Server Fault question. I'd like to know the best configuration for exposing an internal application (in this case a load balanced Asp.Net MVC application) for external access. More details about the situation: The Asp.Net MVC Application is currently running on 2 servers The 2 servers are behind a Windows Network Load Balancer All the servers are on premise/internal network I'm thinking of introducing an F5 Load balancer on off premise DMZ to replace the Windows Network Load Balancer. F5 will act as the public traffic gateway and load balancers to the 2 servers. However, I'd like the internal users to not have go through the Internet to access the app. The idea that I have so far is to keep both Windows Network Load Balancer and the F5. Each appliance will have its own IP and will have its own domain name. External users can use the public domain name which will hit F5, whereas internal users can use the internal domain name which will hit the Windows Network Load Balancer. Is this a good idea? Or is there a better way of doing this?

    Read the article

  • Isn't objective-c function parameter syntax weird? [closed]

    - by Haoest
    Consider the following method: +(void) myMethod:(int)arg1 **argument2**(int)arg2 **argument3**(int) arg3; See how the first argument, unlike the 2nd and 3rd, doesn't have a description, giving it an impression of bad symmetry. Also you would expect the extra typing will provide named argument as you pass it in, but you still have to pass them in the correct order. Can anyone help me make sense of this?

    Read the article

  • How to join multiple tables using LINQ-to-SQL?

    - by user603245
    Hi! I'm quite new to linq, so please bear with me. I'm working on a asp.net webpage and I want to add a "search function" (textbox where user inputs name or surname or both or just parts of it and gets back all related information). I have two tables ("Person" and "Application") and I want to display some columns from Person (name and surname) and some from Application (score, position,...). I know how I could do it using sql, but I want to learn more about linq and thus I want to do it using linq. For now I got two main ideas: 1.) var person = dataContext.GetTable<Person>(); var application = dataContext.GetTable<Application>(); var p1 = from p in Person where(p.Name.Contains(tokens[0]) || p.Surname.Contains(tokens[1])) select new {Id = p.Id, Name = p.Name, Surname = p.Surname}; //or maybe without this line //I don't know how to do the following properly var result = from a in Application where a.FK_Application.Equals(index) //just to get the "right" type of application //this is not right, but I don't know how to do it better join p1 on p1.Id == a.FK_Person 2.) The other idea is just to go through "Application" and instead of "join p1 ..." to use var result = from a in Application where a.FK_Application.Equals(index) //just to get the "right" type of application join p from Person on p.Id == a.FK_Person where p.Name.Contains(tokens[0]) || p.Surname.Contains(tokens[1]) I think that first idea is better for queries without the first "where" condition, which I also intended to use. Regardless of what is better (faster), I still don't know how to do it using linq. Also in the end I wanted to display / select just some parts (columns) of the result (joined tables + filtering conditions). I really want to know how to do such things using linq as I'll be dealing also with some similar problems with local data, where I can use only linq. Could somebody please explain me how to do it, I spent days trying to figure it out and searching on the internet for answers. Thank you for your time.

    Read the article

  • Should you always write code for else cases that "can never happen"?

    - by johnswamps
    Take some code like if (person.IsMale()) { doGuyStuff(); } else { doGirlOtherStuff(); } (Yes, I realize this is bad OO code, it's an example) Should this be written so that to explicitly check if person.isFemale(), and then add a new else that throws an exception? Or maybe you're checking values in an enum, or something like that. You think that no one will add new elements to the enum, but who knows? "Can never happen" sounds like famous last words.

    Read the article

< Previous Page | 207 208 209 210 211 212 213 214 215 216 217 218  | Next Page >