Search Results

Search found 421 results on 17 pages for 'pitfalls'.

Page 10/17 | < Previous Page | 6 7 8 9 10 11 12 13 14 15 16 17  | Next Page >

  • How to justify rewriting/revamping legacy software in a business case?

    - by sxthomson
    I work for a great little software company which makes good revenue from our main software package. The problem for me is that it's almost unmaintainable. It's written in Delphi 7 (has upgraded versions over time) and has been worked on by a lot of developers over the past 20 or so years. The software lacks any meaningful architecture - there's no object orientation whatsoever, horrible amounts of cyclical dependencies and an over-reliance on global variables to name just a few things. Another huge thing for me is Delphi 7 does NOT support 64-bit. The problem here for me is that my management team don't care about technical things, they want to know why they should care. Obviously that's expected, so what I'm asking here is for some guidance, or tales, or pitfalls about this kind of thing. There's a few things I would love to include, namely for me, the length of time taken to debug/write a feature in "legacy" code, versus coherent, well structured OO code. Does anyone know of any blog posts or the like where this is talked about? For us in the company this is a huge reason. Despite being decent developers we feel like writing a new feature is just piling more rubbish on top. On top of that, even for me who has a decent level of understanding of the code, changing things is infuriating - a small change can have a ridiculous domino effect. Anyone have any experiences they'd like to share?

    Read the article

  • TechEd 2012: Windows Phone Exam Cram

    - by Tim Murphy
    Usually speakers take offence if you wear headphones in their talk.  For the exam cram session it was a requirement.  This was because it was a cubical walled room with an open top next to a study hall. While no-one was going to come out of this session ready to take a test, I am glad that I took the time to attend it.  There was a fair amount of material that you should know already if you have ever taken a certification test before.  This was packed around a mix of key concepts and some tidbits that marked where some of the pitfalls are for this particular test.  The biggest warning was that the test is based on Windows Phone 7.0 and not Mango meaning that you have to be careful that you don’t answer a question in the wrong context. I would suggest if you have a chance to take attend a free session grab it.  It is a good break from the other hard core talks and will get your mind into a mode for getting your next certification.  Good luck. del.icio.us Tags: TechEd,TechEd 2012,Windows Phone,Exam Cram,Certification

    Read the article

  • Webcast: DB Enterprise User Security Integration with Oracle Directory Services

    - by B Shashikumar
    The typical enterprise has a large number of DBA (Database administrator) accounts that are locally managed, which is often very costly, problematic and error-prone. Databases are a crucial component of your enterprise IT infrastructure, housing sensitive corporate data and database user accounts and privileges. To ensure the integrity of your enterprise's data, it's imperative to have a well-managed identity management system. This begins with centralized management of user accounts and access rights. Enterprise User Security (EUS), an Oracle Database Enterprise Edition feature, combined with Oracle Identity Management, gives you the ability to centrally manage database users and their authorizations in one central place. The cost of user provisioning and password resets is dramatically reduced. This technology is a must for new application development and should be considered for existing applications as well. Join Oracle Advisors for a live webcast on Jul 11 at 8am Pacific Time where Oracle experts will briefly introduce EUS, followed by a detailed discussion about the various directory options that are supported, including integration with Microsoft Active Directory. We'll conclude how to avoid common pitfalls deploying EUS with directory services. To register for this event, click here  

    Read the article

  • Displaying Datamatrix in application error screen

    - by DaveNay
    Quite often we will get a report from a user in the field saying there was an error in our application. Frequently this leads to the typical round of "What was the error?" "I don't know, it was just an error." We of course log these faults to the log files, and we can even enable detailed debug logs, but this involves the end user changing a setting in the configuration file and then finding the correct files and then emailing them to us. As I'm sure you can all imagine, there are plenty of pitfalls and alligators in this methodology. Recently a couple of people have used their cell phone to email me a "screen capture" of the fault, and while this helps, we still have to scrutinize the image to find the exact fault, and if enabled, the stack trace. So this evening, I had the brilliant idea (IMHO) to encode the fault into a Datamatrix barcode image and then encourage users to send me a picture from their cell phone. I can then decode the datamatrix and get a parse-able error message! Our core technology is machine vision, so the decoding of the datamatrix image would be trivial, I just need to find a method of generating the actual image to display in the fault handler. Thoughts?

    Read the article

  • Displaying Datamatrix in application error screen

    - by DaveNay
    Quite often we will get a report from a user in the field saying there was an error in our application. Frequently this leads to the typical round of "What was the error?" "I don't know, it was just an error." We of course log these faults to the log files, and we can even enable detailed debug logs, but this involves the end user changing a setting in the configuration file and then finding the correct files and then emailing them to us. As I'm sure you can all imagine, there are plenty of pitfalls and alligators in this methodology. Recently a couple of people have used their cell phone to email me a "screen capture" of the fault, and while this helps, we still have to scrutinize the image to find the exact fault, and if enabled, the stack trace. So this evening, I had the brilliant idea (IMHO) to encode the fault into a Datamatrix barcode image and then encourage users to send me a picture from their cell phone. I can then decode the datamatrix and get a parse-able error message! Our core technology is machine vision, so the decoding of the datamatrix image would be trivial, I just need to find a method of generating the actual image to display in the fault handler. Thoughts?

    Read the article

  • Bikeshedding: Placeholders in strings

    - by dotancohen
    I find that I sometimes use placeholders in strings, like this: $ cat example-apache <VirtualHost *:80> ServerName ##DOMAIN_NAME## ServerAlias www.##DOMAIN_NAME## DocumentRoot /var/www/##DOMAIN_NAME##/public_html </VirtualHost> Now I am sure that it is a minor issue if the placeholder is ##DOMAIN_NAME##, !!DOMAIN_NAME!!, {{DOMAIN_NAME}}, or some other variant. However, I now need to standardize with other developers on a project, and we all have a vested interest in having our own placeholder format made standard in the organization. Are there any good reasons for choosing any of these, or others? I am trying to quantify these considerations: Aesthetics and usability. For example, __dict__ may be hard to read as we don't know how many underscores are in there. Compatibility. Will some language try to do something funny with {} syntax in a string (such as PHP does with "Welcome to {$siteName} today!")? Actually, I know that PHP and Python won't, but others? Will a C++ preprocessor choke on ## format? If I need to store the value in some SQL engine, will it not consider something a comment? Any other pitfalls to be wary of? Maintainability. Will the new guy mistake ##SOME_PLACEHOLDER## as a language construct? The unknown. Surely the wise folk here will think of other aspects of this decision that I have not thought of. I might be bikeshedding this, but if there are real issues that might be lurking then I would certainly like to know about them before mandating that our developers adhere to a potentially-problematic convention.

    Read the article

  • Placeholders in strings

    - by dotancohen
    I find that I sometimes use placeholders in strings, like this: $ cat example-apache <VirtualHost *:80> ServerName ##DOMAIN_NAME## ServerAlias www.##DOMAIN_NAME## DocumentRoot /var/www/##DOMAIN_NAME##/public_html </VirtualHost> Now I am sure that it is a minor issue if the placeholder is ##DOMAIN_NAME##, !!DOMAIN_NAME!!, {{DOMAIN_NAME}}, or some other variant. However, I now need to standardize with other developers on a project, and we all have a vested interest in having our own placeholder format made standard in the organization. Are there any good reasons for choosing any of these, or others? I am trying to quantify these considerations: Aesthetics and usability. For example, __dict__ may be hard to read as we don't know how many underscores are in there. Compatibility. Will some language try to do something funny with {} syntax in a string (such as PHP does with "Welcome to {$siteName} today!")? Actually, I know that PHP and Python won't, but others? Will a C++ preprocessor choke on ## format? If I need to store the value in some SQL engine, will it not consider something a comment? Any other pitfalls to be wary of? Maintainability. Will the new guy mistake ##SOME_PLACEHOLDER## as a language construct? The unknown. Surely the wise folk here will think of other aspects of this decision that I have not thought of. I might be bikeshedding this, but if there are real issues that might be lurking then I would certainly like to know about them before mandating that our developers adhere to a potentially-problematic convention.

    Read the article

  • You should NOT be writing jQuery in SharePoint if&hellip;

    - by Mark Rackley
    Yes… another one of these posts. What can I say? I’m a pot stirrer.. a rabble rouser *rabble rabble* jQuery in SharePoint seems to be a fairly polarizing issue with one side thinking it is the most awesome thing since Princess Leia as the slave girl in Return of the Jedi and the other half thinking it is the worst idea since Mannequin 2: On the Move. The correct answer is OF COURSE “it depends”. But what are those deciding factors that make jQuery an awesome fit or leave a bad taste in your mouth? Let’s see if I can drive the discussion here with some polarizing comments of my own… I know some of you are getting ready to leave your comments even now before reading the rest of the blog, which is great! Iron sharpens iron… These discussions hopefully open us up to understanding the entire process better and think about things in a different way. You should not be writing jQuery in SharePoint if you are not a developer… Let’s start off with my most polarizing and rant filled portion of the blog post. If you don’t know what you are doing or you don’t have a background that helps you understand the implications of what you are writing then you should not be writing jQuery in SharePoint! I truly believe that one of the biggest reasons for the jQuery haters is because of all the bad jQuery out there. If you don’t know what you are doing you can do some NASTY things! One of the best stories I’ve heard about this is from my good friend John Ferringer (@ferringer). John tells this story during our Mythbusters session we do together. One of his clients was undergoing a Denial of Service attack and they couldn’t figure out what was going on! After much searching they found that some genius jQuery developer wrote some code for an image rotator, but did not take into account what happens when there are no images to load! The code just kept hitting the servers over and over and over again which prevented anything else from getting done! Now, I’m NOT saying that I have not done the same sort of thing in the past or am immune from such mistakes. My point is that if you don’t know what you are doing, there are very REAL consequences that can have a major impact on your organization AND they will be hard to track down.  Think how happy your boss will be after you copy and pasted some jQuery from a blog without understanding what it does, it brings down the farm, AND it takes them 3 days to track it back to you.  :/ Good times will not be had. Like it or not JavaScript/jQuery is a programming language. While you .NET people sit on your high horses because your code is compiled and “runs faster” (also debatable), the rest of us will be actually getting work done and delivering solutions while you are trying to figure out why your widget won’t deploy. I can pick at that scab because I write .NET code too and speak from experience. I can do both, and do both well. So, I am not speaking from ignorance here. In JavaScript/jQuery you have variables, loops, conditionals, functions, arrays, events, and built in methods. If you are not a developer you just aren’t going to take advantage of all of that and use it correctly. Ahhh.. but there is hope! There is a lot of jQuery resources out there to help you learn and learn well! There are many experts on the subject that will gladly tell you when you are smoking crack. I just this minute saw a tweet from @cquick with a link to: “jQuery Fundamentals”. I just glanced through it and this may be a great primer for you aspiring jQuery devs. Take advantage of all the resources and become a developer! Hey, it will look awesome on your resume right? You should not be writing jQuery in SharePoint if it depends too much on client resources for a good user experience I’ve said it once and I’ll say it over and over until you understand. jQuery is executed on the client’s computer. Got it? If you are looping through hundreds of rows of data, searching through an enormous DOM, or performing many calculations it is going to take some time! AND if your user happens to be sitting on some old PC somewhere that they picked up at a garage sale their experience will be that much worse! If you can’t give the user a good experience they will not use the site. So, if jQuery is causing the user to have a bad experience, don’t use it. I sometimes go as far to say that you should NOT go to jQuery as a first option for external facing web sites because you have ZERO control over what the end user’s computer will be. You just can’t guarantee an awesome user experience all of the time. Ahhh… but you have no choice? (where have I heard that before?). Well… if you really have no choice, here are some tips to help improve the experience: Avoid screen scraping This is not 1999 and SharePoint is not an old green screen from a mainframe… so why are you treating it like it is? Screen scraping is time consuming and client intensive. Take advantage of tools like SPServices to do your data retrieval when possible. Fine tune your DOM searches A lot of time can be eaten up just searching the DOM and ignoring table rows that you don’t need. Write better jQuery to only loop through tables rows that you need, or only access specific elements you need. Take advantage of Element ID’s to return the one element you are looking for instead of looping through all the DOM over and over again. Write better jQuery Remember this is development. Think about how you can write cleaner, faster jQuery. This directly relates to the previous point of improving your DOM searches, but also when using arrays, variables and loops. Do you REALLY need to loop through that array 3 times? How can you knock it down to 2 times or even 1? When you have lots of calculations and data that you are manipulating every operation adds up. Think about how you can streamline it. Back in the old days before RAM was abundant, Cores were plentiful and dinosaurs roamed the earth, us developers had to take performance into account in everything we did. It’s a lost art that really needs to be used here. You should not be writing jQuery in SharePoint if you are sending a lot of data over the wire… Developer:  “Awesome… you can easily call SharePoint’s web services to retrieve and write data using SPServices!” Administrator: “Crap! you can easily call SharePoint’s web services to retrieve and write data using SPServices!” SPServices may indeed be the best thing that happened to SharePoint since the invention of SharePoint Saturdays by Godfather Lotter… BUT you HAVE to use it wisely! (I REFUSE to make the Spiderman reference). If you do not know what you are doing your code will bring back EVERY field and EVERY row from a list and push that over the internet with all that lovely XML wrapped around it. That can be a HUGE amount of data and will GREATLY impact performance! Calling several web service methods at the same time can cause the same problem and can negatively impact your SharePoint servers. These problems, thankfully, are not difficult to rectify if you are careful: Limit list data retrieved Use CAML to reduce the number of rows returned and limit the fields returned using ViewFields.  You should definitely be doing this regardless. If you aren’t I hope your admin thumps you upside the head. Batch large list updates You may or may not have noticed that if you try to do large updates (hundreds of rows) that the performance is either completely abysmal or it fails over half the time. You can greatly improve performance and avoid timeouts by breaking up your updates into several smaller updates. I don’t know if there is a magic number for best performance, it really depends on how much data you are sending back more than the number of rows. However, I have found that 200 rows generally works well.  Play around and find the right number for your situation. Delay Web Service calls when possible One of the cool things about jQuery and SPServices is that you can delay queries to the server until they are actually needed instead of doing them all at once. This can lead to performance improvements over DataViewWebParts and even .NET code in the right situations. So, don’t load the data until it’s needed. In some instances you may not need to retrieve the data at all, so why retrieve it ALL the time? You should not be writing jQuery in SharePoint if there is a better solution… jQuery is NOT the silver bullet in SharePoint, it is not the answer to every question, it is just another tool in the developers toolkit. I urge all developers to know what options exist out there and choose the right one! Sometimes it will be jQuery, sometimes it will be .NET,  sometimes it will be XSL, and sometimes it will be some other choice… So, when is there a better solution to jQuery? When you can’t get away from performance problems Sometimes jQuery will just give you horrible performance regardless of what you do because of unavoidable obstacles. In these situations you are going to have to figure out an alternative. Can I do it with a DVWP or do I have to crack open Visual Studio? When you need to do something that jQuery can’t do There are lots of things you can’t do in jQuery like elevate privileges, event handlers, workflows, or interact with back end systems that have no web service interface. It just can’t do everything. When it can be done faster and more efficiently another way Why are you spending time to write jQuery to do a DataViewWebPart that would take 5 minutes? Or why are you trying to implement complicated logic that would be simple to do in .NET? If your answer is that you don’t have the option, okay. BUT if you do have the option don’t reinvent the wheel! Take advantage of the other tools. The answer is not always jQuery… sorry… the kool-aid tastes good, but sweet tea is pretty awesome too. You should not be using jQuery in SharePoint if you are a moron… Let’s finish up the blog on a high note… Yes.. it’s true, I sometimes type things just to get a reaction… guess this section title might be a good example, but it feels good sometimes just to type the words that a lot of us think… So.. don’t be that guy! Another good buddy of mine that works for Microsoft told me. “I loved jQuery in SharePoint…. until I had to support it.”. He went on to explain that some user was making several web service calls on a page using jQuery and then was calling Microsoft and COMPLAINING because the page took so long to load… DUH! What do you expect to happen when you are pushing that much data over the wire and are making that many web service calls at once!! It’s one thing to write that kind of code and accept it’s just going to take a while, it’s COMPLETELY another issue to do that and then complain when it’s not lightning fast!  Someone’s gene pool needs some chlorine. So, I think this is a nice summary of the blog… DON’T be that guy… don’t be a moron. How can you stop yourself from being a moron? Ah.. glad you asked, here are some tips: Think Is jQuery the right solution to my problem? Is there a better approach? What are the implications and pitfalls of using jQuery in this situation? Search What are others doing? Does someone have a better solution? Is there a third party library that does the same thing I need? Plan Write good jQuery. Limit calculations and data sent over the wire and don’t reinvent the wheel when possible. Test Okay, it works well on your machine. Try it on others ESPECIALLY if this is for an external site. Test with empty data. Test with hundreds of rows of data. Test as many scenarios as possible. Monitor those server resources to see the impact there as well. Ask the experts As smart as you are, there are people smarter than you. Even the experts talk to each other to make sure they aren't doing something stupid. And for the MOST part they are pretty nice guys. Marc Anderson and Christophe Humbert are two guys who regularly keep me in line. Make sure you aren’t doing something stupid. Repeat So, when you think you have the best solution possible, repeat the steps above just to be safe.  Conclusion jQuery is an awesome tool and has come in handy on many occasions. I’m even teaching a 1/2 day SharePoint & jQuery workshop at the upcoming SPTechCon in Boston if you want to berate me in person. However, it’s only as awesome as the developer behind the keyboard. It IS development and has its pitfalls. Knowledge and experience are invaluable to giving the user the best experience possible.  Let’s face it, in the end, no matter our opinions, prejudices, or ego providing our clients, customers, and users with the best solution possible is what counts. Period… end of sentence…

    Read the article

  • Coco/R vs. ANTLR

    - by Eamon Nerbonne
    I'm evaluating using Coco/R vs. ANTLR for use in a C# project as part of what's essentially a scriptable mail-merge functionality. To parse the (simple) scripts, I'll need a parser. I've focussed on Coco/R and ANTLR because both seem fairly mature and well-maintained and capable of generating decent C# parsers. Neither seem to be trivial to use either, however, and simplicity is something I'd appreciate - particularly maintainability by others. Does anyone have any recommendations to make? What are the pros/cons of either for a parsing a small language - or am I looking into the wrong things entirely? How well do these integrate into a typical continuous integration setup? What are the pitfalls? Related: Well, many questions, such as 1, 2, 3, 4, 5.

    Read the article

  • Turning off IE8 Compatibility Mode, Good or Bad?

    - by Mike Cornell
    Hopefully this question isn't as subjective as I think it may be. I have an Intranet application which needs to work with IE8 as the enterprise is replacing IE6 as the standard browser. Our testing team found that it did not work in IE8, little did they know that it actually did. Their browsers were set to run IE8 in compatibility mode for Intranet applications. I found that if I set the meta tag for X-UA-Compatible to IE=EmulateIE8 that I could force the browser to render this application as IE8 and the application worked fine. Are there any pitfalls that I don't know about for this solution? If so, is there a better solution?

    Read the article

  • Deciding between Apache Commons exec or ProcessBuilder

    - by Moev4
    I am trying to decide as to whether to use ProcessBuilder or Commons exec, My requirements are that I am simply trying to create a daemon process whose stdout/stdin/stderr I do not care about. In addition I want to execute a kill to destroy this process when the time comes. I am using Java on Linux. I know that both have their pains and pitfalls (such as being sure to use separate thread to swallow streams can lead to blocking or deadlocks, and closing the streams so not to leave open files hanging around)and wanted to know if anyone had suggestions one way or the other as well as any good resources to follow.

    Read the article

  • Subclassing UIScrollView for drawing w/o views

    - by David Dunham
    I'm contemplating subclassing UIScrollView (the way UITextView does) to draw a fairly large amount of text (formatted in ways that NSTextView can't). So far the view won't actually scroll. I'm setting contentSize, and when I drag, I see the scroll indicator. But nothing changes (and I don't get a drawRect: message). An alternate approach is to use a child view, and I've done this. The view can be over 5000 pixels high, however, and I'm a bit concerned about performance on an actual device. (The other approach, be like UITableView, would be a huge pain -- I'm "porting" Mac Cocoa code, and a collection of views would be a huge architecture change.) I've done some searching, but haven't found anyone who is using UIScrollView to do the drawing. Has anyone done this and know of any pitfalls?

    Read the article

  • Using Subversion in Xcode

    - by Kevin L.
    It seems that all of the initial Google results for "using subversion with xcode" are actually just tutorials for installing and configuring svn and Xcode, as opposed to actually using the two (i.e. interacting with svn via Xcode's GUI). Is anyone aware of a good guide that teaches the tricks and pitfalls of working with svn via Xcode's GUI? Something that bridges the gap between the most excellent Version Control with Subversion book and the Xcode IDE (as in pure Xcode GUI without any terminal command use)? Edit: We all love our terminal commands, and we all love Eclipse but (and I mean this in the nicest possible way) neither is really the point of the question. I’d prefer to use svn via Xcode’s IDE instead of via terminal just as I prefer (well, for this case) to code in Xcode’s IDE instead of using vim and gcc. Apple engineers spent a good bit of time implementing that SCM menu in Xcode; someone has to have seen a usage guide somewhere.

    Read the article

  • Declarative authorization and the if_attribute not working...

    - by ro
    I've been having almost the same issues as Victor Martin (you can see the questions asked here). I've got declarative authorization working for just about everything that doesn't involve using conditionals. E.g. has_permission_on :users, :to => [:edit, :update, :destroy] do if_attribute :user => is { current_user } end Are there any common pitfalls with Declarative Authorization? I'm using authlogic and I'm suspicious the 'current_user' method in the application controller might be the source of the problem.

    Read the article

  • Is wordpress a good platform for webapp development?

    - by darlinton
    I am planning a webapp to control bank paying orders. In a quick review, the user goes online and creates a payment order. This order goes to other people that pays it and register the payment on the system. The system keeps track of all the payments, keeping the account balance up-to-date. The system needs a login system, bank integration, and to support at some point thousands of clients. We can find articles on the web about the benefits of using wordpress platform to build webapps. However, I could not find discussion with counterarguments to user wordpress. As the platform the most important choice in webapp project, I would to know more about the pitfalls and harms for choosing wordpress. The question is: What are the benefits and harms for choosing wordpress as a development platform for a webapp that need to be integrated with other system (backend systems) and to handle thousands of users (does it scale up?)?

    Read the article

  • Common programming mistakes for Scala developers to avoid

    - by jelovirt
    In the spirit of Common programming mistakes for Java developers to avoid? Common programming mistakes for JavaScript developers to avoid? Common programming mistakes for .NET developers to avoid? Common programming mistakes for Haskell developers to avoid? Common programming mistakes for Python developers to avoid? Common Programming Mistakes for Ruby Developers to Avoid Common programming mistakes for PHP developers to avoid? what are some common mistakes made by Scala developers, and how can we avoid them? Also, as the biggest group of new Scala developers come from Java, what specific pitfalls they have to be aware of? For example, one often cited problem Java programmers moving to Scala make is use a procedural approach when a functional one would be more suitable in Scala. What other mistakes e.g. in API design newcomers should try to avoid.

    Read the article

  • Multiple merchant accounts with Activemerchant gem.

    - by sosborn
    I am developing a rails site that will allow a group of merchants (5 - 10) to accept credit card orders online. I plan on using the Activemerchant gem to handle the processing. In this case, each merchant will have their own merchant accounts to handle the payments. Storing banking information like that is not something I am a fan of. This could be solved by queing orders and allowing the merchant to log in to the site, input their credentials and process the order. However, if I go that route then it seems to me that I would have to store the customers' credit card information temporarily until the merchant has the opportunity to log in and process the order, which to me is the greater evil. Has anyone dealt with this situation? If so, what are the options available and what pitfalls should I look out for? In my mind, security customer credit card information is priority number one with the merchant account information a close second.

    Read the article

  • Programming user interface advice?

    - by onurozcelik
    Hi, In my project I going to generate a user interface through programming. Scalability of this UI is very important requirement. So far I am using two dimensional graphics for generating the UI. I think there may be different solutions but for the moment I know only two. First one is supplying X,Y coordinates of each two dimensional graphic on my UI.(I do not prefer this solution because I do not want to calculate X,Y coordinates of each graphic. For the moment I don't have a logic for doing this easily) Second one(which is currently I am using now) is using layouts which organizes its contents according to size of item. In this solution I don't have to calculate X,Y coordinates of each item.(Layout is doing this for me) But this approach may have its own pitfalls. I am very new to user interface programming. Can you give me advice about this issue?

    Read the article

  • Rails - Associations - Automatically setting an association_id for a model which has 2 belongs_to

    - by adam
    I have 3 models class User < ... belongs_to :language has_many :posts end class Post < ... belongs_to :user belongs_to :language end class Language < ... has_many :users has_many :posts end Im going to be creating lots of posts via users and at the same time I have to also specify the language the post was written in, which is always the language associatd with the user i.e. @user.posts.create(:text => "blah", :language_id => @user.language_id) That's fine but the way I set the language doesn't sit well with me. The language will always be that of the users so is there a 'best-practice' way of doing this? I know a little about callbacks and association extensions but not sure of any pitfalls.

    Read the article

  • Is there a standard practice for synchronizing SQL Server tables?

    - by EngineeringAutomation
    I've written an application that retrieves pricing and part options from a SQL database to generate a 3D Model of the product and create a sales proposal. My client likes it so much they want to be able to use it on laptops in the field now. The catch is, they won't have an internet connection. I'm considering setting up a SQLite database as part of the standard installation. The SQLite database on each laptop will synchronize with the main database when the internet connection is re-established. Are there best practices regarding synchronizing SQL tables like this? Are there any pitfalls I should consider? I'm open to all options. Thank you.

    Read the article

  • Reading data from a socket, considerations for robustness and security

    - by w.brian
    I am writing a socket server that will implement small portions of the HTTP and the WebSocket protocol, and I'm wondering what I need to take into consideration in order to make it robust/secure. This is my first time writing a socket-based application so please excuse me if any of my questions are particularly naive. Here goes: Is it wrong to assume that you've received an entire HTTP request (WebSocket request, etc) if you've read all data available from the socket? Likewise, is it wrong to assume you've only received one request? Is TCP responsible for making sure I'm getting the "message" all at once as sent by the client? Or do I have to manually detect the beginning and end of each "message" for whatever protocol I'm implementing? Regarding security: What, in general, should I be aware of? Are there any common pitfalls when implementing something like this? As always, any feedback is greatly appreciated.

    Read the article

  • What are some of best Javascript memory detecting tools?

    - by Philip Fourie
    Our team is faced with slow but serious Javascript memory leak. We have read up on the normal causes for memory leaks in Javascript (eg. closures and circular references). We tried to avoid those pitfalls in the code but it likely we still have unknown mistakes left in our code. I started my search for available tools but would like input from people with actual experience with these tools. Some of the tools I found so far (but have no idea how good and useful they would be for our problem): Sieve Drip JavaScript Memory Leak Detector Our search is not limited to free tools, it will be a bonus, but more importantly something that will get the job done. We do the following in our Javascript code: AJAX calls to a .NET WCF back-end that send back JSON data Manipulate the DOM Keep a fairly sized object model in the Javascript to store current state

    Read the article

  • NHibernate session management in ASP.NET MVC

    - by Kevin Pang
    I am currently playing around with the HybridSessionBuilder class found on Jeffrey Palermo's blog post: http://jeffreypalermo.com/blog/use-this-nhibernate-wrapper-to-keep-your-repository-classes-simple/ Using this class, my repository looks like this: public class UserRepository : IUserRepository { private readonly ISessionBuilder _sessionBuilder; public UserRepository(ISessionBuilder sessionBuilder) { _sessionBuilder = sessionBuilder; } public User GetByID(string userID) { using (ISession session = _sessionBuilder.GetSession()) { return session.Get<User>(userID); } } } Is this the best way to go about managing the NHibernate session / factory? I've heard things about Unit of Work and creating a session per web request and flushing it at the end. From what I can tell, my current implementation isn't doing any of this. It is basically relying on the Repository to grab the session from the session factory and use it to run the queries. Are there any pitfalls to doing database access this way?

    Read the article

  • How to handle an "infinite" IEnumerable?

    - by Danvil
    A trivial example of an "infinite" IEnumerable would be IEnumerable<int> Numbers() { int i=0; while(true) { yield return i++; } } I know, that foreach(int i in Numbers().Take(10)) { Console.WriteLine(i); } and var q = Numbers(); foreach(int i in q.Take(10)) { Console.WriteLine(i); } both work fine (and print out the number 0-9). But are there any pitfalls when copying or handling expressions like q? Can I rely on the fact, that they are always evaluated "lazy"? Is there any danger to produce an infinite loop?

    Read the article

  • .NET Framework - Possible memory-leaky classes?

    - by Robert Fraser
    Just the other day I was investigating a memory leak that was ballooning the app from ~50MB to ~130MB in under two minutes. Turns out that the problem was with the ConcurrentQueue class. Internally, the class stores a linked list of arrays. When an item is dequeued from the ConcurrentQueue, the index in the array is bumped, but the item remains in the array (i.e. it's not set to null). The entire array node is dropped after enough enqueues/dequeues, so it's not technically a leak, but if storing only a few large objects in the ConcurrentQueue, this can get out of hand fast. The documentation makes no note of this danger. I was wondering what other potential memory pitfalls are in the Base Class Library? I know about the Substring one (that is, if you call substring and just hold onto the result, the whole string will still be in memory). Any others you've encountered?

    Read the article

< Previous Page | 6 7 8 9 10 11 12 13 14 15 16 17  | Next Page >