Search Results

Search found 2568 results on 103 pages for 'advantage'.

Page 64/103 | < Previous Page | 60 61 62 63 64 65 66 67 68 69 70 71  | Next Page >

  • Method overloading in groovy

    - by slojo
    I am trying to take advantage of the convenience of groovy's scripting syntax to assign properties, but having trouble with a specific case. I must be missing something simple here. I define class A, B, C as so: class A { A() { println "Constructed class A!" } } class B { B() { println "Constructed class B!" } } class C { private member C() { println "Constructed class C!" } def setMember(A a) { println "Called setMember(A)!" member = a } def setMember(B b) { println "Called setMember(B)!" member = b } } And then try the following calls in a script: c = new C() c.setMember(new A()) // works c.member = new A() // works c.setMember(new B()) // works c.member = new B() // doesn't work! The last assignment results in an error: 'Cannot cast object of class B to class A". Why doesn't it call the proper setMember method for class B like it does for class A?

    Read the article

  • Worth it to use jQuery UI hosted by Google?

    - by chobo2
    Hi So I heard good reasons why to use the jquery hosted on google because of caching. But I am not sure about jQuery UI though. I am guessing that the jQuery UI file hosted on google has every single extension and plugin (such as Draggable, etc). So is that not kind of a waste if say your only using only jQuery UI tabs? to get all that other stuff with it. Also I see they have some of the templates up for the css files. I am guessing the caching would be the main advantage of using the hosted file.

    Read the article

  • How to set ItemsSource?

    - by Mark
    This dialog makes no sense to me And I'm having trouble finding good tutorials on it. Most of the examples aren't detailed enough, or do stuff via code, but I'd like to take advantage of the IDE as much as possible. Whats the difference between ItemsSource and DataContext? I'd like to bind it to just a List for starters. I don't need SQL or databases or anything fancy. Where would I declare my list? In MainWindow.xaml.cs? How do I get it to appear in that dialog?

    Read the article

  • Making linq avoid using in memory filtering where possible

    - by linqmonkey
    Consider the these two LINQ2SQL data retrieval methods. The first creates a 'proper' SQL statement that filters the data, but requires passing the data context into the method. The second has a nicer syntax but loads the entire list of that accounts projects, then does in memory filtering. Is there any way to preserve the syntax of the second method but with the performance advantage of the first? public partial class Account { public IQueryable<Project> GetProjectsByYear(LinqDataContext context, int year) { return context.Projects.Where(p => p.AccountID==this.AccountID && p.Year==year).OrderBy(p => p.ProjectNo) } public IQueryable<Project> GetProjectsByYear(int year) { return this.Projects.Where(p => p.Year==year).OrderBy(p => p.ProjectNo).AsQueryable() } }

    Read the article

  • Is there a way to transfer windows license to a different machine?

    - by Alex Khvatov
    I purchased a license and used Windows 7 Home Premium 32 bit OS for a while. But recently I bought a 64 bit version to take advantage of the larger RAM the machine had and hence reinstalled the OS and activated a new license for the 64-bit version. Now, I am in a need to install the 32 bit version on another machine. How do I go about reactivating a license on another machine? (again the license currently is not used) Am I going to have issues with Microsoft not letting me reactivate that license on a different machine? Thank you.

    Read the article

  • Would dropping X altogether hurt ?

    - by Xavier Maillard
    Hi, I live in the linux terminal all the time under my slackware GNU/linux system (an EeePC). By default, GNU Emacs won't start if It can't find several Xorg libraries. Assuming I will never use X software at all, would it make sense for me to drop all this Xorg stuff and compile emacs again ? Are you aware of anything that could get me into troubles or making GNU Emacs not working at all ? Are there any advantage for me to keep all these dependencies ? I am asking since as said, my main box is an eeepc with little storage and I am dangerously hitting the limits ;-) Regards

    Read the article

  • Can I run Visual Studio 2008 x86 on Windows Vista x64?

    - by TheCodeJunkie
    Hi, Is it possible to run the 32-bit version of Visual Studio 2008 Professional on a Windows Vista 64-bit system? Are there any known caveats that I would need to be aware of? Would have to install the x64 version of the .NET Framework? Would there be any issues on building software targeted for x86? Would there be any (justifiable) arguments for getting the x64 version of VS2008 instead of reusing the current x86 license? Quite tempted on getting a x64 Vista rig to be able to take advantage of more RAM :)

    Read the article

  • Is this a good approach to execute a list of operations on a data structure in Python?

    - by Sridhar Iyer
    I have a dictionary of data, the key is the file name and the value is another dictionary of its attribute values. Now I'd like to pass this data structure to various functions, each of which runs some test on the attribute and returns True/False. One approach would be to call each function one by one explicitly from the main code. However I can do something like this: #MYmodule.py class Mymodule: def MYfunc1(self): ... def MYfunc2(self): ... #main.py import Mymodule ... #fill the data structure ... #Now call all the functions in Mymodule one by one for funcs in dir(Mymodule): if funcs[:2]=='MY': result=Mymodule.__dict__.get(funcs)(dataStructure) The advantage of this approach is that implementation of main class needn't change when I add more logic/tests to MYmodule. Is this a good way to solve the problem at hand? Are there better alternatives to this solution?

    Read the article

  • Passing Func<T> to controller constructure when using Unity IoC with MVC, advantages?

    - by user1361315
    I was looking at a sample of how to setup Unity IoC with MVC, and noticed someone who recommended the approach of having the parameters of Func. I believe the advantage is this is kind of like lazy loading the service, if it never gets called it will never get executed and not consume any resources. private readonly Func<IUserService> _userService; public CourseController(Func<IUserService> userService) { this._userService = userService; } Versus a parameter without a Func: private readonly IUserService _userService; public CourseController(IUserService userService) { this._userService = userService; } Can someone explain to me the differences, is it really more effecient?

    Read the article

  • XML to XHTML - Best Method?

    - by Ian
    Not wishing to be subjective but I have a need to get data from an XML source and convert it to (X)HTML. From my understanding I can do this with PHP (or other server-side scripts), Javascript, or XSLT. My feeling is that it would be more appropriate to use XSLT as it is dealing with an XML source and this is the purpose for which XSLT exists. I also see it having the advantage that it will still work if the user doesn't have Javascript enabled and wont be restricted to a server which runs PHP (or other server-side script). Am I right in my assumptions? Also could the same be same for an RSS feed? Thanks

    Read the article

  • Embed form in another website - pitfalls

    - by Paddy
    Scenario: We provide a hosted site that clients pay to use internally (a tool to support their business workflow). We have a requirement to provide a form that the clients can 'embed' in their outward facing site. This form will permit a member of the public to enter some details to register an interest - this data will be pushed to our remote system. Question: I'm currently planning on creating a simple HTML page that the client's web guys can include in a simple fashion on their site (either using an iframe or an object tag). If I do this, am I going to run into difficulties when the user tries to submit the embedded form (as it will be going to different domain to the one they are currently browsing)? I had a look at google adsense and I see that they just provide a link to a JS file that renders their ads - I'm not sure I see the advantage in this, but if anybody has any bright ideas... Whatever technique that gets used, I'll have to authenticate the request as coming from my client's site(s).

    Read the article

  • using "Reference3 Interface" to add desired references to a project

    - by BDotA
    I found this: http://msdn.microsoft.com/en-us/library/vslangproj80.reference3%28VS.80%29.aspx what I have in mind is that many of the references that we add to our project are on a network drive and there are TON of them. Adding references to the project by right clicking on the References in the porject and choosing add reference is a pain. so I was wondering if I can take advantage of something like what I posted the link to it and have a small program,add-in,macro, etc! that we can give it a list of the references that I want and it will add them to the project.

    Read the article

  • Sharing Eclipse directory on Dropbox between Windows and Mac OS X

    - by sowbug
    This question was close to mine, but not quite. I have a Windows desktop and a MacBook Pro. I'd like to be able to keep my Eclipse workspace in my Dropbox folder. The problem is that many project settings change between platforms: references to JREs, JDKs, and other libs. Every discussion I've seen of this problem seems to suggest taking advantage of the source control system's ignore functionality, so that such-and-such file remains local-only and thus able to remain platform-specific. But when you're working with a real single shared folder, that class of solution doesn't apply. Have you had luck working with a Java Eclipse project living in a single folder shared over the network, cross-platform?

    Read the article

  • How do I clear MVC client side validation errors when a cancel button is clicked when a user has inv

    - by Sci-fi
    I have a partial view that is rendered within a main view. The partial view takes advantage of System.ComponentModel.DataAnnotations and Html.EnableClientValidation(). A link is clicked, and div containing the partial view is displayed within a JQuery.Dialog(). I then click the save button without entering any text in my validated input field. This causes the client side validation to fire as expected, and display the '*required' message beside the invalid field. When the cancel button is clicked, I want to reset the client side MVC validation back to it's default state and remove any messages, ready for when the user opens the dialog again. Is there a recommended way of doing this?

    Read the article

  • Why SQL functions are faster than UDF

    - by Zerotoinfinite
    Though it's a quite subjective question but I feel it necessary to share on this forum. I have personally experienced that when I create a UDF (even if that is not complex) and use it into my SQL it drastically decrease the performance. But when I use SQL inbuild function they happen to work pretty faster. Conversion , logical & string functions are clear example of that. So, my question is "Why SQL in build functions are faster than UDF"? and it would be an advantage if someone can guide me how can I judge/manipulate function cost either mathematically or logically.

    Read the article

  • Do fields need to be explicitly final to have a "proper" immutable object?

    - by Yishai
    You often read about immutable objects requiring final fields to be immutable in Java. Is this in fact the case, or is it simply enough to have no public mutability and not actually mutate the state? For example, if you have an immutable object built by the builder pattern, you could do it by having the builder assign the individual fields as it builds, or having the builder hold the fields itself and ultimately return the immutable object by passing the values to its (private) constructor. Having the fields final has the obvious advantage of preventing implementation errors (such as allowing code to retain a reference to the builder and "building" the object multiple times while in fact mutating an existing object), but having the Builder store its data inside the object as it is built would seem to be DRYer. So the question is: Assuming the Builder does not leak the Object early and stops itself from modifying the object once built (say by setting its reference to the object as null) is there actually anything gained (such as improved thread safety) in the "immutability" of the object if the object's fields were made final instead?

    Read the article

  • View OS X Desktop on windows remotely at higher resolution then hosting machine

    - by Elijha
    I have a new macbook air 11, which I do some web based programming on, I have a windows box with a 1920x1200 display which I'd like to use to view the mac desktop and keep working at home when I can - taking advantage of the higher resolution screen and full sized keyboard/mouse. I don't think VNC or such is the answer I'm looking for as it would restrict the display to the airs 1366x768 - negating the main benefit more lines of text on screen. From some rudimentary googleing I think I'm after some sort of x-windows / x-11 remote display. But I'm not a Linux user and any discussion seems to be about linux os x or windows Linux setups. Can anyone provide a clear set of instructions on how to do this or an application that can do this.

    Read the article

  • Which one is better to have auto-implemented property with private setter or private field and property just getter?

    - by PLB
    My question may be a part of an old topic - "properties vs fields". I have situation where variable is read-only for outside class but needs to modified inside a class. I can approach it in 2 ways: First: private Type m_Field; public Type MyProperty { get { return m_Field; } } Second: public Type MyProperty { get; private set; } After reading several articles (that mostly covered benefits of using public properties instead of public fields) I did not get idea if the second method has some advantage over the first one but writing less code. I am interested which one will be better practice to use in projects (and why) or it's just a personal choice. Maybe this question does not belong to SO so I apologize in advance.

    Read the article

  • Sinatra as backend (API) for Rails app or padrino or any hybrid solution?

    - by JVK
    Is it a good idea to build backend APIs in Sinatra for Rails app. Or is it better to use Padrino? I want to have my backend provides API as service, so that anytime, if I have to develop same app for any client, I can use that back-end API (web services). What is the best approach? My goal is to expose back-end as web services and even rails uses it for webapp. What are the disadvantages or advantage of different approaches?

    Read the article

  • Why is using a Non-Random IV with CBC Mode a vulnerability?

    - by The Rook
    I understand the purpose of an IV. Specifically in CBC mode this insures that the first block of of 2 messages encrypted with the same key will never be identical. But why is it a vulnerability if the IV's are sequential? According to CWE-329 NON-Random IV's allow for the possibility of a dictionary attack. I know that in practice protocols like WEP make no effort to hide the IV. If the attacker has the IV and a cipher text message then this opens the door for a dictionary attack against the key. I don't see how a random iv changes this. (I know the attacks against wep are more complex than this.) What security advantage does a randomized iv have? Is this still a problem with an "Ideal Block Cipher"? (A perfectly secure block cipher with no possible weaknesses.)

    Read the article

  • question about soapClent in php

    - by Alejandra
    Hi guys! I have a question, I´m developing a web page and I communicate with a server via SOAP. my code is in php. $client = new SoapClient(null, array("location" => "$serverpath", "uri" => "$namespace", "style" => SOAP_RPC, "use" => SOAP_ENCODED )); try { $returnedValue = $client->getInfo($user); } catch (SoapException $exception) { $returnedIDValue = "Caught Soap Exception: $exception\n"; } the problem is the following, when the SOAP services are down, I do not get any exception, the program only stops. any suggestion? I would like to handle gracefully that case. Thanks in advantage Alejandra

    Read the article

  • jQuery changing images with animation and waiting for it to trigger hyperlink

    - by user1476298
    I want to switch images on .click() using the url attr I can do so, but I can't figure out how to make it wait, until the animation is done to redirect to the new webpage. Here's the js $(function() { $('.cv').click(function(){ $("#cv img").fadeOut(2000, function() { $(this).load(function() { $(this).fadeIn(); }); $(this).attr("src", "images/cv2.png"); return true; }); }); }); Here's the html: <div id="cv" class="img one-third column"> <a class="cv" target="#" href="cv.joanlascano.com.ar"> <img src="images/cv1.png" alt="Curriculum"/> <br />CV</a> </div> Thank you in advantage!

    Read the article

  • How to build our own java custom layout

    - by nguyendat
    Please help me how to creat own custom layout, container, component, layout manager... Example: Containers and Layout Managers Create a window frame. Nest panels within a frame for better layout control. Create and display buttons in a panel. List two component attributes that are controlled by a layout manager. Set the layout manager for a container. Place components in a panel using BorderLayout, GridLayout, and FlowLayout. Name one advantage of each of the layout managers. Create panels with titles. i was search on google but can't find any that match my requirement Thanks for your help

    Read the article

  • Shall I optimize or let compiler to do that?

    - by Knowing me knowing you
    What is the preferred method of writing loops according to efficiency: Way a) /*here I'm hoping that compiler will optimize this code and won't be calling size every time it iterates through this loop*/ for (unsigned i = firstString.size(); i < anotherString.size(), ++i) { //do something } or maybe should I do it this way: Way b) unsigned first = firstString.size(); unsigned second = anotherString.size(); and now I can write: for (unsigned i = first; i < second, ++i) { //do something } the second way seems to me like worse option for two reasons: scope polluting and verbosity but it has the advantage of being sure that size() will be invoked once for each object. Looking forward to your answers.

    Read the article

  • Using Large Arrays in VB.NET

    - by Tim
    I want to extract large amounts of data from Excel, manipulate it and put it back. I have found the best way to do this is to extract the data from an Excel Range in to a large array, change the contents on the array and write it back to the Excel Range. I am now rewriting the application using VB.NET 2008/2010 and wish to take advantage of any new features. Currently I have to loop through the contents of the array to find elements with certain values; also sorting large arrays is cumbersome. I am looking to use the new features, including LINQ to manipulate the data in my array. Does anybody have any advice on the easiest ways to filter / query, sort etc. data in a large array. Also what are the reasonable limits to the size of the array? ~Many Thanks

    Read the article

< Previous Page | 60 61 62 63 64 65 66 67 68 69 70 71  | Next Page >