Search Results

Search found 4677 results on 188 pages for 'alternative'.

Page 124/188 | < Previous Page | 120 121 122 123 124 125 126 127 128 129 130 131  | Next Page >

  • Is there a way to force JUnit to fail on ANY unchecked exception, even if swallowed

    - by Uri
    I am using JUnit to write some higher level tests for legacy code that does not have unit tests. Much of this code "swallows" a variety of unchecked exceptions like NullPointerExceptions (e.g., by just printing stack trace and returning null). Therefore the unit test can pass even through there is a cascade of disasters at various points in the lower level code. Is there any way to have a test fail on the first unchecked exception even if they are swallowed? The only alternative I can think of is to write a custom JUnit wrapper that redirects System.err and then analyzes the output for exceptions.

    Read the article

  • How can I find all records for a model without doing a long list of "OR" conditions?

    - by gomezuk
    I'm having trouble composing a CakePHP find() which returns the records I'm looking for. My associations go like this: User -(has many)- Friends , User -(has many)- Posts I'm trying to display a list of all a user's friends recent posts, in other words, list every post that was created by a friend of the current user logged in. The only way I can think of doing this is by putting all the user's friends' user_ids in a big array, and then looping through each one, so that the find() call would look something like: $posts = $this->Post->find('all',array( 'conditions' => array( 'Post.user_id' => array( 'OR' => array( $user_id_array[0],$user_id_array[1],$user_id_array[2] # .. etc ) ) ) )); I get the impression this isn't the best way of doing things as if that user is popular that's a lot of OR conditions. Can anyone suggest a better alternative?

    Read the article

  • C/C++ detect network type

    - by Gavimoss
    I need to write a win32 c/c++ application which will be able to determine whether the PC it's running on is connected to one of 2 networks. The first network is the company LAN (which has no internet connection) and the second network is a standalone switch with a single PC connected to it (the PC that the program is running on). I'm pretty new to network programming but so far I have tried testing to see if a network drive which is held on our LAN can be mapped. This works fine if the PC is connected to the LAN, the drive mapping succeeds so so LAN detection is successful. However, if the PC is connected to the switch, this results in a VERY long timeout which is not a suitable as it will delay the program so much as to make it unusable. Does anyone have any alternative suggestions? I'm using c/c++ in VS 6.0

    Read the article

  • Why Camera.setParameters(Camera.Parameters) has no effect on Sony-Ericsson X10 and Droid?

    - by mobilekid
    Has anyone come across a strange behaviour with the Camera API when used on Sony-Ericsson X10 or Droid? For example the following code doesn't work on those devices. As a result I'm getting a lot of negative feedback on the Market translating into many cancelled orders... mParameters.set("rotation", orientation); mParameters.set("jpeg-quality", img_quality); mParameters.set("picture-size", "1024x768"); mCamera.setParameters(mParameters); Could you suggest an alternative way of achieving the same? Thanks.

    Read the article

  • Prevent log4net to send duplicate issues via SMTP

    - by jrEwing
    Hi, we have bridged our log4net with Jira using SMTP. Now we are worried that since the site is public what could happen to the Jira server if we get alot of issues in the production environment. We have already filtered on Critical and Fatal, but we want to see either some acumulator service on log4net or a plain filter which identifies repeating issues and prevents them from being sent via Email. Preferably without having to change the error reporting code, so a config solution would be best. I guess dumping the log into a db and then create a separate listener some smart code would be a (pricy) alternative.

    Read the article

  • ShowDialog and Hide form, when from is called from other object in VS2010

    - by Piotr Dabrowski
    Hallo, I have a modal Form, used for searching information in DB. This Form is used by a COM object, that waits for search result. Initialization of the form take a lot of time (because of building connection to DB). So, I initialize the Form (without showing it), and keep Form-object alive, as long as COM-object work. In this way I keep the state of the Form: public void Search() this.ShowDialog(); string result = this.ResultOfSearch; this.Hide() return result; And it doesn't work anymore on VS2010 (compiled for Framework 2.0). I search for alternative way to make a modal form (or a method to protect a form against Destroy() at the end of ShowDialog). Any ideas?

    Read the article

  • Advantages of GitHub over Bitbucket for Git Repositories [closed]

    - by rolve
    Now that Bitbucket also supports Git repositories, it seams to me that it is a good alternative to GitHub, especially since its free plan includes unlimited private repositories, which is not available on GitHub. Yet, GitHub seams much more popular. Are there any major reasons to choose GitHub as the hosting site for Git repositories instead of Bitbucket? (Although I have no problems with making my personal projects publicly available in general, I like the idea of being able to make the switch from public to private or vice versa any time I want. But if there are some good reasons to use GitHub, I would be willing to give up this freedom.)

    Read the article

  • Programmatically scroll to an Anchor Tag

    - by Anders
    Consider the following code: <a href="#label2">GoTo Label2</a> ... [content here] ... <a name="label0"></a>More content <a name="label1"></a>More content <a name="label2"></a>More content <a name="label3"></a>More content <a name="label4"></a>More content Is there a way to emulate clicking on the "GoTo Label2" link to scroll to the appropriate region on the page through code? EDIT: An acceptable alternative would be to scroll to an element with a unique-id, which already exists on my page. I would be adding the anchor tags if this is a viable solution.

    Read the article

  • Class decorator to declare static member (e.g., for log4net)?

    - by Ken
    I'm using log4net, and we have a lot of this in our code: public class Foo { private static readonly ILog log = LogManager.GetLogger(typeof(Foo)); .... } One downside is that it means we're pasting this 10-word section all over, and every now and then somebody forgets to change the class name. The log4net FAQ also mentions this alternative possibility, which is even more verbose: public class Foo { private static readonly ILog log = LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType); ... } Is it possible to write a decorator to define this? I'd really like to say simply: [LogMe] // or perhaps: [LogMe("log")] public class Foo { ... } I've done similar things in other languages, but never a statically-compiled language like C#. Can I define class members from a decorator?

    Read the article

  • Why Camera.setParameters(Camera.Parameters) does not work on Sony-Ericsson X10 and Droid?

    - by mobilekid
    Has anyone come across a strange behaviour with the Camera API when used on Sony-Ericsson X10 or Droid? For example the following code doesn't work on those devices. As a result I'm getting a lot of negative feedback on the Market translating into many cancelled orders... mParameters.set("rotation", orientation); mParameters.set("jpeg-quality", img_quality); mParameters.set("picture-size", "1024x768"); mCamera.setParameters(mParameters); Could you suggest an alternative way of achieving the same? Thanks.

    Read the article

  • Send a variable to a variable of a function?

    - by J. M
    Let's say I have a function and one of the parameters is for the name of the target variable.. Would it be possible for me to send a variable to the function like this: function otherfunction(input){ ... } function test {target) { var x = 1; target(x); } test(otherfunction); The problem I have is that I'm making a greasemonkey script and one of the variable I need can't be returned from the function due to a limitation.. So this would be the alternative. I just don't know how to get it to work.. Any help would be much appreciated!!

    Read the article

  • How to Create a Virtual Windows Drive

    - by HyLian
    Hello, I'm trying to create a Windows Virtual Drive ( like c:\ ) to map a remote storage. The main purpose is to do it in a clear way to the user. Therefore the user wouldn't know that he is writing/reading from another site. I was searching for available products, and i find that FUSE is not an option in Windows and WebDAV maps directly the drive, and i would like to build a middle layer between windows and remote storage to implement some kind of services. Another alternatives exists, such as Dokan, that is very expensive, and System.IO.IsolatedStorage Namespace, that doesn't seem to explicity create a new Windows Drive. Probably pismo ( http://www.pismotechnic.com/ ) is the thing that mostly matches my requirements but I would know if there is another alternative, including some Windows ( C++ or .NET ) native API to do that. Thanks for reading :)

    Read the article

  • Controlling Too Many listboxes ( C#)

    - by Ases
    I have almost 200 listboxes. I'm changing their visibility according to my variables from database. So I thought that, I prepared a arraylist. like this ListBox[] lbs = this.Controls.OfType<ListBox>().ToArray(); And used like this. for (int idx = 0; idx < Convert.ToInt32(ds.Tables[j].Rows[i][2])*12; idx++) lbs[idx].Visible = true; This codes are written to comboboxchange. Now everything is okay. But; example; first time I changed combobox 1-20 listboxes visible=true I changed combobox again not 1-20. 20,40 changing :S How can it be, can u tell me an alternative array list type, or another way?

    Read the article

  • Ajax image upload and javascript edit on the fly with ASP.NET MVC (without saving to disk)

    - by gavss
    1) Uploadimage action gets requests from form posts. <form action="/content/uploadimage" method="post" enctype="multipart/form-data"> It reads HttpPostedFileBase stream data and sends it to the response. I need to show the image in a div container instead of sending it to the response as a file so that users can manipulate the image using jcrop. Image source is generated at runtime. I can't pass an action name to the src attribute. Is this possible using MVC and without using control viewstate? 2) I don't want to use flash or silverlight. Is there an easy ajax alternative to the method I use to get files from user?

    Read the article

  • using python,How to cut the wav file between certain time ranges??

    - by kaushik
    How to cut the wav file between certain time ranges from multiple wav files and paste the segments together in a single wav file in continous time ?? For this i thou of a way,to store the contents of the wav file in array form and cut the segments required from the array copy thm in another file and convert it back into wav formant. but i hav no idea how to code it in python as i am a beginner in it.. plz help...any alternative methods which serve the purpose are also welcome.. Quick reply,xpected plzz.. Thanks in advance..

    Read the article

  • MoveWindow API doesn't work well on Vista

    - by Dex Ilic
    Hello! I have an application on Vista which loops through all processes and finds associated main windows in order to move and resize them. The problem is that some windows get moved and resized and some don't. Also it even seems that moved and resized windows aren't moved and resized according to the MoveWindow function call because they are resized to title bar and all of them are on the same line (same y coordinate). Here's the sample code: IntPtr handle; Process[] processList = Process.GetProcesses(); int i = 0; foreach (Process process in processList) { handle = process.MainWindowHandle; if (handle != IntPtr.Zero) //If the process has window then move and resize it. { bool moveResult = MoveWindow(handle, i * 50, i * 50, 500, 500, true); i++; } } Is this because of Vista? What alternative should I use?

    Read the article

  • IQueryable<> dynamic ordering/filtering with GetValue fails

    - by MyNameIsJob
    I'm attempting to filter results from a database using Entity Framework CTP5. Here is my current method. IQueryable<Form> Forms = DataContext.CreateFormContext().Forms; foreach(string header in Headers) { Forms = Forms.Where(f => f.GetType() .GetProperty(header) .GetValue(f, null) .ToString() .IndexOf(filter, StringComparison.InvariantCultureIgnoreCase) >= 0); } However, I found that GetValue doesn't work using Entity Framework. It does when the type if IEnumerable< but not IQueryable< Is there an alternative I can use to produce the same effect?

    Read the article

  • Android Loading & Playing Sound Based on String

    - by Chance
    I'm currently working on a simple Android app, and right now I am trying to get it to load in and play sounds. The problem I am faced with is that I want the sound it uses to be based on a string (With the same name as the sound file). The reason for this is simplicity in both the code and adding on to it. Now unfortunately I can't just slap a string in place of referencing the actual sound, but is there some way for me to compare a string to the entire raw folder to find the matching sound, or some other alternative short of defining every sound manually? Thank you for your time.

    Read the article

  • Tie destruction of an object (sealed) to destruction of an unmanaged buffer

    - by testtestSO
    I'll explain my situation first: I'm interested of using the Bitmap constructor that takes scan0, stride and format, because I'm decoding tiled images and I'd like to choose my own stride so I can decode the tiles without caring about the bounds in the decoder part. Anyway, the problem is that the documentation says: The caller is responsible for allocating and freeing the block of memory specified by the scan0 parameter. However, the memory should not be released until the related Bitmap is released. I can't release the buffer easily, because the Bitmap is then passed to another class that will eventually destroy it and I don't have control over it. Is there some way (hacky, I know) to tell the GC to also release my buffer when the Bitmap is destroyed? (Also, any alternative solution is welcome).

    Read the article

  • Offsite data storage for simple app, or a similar supported persistence mechanism?

    - by jdk
    Question Is there a usable facebook entry point to the Data Storage API that facebook lists on their app admin page for developers, or should I consider an alternate mechanism? What alternative mechanisms exist to simply persist my information offsite (away from my server app) without stuffing it into a cookie that's prone to expire? ... Background The facebook Data Store Admin tool is made available in a facebook App's Settings as seen here: (continue reading below) However when I visit the DataStoreAdmin link nothing works (i.e. clicking the buttons to define the data store types and objects does nothing - I have tried different browsers). The Wiki page for Data Store API hasn't been updated recently and the second last update says the beta Data Store was taken offline. It seems odd the link would be readily available and highly visible at the top of the App configuration area if indeed it's defunct. I was hoping some kind of key/value pair solution to remove the data calls from my own server.

    Read the article

  • Uniquely identifying mobile devices over a network for webforms

    - by Eric
    I'm designing a system for mobile devices that can be assigned only to one job at a time. So I need to be able to know which mobile device is being used by accessing it's own unique static IP address or its device ID. I don't want to assign an ID myself for every machine that comes in which is why a static IP would work great. However, in trying to retrieve the client ip address I'm retrieving the wireless router's ip or some other ip which is not the mobile device's ip. I want to store that ip in a table and control which jobs are assigned to it. How can I accomplish this? I've tried the following but I'm getting the wireless ip: var hostEntry = Dns.GetHostEntry(Dns.GetHostName()); var ip = ( from addr in hostEntry.AddressList where addr.AddressFamily.ToString() == "InterNetwork" select addr.ToString() ).FirstOrDefault(); I'd rather not set a cookie if there exists a better alternative. TIA!

    Read the article

  • Can I use the emacs keyboard macro counter as a command prefix?

    - by Sean M
    I'm working on a project in emacs where I'd like to use a keyboard macro that changes slightly with each iteration. When I saw the keyboard macro counter in the manual, that looked like exactly what I needed - but as far as I can tell, that inserts an incrementing number into the current buffer. I want to use an incrementing number as a prefix to another command. For example, instead of inserting 3 into the buffer on the third execution of the macro, I'd like to be able to execute C-u 3 M-x my-command, followed by C-u 4 M-x my-command on the next iteration. Is there way to create a keyboard macro that does this? My specific task is "zipping" two blocks of text in the same buffer together, but even if there's an alternative way to do that specific thing, it'd be good to know the answer to the general question.

    Read the article

  • Adding a conversion page trough Google Websiteoptimizer API

    - by hoppa
    Hey guys, I'm developing a module which allows users of my cms to create A/B tests from my cms instead of Google's interface. I manage to create tests and add the original page and the alternative page(s) just fine using the API documented here: http://code.google.com/apis/analytics/docs/gwo/ My issue is that i can't find documentation on how to add the conversion page. I tried Google forums but to no avail. Is there anyone here who can help me further? Thanks in advance! [edit] I don't know how badly I'm going against convention at this moment nut is there absolutely no one here who can give me a pointer in the right direction?

    Read the article

  • How do you work/interact with WAS 6.1/7.0 from Eclipse 3.x?

    - by Abel Morelos
    I already checked this other question: Where can I obtain an Eclipse server adapter for WebSphere Application Server Version 7? So I understand that there isn't a freely available version of the server adapter for WAS 6.1/7.0, so by now I have been doing a lot of stuff manually, but I'm wondering (after getting tired of this), what is doing other people using Eclipse + WAS6.1/7.0? Are you also doing stuff manually? Have you find an alternative to make things easier when working with Eclipse and you want to deploy or interact with WAS? (I know some of you will say: create your Ant scripts and run them from Eclipse... that's not what I want, I already have that). Currently I'm using Eclipse 3.5 (aka Galileo). Thanks.

    Read the article

  • Unable to locate using find element by link

    - by First Rock
    Newbie in testing. I generated a test case using Selenium, and then exported it as a Python script. Now, when I try to run that in terminal, I get following error: raise exception_class(message, screen, stacktrace) NoSuchElementException: Message: u'Unable to locate element: {"method":"link text","selector":"delete"}' I am using the command generated by Selenium i.e driver.find_element_by_link_text("delete").click() The reason for the error I believe is that the link "delete" in my web page is seen only when I click on a particular line to be deleted. So I guess it is being unable to locate the link. Please suggest what alternative measure could I use to locate and click on the "delete" link. Thanks in Advance:)

    Read the article

< Previous Page | 120 121 122 123 124 125 126 127 128 129 130 131  | Next Page >