Daily Archives

Articles indexed Tuesday December 11 2012

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

  • SQL SERVER – Asynchronous Update and Timestamp – Check if Row Values are Changed Since Last Retrieve

    - by pinaldave
    Here is the question received just this morning. “Pinal, Our application is much different than other application you might have come across. In simple words, I would like to call it Asynchronous Updated Application. We need your quick opinion about one of the situation which we are facing. From business side: We have bidding system (similar to eBay but not exactly) and where multiple parties bid on one item, during the last few minutes of bidding many parties try to bid at the same time with the same price. When they hit submit, we would like to check if the original data which they retrieved is changed or not. If the original data which they have retrieved is the same, we will accept their new proposed price. If original data are changed, they will have to resubmit the data with new price. From technical side: We have a row which we retrieve in our application. Multiple users are retrieving the same row. Some of the users will update the value of the row and submit. However, only the very first user should be allowed to update the row and remaining all the users will have to re-fetch the row and updated it once again. We do not want to lock any record as that will create other problems. Do you have any solution for this kind of situation?” Fantastic Question. I believe there is good chance that we can use timestamp datatype in this kind of application. Before we continue let us see following simple example. USE tempdb GO CREATE TABLE SampleTable (ID INT, Col1 VARCHAR(100), TimeStampCol TIMESTAMP) GO INSERT INTO SampleTable (ID, Col1) VALUES (1, 'FirstVal') GO SELECT ID, Col1, TimeStampCol FROM SampleTable st GO UPDATE SampleTable SET Col1 = 'NextValue' GO SELECT ID, Col1, TimeStampCol FROM SampleTable st GO DROP TABLE SampleTable GO Now let us see the resultset. Here is the simple explanation of the scenario. We created a table with simple column with TIMESTAMP datatype. When we inserted a very first value the timestamp was generated. When we updated any value in that row, the timestamp was updated with the new value. Every single time when we update any value in the row, it will generate new timestamp value. Now let us apply this in an original question’s scenario. In that case multiple users are retrieving the same row. Everybody will have the same now same TimeStamp with them. Before any user update any value they should once again retrieve the timestamp from the table and compare with the timestamp they have with them. If both of the timestamp have the same value – the original row has not been updated and we can safely update the row with the new value. After initial update, now the row will contain a new timestamp. Any subsequent update to the same row should also go to the same process of checking the value of the timestamp they have in their memory. In this case, the timestamp from memory will be different from the timestamp in the row. This indicates that row in the table has changed and new updates should not be allowed. I believe timestamp can be very very useful in this kind of scenario. Is there any better alternative? Please leave a comment with the suggestion and I will post on the blog with due credit. Reference: Pinal Dave (http://blog.sqlauthority.com) Filed under: PostADay, SQL, SQL Authority, SQL Query, SQL Server, SQL Tips and Tricks, T SQL, Technology

    Read the article

  • Oracle B2B - Synchronous Request Reply

    - by cdwright
    Introduction So first off, let me say I didn't create this demo (although I did modify it some). I got it from a member of the B2B development technical staff. Since it came with only a simple readme file, I thought I would take some time and write a more detailed explanation about how it works. Beginning with Oracle SOA Suite PS5 (11.1.1.6), B2B supports synchronous request reply over http using the b2b/syncreceiver servlet. I’m attaching the demo to this blog which includes a SOA composite archive that needs to be deployed using JDeveloper, a B2B repository with two agreements that need to be deployed using the B2B console, and a test xml file that gets sent to the b2b/syncreceiver servlet using your favorite SOAP test tool (I'm using Firefox Poster here). You can download the zip file containing the demo here. The demo works by sending the sample xml request file (req.xml) to http://<b2bhost>:8001/b2b/syncreceiver using the SOAP test tool.  The syncreceiver servlet keeps the socket connection open between itself and the test tool so that it can synchronously send the reply message back. When B2B receives the inbound request message, it is passed to the SOA composite through the default B2B Fabric binding. A simple reply is created in BPEL and returned to B2B which then sends the message back to the test tool using that same socket connection. I’ll show you the B2B configuration first, then we’ll look at the soa composite. Configuring B2B No additional configuration necessary in order to use the syncreceiver servlet. It is already running when you start SOA. After importing the GC_SyncReqRep.zip repository file into B2B, you’ll have the typical GlobalChips host trading partner and the Acme remote trading partner. Document Management The repository contains two very simple custom XML document definitions called Orders and OrdersResponse. In order to determine the trading partner agreement needed to process the inbound Orders document, you need to know two things about it; what is it and where it came from. So let’s look at how B2B identifies the appropriate document definition for the message. The XSD’s for these two document definitions themselves are not particularly interesting. Whenever you're dealing with custom XML documents, B2B identifies the appropriate document definition for each XML message using an XPath Identification Expression. The expression is entered for each of these document definitions under the document administration tab in the B2B console. The full XPATH expression for the Orders document is  //*[local-name()='shiporder']/*[local-name()='shipto']/*[local-name()='name']/text(). You can see this path in the XSD diagram below and how it uniquely identifies this message. The OrdersReponse document is identified in the same way. The XPath expression for it is //*[local-name()='Response']/*[local-name()='Status']/text(). You can see how it’s path differs uniquely identifying the reply from the request. Trading Partner Profile The trading partner profiles are very simple too. For GlobalChips, a generic identifier is being used to identify the sender of the response document using the host trading partner name. For Acme, a generic identifier is also being used to identify the sender of the inbound request using the remote trading partner name. The document types are added for the remote trading partner as usual. So the remote trading partner Acme is the sender of the Orders document, and it is the receiver of the OrdersResponse document. For the remote trading partner only, there needs to be a dummy channel which gets used in the outbound response agreement. The channel is not actually used. It is just a necessary place holder that needs to be there when creating the agreement. Trading Partner Agreement The agreements are equally simple. There is no validation and translation is not an option for a custom XML document type. For the InboundAgreement (request) the document definition is set to OrdersDef. In the Agreement Parameters section the generic identifiers have been added for the host and remote trading partners. That’s all that is needed for the inbound transaction. For the OutboundAgreement (response), the document definition is set to OrdersResponseDef and the generic identifiers for the two trading partners are added. The remote trading partner dummy delivery channel is also added to the agreement. SOA Composite Import the SOA composite archive into JDeveloper as an EJB JAR file. Open the composite and you should have a project that looks like this. In the composite, open the b2bInboundSyncSvc exposed service and advance through the setup wizard. Select your Application Server Connection and advance to the Operations window. Notice here that the B2B binding is set to Receive. It is not set for Synchronous Request Reply. Continue advancing through the wizard as you normally would and select finish at the end. Now open BPELProcess1 in the composite. The BPEL process is set as a Synchronous Request Reply as you can see below. The while loop is there just to give the process something to do. The actual reply message is prepared in the assignResponseValues assignment followed by an Invoke of the B2B binding. Open the replyResponse Invoke and go to the properties tab. You’ll see that the fromTradingPartnerId, toTradingPartner, documentTypeName, and documentProtocolRevision properties have been set. Testing the Configuration To test the configuration, I used Firefox Poster. Enter the URL for the b2b/syncreceiver servlet and browse for the req.xml file that contains the test request message. In the Headers tab, add the property ‘from’ and give it the value ‘Acme’. This is how B2B will know where the message is coming from and it will use that information along with the document type name to find the right trading partner agreement. Now post the message. You should get back a response with a status of ‘200 OK’. That’s all there is to it.

    Read the article

  • Tip #19 Module Private Visibility in OSGi

    - by ByronNevins
    I hate public and protected methods and classes.  It requires so much work to change them in a huge project like GlassFish.  Not to mention that you may well have to support those APIs forever.  They are highly overused in GlassFish.  In fact I'd bet that > 95% of classes are marked as public for no good reason.  It's just (bad) habit is my guess. private and default visibility (I call it package-private) is easier to maintain.  It is much much easier to change such classes and methods around.  If you have ANY public method or public class in GlassFish you'll need to grep through a tremendous amount of source code to find all callers.  But even that won't be theoretically reliable.  What if a caller is using reflection to access public methods?  You may never find such usages. If you have package private methods, it's easy.  Simply grep through all the code in that one package.  As long as that package compiles ok you're all set.  There can' be any compile errors anywhere else.  It's a waste of time to even look around or build the "outside" world.  So you may be thinking: "Aha!  I'll just make my module have one giant package with all the java files.  Then I can use the default visibility and maintenance will be much easier.  But there's a problem.  You are wasting a very nice feature of java -- organizing code into separate packages.  It also makes the code much more encapsulated.  Unfortunately to share code between the packages you have no choice but to declare public visibility. What happens in practice is that a module ends up having tons of public classes and methods that are used exclusively inside the module.  Which finally brings me to the point of this blog:  If Only There Was A Module-Private Visibility Available Well, surprise!  There is such a mechanism.  If your project is running under OSGi that is.  Like GlassFish does!  With this mechanism you can easily add another level of visibility by telling OSGi exactly which public you want to be exposed outside of the module.  You get the best of both worlds: Better encapsulation of your code so that maintenance is easier and productivity is increased. Usage of public visibility inside the module so that you can encapsulate intra-module better with packages. How I do this in GlassFish: Carefully plan out at least one package that will contain "true" publics.  This is the package that will be exported by OSGi.  I recommend just one package. Here is how to tell OSGi to use it in GlassFish -- edit osgi.bundle like so:-exportcontents:     org.glassfish.mymodule.truepublics;  version=${project.osgi.version} Now all publics declared in any other packages will be visible module-wide but not outside the module. There is one caveat: Accessing "module-private" items outside of the module is controlled at run-time, not compile-time.  The compiler has no clue that a public in a dependent module isn't really public.  it will happily compile it.  At runtime you will definitely see fireworks.  The good news is that you don't have to wait for the code path that tries to use the "module-private" items to fire.  OSGi will complain loudly when that module gets loaded.  OSGi will refuse to load it.  You will see an error like this: remote failure: Error while loading FOO: Exception while adding the new configuration : Error occurred during deployment: Exception while loading the app : org.osgi.framework.BundleException: Unresolved constraint in bundle com.oracle.glassfish.miscreant.code [115]: Unable to resolve 115.0: missing requirement [115.0] osgi.wiring.package; (osgi.wiring.package=org.glassfish.mymodule.unexported). Please see server.log for more details. That is if you accidentally change code in module B to use a public that is really a "module-private" in module A, then you will see the error immediately when you try to test whatever you were changing in module B.

    Read the article

  • “Cloud Integration in Minutes” – True or False?

    - by Bruce Tierney
    The short answer is “yes”. Connecting on-premise and cloud applications “in minutes” is true…provided you only consider the connectivity subset of integration and have a small number of cloud integration touch points. At the recent Gartner AADI conference, 230 attendees filled up the Oracle session to get a more comprehensive answer to this question. During the session, titled “Simplifying Integration – The Cloud & Mobile Pre-requisite”, Oracle’s Tim Hall described cloud connectivity and then, equally importantly, the other essential and sometimes overlooked aspects of integration required to ensure a long term application and service integration strategy. To understand the challenges and opportunities faced by cloud integration, the session started off with a slide that describes how connectivity can quickly transition from simplicity to complexity as the number of applications and service vendor instances grows: Increased complexity puts increased demand on the integration platform As companies expand from on-premise applications into a hybrid on-premise/cloud infrastructure with support for mobile, cloud, and social, there is a new sense of urgency to implement a unified and comprehensive service integration platform. Without getting this unified platform in place, companies face increased complexity and cost managing a growing patchwork of niche integration toolsets as well as the disparate standards mandated by each SaaS vendor as shown in the image below: dddddddddddddddddddd Incomplete and overlapping offerings from a patchwork of niche vendors Also at Gartner AADI, Oracle SOA Suite customer Geeta Pyne, Director of Middleware at BMC presented their successful strategy on how BMC efficiently manages their cloud integration despite disparate requirements from each vendor. From one of Geeta’s slide: Interfaces are dictated by SaaS vendors; wide variety (SOAP, REST, Socket, HTTP/POX, SFTP); Flexibility of Oracle Service Bus/SOA Suite helps to support Every vendor has their way to handle Security; WS-Security, Custom Header; Support in Oracle Service Bus helps to adhere to disparate requirements At BMC, the flexibility of Oracle Service Bus and Oracle SOA Suite allowed them to support the wide variation in the functional requirements as mandated by their SaaS vendors. In contrast to the patchwork platform approach of escalating complexity from overlapping SaaS toolkits, Oracle’s strategy is to provide a unified platform to support disparate requirements from your SaaS vendors, on-premise apps, legacy apps, and more. Furthermore, Oracle SOA Suite includes the many aspects of comprehensive integration beyond basic connectivity including orchestration, analytics (BAM, events…), service virtualization and more in a single unified interface. Oracle SOA Suite – Unified and comprehensive To summarize, yes you can achieve “cloud integration in minutes” when considering the connectivity subset of integration but be sure to look for ways to simplify as you consider a more comprehensive view of integration beyond basic connectivity such as service virtualization, management, event processing and more. And finally, be sure your integration platform has the deep flexibility to handle the requirements of all your future SaaS applications…many of which are unknown to you now.

    Read the article

  • Speed up ADF Mobile Deployment to Android with Keystore

    - by Shay Shmeltzer
    As you might have noticed from my latest ADF Mobile entries, I'm doing most of my ADF Mobile development on a windows machine and testing on an Android device. Unfortunately the Android/windows experience is not as fast as the iOS/Mac one. However, there is one thing I learned today that can make this a bit less painful in terms of the speed to deploy and test your application - and this is to use the "Release" mode when deploying your application instead of the "Debug" mode. To do this you'll first need to define a keystore, but as Joe from our Mobile team showed me today, this is quite easy. Here are the steps: Open a command line in your JDK bin directory (I just used the JDK that comes with the JDeveloper install). Issue the following command: keytool –genkey –v –keystore <Keystore Name>.keystore –alias <Alias Name> -keyalg RSA –keysize 2048 –validity 10000 Both keystore name and alias names are strings that you decide on. The keytool utility will then prompt you with various questions that you'll need to answer. Once this is done, the next step is to configure your JDeveloper preferences->ADF Mobile to add this keystore there under the release tab:  Then for your application specific deployment profile - switch the build mode from debug to release. The end result is a much smaller mobile application (for example from 60 to 21mb) and a much faster deployment cycle (for me it is about twice as fast as before).

    Read the article

  • Bienvenidos a la Comunidad de Oracle Direct!

    - by Ivan Hassig
    Es un placer para nosotros, darles la bienvenida a la comunidad de Oracle Direct. Aquí encontrarán información sobre las diferentes soluciones Oracle, buenas prácticas, contenido de industria y noticias sobre los eventos que la división estará adelantando en toda Latinoamérica. Es nuestro interés que las compañías en crecimiento a lo largo de toda América Latina tengan un espacio para acceder a información específica sobre cómo Oracle puede ayudarles a apalancar sus estrategias de negocio a partir de soluciones de hardware y software de infraestructura, capa media y aplicaciones, en modalidades, on premise, as a service y on the cloud de talla mundial, que se ajustan perfectamente a sus necesidades de negocio. Es grato para nosotros tener la oportunidad de compartir con ustedes un amplio mundo de soluciones y buenas prácticas de negocio que ahora están más cerca que nunca.  Esperamos saber de ustedes pronto!

    Read the article

  • Oracle anuncia la disponibilidad de Oracle Knowledge 8.5

    - by Noelia Gomez
    Normal 0 21 false false false ES X-NONE X-NONE MicrosoftInternetExplorer4 /* Style Definitions */ table.MsoNormalTable {mso-style-name:"Table Normal"; mso-tstyle-rowband-size:0; mso-tstyle-colband-size:0; mso-style-noshow:yes; mso-style-priority:99; mso-style-qformat:yes; mso-style-parent:""; mso-padding-alt:0cm 5.4pt 0cm 5.4pt; mso-para-margin:0cm; mso-para-margin-bottom:.0001pt; mso-pagination:widow-orphan; font-family:"Calibri","sans-serif";} El lanzamiento más completo de la gestión del conocimiento de Oracle ayuda a las organizaciones a ofrecer las respuestas correctas en el momento adecuado a los Agentes y Clientes Normal 0 21 false false false ES X-NONE X-NONE MicrosoftInternetExplorer4 -"/ /* Style Definitions */ table.MsoNormalTable {mso-style-name:"Table Normal"; mso-tstyle-rowband-size:0; mso-tstyle-colband-size:0; mso-style-noshow:yes; mso-style-priority:99; mso-style-qformat:yes; mso-style-parent:""; mso-padding-alt:0cm 5.4pt 0cm 5.4pt; mso-para-margin:0cm; mso-para-margin-bottom:.0001pt; mso-pagination:widow-orphan; font-family:"Calibri","sans-serif";} Continuando con su compromiso de ayudar a las organizaciones a ofrecer la mejor experiencia del cliente con la exploración de los datos empresariales, Oracle anunció Oracle Knowledge 8.5, el software líder en la industria del conocimiento que soporta la gestión web de autoservicio, servicio asistido por agente y comunidades de clientes. Oracle Knowledge 8.5 es la versión más completa desde la adquisición de InQuira en octubre de 2011. Se introduce importantes mejoras de productos, análisis de mejora y los avances en el rendimiento y la escalabilidad. Actualmente, las organizaciones entienden la necesidad imperiosa de ofrecer un servicio al cliente consistente y de alta calidad, a través de diferentes canales. Además, las organizaciones reconocen la necesidad de información que sirva para este proceso. Oracle Knowledge 8,5 proactivamente brinda conocimientos relevantes y contextuales en el punto de interacción con los agentes, con los trabajadores del conocimiento y con los clientes - ayudando a aumentar la lealtad del cliente y reducir costes. Al permitir búsquedas a través de una amplia variedad de fuentes, Oracle Knowledge 8,5 amplifica el acceso al conocimiento, una vez oculto en los sistemas múltiples, aplicaciones y bases de datos utilizadas para almacenar contenido empresarial. Nuevas capacidades: AnswerFlow : Oracle Knowledge 8.5 introduce AnswerFlow, una nueva aplicación para la resolución de problemas guiada, diseñado para mejorar la eficiencia, reducir los costes de servicio y proporcionar experiencias de servicio al cliente personalizado. Mejora la analítica del conocimiento: estandarizado en Oracle Business Intelligence Enterprise Edition, el líder en la industria de las soluciones de Business Intelligence, Oracle Knowledge 8.5 proporciona una funcionalidad analítica robusta que se puede adaptar para satisfacer las necesidades únicas de cada negocio. Soporte de idiomas mejorada: Con las capacidades mejoradas en varios idiomas disponibles en Oracle Knowledge 8.5, incluyendo soporte Natural Language Search con 16 Idiomas y búsqueda por palabra clave mejorado para la mayoría de las otras lenguas , las empresas pueden llegar rápidamente a nuevos clientes y, al mismo tiempo, reducir los costes de hacerlo. Mejora la funcionalidad iConnect:Oracle Knowledge 8.5 ofrece iConnect mejorada para una mayor facilidad de uso y rendimiento. Esta aplicación especializada en conocimiento ofrece de forma proactiva un conocimiento contextualizado directamente en las aplicaciones de CRM, permitiendo a los empleados reducir el esfuerzo para servir a los clientes. Estandarización de Plataforma y Tecnología: Oracle Knowledge 8.5 ha sido certificado en tecnologías Oracle, incluyendo Oracle WebLogic Server, Oracle Business Intelligence, Oracle Exadata Database Machine y Oracle Exalogic Elastic Cloud, reduciendo el coste y la complejidad para los clientes a administrar los activos de todas las plataformas."Hemos realizado importantes inversiones de desarrollo desde nuestra adquisición de InQuira, y ahora estamos muy orgullosos de anunciar la disponibilidad de estos esfuerzos con el lanzamiento de Oracle Knowledge 8.5, por lo que es más fácil para las organizaciones obtener una ventaja diferencial a un coste total de propiedad significativamente menor ". dijo David Vap,Vicepresident productos de Oracle. Puedes encontrar más información aquí: Oracle Knowledge 8.5 Oracle Customer Experience Oracle WebLogic Server Oracle Business Intelligence Enterprise Edition

    Read the article

  • I Could Sure Use Some Windows Azure Code Samples…

    - by BuckWoody
    There are multiple ways to learn, and one of the most effective is with examples. You have multiple options with Windows Azure, including the Software Development Kit, the Windows Azure Training Kit and now another one…. the Microsoft All-In-One Code Framework,, a free, centralized code sample library driven by developers' real-world pains and needs. The goal is to provide customer-driven code samples for all Microsoft development technologies, and Windows Azure is included. Once you hit the site, you download an EXE that will create a web-app based installer for a Code Browser.   Once inside, you can configure where the samples store data and other settings, and then search for what you want.   You can also request a sample – if enough people ask, we do it. OneCode also partnered with gallery and Visual Studio team to develop this Sample Browser Visual Studio extension.  It’s an easy way for developers to find and download samples from within Visual Studio.  

    Read the article

  • A wee bit exhausted… time to reenergize

    - by drsql
    I admit it. I am tired and I have not blogged nearly enough. This has been a crazy year, with the book I finished writing , the pre-cons I have done (teaching is NOT my primary profession so I do a lot more prep than some others probably do), lots of training on Data Warehousing topics (from Ralph Kimball, Bob Becker, and Stacia Misner, to name three of the great teachers I have had), SQL Rally, SQL PASS, SQL Saturdays and I have gotten a lot more regular with my simple-talk blog as well… Add to...(read more)

    Read the article

  • Joins in single-table queries

    - by Rob Farley
    Tables are only metadata. They don’t store data. I’ve written something about this before, but I want to take a viewpoint of this idea around the topic of joins, especially since it’s the topic for T-SQL Tuesday this month. Hosted this time by Sebastian Meine (@sqlity), who has a whole series on joins this month. Good for him – it’s a great topic. In that last post I discussed the fact that we write queries against tables, but that the engine turns it into a plan against indexes. My point wasn’t simply that a table is actually just a Clustered Index (or heap, which I consider just a special type of index), but that data access always happens against indexes – never tables – and we should be thinking about the indexes (specifically the non-clustered ones) when we write our queries. I described the scenario of looking up phone numbers, and how it never really occurs to us that there is a master list of phone numbers, because we think in terms of the useful non-clustered indexes that the phone companies provide us, but anyway – that’s not the point of this post. So a table is metadata. It stores information about the names of columns and their data types. Nullability, default values, constraints, triggers – these are all things that define the table, but the data isn’t stored in the table. The data that a table describes is stored in a heap or clustered index, but it goes further than this. All the useful data is going to live in non-clustered indexes. Remember this. It’s important. Stop thinking about tables, and start thinking about indexes. So let’s think about tables as indexes. This applies even in a world created by someone else, who doesn’t have the best indexes in mind for you. I’m sure you don’t need me to explain Covering Index bit – the fact that if you don’t have sufficient columns “included” in your index, your query plan will either have to do a Lookup, or else it’ll give up using your index and use one that does have everything it needs (even if that means scanning it). If you haven’t seen that before, drop me a line and I’ll run through it with you. Or go and read a post I did a long while ago about the maths involved in that decision. So – what I’m going to tell you is that a Lookup is a join. When I run SELECT CustomerID FROM Sales.SalesOrderHeader WHERE SalesPersonID = 285; against the AdventureWorks2012 get the following plan: I’m sure you can see the join. Don’t look in the query, it’s not there. But you should be able to see the join in the plan. It’s an Inner Join, implemented by a Nested Loop. It’s pulling data in from the Index Seek, and joining that to the results of a Key Lookup. It clearly is – the QO wouldn’t call it that if it wasn’t really one. It behaves exactly like any other Nested Loop (Inner Join) operator, pulling rows from one side and putting a request in from the other. You wouldn’t have a problem accepting it as a join if the query were slightly different, such as SELECT sod.OrderQty FROM Sales.SalesOrderHeader AS soh JOIN Sales.SalesOrderDetail as sod on sod.SalesOrderID = soh.SalesOrderID WHERE soh.SalesPersonID = 285; Amazingly similar, of course. This one is an explicit join, the first example was just as much a join, even thought you didn’t actually ask for one. You need to consider this when you’re thinking about your queries. But it gets more interesting. Consider this query: SELECT SalesOrderID FROM Sales.SalesOrderHeader WHERE SalesPersonID = 276 AND CustomerID = 29522; It doesn’t look like there’s a join here either, but look at the plan. That’s not some Lookup in action – that’s a proper Merge Join. The Query Optimizer has worked out that it can get the data it needs by looking in two separate indexes and then doing a Merge Join on the data that it gets. Both indexes used are ordered by the column that’s indexed (one on SalesPersonID, one on CustomerID), and then by the CIX key SalesOrderID. Just like when you seek in the phone book to Farley, the Farleys you have are ordered by FirstName, these seek operations return the data ordered by the next field. This order is SalesOrderID, even though you didn’t explicitly put that column in the index definition. The result is two datasets that are ordered by SalesOrderID, making them very mergeable. Another example is the simple query SELECT CustomerID FROM Sales.SalesOrderHeader WHERE SalesPersonID = 276; This one prefers a Hash Match to a standard lookup even! This isn’t just ordinary index intersection, this is something else again! Just like before, we could imagine it better with two whole tables, but we shouldn’t try to distinguish between joining two tables and joining two indexes. The Query Optimizer can see (using basic maths) that it’s worth doing these particular operations using these two less-than-ideal indexes (because of course, the best indexese would be on both columns – a composite such as (SalesPersonID, CustomerID – and it would have the SalesOrderID column as part of it as the CIX key still). You need to think like this too. Not in terms of excusing single-column indexes like the ones in AdventureWorks2012, but in terms of having a picture about how you’d like your queries to run. If you start to think about what data you need, where it’s coming from, and how it’s going to be used, then you will almost certainly write better queries. …and yes, this would include when you’re dealing with regular joins across multiples, not just against joins within single table queries.

    Read the article

  • Please recommend a patterns book for iOS development

    - by Brett Ryan
    I've read several books on iOS development and Objective-C, however what a lot of them teach is how to work with interfaces and all contain the model inside the view controller, i.e. a UITableViewController based view will simply have an NSArray as it's model. I'm interested in what the best practices are for designing the structure of an application. Specifically I'm interested in best practices for the following: How to separate a model from the view controller. I think I know how to do this by simply replacing the NSArray style example with a specific model object, however what I do not know how to do is alert the view when the model changes. For example in .NET I would solve this by conforming to INotifyPropertyChanged and databinding, and similarly with Java I would use PropertyChangeListener. How to create a service model for my domain objects. For example I want to learn the best way to create a service for a hypothetical Widget object to manage an internal DB and also services for communicating with remote endpoints. I need to learn the best ways to do this in a way that interface components can subscribe to events such as widgetUpdated. These services should be singleton classes and some how dependency injected into model/controller objects. Books I've read so far are: Programming in Objective-C (4th Edition) Beginning iOS 5 Development: Exploring the iOS SDK The iOS 5 Developer's Cookbook: Expanded Electronic Edition: Essentials and Advanced Recipes for iOS Programmers Learn Objective-C on the Mac: For OS X and iOS I've also purchased the following updated books but not yet read them. The Core iOS 6 Developer's Cookbook (4th edition Programming in Objective-C (5th Edition) I come from a Java and C# background with 15 years experience, I understand that many of the ways I would do things in these languages may not fit to the ObjC way of developing applications. Any guidance on the topic is very much appreciated.

    Read the article

  • Useful design patterns for working with FragmentManger on Android

    - by antman8969
    When working with fragments, I have been using a class composed of static methods that define actions on fragments. For any given project, I might have a class called FragmentActions, which contains methods similar to the following: public static void showDeviceFragment(FragmentManager man){ String tag = AllDevicesFragment.getFragmentTag(); AllDevicesFragment fragment = (AllDevicesFragment)man.findFragmentByTag(tag); if(fragment == null){ fragment = new AllDevicesFragment(); } FragmentTransaction t = man.beginTransaction(); t.add(R.id.main_frame, fragment, tag); t.commit(); } I'll usually have one method per application screen. I do something like this when I work with small local databases (usually SQLite) so I applied it to fragments, which seem to have a similar workflow; I'm not married to it though. How have you organized your applications to interface with the Fragments API, and what (if any) design patterns do you think apply do this?

    Read the article

  • Is there a good design pattern for this messaging class?

    - by salonMonsters
    Is there a good design pattern for this? I want to create a messaging class. The class will be passed: the type of message (eg. signup, signup confirmation, password reminder etc) the client's id The class needs to then look up the client's messaging preferences in the db (whether they want communication by email, sms or both) Then depending on the client's preference it will format the message for the medium (short version for sms, long form for email) and send it through our mail or sms provider's API. Because the fact that we want to be able to change out email and sms providers if need be I wondered if the Command Pattern would be a good choice.

    Read the article

  • Am I missing a pattern?

    - by Ryan Pedersen
    I have a class that is a singleton and off of the singleton are properties that hold the instances of all the performance counters in my application. public interface IPerformanceCounters { IPerformanceCounter AccountServiceCallRate { get; } IPerformanceCounter AccountServiceCallDuration { get; } Above is an incomplete snippet of the interface for the class "PerformanceCounters" that is the singleton. I really don't like the plural part of the name and thought about changing it to "PerformanceCounterCollection" but stopped because it really isn't a collection. I also thought about "PerformanceCounterFactory" but it is really a factory either. After failing with these two names and a couple more that aren't worth mentioning I thought that I might be missing a pattern. Is there a name that make sense or a change that I could make towards a standardized pattern that would help me put some polish on this object and get rid of the plural name? I understand that I might be splitting hairs here but that is why I thought that the "Programmers" exchange was the place for this kind of thing. If it is not... I am sorry and I will not make that mistake again. Thanks!

    Read the article

  • Scrum got specific ways for testing software?

    - by joker13
    When reading Scrum Guide, as the official text for scrum, I find out there is no specific solution to provide software testing in scrum. (the only hint is on page15) I'm a little vague on whether scrum is considered a software development methodology or not? If it is not, then how come some of its practices opposes Extreme Programming? (I know that in scrum guide, the author notes that scrum is a framework not a methodology, but still I'm not pretty clear on that) And what's more, I'm not sure if there are any other important textbook that I'm missing so far about scrum. I need them to be official or of great deal of public acceptance.

    Read the article

  • Book suggestions for GUI related topics [closed]

    - by asrijaal
    In the past, I've developed more on the server side, so no big GUI/graphic programming topics have crossed my way so far. I'm switching a little bit to the mobile plattforms (iOS, android) and would like to gather more info on the visual/graphic side. Using the SDK controls/widgets isn't that challenging and I would love to get deeper into the view/presentation layer. Animations, drawing itself, probably OpenGL. Any books that would take me a little deeper in understanding how drawing actually works would be helpful.

    Read the article

  • Humor in Documentation

    - by Lex Fridman
    Is a small amount of lighthearted wording or humor acceptable in source code documentation? For example, I have an algorithm that has a message hop around a graph (network) until its path forms a cycle. When this happens it is removed from the queue of the node it last resided on which removes it from memory. I write that in a comment, and finish the comment with "Rest in peace, little guy". That serves very little documenting purpose, but it cheers me up a bit, and I imagine it might cheer up other people I'm working with as they read through the code. Is this an acceptable practice, or should my in-code documentation resemble as much as possible the speeches of 2004 United States presidential candidate John Kerry? ;-)

    Read the article

  • Upgrading from 11.10- to 12.04 Hangs at "mysql: restarting..."

    - by Mark
    I'm trying to upgrade from Ubuntu Server 11.10 to 12.04 using Update Manager. I figured out that I had to click the arrow next to 'Terminal' and select OK a couple times. Now it's supposed to be "Installing the upgrades" but it's frozen trying to restart mysql for the second time mysql: restarting.... Apache2, atd and cups were all restarted twice after "Restarting services possibly affected by the upgrade". It's been stuck here for nearly an hour. I read here about killing processes, but I can't get a terminal window to open. EDIT: I don't know if this matters but there are 6 occurrences in the Distrobution Upgrade window that say: debconf: unable to initialize frontend: Gnome debconf: (Unable to load Gtk -- is libgtk2-perl installed?) debconf: falling back to frontend: Dialog I should have left the server alone and never run apt-get install ubuntu-desktop yesterday. I would really appreciate any suggestions. Thanks, Mark

    Read the article

  • Launcher sometimes appears while full screen in VM (virtaulbox) - how to stop it?

    - by frumbert
    Launcher is great, and it helps me finds stuff. I have the latest release of 12. But when I'm full screen in VirtualBox running another operating system and I hit some key combination I haven't yet figured out, Laucher suddenly grabs keyboard focus. It might be alt-tab, it might be left-control x. I have physically pulled both the windows key and FN key off my laptop because they get in the way, so it's probably not the windows key. You don't know the focus has been stolen because the full screen app (VirtualBox) is still full screen and launcher is in the background. But you're busy typing into a laucher search box, not your foreground application. This is particularly annoying. In my screenshot (taken from a camera, because the built in screen capture program can't capture a screenshot containing the launcher...) the windows VM is the foreground application, but the launcher has come up and is capturing the keyboard: http://imgur.com/SrMRr I would like a foreground full screen app to stay that way. Is there a way that I can keep the launcher but only have it activate (e.g. pop out with its search box) if I physically click the button, not type some random key combination that foreground applications can get confused about? Otherwise I can do without the launcher, because doing my actual work is more involved than just launching programs.

    Read the article

  • Problems to boot, Ubuntu entry does not work anymore

    - by user104108
    A few months I decided to install Ubuntu 12.04 on my PC alongside with my Windows 7 partition. In order to do that and avoid any mistake, I followed these steps: http://www.linuxbsdos.com/2012/05/17/how-to-dual-boot-ubuntu-12-04-and-windows-7/2/ Everything was going well until I decided to update to the 12.10 realese. I don't know what happened, but after I updated my Ubuntu, it stoped working, it didn't even launched, when I turned on my pc and choose to run "Ubuntu 12.04" on the Grub Screen, a weird messaged appeared. Well, so I decided to install the Ubuntu 12.10 and forget about the 12.04 partition, no problem. I erased the partitions used for the Ubuntu 12.04 with EaseUS partition Manager. However, when I start my PC, there is still the option of "Ubuntu 12.04" to chose, is that bad? And what about now, can I use the Windows Installer of Ubuntu ( http://www.ubuntu.com/download/help/install-ubuntu-with-windows ) to install the Ubuntu 12.10 ? What should I do to have Ubuntu 12.10 and Windows 7 in dual boot again? Thanks; Thales.

    Read the article

  • Can I use Ubuntu One to sync data fiies between two remote computers

    - by Sleepy John
    I've got two computers, both running Ubuntu with files in their home folders sync'd in to Ubuntu One. I'd like to know if it's possible to make Ubuntu One automatically download data changes that have been uploaded automatically to Ubuntu One from one computer to the equivalent data file in the other. Clarifying a bit further, I've installed Red Notebook in both computers and so they each have their own /.rednotebook/data folder containing a series of .txt files corresponding to the monthly entries in each of them. These are sync'd to upload any changes to those .txt files to Ubuntu One. My question is can I, and if so how, do I make Ubuntu One automatically download and replace those .txt files in the other computer after they've been updated and uploaded from the first computer? I did labouriously manage to download all those text files which had been uploaded from the first computer, from Ubuntu One one-by-one to the second computer, but what I want to do is automate this process and that's where I'm stuck. I'm aware that things could get a bit complicated if both my computers were on-line at the same time and both were simultaneously making different Red Notebook entries, so that's not the scenario I'm trying to cover. All I want to achieve is that whatever updates to the files have been uploaded by one computer, will automatically be downloaded to the same-named files in the other computer as soon as that second computer appears on line and detects that Ubuntu One has matching but more recent sync'd files than the ones it's holding.

    Read the article

  • Can't install any Linux distro

    - by rstreeter78
    I have been trying to install Ubuntu on my step-son's netbook and I checked and his hard disk seems to be failing and i keep getting an error message that Ubuntu is unable to install due to hard disk failure. I was wondering how and if it is possible to install Ubuntu on this hard disk without it giving me an error message. I have tried the alternate install disk image and the regular desktop image and get basically the same error message. Is there a way to somehow override this and get it installed

    Read the article

  • ubuntu freezes right after loading

    - by toast
    new install of ubuntu 12.04 i386 desktop.iso on a toshiba satellite intel celeron m gets to the desktop screen and freezes the mouse still moves but nothing responds to it started terminal by pressing ctl+alt+f1 tried "startx" and got this(i cant copy and paste but i will do my best to avoid typos): fatal server error: server is already active for display 0 if this server is no longer running, remove /tmp/.X0-lock and start again please consult the x.org foundation support for help ddxSgiveup: closing log XIO: fatal IO error 11 (resource temporarily unavailable) on x server ":0" after 7 requests (7 known processed) with 0 events remaining. xxxxxx@aaaaaa-Satellite-a105:~$ tried "startx --:1" just took me back to the default wallpaper with nothing else mouse still moves but nothing else

    Read the article

  • How do I make Empathy match my keyring with my password?

    - by lisalisa
    I changed my password a few months ago from the password I first used when I installed Ubuntu on my machine. I tried to add a Google Talk account to Empathy, but every time Empathy gives me a message saying the following: Enter password to unlock your login keyring The password you use to log in to your computer no longer matches that of your login keyring. I do not remember my original password and I'm not sure if I should go to Prefrences Passwords and Keys and delete my login password or if there is a way to change the keyring so that it matches up with my current password.

    Read the article

  • How to customize Unity Launcher's background

    - by Luis Alvarado - The Wolverine
    In this question I do not want to customize the launcher for each workspace, or change the animations or behaviors of the icons. I only want to change how the background of the Launcher looks. Let me show you what I mean: If I do not open the Dash, the launcher looks like the following: It looks like this because I have a background that has gray, black and white colors. So Unity tries to accommodate the launcher to contrast with it. Now when I open the Dash, the launcher looks like this: What I want is to make the launcher look the same as if my Dash were open (Darker, richer background). I thought maybe to invert the colors of an opened Dash with a closed one, but that the end I do not care if the colors do change when I open the Dash, so long as the darker richer version stays. Is it possible to do this, to make the background stay with a darker color like shown in the pictures above?

    Read the article

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