Search Results

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

Page 50/1111 | < Previous Page | 46 47 48 49 50 51 52 53 54 55 56 57  | Next Page >

  • What does: throw 0 do/mean? Is it "bad"?

    - by MartinP
    Context I came across some code, like this: if( Some_Condition ) throw 0; I googled a bit, and found a few other code snippets using that odd looking throw 0 form. I presume one would catch this as: catch(const int& e) { } Or is this a NULL ptr? to be caught as void* ? Question What does this throw 0 do? Is it special in some way? My normal preference would be to throw something that is (or derived from) std::exception. So to me this looks "bad". Is it "bad" ?

    Read the article

  • Why is it bad to use boolean flags in databases? And what should be used instead?

    - by David Chanin
    I've been reading through some of guides on database optimization and best practices and a lot of them suggest not using boolean flags at all in the DB schema (ex http://forge.mysql.com/wiki/Top10SQLPerformanceTips). However, they never provide any reason as to why this is bad. Is it a peformance issue? is it hard to index or query properly? Furthermore, if boolean flags are bad, what should you use to store boolean values in a database? Is it better to store boolean flags as an integer and use a bitmask? This seems like it would be less readable.

    Read the article

  • Is wrapping new within the constructor good or bad?

    - by Timothy
    I watched John Resig's Best Practices in JavaScript Library Design presentation; one slide suggested "tweaking" the object constructor so it instantiates itself. function jQuery(str, con) { if (window === this) { return new jQuery(str, con); } // ... } With that, new jQuery("#foo") becomes jQuery("# foo"). I thought it was rather interesting, but I haven't written a constructor like that in my own code. A little later I read a post here on SO. (Sorry, I don't remember which or I'd supply a link. I will update the question if I can find it again.) One of the comments said it was bad practice to hide new from the programmer like that, but didn't go into details. My question is, it the above generally considered good, bad, or indifferent, and why?

    Read the article

  • Android OS 2.2 Permissions: I have absolutely no idea why this simple piece of code doesn't work. Wh

    - by Kevin
    I'm just playing around with some code. I create an Activity and simply do something like this: long lo = currentTimeMillis(); System.out.println(lo); lo *= 3; System.out.println(lo); SystemClock.setCurrentTimeMillis(lo); System.out.println( currentTimeMillis() ); Yes, in my AndroidManifest.xml, I've added: <uses-permission android:name="android.permission.SET_TIME"></uses-permission> <uses-permission android:name="android.permission.SET_TIME_ZONE"></uses-permission> Nothing changes. The SystemClock is never reset...it just keeps on ticking. The error that I'm getting just says that the permission "SET_TIME" was not granted to the program. Protection level 3. The permissions are there...and in the API for 2.2 it says that this feature is supported now. I have no idea what I'm doing wrong. If android.content.Intent; comes into play, please explain. I don't really understand what the idea behind intents! Thanks for any help!

    Read the article

  • Can't mount home after trying to resize (bad geometry: block count exceeds size of device).

    - by Lynn
    This is on a fresh computer (super computer actually). It got to me with 15T on the home mount and 50G on the root. I tried allocating 7T to root and resizing (since I'm putting a local yum repo on this machine as it has no internet access nor will it ever). I tried following the instructions here: Centos 6.3 disk space allocation but something went wrong and the home won't mount again. Instead I get from dmesg | tail: EXT4-fs (dm-2): bad geometry: block count 4294967295 exceeds size of device (1342177280 blocks) df -h nets this output: Filesystem Size Used Avail Use% Mounted on /dev/mapper/VolGroup-lv_root 7.0T 3.6G 6.6T 1% / tmpfs 190G 216K 190G 1% /dev/shm /dev/sda1 485M 38M 422M 9% /boot I didn't have any files on /dev/mapper/VolGroup-lv_home. Will simply running mke2fs fix it to be mountable? What sort of options should I run it with. I've never resized volumes before or used mke2fs. I don't want to make this mess worse.

    Read the article

  • Would an immutable keyword in Java be a good idea?

    - by berry120
    Generally speaking, the more I use immutable objects in Java the more I'm thinking they're a great idea. They've got lots of advantages from automatically being thread-safe to not needing to worry about cloning or copy constructors. This has got me thinking, would an "immutable" keyword go amiss? Obviously there's the disadvantages with adding another reserved word to the language, and I doubt it will actually happen primarily for the above reason - but ignoring that I can't really see many disadvantages. At present great care has to be taken to make sure objects are immutable, and even then a dodgy javadoc comment claiming a component object is immutable when it's in fact not can wreck the whole thing. There's also the argument that even basic objects like string aren't truly immutable because they're easily vunerable to reflection attacks. If we had an immutable keyword the compiler could surely recursively check and give an iron clad guarantee that all instances of a class were immutable, something that can't presently be done. Especially with concurrency becoming more and more used, I personally think it'd be good to add a keyword to this effect. But are there any disadvantages or implementation details I'm missing that makes this a bad idea?

    Read the article

  • Running OpenVZ virtual servers within a Xen XCP vritual server? Bad practice?

    - by Damainman
    I have a 1 server with 8GB RAM and 2xQuadcore Processors. It currently has the Xen XCP installed on it, and centos6.2 x64 running on a virtual machine. I have a server control panel software that I want to use and it allows the administration via a web interface for Openvz machines. My questions are: Would this be considered bad practice? Would there be a big performance hit? Should I avoid this all together or am I going about it all wrong? Thank you in advance.

    Read the article

  • What real life bad habits has programming given you? [closed]

    - by Jacob T. Nielsen
    Programming has given me a lot of bad habits and it continues to give me more everyday. But I have also gotten some bad habits from the mindset that I have put myself in. There simply are some things that are deeply rooted in my nature, though some of them I wish I could get rid of. A few: Looking for polymorphism, inheritance and patterns in all of God's creations. Explaining the size of something in pixels and colors in hex code. Using code related abstract terms in everyday conversations. How have you been damaged?

    Read the article

  • Is it bad practice to assign a css class for the sole purpose of finding it with jQuery?

    - by user187305
    I'm using ASP.NET, not the newest one with that clientIdMode stuff. So, the control ids are generated and funky. There are lots of ways of passing ids around, but lately I've been assigning a 'fake' css class to the control I'm interested in. Then in a js file I use jQuery to find the control. Is this bad practice? It seems a lot like the ajaxControlToolkit's behaviorId to me... Is the behaviorId bad practice as well?

    Read the article

  • Is it a good idea for me to learn Python before C or some other Compiler language?

    - by Dream Lane
    Right now I am going through MIT's introduction to Computer Science course via OpenCourseWare. As a part of this course I am learning the Python Language. I've read a lot of things about the benefits of learning C. Before I dig any deeper into Python I wonder if I will be hindered or helped by learning Python first. Do you think that I will develop any bad habits or anything like that from Python?

    Read the article

  • Why is 'using namespace std;' considered a bad practice in C++?

    - by Mana
    Okay, sorry for the simplistic question, but this has been bugging me ever since I finished high school C++ last year. I've been told by others on numerous occasions that my teacher was wrong in saying that we should have "using namespace std;" in our programs, and that std::cout and std::cin are more proper. However, they would always be vague as to why this is a bad practice. So, I'm asking now: Why is "using namespace std;" considered bad? Is it really that inefficient, or risk declaring ambiguous vars(variables that share the same name as a function in std namespace) that much? Or does this impact program performance noticeably as you get into writing larger applications? I'm sorry if this is something I should have googled to solve; I figured it would be nice to have this question on here regardless in case anyone else was wondering.

    Read the article

  • Apache2: 400 Bad Reqeust with Rewrite Rules, nothing in error log?

    - by neezer
    This is driving me nuts. Background: I'm using the built-in Apache2 & PHP that comes with Mac OS X 10.6 I have a vhost setup as follows: NameVirtualHost *:81 <Directory "/Users/neezer/Sites/"> Options Indexes MultiViews AllowOverride None Order allow,deny Allow from all </Directory> <VirtualHost *:81> ServerName lobster.dev ServerAlias *.lobster.dev DocumentRoot /Users/neezer/Sites/lobster/www RewriteEngine On RewriteCond $1 !^(index\.php|resources|robots\.txt) RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule ^(.*)$ index.php/$1 [L,QSA] LogLevel debug ErrorLog /private/var/log/apache2/lobster_error </VirtualHost> This is in /private/etc/apache2/users/neezer.conf. My code in the lobster project is PHP with the CodeIgniter framework. Trying to load http://lobster.dev:81/ gives me: 400 Bad Request Normally, I'd go check my logs to see what caused it, yet my logs are empty! I looked in both /private/var/log/apache2/error_log and /private/var/log/apache2/lobster_error, and neither records ANY message relating to the 400. I have LogLevel set to debug in /private/etc/apache2/http.conf. Removing the rewrite rules gets rid of the error, but these same rules work on my MAMP host. I've double-checked and rewrite_module is loaded in my default Apache installation. My http.conf can be found here: https://gist.github.com/1057091 What gives? Let me know if you need any additional info. NOTE: I do NOT want to add the rewrite rules to .htaccess in the project directory (it's checked into a git repo and I don't want to touch it).

    Read the article

  • Why is it bad to map network drives in Windows?

    - by Beeblebrox
    There has been some spirited discussion within our IT department about mapping network drives. In particular, it has been said that mapping network drives is A Bad Thing and that adding DFS paths or network shares to your (Windows Explorer/Libraries) Favourites is a far better solution. Why is this the case? Personally I find the convenience of z:\folder to be better than \\server\path\folder', particularly with cmd line and scripting (of course I'm not talking about hard-coded links, naturally!). I have tried searching for pros and cons of mapped network drives, but I haven't seen anything other than 'should the network go down, the drive will be unavailable'. But this is a limitation of any network-accessed storage... I have also been told that mapped network drives poll the network when the network resource is unavailable, however I haven't found more information on this. Wouldn't this still be an issue with other network access mechanisms (that is, mapped Favourites) whenever Windows tries to enumerate the file system (for example, when a file/folder picker dialog is opened)? -- Do network drives poll the network any more than a Windows Explorer library/favourite?

    Read the article

  • Could 0x800CCC0E in Outlook be caused by bad wireless connection?

    - by AndrejaKo
    I have a computer connected to a WiFi access point/router/modem. Sometimes, I get page not found errors and similar when opening a browser window, sometimes pings fail and it looks like the router's signal isn't very good. On the other hand, I get around 4 bars of signal strength in windows and graph looks good in Inssider. I also never get dropped connection to the router. My main problem is that I often get errors (such as 0x800CCC0E) in Outlook 2010 that after some searching appear to be connected to bad server connection. I'm using GMail over IMAP and all settings are correct. I didn't have similar errors on my previous router, but I'm not 100% sure that they appeared after switching to current one. It may have worked for some time without errors. There are also around 3000 messages on the server and the size of mailbox is around 12 GiB, which may contribute to the problems. On the other hand, there are at least 24 other networks in the 2.4 GHz range which I'm using and the number may have increased since I switched routers. Should I try solving this by getting a router with stronger signal?

    Read the article

  • Use cell formatting (e.g. "Good", "Bad", "Neutral") in formulas?

    - by ngm
    I am compiling a comparison of different pieces of software in an Excel spreadsheet. It is a big long list of features (the rows), with each column being one of the applications I'm evaluating. I've used styles to visually show how well each product meets each feature, as well as the importance of that feature, and now I'm wondering if there's a way I can use those annotations in a formula. The table is like: . | Product A | Product B | Product C Feature A | blah blah blah Feature B | blah blah blah Feature C | blah blah blah .... | .... | etc | Where I've put 'blah' in the table above, in my actual spreadsheet is (potentially lengthy) descriptive text explaining something about this feature in the given product. I've then used the styles "Good", "Neutral" and "Bad" to visually annotate the description, to show how well each product meets that feature. For each feature I've also used the styles Accent4, 60% Accent4, 40% Accent4, etc, to annotate the importance of each feature. Now I'm wondering if somehow I can use those styles (the annotations) to tot up a total score for each product. e.g., Score for feature A = valueof(60% Accent4) * valueof(Good) Is it possible at all?

    Read the article

  • Will the removal of NAT (with the use of IPv6) be bad for consumers? [closed]

    - by Jonathan.
    Possible Duplicate: How will IPv6 impact everyday users? (World IPv6 Day) As I understand when we have finally made the switch to IPv6 not only will NAT be unnecessary but it is incompatible with IPv6? Will that mean that ISPs will have to serve multiple IP addresses per customer? Will they provide a range of addresses for each customer or as each device connects will they get an IP address that isn't necessarily near that of the other devices in their house? But overall will this be bad for the Internet users? as surely it will allow ISPs to see exactly how many devices are being used, and so allow them to charge for the use of additional IP addresses? And then if that happens, what happens when you try to connect an extra device to your network? Will it simply not get an IP address? In my home we have about 15-20 devices connected at once, but for places where there are hundreds of devices, it seems like the perfect opportunity for ISPs to charge more? I think I may have it completely wrong, so is there somewhere where there is an explanation of who things will work when IPv6 becomes the norm?

    Read the article

  • Is it a good idea to keep all the enums in one place?

    - by kzen
    When I'm building a class library I usually create a file Enums.cs to hold all the enums used in the assembly. Here is an example: namespace MyNamespace { public enum Colors { Red, Green, Blue } public enum Shapes { Circle, Square, Triangle } } This makes all my enums easy to find, well organized and easy to access in code. I'm wondering if there is any reason why this would not be such a good idea?

    Read the article

  • Embedded "Smart" character LCD driver. Is this a good idea?

    - by chris12892
    I have an embedded project that I am working on, and I am currently coding the character LCD driver. At the moment, the LCD driver only supports "dumb" writing. For example, let's say line 1 has some text on it, and I make a call to the function that writes to the line. The function will simply seek to the beginning of the line and write the text (plus enough whitespace to erase whatever was last written). This is well and good, but I get the feeling it is horribly inefficient sometimes, since some lines are simply: "Some-reading: some-Value" Rather than "brute force" replacing the entire line, I wanted to develop some code that would figure out the best way to update the information on the LCD. (just as background, it takes 2 bytes to seek to any char position. I can then begin writing the string) My idea was to first have a loop. This loop would compare the input to the last write, and in doing so, it would cover two things: A: Collect all the differences between the last write and the input. For every contiguous segment (be it same or different) add two bytes to the byte count. This is referenced in B to determine if we are wasting serial bandwidth. B: The loop would determine if this is really a smart thing to do. If we end up using more bytes to update the line than to "brute force" the line, then we should just return and let the brute force method take over. We should exit the smart write function as soon as this condition is met to avoid wasting time. The next part of the function would take all the differences, seek to the required char on the LCD, and write them. Thus, if we have a string like this already on the LCD: "Current Temp: 80F" and we want to update it to "Current Temp: 79F" The function will go through and see that it would take less bandwidth to simply seek to the "8" and write "79". The "7" will cover the "8" and the "9" will cover the "0". That way, we don't waste time writing out the entire string. Does this seem like a practical idea?

    Read the article

< Previous Page | 46 47 48 49 50 51 52 53 54 55 56 57  | Next Page >