Search Results

Search found 26214 results on 1049 pages for 'farm solution'.

Page 67/1049 | < Previous Page | 63 64 65 66 67 68 69 70 71 72 73 74  | Next Page >

  • Heaps of Trouble?

    - by Paul White NZ
    If you’re not already a regular reader of Brad Schulz’s blog, you’re missing out on some great material.  In his latest entry, he is tasked with optimizing a query run against tables that have no indexes at all.  The problem is, predictably, that performance is not very good.  The catch is that we are not allowed to create any indexes (or even new statistics) as part of our optimization efforts. In this post, I’m going to look at the problem from a slightly different angle, and present an alternative solution to the one Brad found.  Inevitably, there’s going to be some overlap between our entries, and while you don’t necessarily need to read Brad’s post before this one, I do strongly recommend that you read it at some stage; he covers some important points that I won’t cover again here. The Example We’ll use data from the AdventureWorks database, copied to temporary unindexed tables.  A script to create these structures is shown below: CREATE TABLE #Custs ( CustomerID INTEGER NOT NULL, TerritoryID INTEGER NULL, CustomerType NCHAR(1) COLLATE SQL_Latin1_General_CP1_CI_AI NOT NULL, ); GO CREATE TABLE #Prods ( ProductMainID INTEGER NOT NULL, ProductSubID INTEGER NOT NULL, ProductSubSubID INTEGER NOT NULL, Name NVARCHAR(50) COLLATE SQL_Latin1_General_CP1_CI_AI NOT NULL, ); GO CREATE TABLE #OrdHeader ( SalesOrderID INTEGER NOT NULL, OrderDate DATETIME NOT NULL, SalesOrderNumber NVARCHAR(25) COLLATE SQL_Latin1_General_CP1_CI_AI NOT NULL, CustomerID INTEGER NOT NULL, ); GO CREATE TABLE #OrdDetail ( SalesOrderID INTEGER NOT NULL, OrderQty SMALLINT NOT NULL, LineTotal NUMERIC(38,6) NOT NULL, ProductMainID INTEGER NOT NULL, ProductSubID INTEGER NOT NULL, ProductSubSubID INTEGER NOT NULL, ); GO INSERT #Custs ( CustomerID, TerritoryID, CustomerType ) SELECT C.CustomerID, C.TerritoryID, C.CustomerType FROM AdventureWorks.Sales.Customer C WITH (TABLOCK); GO INSERT #Prods ( ProductMainID, ProductSubID, ProductSubSubID, Name ) SELECT P.ProductID, P.ProductID, P.ProductID, P.Name FROM AdventureWorks.Production.Product P WITH (TABLOCK); GO INSERT #OrdHeader ( SalesOrderID, OrderDate, SalesOrderNumber, CustomerID ) SELECT H.SalesOrderID, H.OrderDate, H.SalesOrderNumber, H.CustomerID FROM AdventureWorks.Sales.SalesOrderHeader H WITH (TABLOCK); GO INSERT #OrdDetail ( SalesOrderID, OrderQty, LineTotal, ProductMainID, ProductSubID, ProductSubSubID ) SELECT D.SalesOrderID, D.OrderQty, D.LineTotal, D.ProductID, D.ProductID, D.ProductID FROM AdventureWorks.Sales.SalesOrderDetail D WITH (TABLOCK); The query itself is a simple join of the four tables: SELECT P.ProductMainID AS PID, P.Name, D.OrderQty, H.SalesOrderNumber, H.OrderDate, C.TerritoryID FROM #Prods P JOIN #OrdDetail D ON P.ProductMainID = D.ProductMainID AND P.ProductSubID = D.ProductSubID AND P.ProductSubSubID = D.ProductSubSubID JOIN #OrdHeader H ON D.SalesOrderID = H.SalesOrderID JOIN #Custs C ON H.CustomerID = C.CustomerID ORDER BY P.ProductMainID ASC OPTION (RECOMPILE, MAXDOP 1); Remember that these tables have no indexes at all, and only the single-column sampled statistics SQL Server automatically creates (assuming default settings).  The estimated query plan produced for the test query looks like this (click to enlarge): The Problem The problem here is one of cardinality estimation – the number of rows SQL Server expects to find at each step of the plan.  The lack of indexes and useful statistical information means that SQL Server does not have the information it needs to make a good estimate.  Every join in the plan shown above estimates that it will produce just a single row as output.  Brad covers the factors that lead to the low estimates in his post. In reality, the join between the #Prods and #OrdDetail tables will produce 121,317 rows.  It should not surprise you that this has rather dire consequences for the remainder of the query plan.  In particular, it makes a nonsense of the optimizer’s decision to use Nested Loops to join to the two remaining tables.  Instead of scanning the #OrdHeader and #Custs tables once (as it expected), it has to perform 121,317 full scans of each.  The query takes somewhere in the region of twenty minutes to run to completion on my development machine. A Solution At this point, you may be thinking the same thing I was: if we really are stuck with no indexes, the best we can do is to use hash joins everywhere. We can force the exclusive use of hash joins in several ways, the two most common being join and query hints.  A join hint means writing the query using the INNER HASH JOIN syntax; using a query hint involves adding OPTION (HASH JOIN) at the bottom of the query.  The difference is that using join hints also forces the order of the join, whereas the query hint gives the optimizer freedom to reorder the joins at its discretion. Adding the OPTION (HASH JOIN) hint results in this estimated plan: That produces the correct output in around seven seconds, which is quite an improvement!  As a purely practical matter, and given the rigid rules of the environment we find ourselves in, we might leave things there.  (We can improve the hashing solution a bit – I’ll come back to that later on). Faster Nested Loops It might surprise you to hear that we can beat the performance of the hash join solution shown above using nested loops joins exclusively, and without breaking the rules we have been set. The key to this part is to realize that a condition like (A = B) can be expressed as (A <= B) AND (A >= B).  Armed with this tremendous new insight, we can rewrite the join predicates like so: SELECT P.ProductMainID AS PID, P.Name, D.OrderQty, H.SalesOrderNumber, H.OrderDate, C.TerritoryID FROM #OrdDetail D JOIN #OrdHeader H ON D.SalesOrderID >= H.SalesOrderID AND D.SalesOrderID <= H.SalesOrderID JOIN #Custs C ON H.CustomerID >= C.CustomerID AND H.CustomerID <= C.CustomerID JOIN #Prods P ON P.ProductMainID >= D.ProductMainID AND P.ProductMainID <= D.ProductMainID AND P.ProductSubID = D.ProductSubID AND P.ProductSubSubID = D.ProductSubSubID ORDER BY D.ProductMainID OPTION (RECOMPILE, LOOP JOIN, MAXDOP 1, FORCE ORDER); I’ve also added LOOP JOIN and FORCE ORDER query hints to ensure that only nested loops joins are used, and that the tables are joined in the order they appear.  The new estimated execution plan is: This new query runs in under 2 seconds. Why Is It Faster? The main reason for the improvement is the appearance of the eager Index Spools, which are also known as index-on-the-fly spools.  If you read my Inside The Optimiser series you might be interested to know that the rule responsible is called JoinToIndexOnTheFly. An eager index spool consumes all rows from the table it sits above, and builds a index suitable for the join to seek on.  Taking the index spool above the #Custs table as an example, it reads all the CustomerID and TerritoryID values with a single scan of the table, and builds an index keyed on CustomerID.  The term ‘eager’ means that the spool consumes all of its input rows when it starts up.  The index is built in a work table in tempdb, has no associated statistics, and only exists until the query finishes executing. The result is that each unindexed table is only scanned once, and just for the columns necessary to build the temporary index.  From that point on, every execution of the inner side of the join is answered by a seek on the temporary index – not the base table. A second optimization is that the sort on ProductMainID (required by the ORDER BY clause) is performed early, on just the rows coming from the #OrdDetail table.  The optimizer has a good estimate for the number of rows it needs to sort at that stage – it is just the cardinality of the table itself.  The accuracy of the estimate there is important because it helps determine the memory grant given to the sort operation.  Nested loops join preserves the order of rows on its outer input, so sorting early is safe.  (Hash joins do not preserve order in this way, of course). The extra lazy spool on the #Prods branch is a further optimization that avoids executing the seek on the temporary index if the value being joined (the ‘outer reference’) hasn’t changed from the last row received on the outer input.  It takes advantage of the fact that rows are still sorted on ProductMainID, so if duplicates exist, they will arrive at the join operator one after the other. The optimizer is quite conservative about introducing index spools into a plan, because creating and dropping a temporary index is a relatively expensive operation.  It’s presence in a plan is often an indication that a useful index is missing. I want to stress that I rewrote the query in this way primarily as an educational exercise – I can’t imagine having to do something so horrible to a production system. Improving the Hash Join I promised I would return to the solution that uses hash joins.  You might be puzzled that SQL Server can create three new indexes (and perform all those nested loops iterations) faster than it can perform three hash joins.  The answer, again, is down to the poor information available to the optimizer.  Let’s look at the hash join plan again: Two of the hash joins have single-row estimates on their build inputs.  SQL Server fixes the amount of memory available for the hash table based on this cardinality estimate, so at run time the hash join very quickly runs out of memory. This results in the join spilling hash buckets to disk, and any rows from the probe input that hash to the spilled buckets also get written to disk.  The join process then continues, and may again run out of memory.  This is a recursive process, which may eventually result in SQL Server resorting to a bailout join algorithm, which is guaranteed to complete eventually, but may be very slow.  The data sizes in the example tables are not large enough to force a hash bailout, but it does result in multiple levels of hash recursion.  You can see this for yourself by tracing the Hash Warning event using the Profiler tool. The final sort in the plan also suffers from a similar problem: it receives very little memory and has to perform multiple sort passes, saving intermediate runs to disk (the Sort Warnings Profiler event can be used to confirm this).  Notice also that because hash joins don’t preserve sort order, the sort cannot be pushed down the plan toward the #OrdDetail table, as in the nested loops plan. Ok, so now we understand the problems, what can we do to fix it?  We can address the hash spilling by forcing a different order for the joins: SELECT P.ProductMainID AS PID, P.Name, D.OrderQty, H.SalesOrderNumber, H.OrderDate, C.TerritoryID FROM #Prods P JOIN #Custs C JOIN #OrdHeader H ON H.CustomerID = C.CustomerID JOIN #OrdDetail D ON D.SalesOrderID = H.SalesOrderID ON P.ProductMainID = D.ProductMainID AND P.ProductSubID = D.ProductSubID AND P.ProductSubSubID = D.ProductSubSubID ORDER BY D.ProductMainID OPTION (MAXDOP 1, HASH JOIN, FORCE ORDER); With this plan, each of the inputs to the hash joins has a good estimate, and no hash recursion occurs.  The final sort still suffers from the one-row estimate problem, and we get a single-pass sort warning as it writes rows to disk.  Even so, the query runs to completion in three or four seconds.  That’s around half the time of the previous hashing solution, but still not as fast as the nested loops trickery. Final Thoughts SQL Server’s optimizer makes cost-based decisions, so it is vital to provide it with accurate information.  We can’t really blame the performance problems highlighted here on anything other than the decision to use completely unindexed tables, and not to allow the creation of additional statistics. I should probably stress that the nested loops solution shown above is not one I would normally contemplate in the real world.  It’s there primarily for its educational and entertainment value.  I might perhaps use it to demonstrate to the sceptical that SQL Server itself is crying out for an index. Be sure to read Brad’s original post for more details.  My grateful thanks to him for granting permission to reuse some of his material. Paul White Email: [email protected] Twitter: @PaulWhiteNZ

    Read the article

  • Silverlight 4 application failing to build in Blend 4 Beta..

    - by loyalpenguin
    Hi, I'm creating a simple silverlight application using Silverlight 4 and Expression Blend 4 Beta, but when I run the Application I get the following Error: C:\Users\WebDevelop1\Documents\Expression\Blend 4 Beta\Projects\SilverlightApplication1\SilverlightApplication1.sln.metaproj : error MSB4126: The specified solution configuration "Debug|HPD" is invalid. Please specify a valid solution configuration using the Configuration and Platform properties (e.g. MSBuild.exe Solution.sln /p:Configuration=Debug /p:Platform="Any CPU") or leave those properties blank to use the default solution configuration. Done building project "SilverlightApplication1.sln" -- FAILED. Build failed. I'm relatively new to silverlight and not really sure where to start. This has happened with every project I have created in Blend, but when I run it in VS2010 it runs perfect. Is this a known issue with the Beta release or am I possibly missing something? Thanks in advance.

    Read the article

  • Overwriting the content from one MOSS content database to another

    - by 78lro
    We have a content database on our live moss server. It contains one site collection with several sub-sites. I'm using the stsadm export command to produce a cmp file, then moving this to our test server in a different farm. I then want to import this content into the content database on our test farm, using the import stsadm command results in me being left with all the existing test data as well as the live data. I tried detaching the existing content database from test in central admin and creating a new empty one,to the then run the import against that but the import failed as obviously there's not root site in the empty db. The aim is to have the data on test look like live, clearing out all the test data. Can anyone suggest a good approach to this type of problem?

    Read the article

  • How to find long running transactions in Websphere MQ Series?

    - by raistlin
    In a J2EE environment the MQ server log shows the following: Process(954584.5) User(mqm) Program(amqzmuc0) AMQ7469: Transactions rolled back to release log space. .... While increasing the logfile size/space might be a temporary solution, the definitive solution must be to identify the culprit process/queue that causes this long transaction. Is there any solution/tool for this? Note: MQ is used via JMS only

    Read the article

  • Authorization and authenthication for WinForm application

    - by Adrian
    Hi! I'm starting to develop windows application and I've been looking around for some authenthication and authorization solution available, but no luck so far. I have to be able to allow admin create users and roles, assign users to roles and define access to controls on form for specified roles (button enabled/disabled etc). Is there any solution out there or maybe someone could give me short description of solution he's using? Adrian

    Read the article

  • How to implement eCommerce susbscription service with multiple products

    - by Todd Brooks
    I've been researching eCommerce payment gateways and service offerings, but I'm an eCommerce novice, so please excuse my ignorance. I wish to set up an eCommerce solution with the following requirements: User "subscribes" to the service on a yearly basis. This service includes a single product subscription for a set amount (let's say $50/yr). User can "subscribe" to additional product services for a lesser rate per year (let's say $25/yr). I will need to store a product service unique Id of some sort for each product subscription the user subscribes to in order to show them product unique information. I also need to prevent duplicates...for example, user can subscribe to product ABC and XYZ, but not 2 of ABC. Is PayPal the best solution for something like this? Is there a better solution? Any assistance is greatly appreciated, even if just links to specific tutorials or examples. Update: It looks like Chargify could be the perfect solution.

    Read the article

  • ASP.NET MVC 1.0: OutputCache, RenderPartial and WriteSubstitution

    - by David
    Hi folks, after digging into this topic and having the requirement, that a single page should be totally cached, except for a Html.RenderPartial("LogOnUserControl"); i couldn't find any working solution on this... the only "it getting warmer" thing i foudn was this solution , which unfortunately is not working with a "partial view", which requires the Request.IsAuthenticated attribute ( the fakeContext is losing this info ) Have you heard of any other solution to do this?!

    Read the article

  • 404 Error Hosting WCF Service via IIS 7.5 Shared Content

    - by Chad Gruka
    We're attempting to host a WCF Service (.NET 3.5 SP1) using Shared Content on IIS 7.5. At the moment it's returning a 404 error. My assumption at this point is that WCF can not be hosted via a UNC path (See workaroundHosting WCF service in IIS6 using UNC). Steps I've taken: - Established a FullTrust to/with the UNC path. - The service works hosting it on a local disk. - A basic HTML page renders without issue from the UNC path. - A ASPX page renders without issue from the UNC path. - Explicitly set "Full Control" permissions to the user running the service. The reason for using Shared Content in IIS 7.5 to host this WCF Service, and several other websites, in a web farm. Using Shared Content avoids the need for file replication between the nodes in the farm. (Note we are also using Shared Configuration to support this environment.)

    Read the article

  • C#/.NET &ndash; Finding an Item&rsquo;s Index in IEnumerable&lt;T&gt;

    - by James Michael Hare
    Sorry for the long blogging hiatus.  First it was, of course, the holidays hustle and bustle, then my brother and his wife gave birth to their son, so I’ve been away from my blogging for two weeks. Background: Finding an item’s index in List<T> is easy… Many times in our day to day programming activities, we want to find the index of an item in a collection.  Now, if we have a List<T> and we’re looking for the item itself this is trivial: 1: // assume have a list of ints: 2: var list = new List<int> { 1, 13, 42, 64, 121, 77, 5, 99, 132 }; 3:  4: // can find the exact item using IndexOf() 5: var pos = list.IndexOf(64); This will return the position of the item if it’s found, or –1 if not.  It’s easy to see how this works for primitive types where equality is well defined.  For complex types, however, it will attempt to compare them using EqualityComparer<T>.Default which, in a nutshell, relies on the object’s Equals() method. So what if we want to search for a condition instead of equality?  That’s also easy in a List<T> with the FindIndex() method: 1: // assume have a list of ints: 2: var list = new List<int> { 1, 13, 42, 64, 121, 77, 5, 99, 132 }; 3:  4: // finds index of first even number or -1 if not found. 5: var pos = list.FindIndex(i => i % 2 == 0);   Problem: Finding an item’s index in IEnumerable<T> is not so easy... This is all well and good for lists, but what if we want to do the same thing for IEnumerable<T>?  A collection of IEnumerable<T> has no indexing, so there’s no direct method to find an item’s index.  LINQ, as powerful as it is, gives us many tools to get us this information, but not in one step.  As with almost any problem involving collections, there are several ways to accomplish the same goal.  And once again as with almost any problem involving collections, the choice of the solution somewhat depends on the situation. So let’s look at a few possible alternatives.  I’m going to express each of these as extension methods for simplicity and consistency. Solution: The TakeWhile() and Count() combo One of the things you can do is to perform a TakeWhile() on the list as long as your find condition is not true, and then do a Count() of the items it took.  The only downside to this method is that if the item is not in the list, the index will be the full Count() of items, and not –1.  So if you don’t know the size of the list beforehand, this can be confusing. 1: // a collection of extra extension methods off IEnumerable<T> 2: public static class EnumerableExtensions 3: { 4: // Finds an item in the collection, similar to List<T>.FindIndex() 5: public static int FindIndex<T>(this IEnumerable<T> list, Predicate<T> finder) 6: { 7: // note if item not found, result is length and not -1! 8: return list.TakeWhile(i => !finder(i)).Count(); 9: } 10: } Personally, I don’t like switching the paradigm of not found away from –1, so this is one of my least favorites.  Solution: Select with index Many people don’t realize that there is an alternative form of the LINQ Select() method that will provide you an index of the item being selected: 1: list.Select( (item,index) => do something here with the item and/or index... ) This can come in handy, but must be treated with care.  This is because the index provided is only as pertains to the result of previous operations (if any).  For example: 1: // assume have a list of ints: 2: var list = new List<int> { 1, 13, 42, 64, 121, 77, 5, 99, 132 }; 3:  4: // you'd hope this would give you the indexes of the even numbers 5: // which would be 2, 3, 8, but in reality it gives you 0, 1, 2 6: list.Where(item => item % 2 == 0).Select((item,index) => index); The reason the example gives you the collection { 0, 1, 2 } is because the where clause passes over any items that are odd, and therefore only the even items are given to the select and only they are given indexes. Conversely, we can’t select the index and then test the item in a Where() clause, because then the Where() clause would be operating on the index and not the item! So, what we have to do is to select the item and index and put them together in an anonymous type.  It looks ugly, but it works: 1: // extensions defined on IEnumerable<T> 2: public static class EnumerableExtensions 3: { 4: // finds an item in a collection, similar to List<T>.FindIndex() 5: public static int FindIndex<T>(this IEnumerable<T> list, Predicate<T> finder) 6: { 7: // if you don't name the anonymous properties they are the variable names 8: return list.Select((item, index) => new { item, index }) 9: .Where(p => finder(p.item)) 10: .Select(p => p.index + 1) 11: .FirstOrDefault() - 1; 12: } 13: }     So let’s look at this, because i know it’s convoluted: First Select() joins the items and their indexes into an anonymous type. Where() filters that list to only the ones matching the predicate. Second Select() picks the index of the matches and adds 1 – this is to distinguish between not found and first item. FirstOrDefault() returns the first item found from the previous clauses or default (zero) if not found. Subtract one so that not found (zero) will be –1, and first item (one) will be zero. The bad thing is, this is ugly as hell and creates anonymous objects for each item tested until it finds the match.  This concerns me a bit but we’ll defer judgment until compare the relative performances below. Solution: Convert ToList() and use FindIndex() This solution is easy enough.  We know any IEnumerable<T> can be converted to List<T> using the LINQ extension method ToList(), so we can easily convert the collection to a list and then just use the FindIndex() method baked into List<T>. 1: // a collection of extension methods for IEnumerable<T> 2: public static class EnumerableExtensions 3: { 4: // find the index of an item in the collection similar to List<T>.FindIndex() 5: public static int FindIndex<T>(this IEnumerable<T> list, Predicate<T> finder) 6: { 7: return list.ToList().FindIndex(finder); 8: } 9: } This solution is simplicity itself!  It is very concise and elegant and you need not worry about anyone misinterpreting what it’s trying to do (as opposed to the more convoluted LINQ methods above). But the main thing I’m concerned about here is the performance hit to allocate the List<T> in the ToList() call, but once again we’ll explore that in a second. Solution: Roll your own FindIndex() for IEnumerable<T> Of course, you can always roll your own FindIndex() method for IEnumerable<T>.  It would be a very simple for loop which scans for the item and counts as it goes.  There’s many ways to do this, but one such way might look like: 1: // extension methods for IEnumerable<T> 2: public static class EnumerableExtensions 3: { 4: // Finds an item matching a predicate in the enumeration, much like List<T>.FindIndex() 5: public static int FindIndex<T>(this IEnumerable<T> list, Predicate<T> finder) 6: { 7: int index = 0; 8: foreach (var item in list) 9: { 10: if (finder(item)) 11: { 12: return index; 13: } 14:  15: index++; 16: } 17:  18: return -1; 19: } 20: } Well, it’s not quite simplicity, and those less familiar with LINQ may prefer it since it doesn’t include all of the lambdas and behind the scenes iterators that come with deferred execution.  But does having this long, blown out method really gain us much in performance? Comparison of Proposed Solutions So we’ve now seen four solutions, let’s analyze their collective performance.  I took each of the four methods described above and run them over 100,000 iterations of lists of size 10, 100, 1000, and 10000 and here’s the performance results.  Then I looked for targets at the begining of the list (best case), middle of the list (the average case) and not in the list (worst case as must scan all of the list). Each of the times below is the average time in milliseconds for one execution as computer over the 100,000 iterations: Searches Matching First Item (Best Case)   10 100 1000 10000 TakeWhile 0.0003 0.0003 0.0003 0.0003 Select 0.0005 0.0005 0.0005 0.0005 ToList 0.0002 0.0003 0.0013 0.0121 Manual 0.0001 0.0001 0.0001 0.0001   Searches Matching Middle Item (Average Case)   10 100 1000 10000 TakeWhile 0.0004 0.0020 0.0191 0.1889 Select 0.0008 0.0042 0.0387 0.3802 ToList 0.0002 0.0007 0.0057 0.0562 Manual 0.0002 0.0013 0.0129 0.1255   Searches Where Not Found (Worst Case)   10 100 1000 10000 TakeWhile 0.0006 0.0039 0.0381 0.3770 Select 0.0012 0.0081 0.0758 0.7583 ToList 0.0002 0.0012 0.0100 0.0996 Manual 0.0003 0.0026 0.0253 0.2514   Notice something interesting here, you’d think the “roll your own” loop would be the most efficient, but it only wins when the item is first (or very close to it) regardless of list size.  In almost all other cases though and in particular the average case and worst case, the ToList()/FindIndex() combo wins for performance, even though it is creating some temporary memory to hold the List<T>.  If you examine the algorithm, the reason why is most likely because once it’s in a ToList() form, internally FindIndex() scans the internal array which is much more efficient to iterate over.  Thus, it takes a one time performance hit (not including any GC impact) to create the List<T> but after that the performance is much better. Summary If you’re concerned about too many throw-away objects, you can always roll your own FindIndex() method, but for sheer simplicity and overall performance, using the ToList()/FindIndex() combo performs best on nearly all list sizes in the average and worst cases.    Technorati Tags: C#,.NET,Litte Wonders,BlackRabbitCoder,Software,LINQ,List

    Read the article

  • MVC ASP.NET, ObjectContext and Ajax. Weird Behaviour

    - by fabianadipolo
    Hi, i've been creating a web application in mvc asp.net. I have three different project/solutions. One solution contains the model in EF (DAL) and all the methods to add, update, delete and query the objects in the model, the objectcontext is managed here in a per request basis. Other solution contains a content management system in wich authorized users insert, delete, update and access objects through the DAL mentioned before. And the last solution contains the web page that is accessed by all users and where the only operations executed are selects, no update, inserts or deletes here. All the selects are executed against the DAL mentioned before (the first solution). The problem here is that i'm not sure whether an HttpContext lifespan ObjectContext is the best solution. I have a lot of ajax calls in my web app and i'm not sure if an httpcontext could interfere with the performance of the application. I've been noticed that in some cases, specially when someone is working in the content manager inserting, updating or deleting, when you try to click on any link of the user web application (the web app that is accessed by any user - the third one that i mentioned before) the web page freezes and it remains stucked transferring data. In order to stop that behaviour you have to stop and refresh or click several times on the link. Excuse me for my bad english. I hope you could understand and could help me to solve this issue. Thanx in advance.

    Read the article

  • How can I log and retrieve error messages from a client-side desktop app?

    - by KeyboardMonkey
    Update: The service-based answers below are most likely the way to go, I am also curious to see if there are any out-the-box solutions anyone has tried in the field. Our system uses a client-server architecture, and with more clients using it I'm thinking of better ways to log client application errors, and get them sent to us. Currently we just show a simple error message, with a button that preps an email (with the default system email client) and the clients send this on to our support address. This contains extra info like the stack trace. We also tried saving errors to a network share in the company, but I'm not too keen on that archaic solution either. Now there are only two businesses that refer to clients as users, and I'm sure some of ours support both lifestyles, as they just ignore the email button, and sends a full screen-shot wrapped nicely in a word document. Some factors I'm thinking of include A solution to log errors, like the contrived one above, A robust solution; Logging to a SQL database won't work; if that fails too, then what? Is at least semi-automated, preferably to the point where the logs reach my side. It copes with load, our client base is growing and the current solution, and our inboxes, won't hold up. Minimise installing extra 3rd party components on clients, I want to keep the SPOF to a min. I'd love to hear about any experience or suggestions you have on how I can implement such a solution. System Details It's a Microsoft .Net 2 based system with a SQL backend. Some users work remotely over the net, so network shares aren't always available (unless they VPN, which is awesomely slow at any rate). We have users across different companies, their DB's are hosted on-site. We have remote access to 90% of them.

    Read the article

  • What's "Disassembly" page when i trace my ASP.NET WebApp ?

    - by Mostafa
    Hi I have a ClassLibrary in my ASP.NET Web Application solution , Recently when i do some changes in that ClassLibrary and rebuilt that , That doesn't affect the solution . While debuging and tracing instead of going into method of that ClassLibrary , i face "Disassembly" page . I delete Temporary ASP.NET File's folder and Removed the class library from the solution and i added again several times ,But No difference could you help me at this please ?

    Read the article

  • Map enum in JPA with fixed values ?

    - by Kartoch
    I'm looking for the different ways to map an enum using JPA. I especially want to set the integer value of each enum entry and to save only the integer value. @Entity @Table(name = "AUTHORITY_") public class Authority implements Serializable { public enum Right { READ(100), WRITE(200), EDITOR (300); private int value; Right(int value) { this.value = value; } public int getValue() { return value; } }; @Id @GeneratedValue(strategy = GenerationType.AUTO) @Column(name = "AUTHORITY_ID") private Long id; // the enum to map : private Right right; } A simple solution is to use the Enumerated annotation with EnumType.ORDINAL: @Column(name = "RIGHT") @Enumerated(EnumType.ORDINAL) private Right right; But in this case JPA maps the enum index (0,1,2) and not the value I want (100,200,300). Th two solutions I found do not seem simple... First Solution A solution, proposed here, uses @PrePersist and @PostLoad to convert the enum to an other field and mark the enum field as transient: @Basic private int intValueForAnEnum; @PrePersist void populateDBFields() { intValueForAnEnum = right.getValue(); } @PostLoad void populateTransientFields() { right = Right.valueOf(intValueForAnEnum); } Second Solution The second solution proposed here proposed a generic conversion object, but still seems heavy and hibernate-oriented (@Type doesn't seem to exist in JEE): @Type( type = "org.appfuse.tutorial.commons.hibernate.GenericEnumUserType", parameters = { @Parameter( name = "enumClass", value = "Authority$Right"), @Parameter( name = "identifierMethod", value = "toInt"), @Parameter( name = "valueOfMethod", value = "fromInt") } ) Is there any other solutions ? I've several ideas in mind but I don't know if they exist in JPA: use the setter and getter methods of right member of Authority Class when loading and saving the Authority object an equivalent idea would be to tell JPA what are the methods of Right enum to convert enum to int and int to enum Because I'm using Spring, is there any way to tell JPA to use a specific converter (RightEditor) ?

    Read the article

  • Solve the IE select overlap bug

    - by Vincent Robert
    When using IE, you cannot put an absolutely positioned div over a select input element. That's because the select element is considered an ActiveX object and is on top of every HTML element in the page. I already saw people hiding selects when opening a popup div, that leads to pretty bad user experience having controls disappearing. FogBugz actually had a pretty smart solution (before v6) of turning every select into text boxes when a popup was displayed. This solved the bug and tricked the user eye but the behavior was not perfect. Another solution is in FogBugz 6 where they no more use the select element and recoded it everywhere. Last solution I currently use is messing up the IE rendering engine and force it to render the absolutely positioned div as an ActiveX element too, ensuring it can live over a select element. This is achieved by placing an invisible iframe inside the div and styling it with: #MyDiv iframe { position: absolute; z-index: -1; filter: mask(); border: 0; margin: 0; padding: 0; top: 0; left: 0; width: 9999px; height: 9999px; overflow: hidden; } Anyone has a even better solution than this one ? EDIT: The purpose of this question is as much informative as it is a real question. I find the iframe trick to be a good solution but I am still looking for improvement like removing this ugly useless iframe tag that degrade accessibility.

    Read the article

  • Code Golf: Evaluating Mathematical Expressions

    - by Noldorin
    Challenge Here is the challenge (of my own invention, though I wouldn't be surprised if it has previously appeared elsewhere on the web). Write a function that takes a single argument that is a string representation of a simple mathematical expression and evaluates it as a floating point value. A "simple expression" may include any of the following: positive or negative decimal numbers, +, -, *, /, (, ). Expressions use (normal) infix notation. Operators should be evaluated in the order they appear, i.e. not as in BODMAS, though brackets should be correctly observed, of course. The function should return the correct result for any possible expression of this form. However, the function does not have to handle malformed expressions (i.e. ones with bad syntax). Examples of expressions: 1 + 3 / -8 = -0.5 (No BODMAS) 2*3*4*5+99 = 219 4 * (9 - 4) / (2 * 6 - 2) + 8 = 10 1 + ((123 * 3 - 69) / 100) = 4 2.45/8.5*9.27+(5*0.0023) = 2.68... Rules I anticipate some form of "cheating"/craftiness here, so please let me forewarn against it! By cheating, I refer to the use of the eval or equivalent function in dynamic languages such as JavaScript or PHP, or equally compiling and executing code on the fly. (I think my specification of "no BODMAS" has pretty much guaranteed this however.) Apart from that, there are no restrictions. I anticipate a few Regex solutions here, but it would be nice to see more than just that. Now, I'm mainly interested in a C#/.NET solution here, but any other language would be perfectly acceptable too (in particular, F# and Python for the functional/mixed approaches). I haven't yet decided whether I'm going to accept the shortest or most ingenious solution (at least for the language) as the answer, but I would welcome any form of solution in any language, except what I've just prohibited above! My Solution I've now posted my C# solution here (403 chars). Update: My new solution has beaten the old one significantly at 294 chars, with the help of a bit of lovely regex! I suspected that this will get easily beaten by some of the languages out there with lighter syntax (particularly the funcional/dynamic ones), and have been proved right, but I'd be curious if someone could beat this in C# still. Update I've seen some very crafty solutions already. Thanks to everyone who has posted one. Although I haven't tested any of them yet, I'm going to trust people and assume they at least work with all of the given examples. Just for the note, re-entrancy (i.e. thread-safety) is not a requirement for the function, though it is a bonus. Format Please post all answers in the following format for the purpose of easy comparison: Language Number of characters: ??? Fully obfuscated function: (code here) Clear/semi-obfuscated function: (code here) Any notes on the algorithm/clever shortcuts it takes.

    Read the article

  • How to use Svn Version Task to set the Version of a vb project

    - by SchlaWiener
    I have a Visual Studio 2008 Solution where the main output exe is a VB.Net Winforms exe which has several VB.Net and C# dll's linked from the same solution. The whole solution is under version control with subversion. Now I want to automagically update by generated files with the current svn revision number. For this purpose I found this neat project: http://svnversiontasks.codeplex.com/ You also need the MSBuild.Communuity.Tasks for this to work. There was a msbuild example on how to update the rev number for every single project in your solution which I use: <Import Project="$(MSBuildExtensionsPath)\SvnTools.Targets\SvnTools.Tasks.VersionManagement.Tasks" /> <Target Name="build"> <CreateItem Include="../**/AssemblyInfo.vb;../**/AssemblyInfo.cs;../**/Properties/AssemblyInfo.cs"> <Output TaskParameter="Include" ItemName="AssemblyInfoFiles" /> </CreateItem> <CreateItem Include="../**/*.vdproj;*.vdproj"> <Output TaskParameter="Include" ItemName="DeploymentProjectFiles" /> </CreateItem> <UpdateVersion AssemblyInfoFiles="@(AssemblyInfoFiles)" DeploymentProjectFiles="@(DeploymentProjectFiles)" Format="yyyy.mm.dd.rev" /> <Exec Command="&quot;$(VS90COMNTOOLS)..\IDE\devenv&quot; ..\MyApp.sln /build" /> <RevertVersionChange AssemblyInfoFiles="@(AssemblyInfoFiles)" DeploymentProjectFiles="@(DeploymentProjectFiles)" /> </Target> I modified the original file to also include the AssemblyInfo.vb file and saved it as a msbuild.proj file. However if I execute msbuild from the console I see that the C# projects are updated (I can also confirm that from the properties of the output dll but my vb project remains unchanged: Reverting version number change: ../App1\AssemblyInfo.vb Updating version number (to rev 0) for file: ../App1\AssemblyInfo.vb D:\Source\MyApp\MyAppDeploy\MyAppDeploy.csproj : warning : Version attribute not found, file not updated. Reverting version number change: ../App2\Properties\AssemblyInfo.cs Updating version number (to rev 0) for file: ../App2\Properties\AssemblyInfo.cs Successfully updated file. Maybe the task does not support VB.Net. But maybe someone has a solution for this...

    Read the article

  • Manage spreadsheet versioning

    - by oo
    We have a lot of VBA code in spreadsheets and a lot of time people save them to local drives. When we want to upgrade the spreadsheets we push a new version out to a shared drive but dont have any way of enforcing that people dont use the old versions of the spreadsheets. Is there some best practice here to deploy vba spreadsheets so if someone loads an old version it wont open or will ask you to upgrade. It seems like this must be an issue for any custom solution so i would have through MS would have some solution here. Does microsoft have a standard versioning / deployment solution for this or do i need to come up with some home grown solution (spreadsheet pings a database on startup to check version)

    Read the article

  • I am geting message when i am loading VS

    - by kumar
    when loading up a solution in VS2008 I get: An error was encountered while opening associated documents the last time this solution was loaded. Document load is being skipped during this solution load in order to avoid that error. First time when i open it shout down immediatlym then next time when I open it popups this message box it is not shouting down, once I click any usercotrols or ASPX page it is shutting off again.. How can I find which document is causing the problem? Thanks...

    Read the article

  • What is the best way to do testing database (MYSQL spesific)

    - by justjoe
    Right now i'm on testing something in a database. It's a wordpress database. i have to write and delete and do other operation on it. As you know it, it has indexing mechanism that will always make every new post inherit the next highest possible ID. Please consider that this database is a copying of used database. it has been written before. So, i will need to make sure when i finish my testing, it will be the same Right now, my only solution is making backup. So if i have end in some section of planned testing, i will backup it and start next testing on another copy of it. Fortunately, the size of database is only a small one. so delete and copy and backup it will be easy. but i know this way of database testing is only partial solution.It force me to create too many backup copy. I don't know what i will do if the database has bigger size. it will be a very long of testing nightmare. so i wonder is there any solution that work just like rollback. So it will just lock the database and just put new entry as some kind of cache. I can erase it or write it into the database. i use mysql and phpmyadmin and use it to developed some custom solution. EDIT ::: How to effectively doing testing on database when developing PHP solution ?

    Read the article

  • Compile Error: Ticks must be between DateTime.MinValue.Ticks and DateTime.MaxValue.Ticks. Parameter

    - by mickyjtwin
    I have a Visual Studio 2008 solution that when I build, returns the following error: Ticks must be between DateTime.MinValue.Ticks and DateTime.MaxValue.Ticks. Parameter name: ticks There is no reference file/line/column in the error. Becoming quite frustrating as the solution builds in the end, however I cannot debug. In the solution, there is no reference/using to DateTime.MinValue.Ticks at all...

    Read the article

  • CodePlex Daily Summary for Monday, March 26, 2012

    CodePlex Daily Summary for Monday, March 26, 2012Popular ReleasesQuick Performance Monitor: Version 1.8.1: Added option to set main window to be 'Always On Top'. Use context (right-click) menu on graph to toggle..Net Rest API for Kayako Fusion 4: kayako_rest_api_2012.03.26: Added ability to search for users via organisation/email. This is much quicker than getting all users then filtering.GeoMedia PostGIS data server: PostGIS GDO 1.0.1.1: This is a new version of GeoMeda PostGIS data server which supports user rights. It means that only those feature classes, which the current user has rights to select, are visible in GeoMedia. Issues fixed in this release Fixed a problem when gdo.gfeaturesbase table has been visible in GeoMedia. To hide this table, run the previous version of Database Utilities and uncheck this table in the feature classes list. Then load the new release. Fixed a problem when coordinate system list has not...Silverlight 4 & 5 Persian DatePicker: Silverlight 4 and 5 Persian DatePicker: Added Silverlight 5 support.Y.Music: Y.Music v.1.0: ?????? ?????? ?????????. ????????: ????? ???? ????, ??????? ?????? ? ??? - Beta.Asp.NET Url Router: v1.0: build for .net 2.0 and .net 4.0menu4web: menu4web 0.0.3: menu4web 0.0.3ArcGIS Editor for OpenStreetMap: ArcGIS Editor for OSM 2.0 Final: This release installs both the ArcGIS Editor for OSM Server Component and/or ArcGIS Editor for OSM Desktop components. The Desktop tools allow you to download data from the OpenStreetMap servers and store it locally in a geodatabase. You can then use the familiar editing environment of ArcGIS Desktop to create, modify, or delete data. Once you are done editing, you can post back the edit changes to OSM to make them available to all OSM users. The Server Component allows you to quickly create...Craig's Utility Library: Craig's Utility Library 3.1: This update adds about 60 new extension methods, a couple of new classes, and a number of fixes including: Additions Added DateSpan class Added GenericDelimited class Random additions Added static thread friendly version of Random.Next called ThreadSafeNext. AOP Manager additions Added Destroy function to AOPManager (clears out all data so system can be recreated. Really only useful for testing...) ORM additions Added PagedCommand and PageCount functions to ObjectBaseClass (same as M...XNA Electric Effect: Jason Electric Effect v1.1: The library now includes 3 effect types: Line, Bezier, CatmullRom, providing different look and feel.DotSpatial: DotSpatial 1.1: This is a Minor Release. See the changes in the issue tracker. Minimal -- includes DotSpatial core and essential extensions Extended -- includes debugging symbols and additional extensions Just want to run the software? End user (non-programmer) version available branded as MapWindow Want to add your own feature? Develop a plugin, using the template and contribute to the extension feed (you can also write extensions that you distribute in other ways). Components are available as NuGet pa...Change default Share-site group SharePoint Online (Office 365): Change default Share-site group SharePoint Online: As default when we share a site collection or site with external users, SharePoint Online show default SharePoint groups which are Visitors and Members. By using this feature, you will get a link which you can use to customize the default groups to your custom groups and other default groups.Microsoft All-In-One Code Framework - a centralized code sample library: C++, .NET Coding Guideline: Microsoft All-In-One Code Framework Coding Guideline This document describes the coding style guideline for native C++ and .NET (C# and VB.NET) programming used by the Microsoft All-In-One Code Framework project team.Working with Social Data: Tag Cloud Customization: http://swatipoint.blogspot.com/2011/10/sharepoint-2010-social-featurestagging.htmlWebDAV for WHS: Version 1.0.67: - Added: Check whether the Remote Web Access is turned on or not; - Added: Check for Add-In updates;Phalanger - The PHP Language Compiler for the .NET Framework: 3.0 (March 2012) for .NET 4.0: March release of Phalanger 3.0 significantly enhances performance, adds new features and fixes many issues. See following for the list of main improvements: New features: Phalanger Tools installable for Visual Studio 2011 Beta "filter" extension with several most used filters implemented DomDocument HTML parser, loadHTML() method mail() PHP compatible function PHP 5.4 T_CALLABLE token PHP 5.4 "callable" type hint PCRE: UTF32 characters in range support configuration supports <c...Nearforums - ASP.NET MVC forum engine: Nearforums v8.0: Version 8.0 of Nearforums, the ASP.NET MVC Forum Engine, containing new features: Internationalization Custom authentication provider Access control list for forums and threads Webdeploy package checksum: abc62990189cf0d488ef915d4a55e4b14169bc01 Visit Roadmap for more details.BIDS Helper: BIDS Helper 1.6: This beta release is the first to support SQL Server 2012 (in addition to SQL Server 2005, 2008, and 2008 R2). Since it is marked as a beta release, we are looking for bug reports in the next few months as you use BIDS Helper on real projects. In addition to getting all existing BIDS Helper functionality working appropriately in SQL Server 2012 (SSDT), the following features are new... Analysis Services Tabular Smart Diff Tabular Actions Editor Tabular HideMemberIf Tabular Pre-Build ...Json.NET: Json.NET 4.5 Release 1: New feature - Windows 8 Metro build New feature - JsonTextReader automatically reads ISO strings as dates New feature - Added DateFormatHandling to control whether dates are written in the MS format or ISO format, with ISO as the default New feature - Added DateTimeZoneHandling to control reading and writing DateTime time zone details New feature - Added async serialize/deserialize methods to JsonConvert New feature - Added Path to JsonReader/JsonWriter/ErrorContext and exceptions w...New ProjectsASIVeste: No description availableAuthor-it Sync Headings Plug-in: Author-it plug-in that allows the user to synchronize the Print, Help, and Web headings with the Description for each selected topic.BlogEngine.Web: BlogEngine.Web is a BlogEngine.Net converted to use Web Application Project model (WAP).Code Writer Helper: A quick solution to help code generator writers.CodeUITest: Practise CodeUI automation.DAX Studio: Excel Add-In for PowerPivot and Analysis Services Tabular projects that will include an Object Browser, query editing and execution, formula and measure editing ,syntax highlighting, integrated tracing and query execution breakdowns.Fated: Fated is an isometric-viewed, tile-based tactical RPG developed in C# using XNA to be deployed to XBox. This includes a character generation core, graphics engine, and storyline parser.iSufe???: “iSufe???”??????????????????????????????。???????????、????、?????????,??????????????。??,????iOS/Android/WAP???????,???????????????。????GPLv2??,?????????????。Kinect test project: Basic project for my kinect test applicationLoLTimers: LoLTimers by Christian Schubert 2012. Version 1.0.0.0 This is a small app that lets you keep track of the most important creep camp cooldowns. Developed in Visual Studio C#.London Priority Security Services Ltd: LPSS - London Priority Security Services LtdNMCNPM: code nhóm nmcnpmOffice 365 Anonymous Access Manager Sandbox Solution: The sandbox solution enables you to manage anonymous access of lists on Office 365. It allows setting read, modifying and adding rights. Additionally the configuration page adds the necessary events to be able to use moderations, when anonymous users are creating a list item. The second feature in the solution enables anonymous access on blogs sites, it allows to enable anonymous users to comment on a blog.Office 365 Google Analytics: This sandbox solution enables google analytics everywhere in your site collection. This allows you to use the google analytics reporting on all your Office 365 sites.Office 365 Mobile Access Enables for Public Sites & Blogs: This sandbox solution enables mobile access on Office 365 sites.OwnMFCSolution: MFC test solution.People Data Generator: Need to load a bunch of test data to represent people (e.g. name, address, phone, etc.)? Wish it looked realistic? People Data Generator is what you need. Features: *Realistic names *Realistic addresses, using real towns and postal codes *Realistic phone numbers and emails *Very ExtensibleProventi: Met dit programma kan je je voorraad van je onderneming beheren. Dit programma zal in eerste instantie gebruikt worden binnen de minionderneming Proventi. Het programma is geschreven in VB.Net en maakt gebruik van SQL Server CE voor de gegevensopslag.qCommerce: ??????????? ???????, ???????????? ??? ????? qSoftwareQuanLyOTo: Ð? án môn h?c C# qu?n lý garage ô tôRoyaSoft.ir Resources: i am use this project for my personal web site :)SGPF: The team does not have nothing to declare here!SharePoint 2010 Autocomplete Lookup Field: Autocomplete Lookup field allows type ahead functionality while entering lookup values in list items.Sharing Photos using SignalR: An MVC application using SignalR that can be used to share photos between friends and get realtime updates. An user connected to the website can upload a photo which will be automatically broadcasted to all clients connected at that point.Sistema Hoteleiro: Sistema Hoteleiro é o meu trabalho final da disciplina Arquitetura de Aplicativos Ambiente .NET da 4a turma do curso de pós-graduação de especialização em Arquitetura de Sistemas Distribuídos oferecido pelo Instituto de Educação Continuada da Pontifícia Universidade Católica de MSoftware Revolution: This project is core information site of Software Revolution named company which provides software solutions.tgryi: tgyrivbWSUS: Really decide which and when to install updates from a centralized server, globally or per host : - installation schedule - updates to install - email results - configure extra Windows Update parameters Works with WSUS server or Windows Update from Microsoft. See README.txt for more informations ! :) Current official website is http://sourceforge.net/projects/vbwsus/XamlCombine: Combines multiple XAML resource dictionaries in one. Replaces DynamicResources to StaticResources. And sort them in order of usage.XNA Shader-free Linear Burn effect: Sample demonstrating a Linear Burn effect in XNA without using custom shaderszhCms: zhCmszhtest: my test project

    Read the article

  • Displaying Calendar in an Android App

    - by Rony
    Hi experts, I would be obliged if someone could provide me a solution as to which component to be used so that, I can display a fairly good looking calender in my android application. I kept browsing for a solution for the past two days, but unfortunately could not find a solution. Since, this is a very basic requisite, I am sure that, there will be a perfect solution for this. Please help with suggestions, comments and solutions. ANy help in this regard is well appreciated. Looking forward, Regards, Rony

    Read the article

  • is it possible to use iis 7 to manage users when using forms authentication

    - by yamspog
    I have a web application that is using forms authentication. Everything is configured and working correctly. However, i'm dealing with the issue of creating and maintaining users and role membership. I know that I can roll my own solution but I'm wondering if there is an alternative solution? Does iis7 provide screens for managing forms authentication users? Is there a reliable, free solution that someone would recommend? Thanks!

    Read the article

  • Batch Geocoding with Garmin Mapsource

    - by Mike Trader
    Please Note: I AM NOT LOOKING FOR AN ALTERNATIVE SOLUTION I lost track of this effort years ago but have need to geocode thousands of addresses nightly. I must use the very accurate database sitting on the machine, installed when the Nuvi map update installed Mapsource. When I contacted Garmin years ago, they expressed an interest in providing an API for this, but then I heard nothing and did not follow up. Their database is provided by navtec? I believe. Anyone have experience with that format? I posted on the Garmin Developer forum a while ago, but its a little lethargic over there :) Has anyone done this? Does anyone know how it might be done without an API; meaning database structure and calls? I'll take a solution in any language. Added: Garmin has expressed an interest in making this available to me. They just have not done it. I do not know the database format. I am NOT looking for an online solution or any other "alternative". This question is very specific. Contact Info: MikeTrader2 A T gmail D O T com Added: I offered a 400 pt bounty for this. Jeff Atwood then offered 400pts also. If you would like to see a solution to this, vote up the question and I will chase up Garmin and show there is interest in finally providing this. Please Note: I AM NOT LOOKING FOR AN ALTERNATIVE SOLUTION

    Read the article

< Previous Page | 63 64 65 66 67 68 69 70 71 72 73 74  | Next Page >