Search Results

Search found 39456 results on 1579 pages for 'why'.

Page 4/1579 | < Previous Page | 1 2 3 4 5 6 7 8 9 10 11 12  | Next Page >

  • SQL University: What and why of database refactoring

    - by Mladen Prajdic
    This is a post for a great idea called SQL University started by Jorge Segarra also famously known as SqlChicken on Twitter. It’s a collection of blog posts on different database related topics contributed by several smart people all over the world. So this week is mine and we’ll be talking about database testing and refactoring. In 3 posts we’ll cover: SQLU part 1 - What and why of database testing SQLU part 2 - What and why of database refactoring SQLU part 3 - Tools of the trade This is a second part of the series and in it we’ll take a look at what database refactoring is and why do it. Why refactor a database To know why refactor we first have to know what refactoring actually is. Code refactoring is a process where we change module internals in a way that does not change that module’s input/output behavior. For successful refactoring there is one crucial thing we absolutely must have: Tests. Automated unit tests are the only guarantee we have that we haven’t broken the input/output behavior before refactoring. If you haven’t go back ad read my post on the matter. Then start writing them. Next thing you need is a code module. Those are views, UDFs and stored procedures. By having direct table access we can kiss fast and sweet refactoring good bye. One more point to have a database abstraction layer. And no, ORM’s don’t fall into that category. But also know that refactoring is NOT adding new functionality to your code. Many have fallen into this trap. Don’t be one of them and resist the lure of the dark side. And it’s a strong lure. We developers in general love to add new stuff to our code, but hate fixing our own mistakes or changing existing code for no apparent reason. To be a good refactorer one needs discipline and focus. Now we know that refactoring is all about changing inner workings of existing code. This can be due to performance optimizations, changing internal code workflows or some other reason. This is a typical black box scenario to the outside world. If we upgrade the car engine it still has to drive on the road (preferably faster) and not fly (no matter how cool that would be). Also be aware that white box tests will break when we refactor. What to refactor in a database Refactoring databases doesn’t happen that often but when it does it can include a lot of stuff. Let us look at a few common cases. Adding or removing database schema objects Adding, removing or changing table columns in any way, adding constraints, keys, etc… All of these can be counted as internal changes not visible to the data consumer. But each of these carries a potential input/output behavior change. Dropping a column can result in views not working anymore or stored procedure logic crashing. Adding a unique constraint shows duplicated data that shouldn’t exist. Foreign keys break a truncate table command executed from an application that runs once a month. All these scenarios are very real and can happen. With the proper database abstraction layer fully covered with black box tests we can make sure something like that does not happen (hopefully at all). Changing physical structures Physical structures include heaps, indexes and partitions. We can pretty much add or remove those without changing the data returned by the database. But the performance can be affected. So here we use our performance tests. We do have them, right? Just by adding a single index we can achieve orders of magnitude performance improvement. Won’t that make users happy? But what if that index causes our write operations to crawl to a stop. again we have to test this. There are a lot of things to think about and have tests for. Without tests we can’t do successful refactoring! Fixing bad code We all have some bad code in our systems. We usually refer to that code as code smell as they violate good coding practices. Examples of such code smells are SQL injection, use of SELECT *, scalar UDFs or cursors, etc… Each of those is huge code smell and can result in major code changes. Take SELECT * from example. If we remove a column from a table the client using that SELECT * statement won’t have a clue about that until it runs. Then it will gracefully crash and burn. Not to mention the widely unknown SELECT * view refresh problem that Tomas LaRock (@SQLRockstar on Twitter) and Colin Stasiuk (@BenchmarkIT on Twitter) talk about in detail. Go read about it, it’s informative. Refactoring this includes replacing the * with column names and most likely change to application using the database. Breaking apart huge stored procedures Have you ever seen seen a stored procedure that was 2000 lines long? I have. It’s not pretty. It hurts the eyes and sucks the will to live the next 10 minutes. They are a maintenance nightmare and turn into things no one dares to touch. I’m willing to bet that 100% of time they don’t have a single test on them. Large stored procedures (and functions) are a clear sign that they contain business logic. General opinion on good database coding practices says that business logic has no business in the database. That’s the applications part. Refactoring such behemoths requires writing lots of edge case tests for the stored procedure input/output behavior and then start to refactor it. First we split the logic inside into smaller parts like new stored procedures and UDFs. Those then get called from the master stored procedure. Once we’ve successfully modularized the database code it’s best to transfer that logic into the applications consuming it. This only leaves the stored procedure with common data manipulation logic. Of course this isn’t always possible so having a plethora of performance and behavior unit tests is absolutely necessary to confirm we’ve actually improved the codebase in some way.   Refactoring is not a popular chore amongst developers or managers. The former don’t like fixing old code, the latter can’t see the financial benefit. Remember how we talked about being lousy at estimating future costs in the previous post? But there comes a time when it must be done. Hopefully I’ve given you some ideas how to get started. In the last post of the series we’ll take a look at the tools to use and an example of testing and refactoring.

    Read the article

  • SQL SERVER – Challenge – Puzzle – Why does RIGHT JOIN Exists

    - by pinaldave
    I had interesting conversation with the attendees of the my SQL Server Performance Tuning course. I was asked if LEFT JOIN can do the same task as RIGHT JOIN by reserving the order of the tables in join, why does RIGHT JOIN exists? The definitions are as following: Left Join – select all the records from the LEFT table and then pick up any matching records from the RIGHT table   Right Join – select all the records from the RIGHT table and then pick up any matching records from the LEFT table Most of us read from LEFT to RIGHT so we are using LEFT join. Do you have any explaination why RIGHT JOIN exists or can you come up with example, where RIGHT JOIN is absolutely required and the task can not be achieved with LEFT JOIN. Other Puzzles: SQL SERVER – Puzzle – Challenge – Error While Converting Money to Decimal SQL SERVER – Challenge – Puzzle – Usage of FAST Hint Reference: Pinal Dave (http://blog.sqlauthority.com) Filed under: Pinal Dave, SQL, SQL Authority, SQL Puzzle, SQL Query, SQL Scripts, SQL Server, SQL Tips and Tricks, T SQL, Technology

    Read the article

  • Why is Robert C. Martin called Uncle Bob?

    - by Lernkurve
    Is there a story behind it? I did a Google search for "Why is Robert C. Martin called Uncle Bob?" but didn't find an answer. More context There is this pretty well-know person in the software engineering world named Robert C. Martin. He speaks at conferences and has published many excellent books one of which is Clean Code (Amazon). He is the founder and CEO of Object Mentor Inc. Robert C. Martin is also called Uncle Bob. But I can't figure out why.

    Read the article

  • why must i uninstall libavcodec53 and libavutil51 to install ubuntu restricted extras

    - by honestann
    When I try to install "ubuntu restricted extras" in "ubuntu software center", it displays a warning dialog that says the following items must be removed: libavcodec53 libavutil51 Why? And if I choose to install "ubuntu restricted extras", what will I lose? PS: I think I noticed libavcodec53 flash past as my daily build of codeblocks package was installing... so that's one possibility. Will I break my software development environment if I install "ubuntu restricted extras"? Or do these packages need to be removed because they are included in "ubuntu restricted extras"? If so, why doesn't the dialog mention that (and remove the worry and confusion)? PS: The output generated by "apt-get -s install ubuntu-restricted-extras" is HERE.

    Read the article

  • What "bad practice" do you do, and why?

    - by coppro
    Well, "good practice" and "bad practice" are tossed around a lot these days - "Disable assertions in release builds", "Don't disable assertions in release builds", "Don't use goto.", we've got all sorts of guidelines above and beyond simply making your program work. So I ask of you, what coding practices do you violate all the time, and more importantly, why? Do you disagree with the establishment? Do you just not care? Why should everyone else do the same? cross links: What's your favorite abandoned rule? Rule you know you should follow but don't

    Read the article

  • Why do we need fork to create new process

    - by user3671483
    In Unix whenever we want to create a new process, we fork the current process i.e. we create a new child process which is exactly the same as the parent process and then we do exec system call to replace the child process with a new process i.e. we replace all the data for the parent process eith that for the new process. Why do we create a copy of the parent process in the first place and why don't we create a new process directly? I am new to Unix please explain in lay-man terms.

    Read the article

  • Why do we keep using CSV?

    - by Stephen
    Why do we keep using CSV? I recently made a shift to working the health domain and despite the wonderful work in data transfer standards, all data transfer is in CSV, both for reporting to external organisations, and for data migrations when implementing new systems. Unfortunately the use of CSV is the cause of the endless repetition of the same stupid errors, with the same waste of developer time. (bad escaping, failing to handle null fields etc.) I know we can do better, and anything between JSON and XML (depending on the instance) would be fine. (Most of the time this is data going from one MS SQLserver 2005 to another!) I feel as if each time I see this happening I am literally watching one developer waste anothers time. So why do we keep shafting each other? When will we stop?

    Read the article

  • Why is Python slower than Java but faster than PHP

    - by good_computer
    I have many times seen various benchmarks that show how a bunch of languages perform on a given task. Always these benchmarks reveal that Python is slower then Java and faster than PHP. And I wonder why is that the case. Java, Python, and PHP run inside a virtual machine All three languages convert their programs into their custom byte codes that run on top of OS -- so none is running natively Both Java and Python can be "complied" (.pyc for Python) but the __main__ module for Python is not compiled Python and PHP are dynamically typed and Java statically -- is this the reason Java is faster, and if so, please explain how that affects speed. And, even if the dynamic-vs-static argument is correct, this does not explain why PHP is slower than Python -- because both are dynamic languages. You can see some benchmarks here and here, and here

    Read the article

  • Why Google skips page title

    - by Bob
    I have no idea why this is happening. An example http://www.londonofficespace.com/ofdj17062004934429t.htm Title tag is: Unfurnished Office Space Wimbledon – Serviced Office on Lombard Road SW19 But is indexed as: Lombard Road – SW19 - London Office Space If you look in the source code and search for this portion ‘Lombard Road – SW19’ You then find that it's next to an office image alt=’Lombard Road – SW19’. The only thing I could think of is that the spider somehow ‘skips’ our title tag and grabs this bit, and then inserts the name of the site (but WHY?) Is there anything I can do with this? or is this a Google behaviour?

    Read the article

  • Why is trailing whitespace a big deal?

    - by EpsilonVector
    Trailing whitespace is enough of a problem for programmers that editors like Emacs have special functions that highlight it or get rid of it automatically, and many coding standards require you to eliminate all instances of it. I'm not entirely sure why though. I can think of one practical reason of avoiding unnecessary whitespace, and it is that if people are not careful about avoiding it, then they might change it in between commits, and then we get diffs polluted with seemingly unchanged lines, just because someone removed or added a space. This already sounds like a pretty good reason to avoid it, but I do want to see if there's more to it than that. So, why is trailing whitespace such a big deal?

    Read the article

  • Why is email HTML stuck in the 90's?

    - by Sean Dunwoody
    (disclaimer - I've already tried asking this on StackOverflow, but apparently it was off topic. If the same is true here please let me know and I'll close/delete this question.) I've spent about a day putting together a frustrating email newsletter, using tables, inline styles etc. It feels a lot harder than it should be. I was just wondering, is there any reason why email clients have such poor support of HTML and CSS (CSS in particular)? I would have imagined they'd be scrambling to outdo each other in this department ... Is is a security thing (I can't really imagine why)? Or are they just lazy?

    Read the article

  • Why All The Hype Around Live Help?

    - by ruth.donohue
    I am pleased to introduce guest blogger, Damien Acheson today. Based in Cambridge, MA, Damien is the Product Marketing Manager for ATG’s Live Help products. Welcome, Damien!! BY DAMIEN ACHESON Why all the hype around live help? An eCommerce professional recently asked me: “Why all the hype around live chat and click to call?” I already have a customer service phone number that’s available to my online visitors. Why would I want to add live help? If anything, I want my website to reduce the number of calls to my contact center, not increase it!” The effect of adding live help to a website is counter-intuitive. Done right, live help doesn’t increase your call volume; it optimizes it by replacing traditional telephone calls with smarter, more productive, live voice and live chat interactions. This generates instant cost savings, and a measurable lift in sales and customer retention. A live help interaction differs from a traditional telephone call in six radical ways: Targeting. With live help you can target specific visitors at just the exact right time with a live call or live chat invitation based on hundreds of different parameters. For example, visitors who appear to hesitate before making a large purchase may receive a live help invitation, while others may not. Productivity. By reserving live voice to visitors with complex questions, and offering self-service and live chat for more simple interactions, agents with the right domain expertise can handle simultaneous queries and achieve substantial productivity gains. Routing. Live help interactions take into account visitors’ web context to intelligently route queries to the best available agent, thereby lifting first contact resolution. Context. Traditional telephone numbers force online customers to “change channels” and “start over” with a phone agent. With Live help, agents get the context of the web session and can instantly access the customer’s transaction details and account information, substantially reducing handle times. Interaction. Agents can solve a customer’s problem more effectively co-browsing and collaborating with the visitor in real-time to complete online forms and transactions. Analytics. Unlike traditional telephone numbers, live help allows you to tie Web analytics to customer satisfaction and agent performance indicators. To better understand these differences and advantages over traditional customer service, watch this demo on optimizing customer interactions with Live Help. Technorati Tags: ATG,Live Help,Commerce

    Read the article

  • Why there are many guest accounts?

    - by Radu Radeanu
    After I saw this answer, I realized that there are many guest accounts on my system: grep guest /etc/passwd guest-jzXeRx:x:117:127:Guest,,,:/tmp/guest-jzXeRx:/bin/false guest-l5dAPU:x:118:128:Guest,,,:/tmp/guest-l5dAPU:/bin/false guest-FdSAkw:x:119:129:Guest,,,:/tmp/guest-FdSAkw:/bin/false guest-eBU0cU:x:121:131:Guest,,,:/tmp/guest-eBU0cU:/bin/false Moreover, in this moment there is nobody logged as guest, but if somebody will login as guest, a new guest account is created - why, since there are already other guest accounts? After the new guest will log out, his account will be deleted. But why the other guest accounts remain? For what use/purpose? It doesn't mind me at all this guest account, but I want to know if it is okay to delete them manually.

    Read the article

  • Why ubuntu 12.04 Operating System too slow..?

    - by Sumit Singh
    I was using ubuntu 10.10 from last year. every thing was Ok with that. recently I've installed Ubuntu 12.04 in place of 10.10, after installing that on my Dell laptop, I started to feel uncomfortable. It to slow event if you move mouse then its feel like i'll take 1min to move one place 2 another.. I know why this is happening, all because of 12.04 runs my CPU up to 99%-100% all over time. And there are 2-3 processes who use all the cpu.. like 1. System_Monitor 2. compiz I don't know why its use all the CPU even Other app can't able to run .. in Ubuntu 10.10 every think was Ok.. Any solution for this problem..!! | Thank's

    Read the article

  • Why upgrade from LTS to a X.10 version

    - by Roberto Bravo
    recently in an OMGubuntu's article i saw some comments about the reason of the selection of ubuntu 12.10 over 12.04 LTS for the new System76's All in One. One of the comments said more or less "Why using 12.10 with 1.5 years of support over the 5 years the LTS offer?". Until now i thought the X.10 version was more complete, but with this point of view of the LTS, the LTS will in some moment be more complete than 12.10 i guess. Should i stick with the LTS or upgrade to 12.10 and why?

    Read the article

  • Why is ssh-add adding duplicate identity keys?

    - by skyblue
    I have created a private/public SSH key pair using "ssh-keygen". I use this to authenticate to remote servers. However, I find that when I log in, "ssh-add -l" already lists my identity key even though I have not added it! If I use the command "ssh-add" it prompts me for my passphrase and loads my identity key. If I then list my keys with "ssh-add -l", it now shows two identity keys! These are obviously the same as both have the same fingerprint, but their descriptions are different (the automatically is "user@host (RSA)" and the one added using ssh-add is "/home/user/.ssh/id_rsa (RSA)"). So why does my identity key appear to be loaded without any action on my part, and why does ssh-add add the same key again? Obviously something must be doing this automatically, but what is it, and how can I stop it?

    Read the article

  • Why do operating systems do low level stuff in C and C++? Why not just C++?

    - by Cole Johnson
    On the Wikipedia page for Windows, it states the Windows is written in Assembly for the bootloader and task switcher, and C and C++ for kernel routines. This confuses me because AFAIK, you can call C++ functions from an extern "C"'d block as C++ is just C with extra features (all of which can be rewritten in C if you wanted to AFAIK). I can get using C for the kernel functions so pure C apps can use them (like printf and such), but if they can just be wrapped in an extern "C " block, then why code in C? So my question is: Why would a kernel be written in both C and C++ instead of just C++

    Read the article

  • Why prefer a wildcard to a type discriminator in a Java API (Re: Effective Java)

    - by Michael Campbell
    In the generics section of Bloch's Effective Java (which handily is the "free" chapter available to all: http://java.sun.com/docs/books/effective/generics.pdf), he says: If a type parameter appears only once in a method declaration, replace it with a wildcard. (See page 31-33 of that pdf) The signature in question is: public static void swap(List<?> list, int i, int j) vs public static void swap(List<E> list, int i, int j) And then proceeds to use a static private "helper" function with an actual type parameter to perform the work. The helper function signature is EXACTLY that of the second option. Why is the wildcard preferable, since you need to NOT use a wildcard to get the work done anyway? I understand that in this case since he's modifying the List and you can't add to a collection with an unbounded wildcard, so why use it at all?

    Read the article

  • Why aren't tangent space normal maps completely blue?

    - by seahorse
    Why aren't normal maps just blue? I would think that normal maps should be predominantly blue in color because the Z component of the normal is represented by blue. Normals point out of the surface in the Z direction so we should see blue as the predominant colour since the Z component is dominant. By definition tangent space is perpendicular to the surface. At any point we should have the normal always pointing in the Z (blue direction) with no X (red direction) or Y (green direction). Thus the normal map (since it is a "normal map") should have the colour of the normals which is just blue (R = x = 0, G = y = 0, B = z = 1) with no shades in between. But normal maps are not so, and they have gradients of shades in them. Why is this so?

    Read the article

  • Why use link classes in oql instead of classes that contain links

    - by Isaac
    itop abstracts its very complex database design with an object query language (oql). For this there are classes definded, like 'Ticket' and 'Server'. Now a Ticket usually is linked to a Server. In my naive way I would give the Ticket class an attribute 'affected_server_list', where I could reference the affected servers. itop does it different: neither Servers nor Tickets know of each other. Instead there is a class 'linkTicketToServer', which provides the link between the two. The first thing I noticed is that it makes oql queries more complex. So I wondered why they designed it this way. One thing that occured to me is that it allows for more flexiblity, in that I can add links without modifying the original classes. Is this allready why one would implement it this way, or are there other reasons for this kind of design?

    Read the article

  • Why is CSS3 doing animations?

    - by Joseph the Dreamer
    Like what the title says, why are there animations in CSS3? With basis from the "rule" of separation of concerns, HTML is the content, CSS is the style, and JavaScript is the interactive component. And by interactivity, one can conclude that anything moving due to any interaction, user or non-user triggered should be covered by JavaScript, not CSS. So why did they make CSS3 capable of doing animations? Doesn't it breach the rule, which is separation of concerns? Is there anything I missed that makes animations qualified to be classified as styles rather than interaction?

    Read the article

  • Why won't Unity include these simple features?

    - by eduart
    Every respected dock out there (docky, awn, cairo dock) has these 2 important features that I really consider a must: The ability to re-size them (someone may like smaller or bigger icons than the default ones) The ability to change their position (bottom, left, right) In Unity (which let's face it, is a dock) I heard that it will not be possible even in the long run to have these features implemented. In my opinion Ubuntu is reinventing the wheel here, because so far Unity doesn't offer a thing more than, for example docky (they are offering even less) and they are doing it the wrong way by not including some simple and very necessary options that I think everybody wants, that's why they are present in the other docks. In Mac OS X, the Apple logo is in the left, the min, max, close buttons are on the left, but still you can resize and position your dock wherever you want. So again, my question is: Is there any really plausible explanation why unity will not include these simple features?

    Read the article

  • why not use unmanaged safe code in c#

    - by user613326
    There is an option in c# to execute code unchecked. It's generally not advised to do so, as managed code is much safer and it overcomes a lot of problems. However I am wondering, if you're sure your code won't cause errors, and you know how to handle memory then why (if you like fast code) follow the general advice? I am wondering this since I wrote a program for a video camera, which required some extremely fast bitmap manipulation. I made some fast graphical algorithms myself, and they work excellent on the bitmaps using unmanaged code. Now I wonder in general, if you're sure you don't have memory leaks, or risks of crashes, why not use unmanaged code more often ? PS my background: I kinda rolled into this programming world and I work alone (I do so for a few years) and so I hope this software design question isn't that strange. I don't really have other people out there like a teacher to ask such things.

    Read the article

  • Why isn't reflection on the SCJP / OCJP?

    - by Nick Rosencrantz
    I read through Kathy Sierra's SCJP study guide and I will read it again more throughly to improve myself as a Java programmer and be able to take the certification either Java 6 or wait for the Java 7 exam (I'm already employed as Java developer so I'm in no hurry to take the exam.) Now I wonder why reflection is not on the exam? The book it seems covers everything that should be on the exam and AFAIK reflection is at least as important as threads if not more used inpractice since many frameworks use reflection. Do you know why reflection is not part of the SCJP? Do you agree that it's at least important to know reflection as threads? Thanks for any answer

    Read the article

  • Why is prefixing column names considered bad practice?

    - by P.Brian.Mackey
    According to a popular SO post is it considered a bad practice to prefix table names. At my company every column is prefixed by a table name. This is difficult for me to read. I'm not sure the reason, but this naming is actually the company standard. I can't stand the naming convention, but I have no documentation to back up my reasoning. All I know is that reading AdventureWorks is much simpler. In this our company DB you will see a table, Person and it might have column name: Person_First_Name or maybe even Person_Person_First_Name (don't ask me why you see person 2x) Why is it considered a bad practice to pre-fix column names? Are underscores considered evil in SQL as well? Note: I own Pro SQL Server 2008 - Relation Database design and implementation. References to that book are welcome.

    Read the article

< Previous Page | 1 2 3 4 5 6 7 8 9 10 11 12  | Next Page >