Search Results

Search found 27766 results on 1111 pages for 'bad idea jeans'.

Page 58/1111 | < Previous Page | 54 55 56 57 58 59 60 61 62 63 64 65  | Next Page >

  • Is it a good idea to mock/stub in integration tests?

    - by ez
    Say there are multiple requests in a integration test, some of them are sphinx calls(locator for example). Should we just stub out the entire response of these sphinx call, or, since it is a integration test, we want to excise the entire test without stubbing. If that is the case, how do we still keep test independent in the situation when sphinx fails, no internet connection, or third party server non-responsive. Give reasons. Thanks

    Read the article

  • Why would it be a bad idea to have database connection open between client requests?

    - by AspOnMyNet
    1) Book I’m reading argues that connections shouldn’t be opened between client requests, since they are a finite resource. I realize that max pool size can quickly be reached and thus any further attempts to open a connection will be queued until connection becomes available and for that reason it would be imperative that we release connection as soon as possible. But assuming all request will open connection to the same DB, then I’m not sure how having a connection open between two client requests would be any less efficient than having each request first acquiring a connection from connection pool and later returning that object to connection pool? 2) Book also recommends that when database code is encapsulated in a dedicated data access class, then method M opening a database connection should also close that connection. a) I assume one reason why M should also close it, is because if method M opening the connection doesn’t also close it, but instead this connection object is used inside several methods, then it’s more likely that a programmer will forget to close it. b) Are there any other reasons why a method opening the connection should also close it? thanx

    Read the article

  • Free Software for Billing (Columbia)

    - by Yoimir Yamit Castrillon Duque
    English I'm looking for a billing application (also inventories, shopping, clients, providers, accounts, etc) for small businesses. The software should adapt with Colombia's necessities. I searched for it in Google, and I found several ERP such as OpenBravo and Adempiere, but these applications are very big and difficult to use, in fact, I couldn't make them work. I found an application called Ubifactura (made specifically for Colombia), I downloaded the Java source code, but I don't have any idea about how to compile it. I need someone to help me to compile it or just some recommendations for similar software. The idea is to help small business from my town with one of these applications (it doesn't matter if it is for Windows or Linux), the idea is to help. All help is welcome. Spanish (Español) Estoy buscando una aplicacion de facturacion (tambien inventario, compras, clientes, proveedores, cuentas, etc) para pequeñas empresas, que se adaptade a las necesidades de Colombia, en google encontre varios ERP como openbravo y adempiere, pero aplicaciones muy grandes y dificiles de manejas, de hecho no puede hacerlas funcionar. Encontre un programa llamado Ubifactura, hecho para facturar en Colomabia, descarge los archivos de codigo fuente en java, pero no tengo ni idea de como ponerlo a funcionar, pues habla de eclipce, de un servsdor CVS, que no tengo ni idea de como poner a funcionar, necesito si alguien me puede ayudar a trabajar con estos archivos java, o me suguieran aplicacion de acuerdo a mis necesidades. La idea es bebeficiar a varias pequeñas empresas de mi pueblo con una aplicacion de estas, ni importa si en entorno windows o ubuntu, la idea es aportarles algo desde el software libre. Saludos y a la espera de respuestas. Toda ayuda es bienvenida.

    Read the article

  • PHP / MYSQL: Sanitizing user input - is this a bad idea?

    - by Greg
    I have one "go" script that fetches any other script requested and this is what I wrote to sanitize user input: foreach ($_REQUEST as $key => $value){ if (get_magic_quotes_gpc()) $_REQUEST[$key] = mysql_real_escape_string(stripslashes($value)); else $_REQUEST[$key] = mysql_real_escape_string($value); } I haven't seen anyone else use this approach. Is there any reason not to? EDIT - amended for to work for arrays: function mysql_escape($thing) { if (is_array($thing)) { $escaped = array(); foreach ($thing as $key => $value) { $escaped[$key] = mysql_escape($value); } return $escaped; } // else if (get_magic_quotes_gpc()) $thing = stripslashes($thing); return mysql_real_escape_string($thing); } foreach ($_REQUEST as $key => $value){ $_REQUEST[$key] = mysql_escape($value); }

    Read the article

  • Raising C# events with an extension method - is it bad?

    - by Kyralessa
    We're all familiar with the horror that is C# event declaration. To ensure thread-safety, the standard is to write something like this: public event EventHandler SomethingHappened; protected virtual void OnSomethingHappened(EventArgs e) { var handler = SomethingHappened; if (handler != null) handler(this, e); } Recently in some other question on this board (which I can't find now), someone pointed out that extension methods could be used nicely in this scenario. Here's one way to do it: static public class EventExtensions { static public void RaiseEvent(this EventHandler @event, object sender, EventArgs e) { var handler = @event; if (handler != null) handler(sender, e); } static public void RaiseEvent<T>(this EventHandler<T> @event, object sender, T e) where T : EventArgs { var handler = @event; if (handler != null) handler(sender, e); } } With these extension methods in place, all you need to declare and raise an event is something like this: public event EventHandler SomethingHappened; void SomeMethod() { this.SomethingHappened.RaiseEvent(this, EventArgs.Empty); } My question: Is this a good idea? Are we missing anything by not having the standard On method? (One thing I notice is that it doesn't work with events that have explicit add/remove code.)

    Read the article

  • Is unobtrusive RJS files in Rails 3 considered a good idea?

    - by midas06
    I'm working on implementing javascript functionality in my rails 3 app. Now that rjs is supposedly unobtrusive (I honestly don't know a lot about rjs), is it still "evil"? It seems to me the downside may be a lack of testability, but partial page updates via rjs seem to be easier than jumping through the rails hurdles to make ajax requests via jquery. Thoughts? Examples?

    Read the article

  • Using Silverlight for Views in ASP.Net MVC - a bad idea?

    - by bplus
    I'm currently writing a small application for use internally at my office. I started out teaching myself some MVC (I've been a C# dev for 3 years). One of the main requirements is editable grids - I quickly realised that silverlight (i have zero silverlight experience) could be a big help in this. I've managed to create a proof of concept of getting MVC and silverlight to talk back an forth by combining these two techniques: Creating a Rest API using MVC MVC SilverLight I also got some help on stackoverflow: silverlight-grids-mvc-http-post Essentially all I'm doing is embedding a silver light object in a view. Serializing the Model data as JSON and passing it to silverlight(using intit params written into the response). The silverlight object can post data back to the controller as JSON. So far this seems like it could work quite well. However I am a bit concerned that I could be painting myself into a corner with this approach, as in I don't have much experience with either technology so I'm worried I'm going get hit with something further down the line that I won't be able to work around. Has anybody else tried doing this? Any advice would be much appreciated!

    Read the article

  • Streaming binary data to WCF rest service gives Bad Request (400) when content length is greater than 64k

    - by Mikey Cee
    I have a WCF service that takes a stream: [ServiceContract] public class UploadService : BaseService { [OperationContract] [WebInvoke(BodyStyle=WebMessageBodyStyle.Bare, Method=WebRequestMethods.Http.Post)] public void Upload(Stream data) { // etc. } } This method is to allow my Silverlight application to upload large binary files, the easiest way being to craft the HTTP request by hand from the client. Here is the code in the Silverlight client that does this: const int contentLength = 64 * 1024; // 64 Kb var request = (HttpWebRequest)WebRequest.Create("http://localhost:8732/UploadService/"); request.AllowWriteStreamBuffering = false; request.Method = WebRequestMethods.Http.Post; request.ContentType = "application/octet-stream"; request.ContentLength = contentLength; using (var outputStream = request.GetRequestStream()) { outputStream.Write(new byte[contentLength], 0, contentLength); outputStream.Flush(); using (var response = request.GetResponse()); } Now, in the case above, where I am streaming 64 kB of data (or less), this works OK and if I set a breakpoint in my WCF method, and I can examine the stream and see 64 kB worth of zeros - yay! The problem arises if I send anything more than 64 kB of data, for instance by changing the first line of my client code to the following: const int contentLength = 64 * 1024 + 1; // 64 kB + 1 B This now throws an exception when I call request.GetResponse(): The remote server returned an error: (400) Bad Request. In my WCF configuration I have set maxReceivedMessageSize, maxBufferSize and maxBufferPoolSize to 2147483647, but to no avail. Here are the relevant sections from my service's app.config: <service name="UploadService"> <endpoint address="" binding="webHttpBinding" bindingName="StreamedRequestWebBinding" contract="UploadService" behaviorConfiguration="webBehavior"> <identity> <dns value="localhost" /> </identity> </endpoint> <host> <baseAddresses> <add baseAddress="http://localhost:8732/UploadService/" /> </baseAddresses> </host> </service> <bindings> <webHttpBinding> <binding name="StreamedRequestWebBinding" bypassProxyOnLocal="true" useDefaultWebProxy="false" hostNameComparisonMode="WeakWildcard" sendTimeout="00:05:00" openTimeout="00:05:00" receiveTimeout="00:05:00" maxReceivedMessageSize="2147483647" maxBufferSize="2147483647" maxBufferPoolSize="2147483647" transferMode="StreamedRequest"> <readerQuotas maxArrayLength="2147483647" maxStringContentLength="2147483647" /> </binding> </webHttpBinding> </bindings> <behaviors> <endpointBehaviors> <behavior name="webBehavior"> <webHttp /> </behavior> <endpointBehaviors> </behaviors> How do I make my service accept more than 64 kB of streamed post data?

    Read the article

  • Is using the windows script host, especially the FileSystemObject hereof a good idea?

    - by Dabblernl
    Recently I have been asked to do some maintenance on a VB6 application. This involves some file IO. I find the IO operations offered by referencing the windows script host and using the FileSystemObject a lot friendlier than the IO operations that come with VB6. But will this cause problems because of security issues, or because of the fact that the script host will be disabled on some users' computers?

    Read the article

  • What is the basic design idea behind the Scala for-loop implicit box/unboxing of numerical types?

    - by IODEV
    I'm trying to understand the behavior of Scala for-loop implicit box/unboxing of "numerical" types. Why does the two first fail but not the rest? 1) Fails: scala for (i:Long <- 0 to 10000000L) {} <console>:19: error: type mismatch;<br> found : Long(10000000L) required: Int for (i:Long <- 0 to 10000000L) {} ^ 2 Fails: scala for (i <- 0 to 10000000L) {} <console>:19: error: type mismatch; found : Long(10000000L) required: Int for (i <- 0 to 10000000L) {} ^ 3) Works: scala for (i:Long <- 0L to 10000000L) {} 4) Works: scala for (i <- 0L to 10000000L) {}

    Read the article

  • Do you think it's a good idea to create a login box as a user control?

    - by Sergio Tapia
    Hi there guys! I'm starting out learning some ASP.Net programming and I'm going to be making a little community website for my friends and myself. I'm trying to pick up some good habits along the way. I was thinking of having a usercontrol and have that 'loginBox' shows the appropriate textboxes and login button, but also show his username when he is logged in. Do you think I should handle this as a user control or am I missing something as an ASP.Net newbie?

    Read the article

  • Install 32-bit gstreamer plugins on 64-bit

    - by Rua
    I am trying to install the 32-bit gstreamer plugins on my 64-bit system (Ubuntu 12.10 based). I can install the packages gstreamer0.10-plugins-base:i386 and gstreamer0.10-plugins-good:i386. However, gstreamer0.10-plugins-bad:i386, gstreamer0.10-plugins-bad-multiverse:i386 and gstreamer0.10-plugins-ugly:i386 conflict with 64-bit packages already installed on my system: $ sudo apt-get install gstreamer0.10-plugins-bad:i386 Reading package lists... Done Building dependency tree Reading state information... Done Some packages could not be installed. This may mean that you have requested an impossible situation or if you are using the unstable distribution that some required packages have not yet been created or been moved out of Incoming. The following information may help to resolve the situation: The following packages have unmet dependencies: gstreamer0.10-plugins-bad:i386 : Depends: libass4:i386 (>= 0.9.7) but it is not going to be installed Depends: libdca0:i386 but it is not going to be installed Depends: libdvdnav4:i386 (>= 4.2.0+20120524) but it is not going to be installed Depends: libdvdread4:i386 but it is not going to be installed Depends: libslv2-9:i386 (>= 0.6.4-1~) but it is not going to be installed E: Unable to correct problems, you have held broken packages. ... $ sudo apt-get install gstreamer0.10-plugins-bad-multiverse:i386 Reading package lists... Done Building dependency tree Reading state information... Done The following extra packages will be installed: libavcodec53:i386 libavutil51:i386 libfaac0:i386 libfaad2:i386 libgsm1:i386 libmjpegtools-1.9:i386 libmp3lame0:i386 libquicktime2:i386 libschroedinger-1.0-0:i386 libswscale2:i386 libva1:i386 libvpx1:i386 libx264-123:i386 libxvidcore4:i386 The following packages will be REMOVED: gstreamer0.10-plugins-bad-multiverse libfaac0 libmjpegtools-1.9 mint-meta-codecs The following NEW packages will be installed: gstreamer0.10-plugins-bad-multiverse:i386 libavcodec53:i386 libavutil51:i386 libfaac0:i386 libfaad2:i386 libgsm1:i386 libmjpegtools-1.9:i386 libmp3lame0:i386 libquicktime2:i386 libschroedinger-1.0-0:i386 libswscale2:i386 libva1:i386 libvpx1:i386 libx264-123:i386 libxvidcore4:i386 0 upgraded, 15 newly installed, 4 to remove and 5 not upgraded. Need to get 9,198 kB of archives. After this operation, 23.3 MB of additional disk space will be used. Do you want to continue [Y/n]? ... $ sudo apt-get install gstreamer0.10-plugins-ugly:i386 Reading package lists... Done Building dependency tree Reading state information... Done Some packages could not be installed. This may mean that you have requested an impossible situation or if you are using the unstable distribution that some required packages have not yet been created or been moved out of Incoming. The following information may help to resolve the situation: The following packages have unmet dependencies: gstreamer0.10-plugins-ugly:i386 : Depends: libdvdread4:i386 but it is not going to be installed E: Unable to correct problems, you have held broken packages. This means that I can't play mp3s (among other things) in 32-bit applications that use gstreamer. Is there a way around this?

    Read the article

  • Is it a good idea to "migrate business logic code into our domain model"?

    - by Bytecode Ninja
    I am reading Hibernate in Action and the author suggests to move business logic into our domain models (p. 306). For instance, in the example presented by the book, we have three entities named Item, Bid, and User and the author suggests to add a placeBid(User bidder, BigDecimal amount) method to the Item class. Considering that usually we have a distinct layer for business logic (e.g. Manager or Service classes in Spring) that among other things control transactions, etc. is this really a good advice? Isn't it better not to add business logic methods to our entities? Thanks in advance.

    Read the article

  • If terminating a hung thread is a good idea, how do I do it safely?

    - by Steve
    My Delphi program relies heavily on Outlook automation. Outlook versions prior to 2007-SP2 tend to get stuck in memory due to badly written addins and badly written Outlook code. If Outlook is stuck, calling CreateOleObject('Outlook.Application') or GetActiveObject ... doesn't return and keeps my application hanging till Outlook.exe is closed in the task manager. I've thought of a solution, but I'm unsure whether it's good practice or not. I'd start Outlook with CreateOleObject in a separate thread, wait 10 seconds in my main thread and if Outlook hangs (CreateOleObject doesn't return), offer the user to kill the Outlook.exe process from my program. But since I don't want to force the user to kill the Outlook.exe process, as an alternative I also need a way to kill the new thread in my program which keeps hanging now. Is this good practice? How can I terminate a hanging thread in Delphi without leaking memory?

    Read the article

  • Writing my own iostream utility class: Is this a good idea?

    - by Alex
    I have an application that wants to read word by word, delimited by whitespace, from a file. I am using code along these lines: std::istream in; string word; while (in.good()) { in>>word; // Processing, etc. ... } My issue is that the processing on the words themselves is actually rather light. The major time consumer is a set of mySQL queries I run. What I was thinking is writing a buffered class that reads something like a kilobyte from the file, initializes a stringstream as a buffer, and performs extraction from that transparently to avoid a great many IO operations. Thoughts and advice?

    Read the article

  • mixing OpenGL and Interface Builder/ UI Controls - bad idea? Why? (iPhone)

    - by Adam
    I've heard that OpenGL ES and standard iPhone UI controls don't play well together, but I'm wondering if anyone knows why, and what the effects are? I'm writing an OpenGL based game, and the view is loaded from a nib file with ui controls, and it seems to work ok, but the game is really simple at this point... does using ui controls cause some kind of performance hit?

    Read the article

  • Java Script in Rails 3.1 works only in certain parts. Any idea why?

    - by Sergio Nekora
    This might seem a bit weird, but since I am new in RoR and cannot find any similar questions I thought you might know. The situation is that JavaScript does not work throughout my whole site. For instance. For the sake of checking, I place a link with an alert function in the footer. It did not work at the beginning, it felt like the JS was disabled(but it wasn't). But eventually it worked. Now it works in most the pages but it does not work in one that there is also an 'autocomplete' field. Of course, this autocomplete field does not work either. That could lead you to think that there is something wrong with the autocomplete code. However this same code is working in the sidebar. Any ideas why? Could it have anything to do with the fact that one day my assets folder appeared empty? After installing the gmaps4rails gem I realized that all my Js and CSS files were gone from my assests folder. Ok, it might have happened long before and I just realized at that point. I don't really know. Here in the root you can see that the 'Hola sip' click at the button works. here it works However, here same link does not trigger the alert function. here it doesn't

    Read the article

  • What if I change my Android App price to free and after i change idea?

    - by Skatephone
    Hi, i have read on the market support that "If you have previously published an application for free, you cannot change it to have a price." But I was wondering, if at the contrary I change my app from payed to free and some time after i want to re change it from free to payed! Can I? And if yes, Have I to wait some period (I have read something like this in the contract)? Tnk's Valerio From Italy

    Read the article

  • Is it a good idea to return " const char * " from a function?

    - by AJ
    Now I have a function that has to return a string. I saw a particular implementation where he returns a const char * from the function. Something like this: const char * GetSomeString() { ........ return somestlstring.c_str(); } SomeOtherFoo () { const char * tmp = GetSomeString(); string s = tmp; } Now I felt there is something potentially wrong with this. Is my gut feel right? or Is this a perfectly safe code? Kindly give me ur suggestions. I have a feeling return const char * this way might result in havoc.. Thanks, Arjun

    Read the article

  • Is it a good idea to work on header files only, just at the start of the project?

    - by m4design
    To explain my point further, I'm a beginner in programming, and I'm working on a small project. Instead of separating the .cpp file from the header file, I'm implementing the code in the header files, and making one .cpp file for testing. I do this to have less files, hence easier navigation. Then later I'll separate the code as it should be. Will this cause any problems? should I continue doing that? Thanks.

    Read the article

  • Is it a good idea to use .Net for commercial software?

    - by user146780
    I was playing around with .Net reflector today and realized that Miicrosoft's entire Expression suite is written in .Net. As a result I was pretty much able to see the underlying code for expression. This makes it far easier than binary to break copy protection. I think that that's a big deal. Is it generally recommended to make commercial software in .Net where it is fairly easy to see the source code down to the variable names? I was surprised that Microsoft didn't at least dotfescate it. Thanks

    Read the article

  • How is a h264 idea bitstream organized? / header start codes

    - by Wolax
    I was trying to learn a bit about h264 by looking at the bitstream of a video file with a hex editor. I found here the start codes for a video object planes (0x000001b6) and for i-frames (0x000001b600). But I can't find many of those bytes in video files. Most of the time those start codes appear at the beginning of a file with only a few bites in between. I expected them to show up very regularly, in equal distance all over the file!? Is is even ok to look at a file with a hex editor this way? What other start codes exist and how is a h264 file organised?

    Read the article

< Previous Page | 54 55 56 57 58 59 60 61 62 63 64 65  | Next Page >