Search Results

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

Page 47/359 | < Previous Page | 43 44 45 46 47 48 49 50 51 52 53 54  | Next Page >

  • Are indexes good or bad for a large database?

    - by gmemon
    Hello All, I read on MySQL Performance Blog that when tables are large, it is better to scan full tables, instead of using indexes. I have a table with tens of millions of rows. When conducting queries, if I use no indexes, then queries are 24 times slower than with indexes. I know lot of things may cause this (e.g., are rows stored sequentially), but can you please give me some hints what might be happening? Or how I should start examining this issue? I want to understand when use of indexes is preferred and when it's not Thanks

    Read the article

  • Is it bad practice to 'mix class and interfaces in the same package'?

    - by DerMike
    Hello, I just found something that I never heard of before and I do not agree with (by now). In an (upvoted and not further commented) answer I read "why to mix class and interfaces in the same package" So I wonder, if there are reasons to separate Interfaces and implementations in Java. I know that we are not obliged to have all implementations in the package of the interface, but is it (sometimes) wise to have none there? Regards Mike [;-)

    Read the article

  • Using low level api for datastore in google app engine ? is it bad ?

    - by Chez
    There is little documentation on how to use the low level api for datastore and quite a lot on JPA and JDO and how it translates to it. My question is: is there any advantage in coding against the JPA or JDO specs instead of accessing directly the low level api for datastore ? From an initial look, it seems simple and straight forward but I am not sure if there are good reasons why not to do it. Thanks Cx

    Read the article

  • Is it bad practice to declare an array mid-function...

    - by Maximus
    In C, which would be more proper... void MyFunction() { int* array; int size; //do a bunch of stuff size = 10; array = (int*)(sizeof(int)*size); //do more stuff... //no longer need array... free(array); } Or is something like this okay? void MyFunction() { int size; //do a bunch of stuff size = 10; array[size]; //do more stuff... } The malloc uses the heap instead of the stack, so I suppose if you know size is going to be very large you'd want to malloc... but if you're quite certain size will be small enough, would the second method be reasonable?

    Read the article

  • Why did I get a 400 Bad Request when getting a page with PHP Curl?

    - by user307272
    Hi, I was trying to access a page using curl. I could access it perfectly using the browser and using "static" strings as the URL, like: $url = "http://www.example.com/?q=1234" But when I tried to access the page using a variable in the URL string like: $url = "http://www.example.com/?q=$param" I got a 400 error code. I checked out on the web and found some comments here in this stackoverflow thread: Then, just for curiosity I did the following: $url = "http://www.example.com/?q=" . trim($param); and it worked! And no, $param did NOT contain any spaces. To me, it seems that it can be some encoding error, but I really can't find an explanation for it. Does anyone here in stackoverflow know what it can possibly be? Thanks in advance :)

    Read the article

  • Is the 'var' keyword bad? Or am I just old school?

    - by WaggingSiberian
    Recently I overheard junior developer ask "why do you use 'var' so much?". The mid-level developer responded "I use VAR all the time. I love it! I don't have to figure out the type." I didn't have the time or energy to get into a religious war and hey, I'm still the new guy here :-) I understand var has its place. LINQ comes to mind. But I have also always been told the use of var represents lazy programming and I should just use the correct type to begin with. If it's an int, define it as an int, not a var. When reviewing code, seeing the type makes it easier to follow. My opinion is, it's just lazy but there are exceptions. Var also reminds me of the VB/VBA variant type. It also had its place. I recall (from many years ago) its usage being less-than-desirable type and it was rather resource hungry. Am I just being stuck in my ways? Should we start using var all the time as my co-worker does?

    Read the article

  • Is it bad for SEO to have an 'article' published under 2 urls?

    - by Alichad
    Hi, On our new website we publish an article once and can tag it to appear in several sections eg. blahblah.com/insight/10-05-21/Buzzcity-releases-mobile-game-library.aspx blahblah.com/international_media/10-05-21/Buzzcity-releases-mobile-game-library.aspx Is it better for SEO to have the 2 different urls which include important keywords like ‘insight’ and ‘international media’ or is it better to have a single generic url? E.g. blahblah.com/articles/10-05-21/Buzzcity_releases_mobile_game_library.aspx I read somewhere that google doesn’t like the same content ‘duplicated’ in 2 (or 3) places - I am not a tecchie. THanks

    Read the article

  • Are multiple asserts bad in a unit test? Even if chaining?

    - by Michael Haren
    Is there anything wrong with checking so many things in this unit test?: ActualModel = ActualResult.AssertViewRendered() // check 1 .ForView("Index") // check 2 .WithViewData<List<Page>>(); // check 3 CollectionAssert.AreEqual(Expected, ActualModel); // check 4 The primary goals of this test are to verify the right view is returned (check 2) and it contains the right data (check 4). Would I gain anything by splitting this into multiple tests? I'm all about doing things right, but I'm not going to split things up if it doesn't have practical value. I'm pretty new to unit testing, so be gentle.

    Read the article

  • (iphone) maintaining CGContextRef or CGLayerRef is a bad idea?

    - by Eugene
    Hi, I need to work with many images, and I can't hold them as UIImage in memory because they are too big. I also need to change colors of image and merge them on the fly. Creating UIImage from underlying NSData, change color, and combine them when you can't have many images on memory is fairly slow. (as far as I can get) I thought maybe I can store underlying CGLayerRef(for image that will be combined) and CGContextRef(the resulting combined image). I am new to drawing world, and not sure if CGLayerRef or CGContextRef is smaller in memory than UIImage. I recently heard that w*h image takes up w*h*4 bytes in memory. Does CGLayerRef or CGContextRef also take up that much memory? Thank you

    Read the article

  • Is there possible in clojure to make a deadlock (or anything bad case) using agents?

    - by hsestupin
    CLojure agents is powerful tool. So actions to the agents are asynchronously sent using functions "send" and "send-off". And in theory there couldn't appear something like deadlock. Is there possible to write some clojure code (for example invoking from some action another action to another agent) using agents in which we have some concurrency problem - it could be deadlock, race condition or anything else. (guys, i'm very sorry for my english)

    Read the article

  • HTML block nested in PHP if statement - is this considered bad practice?

    - by JYelton
    Consider the following example: <table> <tr> <td>Row One</td> </tr> <?php if ($rowtwo) { ?> <tr> <td>Row Two</td> </tr> <?php } ?> </table> If $rowtwo is true, the second row is output, otherwise it is skipped. The code works as desired, however I am evaluating Netbeans (7 beta) as a PHP IDE (instead of just using a text editor). Netbeans flags the code with an error: Misplaced non-space characters insided [sic] a table. Should I consider an alternate way of writing this code, or is Netbeans incapable of understanding this flow control wrapper for HTML output?

    Read the article

  • Why is the 'var' keyword bad? Or am I just old school?

    - by WaggingSiberian
    Recently I overheard junior developer ask "why do you use 'var' so much?". The mid-level developer responded "I use VAR all the time. I love it! I don't have to figure out the type." I didn't have the time or energy to get into a religious war and hey, I'm still the new guy here :-) I understand var has its place. LINQ comes to mind. But I have also always been told the use of var represents lazy programming and I should just use the correct type to begin with. If it's an int, define it as an int, not a var. When reviewing code, seeing the type makes it easier to follow. My opinion is, it's just lazy but there are exception. Var also reminds me of the VB/VBA variant type. It also had its place. I recall (from many years ago) its usage being less-than-desirable type and it was rather resource hungry. Am I just being stuck in my ways? Should we start using var all the time as my co-worker does?

    Read the article

  • Is "campaign_$" a bad name for a SQL column?

    - by Summer
    PostgreSQL has allowed me to name a column "campaign_$". I like the name because it's short and to the point, and other potential names like "campaign_receipts" seem longer and less clear. BUT, I wonder if I'll eventually regret putting a $ symbol in a column name, either in PHP or in some other distant part of the architecture. Should I just stick to letters and underscores? Thanks!

    Read the article

  • Is it always bad idea to use inline css for used-once property?

    - by user93422
    I have a table, with 10 columns. I want to control the width of each column. Each column is unique, right now I create an external CSS style for each column: div#my-page table#members th.name-col { width: 40px; } I know there is a best practice to avoid inline style. I do approve using external CSS for anything look'n'feel related: fonts, colors, images. But is it really better to use external CSS in this case? It does not incur extra maintenance cost. It is easier to produce. Cons I can think of: If you have separate designers and development team - using inline styles will force designers to modify content-file (aspx in my case). It might use more bandwidth. Anything else I've missed?

    Read the article

  • Is a string formatter that pulls variables from its calling scope bad practice?

    - by Eric
    I have some code that does an awful lot of string formatting, Often, I end up with code along the lines of: "...".format(x=x, y=y, z=z, foo=foo, ...) Where I'm trying to interpolate a large number of variables into a large string. Is there a good reason not to write a function like this that uses the inspect module to find variables to interpolate? import inspect def interpolate(s): return s.format(**inspect.currentframe().f_back.f_locals) def generateTheString(x): y = foo(x) z = x + y # more calculations go here return interpolate("{x}, {y}, {z}")

    Read the article

  • Is this a bad indexing strategy for a table?

    - by llamaoo7
    The table in question is part of a database that a vendor's software uses on our network. The table contains metadata about files. The schema of the table is as follows Metadata ResultID (PK, int, not null) MappedFieldname (char(50), not null) Fieldname (PK, char(50), not null) Fieldvalue (text, null) There is a clustered index on ResultID and Fieldname. This table typically contains millions of rows (in one case, it contains 500 million). The table is populated by 24 workers running 4 threads each when data is being "processed". This results in many non-sequential inserts. Later after processing, more data is inserted into this table by some of our in-house software. The fragmentation for a given table is at least 50%. In the case of the largest table, it is at 90%. We do not have a DBA. I am aware we desperately need a DB maintenance strategy. As far as my background, I'm a college student working part time at this company. My question is this, is a clustered index the best way to go about this? Should another index be considered? Are there any good references for this type and similar ad-hoc DBA tasks?

    Read the article

  • What do you do when a client ask for a feature which is a really bad idea?

    - by TAG
    Recently there was a SO question asking how to implement a feature which blocked users from copying text from a page in their browser. There were many negative comments on this feature, both because it's not practically possible to implement effectively and because it will interfere with the users' experience? What's a programmer to do in these sorts of situations in dealing with their clients or employers?

    Read the article

  • Replacing repetitively occuring loops with eval in Javascript - good or bad?

    - by Herc
    Hello stackoverflow! I have a certain loop occurring several times in various functions in my code. To illustrate with an example, it's pretty much along the lines of the following: for (var i=0;i<= 5; i++) { function1(function2(arr[i],i),$('div'+i)); $('span'+i).value = function3(arr[i]); } Where i is the loop counter of course. For the sake of reducing my code size and avoid repeating the loop declaration, I thought I should replace it with the following: function loop(s) { for (var i=0;i<= 5; i++) { eval(s); } } [...] loop("function1(function2(arr[i],i),$('div'+i));$('span'+i).value = function3(arr[i]);"); Or should I? I've heard a lot about eval() slowing code execution and I'd like it to work as fast as a proper loop even in the Nintendo DSi browser, but I'd also like to cut down on code. What would you suggest? Thank you in advance!

    Read the article

  • Configuring Novel iPrint client on ubuntu 13.10

    - by Mahdi Sadeghi
    Recently I have struggled a lot to make Novel iPrint client to work on my laptop. I need it to use Follow Me printers in our university(you can take your print form any printer). Using this tutorial from Novel, I tried to convert the rpm package and install it on Ubuntu 13.04 & 13.10. The post install script from installing generated deb package had a typo which I saw in post install messages and I fixed that. Now I have the client running. To see the client UI I installed cinnamon desktop(because unity does not have system tray and old solutions did'nt work to whitelist Novel clinet). I have iPrint plugin installed on firefox as well(I copied the shared object files to plugin directories). I try installing printers from provided ipp URL(which lists available printers on the server) with no success. After clicking the printer name I see this: I have various errors: Formerly firefox used to asked my network username/password for installing SSL printer but now it returns this: iPrint Printer - The printer is currently not available. However I can install non-SSL version but the printer location is either empty or points to: file:///dev/null even if I change it to the exact address which I see on working machines still it prints nothing. I have tried the novel command line tool, iprntcmd to print. It is being installed at: /opt/novell/iprint/bin/ msadeghi@werkstatt:/opt/novell/iprint/bin$ ./iprntcmd --addprinter ipp://iprint.rz.hs-offenburg.de/ipp/Follow-me\ -\ IPP iprntcmd v05.04.00 Adding printer ipp://iprint.rz.hs-offenburg.de/ipp/Follow-me - IPP. Added printer ipp://iprint.rz.hs-offenburg.de/ipp/Follow-me - IPP successfully. It adds the printer with empty location and again no print. What I found interesting is the log file at ~/.iprint/errors.txt with strange errors which I hope somebody here can understand. When I try to install the SSL printer I receive these logs(note that HP is my local printer and has nothing to do with iprint): Thu Oct 31 11:02:03 2013 Trace Info: iprint.c, line 6690 Group Info: IPRINT-lib Error Code: 4096 (0x1000) User ID: 1000 Error Msg: iPrint Lib - Bad URI type supplied (not IPP:, HTTP:, or HTTPS:). Debug Msg: IPRINTInterpretURI for file:///dev/null - Unknown Port Type - file Thu Oct 31 11:02:03 2013 Trace Info: iprint.c, line 6800 Group Info: IPRINT-lib Error Code: 4096 (0x1000) User ID: 1000 Error Msg: iPrint Lib - Bad URI type supplied (not IPP:, HTTP:, or HTTPS:). Debug Msg: IPRINTInterpretURI for hp:/usb/HP_LaserJet_1018?serial=KP103A1 - No Port type specified Thu Oct 31 11:02:05 2013 Trace Info: iprint.c, line 6690 Group Info: IPRINT-lib Error Code: 4096 (0x1000) User ID: 1000 Error Msg: iPrint Lib - Bad URI type supplied (not IPP:, HTTP:, or HTTPS:). Debug Msg: IPRINTInterpretURI for file:///dev/null - Unknown Port Type - file Thu Oct 31 11:02:05 2013 Trace Info: iprint.c, line 6800 Group Info: IPRINT-lib Error Code: 4096 (0x1000) User ID: 1000 Error Msg: iPrint Lib - Bad URI type supplied (not IPP:, HTTP:, or HTTPS:). Debug Msg: IPRINTInterpretURI for hp:/usb/HP_LaserJet_1018?serial=KP103A1 - No Port type specified Thu Oct 31 11:02:06 2013 Trace Info: mydoreq.c, line 676 Group Info: CLIB Error Code: 0 (0x0) User ID: 1000 Error Msg: Success Debug Msg: MyCupsDoFileRequest - httpReconnect failed (0) Thu Oct 31 11:02:06 2013 Trace Info: mydoreq.c, line 1293 Group Info: CUPS-IPP Error Code: 1282 (0x502) User ID: 1000 Error Msg: iPrint Printer - The printer is currently not available. Debug Msg: MyCupsDoFileRequest - IPP SERVICE UNAVAILABLE Thu Oct 31 11:02:06 2013 Trace Info: iprint.c, line 6690 Group Info: IPRINT-lib Error Code: 4096 (0x1000) User ID: 1000 Error Msg: iPrint Lib - Bad URI type supplied (not IPP:, HTTP:, or HTTPS:). Debug Msg: IPRINTInterpretURI for file:///dev/null - Unknown Port Type - file Thu Oct 31 11:02:06 2013 Trace Info: iprint.c, line 6800 Group Info: IPRINT-lib Error Code: 4096 (0x1000) User ID: 1000 Error Msg: iPrint Lib - Bad URI type supplied (not IPP:, HTTP:, or HTTPS:). Debug Msg: IPRINTInterpretURI for hp:/usb/HP_LaserJet_1018?serial=KP103A1 - No Port type specified Thu Oct 31 11:02:08 2013 Trace Info: iprint.c, line 6690 Group Info: IPRINT-lib Error Code: 4096 (0x1000) User ID: 1000 Error Msg: iPrint Lib - Bad URI type supplied (not IPP:, HTTP:, or HTTPS:). Debug Msg: IPRINTInterpretURI for file:///dev/null - Unknown Port Type - file Thu Oct 31 11:02:08 2013 Trace Info: iprint.c, line 6800 Group Info: IPRINT-lib Error Code: 4096 (0x1000) User ID: 1000 Error Msg: iPrint Lib - Bad URI type supplied (not IPP:, HTTP:, or HTTPS:). Debug Msg: IPRINTInterpretURI for hp:/usb/HP_LaserJet_1018?serial=KP103A1 - No Port type specified I should say that my friend can print using the same instructions on CrunchBang easily and another guy on 12.04 LTS but with more struggling. It worked for me on linux mint maya with my old laptop as well. Is there anybody out there who can help me to solve these problems? I am really disappointed with Novell and our university support. PS. I had the same problemwith 13.04. No matter if I am within the network or I connect with VPN, I have the same issues.

    Read the article

  • What am I (a beginner) losing, by choosing Cherokee over Apache for serving dynamic content?

    - by Bad Learner
    I am a complete beginner and am planning to setup a photo sharing site. This is the setup I am planning, basically for a start - - Cherokee (instead of Apache) for serving dynamic content (python-based application), and Nginx for serving static files. Since, I am a beginner, what have I, to lose? So, can someone, from your experience, please tell me, what I'd lose by choosing Cherokee over Apache for serving dynamic content in PHP/Python/whatever? Anything other than the fact that there's lot of documentation, many people who can help when there's an issue etc as Apache is well established and the most popular web server? Again, my intention is not to spurt a flame war here. Just wanted to know if Cherokee would be better than Apache in terms of performance, reliability, and speed, when it matters (peak load times). Also, I heard it's a lot faster than Apache in serving dynamic content, is it true?

    Read the article

  • Bunny Inc. – Episode 1. Mr. CIO meets Mr. Executive Manager

    - by kellsey.ruppel(at)oracle.com
    To make accurate and timely business decisions, executive managers are constantly in need of valuable information that is often hidden in old-style traditional systems. What can Mr. CIO come up with to help make Mr. Executive Manager's job easier at Bunny Inc.? Take a look and discover how you too can make informed business decisions by combining back-office systems with social media. Bunny Inc. -- Episode 1. Mr. CIO meets Mr. Executive ManagerTechnorati Tags: UXP, collaboration, enterprise 2.0, modern user experience, oracle, portals, webcenter, e20bunnies

    Read the article

  • Writing to the UI with MonoDroid using RunOnUIThread

    - by Wallym
    I've been pulling my hair out over the past day or so trying to update the UI in my test app.  I was having problem after problem.  I finally got down to my base problem.  I could not write out to my TextView.  WTF could be causing that?  I can write to my UI in other parts of my app.  This is pure craziness.  I thought long and hard and nothing was coming to me.  Wait, the light bulb went on.  I am in the wrong thread.  Great, how do I write in the correct thread?  MonoDroid supports the entire AsyncTask set of objects, but this seemed like overkill.  I was reading and came across RunOnUIThread().......Bing..........The lightbulb has been invented...BlueStar Airlines (oh wait, wrong context). Anyway, here is what I needed:this.RunOnUiThread(() => TextViewControl.Text = "Hello World"); Enjoy!!!!!!!  Remember kiddies, running on the main ui for off device operations is bad, not as bad as crossing the streams bad, but bad as in trying to drive on a flat tire bad. It won't kill you, but it does keep you from getting anywhere.

    Read the article

  • Self Documenting Code Vs. Commented Code

    - by Phill
    I had a search but didn't find what I was looking for, please feel free to link me if this question has already being asked. Earlier this month this post was made: http://net.tutsplus.com/tutorials/php/why-youre-a-bad-php-programmer/ Basically to sum it up, you're a bad programmer if you don't write comments. My personal opinion is that code should be descriptive and mostly not require comment's unless the code cannot be self describing. In the example given // Get the extension off the image filename $pieces = explode('.', $image_name); $extension = array_pop($pieces); The author said this code should be given a comment, my personal opinion is the code should be a function call that is descriptive: $extension = GetFileExtension($image_filename); However in the comments someone actually made just that suggestion: http://net.tutsplus.com/tutorials/php/why-youre-a-bad-php-programmer/comment-page-2/#comment-357130 The author responded by saying the commenter was "one of those people", i.e, a bad programmer. What are everyone elses views on Self Describing Code vs Commenting Code?

    Read the article

< Previous Page | 43 44 45 46 47 48 49 50 51 52 53 54  | Next Page >