Search Results

Search found 2715 results on 109 pages for 'lazy initialization'.

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

  • Editing Multiple files in vi with Wildcards

    - by Alan Storm
    When using the programmers text editor vi, I'll often using a wildcard search to be lazy about the file I want to edit vi ThisIsAReallLongFi*.txt When this matches a single file it works great. However, if it matches multiple files vi does something weird. First, it opens the first file for editing Second, when I :wq out of the file, I get a message the bottom of the terminal that looks like this E173: 4 more files to edit Hit ENTER or type command to continue When I hit enter, it returns me to edit mode in the file I was just in. The behavior I'd expect here would be that vi would move on to the next file to edit. So, What's the logic behind vi's behavior here Is there a way to move on and edit the next file that's been matched? And yes, I know about tab completion, this question is based on curiosity and wanting to understand the shell better.

    Read the article

  • Question about gets and sets and when to use super classes

    - by Nazgulled
    Hi, I have the following get method: public List<PersonalMessage> getMessagesList() { List<PersonalMessage> newList = new ArrayList<PersonalMessage>(); for(PersonalMessage pMessage : this.listMessages) { newList.add(pMessage.clone()); } return newList; } And you can see that if I need to change the implementation from ArrayList to something else, I can easily do it and I just have to change the initialization of newList and all other code that depends on what getMessageList() returns will still work. Then I have this set method: public void setMessagesList(ArrayList<PersonalMessage> listMessages) { this.listMessages = listMessages; } My question is, should I use List instead of `ArrayList in the method signature? I have decided to use ArrayList because this way I can force the implementation I want, otherwise there could be a mess with different types of lists here and there. But I'm not sure if this is the way to go...

    Read the article

  • Java singleton VO class implementing serializable, having default values using getter methods

    - by user309281
    Hi All I have a J2SE application having user threads running in a separate JVM outside JBOSS server. During startup, J2SE invokes a EJB inside jboss, by passing a new object(singleton) of simple JAVA VO class having getter/setter methods. {The VO class is a singleton and implements serialiable(as mandated by EJB)}. EJB receives the object, reads all db configuration and uses the setter methods of new object to set all the values. It then returns back this updated object back to J2SE in the same remote call. After J2SE receives the object(singleton/serializable), if i invoke getter methods, I could see only default values set during object creation before EJB call, and not the values set by the EJB. Kindly throw some light on, why the received object from EJB does not see any updated values and how to rectify this. I believe it got to do with object initialization during deserialization. And i tried overriding readResolve() in the VO class, but of no help. With Regards, Krishna

    Read the article

  • DebuggerDisplay attribute does not work as expected!

    - by mark
    Dear ladies and sirs. I know that this attribute should work in C# and yet, in my case it does not. I have a class with a lazy property Children. Accessing this property may have a side effect of roundtripping to the server. So, naturally, I do not want this to happen when I just watch it in the debugger watch window. Omitting all the irrelevant details the source looks pretty ordinary: [DebuggerDisplay("(Frozen) {m_children}")] public IList<IEntityBase> Children { get { if (m_children == null) { m_children = FetchChildrenFromDB(this); } return m_children; } } And yet, when I watch the object and expand this in the watch window I do not see (Frozen) in the display, meaning the debugger simply ignores the attribute. Provided the image link is still valid it should be visible below: http://i28.tinypic.com/2zxo9s5.jpg The attribute is really there, according to Reflector. I use VS2008. Any ideas?

    Read the article

  • Authorization in a more purely OOP style...

    - by noblethrasher
    I've never seen this done but I had an idea of doing authorization in a more purely OO way. For each method that requires authorization we associate a delegate. During initialization of the class we wire up the delegates so that they point to the appropriate method (based on the user's rights). For example: class User { private deleteMemberDelegate deleteMember; public StatusMessage DeleteMember(Member member) { if(deleteMember != null) { deleteMember(member); } } //other methods defined similarly... User(string name, string password) //cstor. { //wire up delegates based on user's rights. //Thus we handle authentication and authorization in the same method. } } This way the client code never has to explictly check whether or not a user is in a role, it just calls the method. Of course each method should return a status message so that we know if and why it failed. Thoughts?

    Read the article

  • Paging in ActiveRecord

    - by Alex
    Does CastleProject ActiveRecord support paging? I need to load only data which is now seen on the screen. If I use [HasMany], it will be loaded as a whole either immediately or at the first call (if lazy attribute is true). However I only need something like first 100 records (then maybe 100 next records). Another question is how to load only 100 items. If the collection is too big, memory can reach its limit if we constantly load more and more items.

    Read the article

  • jQuery TriggerHandler doesn't trigger keyup event set via live

    - by Beck
    Why i can't trigget handler via triggerHandler if it's was bound via live? For example form.find('#code').live('change keyup',function(){ process_code($(this)); }); Startups after window load: /* Triggers */ if(checkCookie('banner_ready_code')) { $('#form').find('#code').triggerHandler('keyup'); } Nothing happens... If i'm binding simply by .change or .keyup, triggerHandler is working properly as intended. If it's bug, where to report it. Too lazy :) If not, please explain. :)

    Read the article

  • What is a good Very-High level UI framework for JavaScript?

    - by Robert Gould
    I need to write a temporary Web-based graphical front-end for a custom server system. In this case performance and scalability aren't issues, since at most 10 people may check the system simultaneously. Also it should be PHP or Python (server) & JavaScript (client) (can't use Flex or Silverlight for very specific non-programming related issues). So I know I could use YUI or jQuery, but was wondering if there is something even more high-level that would say allow me to write such a little project within a few hours of work, and get done with it. Basically I want to be as lazy as possible (this is throw-away code anyways) and get the job done in as little time as possible. Any suggestions?

    Read the article

  • Is it possible to exclude some files from checkin (TFS) ?

    - by Thomas Wanner
    We use configuration files within various projects under source control (TFS), where each developer has to make some adjustments in his local copy to configure his environment. The build process takes care about replacing the config files with the server configuration as a part of the deployment, so it doesn't actually matter what is in the repository. However, we would anyway like to keep some kind of a default non-breaking version of config files in the repository, so that e.g. people not involved in the particular project won't run into troubles because of local misconfiguration. We tried to resolve this by introducing the check-in policy that simply forbids to check-in the config files. This works fine, but just because we're lazy to always uncheck those checkboxes in the pending changes window, the question comes : is it possible to transparently disable the check-in of particular files without keeping them out of source control (e.g. locking their current version) ?

    Read the article

  • Need help configuring SQL Server CE connections string in Fluent NHibernate

    - by Yoav
    Hi, I'm trying to return a session factory using this code: return Fluently.Configure() .Database(MsSqlCeConfiguration.Standard.ShowSql().ConnectionString(path)) .Mappings(m => m.FluentMappings.AddFromAssemblyOf<Project>()) .BuildSessionFactory(); Path is the full path to an .sdf file. And get this exception: System.ArgumentException: Format of the initialization string does not conform to specification starting at index 0. at System.Data.SqlServerCe.ConStringUtil.GetKeyValuePair(Char[] connectionString, Int32 currentPosition, String& key, Char[] valuebuf, Int32& vallength, Boolean& isempty) What am I doing wrong?

    Read the article

  • Same table NHibernate mapping

    - by mircea .
    How can i go about defining a same table relation mapping (mappingbycode) using Nhibernate for instance let's say I have a class: public class Structure{ public int structureId; public string structureName; public Structure rootStructure; } that references the same class as rootStructure. mapper.Class<Structure>(m => { m.Lazy(true); m.Id(u => u.structureId, map => { map.Generator(Generators.Identity); }); m.Property(c => c.structureName); m.? // Same table mapping } ; Thanks

    Read the article

  • How different protocols interact with eachother in Twisted

    - by stsupermouse
    The scenario I want two different protocols interact with each other is as below: A and B is two different protocols. First A will interact with the server and retrieve some values. Only after A finishes retrieving the values , B will start to interact with the server. Now my problem is that is there an elegant way to initial B when A retrieves the values. Currently I just initial B in A's data process function. But i don't think that this is an elegant way. What I mean an elegant way is that the initialization of B is done by a flow controller or something like that, but not another protocol. Is there an elegant way? such using defered or any other things. I'm just new to twisted, not knowing very much about defered.... Thank you very much!

    Read the article

  • Returning a C++ reference in a const member functionasses

    - by Chris Kaminski
    A have a class hierarchy that looks somethign like this: class AbstractDataType { public: virtual int getInfo() = 0; }; class DataType: public AbstractDataType { public: virtual int getInfo() { }; } class Accessor { DataType data; public: const AbstractDataType& getData() const { return(data); } } Well, GCC 4.4 reports: In member function ‘const AbstractDataType& Accessor::getData() const’: error: invalid initialization of reference of type ‘const AbstractDataType&’ from expression of type ‘const DataType’ Where am I going wrong - is this a case where I MUST use a pointer?

    Read the article

  • Why does Java not have any destructor like C++?

    - by Abhishek Jain
    Java has its own garbage collection implementation so it does not require any destructor like C++ . This makes Java developer lazy in implementing memory management. And Garbage Collection is very expensive. Still we can have destructor along with garbage collector where developer can free resources and which can save garbage collector's work. This might improves the performance of application. Why does Java not provide any destructor kind of mechanism? Developer does not have control over GC but he/she can control or create object. Then why not give them ability to destruct the objects?

    Read the article

  • Using static mutex in a class

    - by Dmitry Yudakov
    I have a class that I can have many instances of. Inside it creates and initializes some members from a 3rd party library (that use some global variables) and is not thread-safe. I thought about using static boost::mutex, that would be locked in my class constructor and destructor. Thus creating and destroying instances among my threads would be safe for the 3rd party members. class MyClass { static boost::mutex mx; // 3rd party library members public: MyClass(); ~MyClass(); }; MyClass::MyClass() { boost::mutex::scoped_lock scoped_lock(mx); // create and init 3rd party library stuff } MyClass::~MyClass() { boost::mutex::scoped_lock scoped_lock(mx); // destroy 3rd party library stuff } I cannot link because I receive error: undefined reference to `MyClass::mx` Do I need some special initialization of such static member? Is the whole conception of static mutex wrong?

    Read the article

  • ASP.NET MVC: run code after view has rendered (close db transaction)

    - by thermal7
    Hi, I am using ASP.NET MVC2 with NHibernate, but am facing an issue. All calls to the database via NHibernate should be inside a transaction, however code inside the view kicks off database calls in some instances. Thus there is a need to be able to commit the transaction after the view has rendered. For example displaying a list of users and their user roles you might show the user role using this code: <%: Model.UserRole.Name % This will cause a hit on the database as the UserRole is loaded using a NHibernate proxy. You can fetch the UserRole eagerly which circumvents the issue in this case, but there are cases where it is much faster to use lazy loading. Anyway, is there a way to run code after a view has rendered?

    Read the article

  • JTextArea thread safe?

    - by Dhaivat Pandya
    Hello everyone, I have some code that does some initialization (including making a JTextArea object), starts three seperate threads, and then these threads try to update the JTextArea (i.e. append() to it), but its not working at all. Nothing shows up on the JTextArea (however, during the initialzation, I print some test lines onto it, and that works fine). What's going on? How can I fix this? Also, each of those threads sleeps a random amount of time every time it has to update the JTextArea. Sorry I haven't provided any code, its all spread out over several files.

    Read the article

  • SaaS practical basics and projects

    - by Medardas
    So i need some directions. I want to understand Cloud Software as a Service(SaaS) practical initialization. The thing is I want to create a simple cloud service which would let me run programs on this cloud from remote machine. As I understand, I need some kind of specific backbone project to start this system, similar like OpenStack or Apache Cloud for Infostructure as a Service. Of course it may be that I understand it completely wrong and even if there is such project, it is not open source, free. I could also comprehend SaaS building on IaaS, but the thing is, I can't find any practical information at all. Could Somebody indulge me if there is any kind of free licence SaaS project or recommend a related articles or explain everything in a nut case with atleast vague direction.

    Read the article

  • Help me find some good 'Reflection' reading materials??

    - by IbrarMumtaz
    If it wasn't you guys I would've never discovered Albahari.com's free threading ebook. My apologies if I come off as being extremely lazy but I need to make efficient use of my time and make sure am not just swallowing any garbage of the web. Therefore I am looking for the best and most informative and with a fair bit of detail for the Reflection chapter in .Net. Reflection is something that comes up time and time again and I want to extend my reading from what I know already from the official 70-536 book. I'm not a big fan of MSDN but at the moment that's al I'm using. Anyone got any other good published reading material off the inter web that can help revision for the entrance exam??? Would be greatly appreciated !!! Thanks in Advance, Ibrar

    Read the article

  • why does an event handler never gets called if its added within a loop on an ienumerable

    - by André Carvalho
    For instance: IEnumerable<MyType> list = someCollection.Select(i => new MyType(i)); foreach (var item in list) item.PropertyChanged += item_PropertyChanged; <-- this never gets called Bu if list is assigned like list = someCollection.Select(i => new MyType(i)).ToArray(); the event handler does get called.. Why? (i imagine it has something to do with the fact that a linq query is lazy, but the fact of looping through the result isn't enough??)

    Read the article

  • Why is my UIViewController initializer never called?

    - by mystify
    I made a view-based project from a fresh template. There's a UIViewController which is created with an XIB. In the implementation I uncommented that and added an NSLog. But this is never called: // The designated initializer. Override to perform setup that is required before the view is loaded. - (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil { if ((self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil])) { // Custom initialization NSLog(@"nib"); } return self; } since that is initialized from a nib / xib, that should be called for sure, right? however, it doesn't. I do get an NSLog message when I put that in viewDidLoad.

    Read the article

  • Premature optimization is the root of all evil, but can it ever be too late?

    - by polygenelubricants
    "We should forget about small efficiencies, say about 97% of the time: premature optimization is the root of all evil" So what is that 3% like? Can the avoidance of premature optimization ever be taken too extreme that it does more harm than good? Even if it's rare, has there been a case of a real measurable software engineering disaster due to complete negligence to optimize early in the process? Bonus question: is software engineering pretty much the only field that has such a counter intuitive principle regarding doing something earlier rather than later before things potentially become too big a problem to fix? Personal question: how do you justify something as premature optimization and not just a case of you being lazy/ignorant/dumb?

    Read the article

  • WPF -- Where do you draw the line between code and XAML?

    - by John Franks
    I'm a long-time C#/.NET programmer but totally new to WPF and the System.Windows.Controls namespace and XAML. The more I learn about it the more I realize that you can do pretty much all of your GUI initialization and event handling glue in either XAML or in code (say C# code or VB.Net code). My question is to those who have been working on WPF for longer and ideally those who have shipped apps with it -- where did you find was the best place to 'draw the line' between XAML and code? Did you use XAML wherever you could? Only where interfacing with non-coding UI designers? Any tips in this area would be extremely helpful to myself and other coders who are just getting into WPF programming and are kind of paralyzed by all the choices we can make!

    Read the article

  • Is this ISession handled by the SessionScope - Castle ActiveRecord

    - by oillio
    Can I do this? I have the following in my code: public class ARClass : ActiveRecordBase<ARClass> { ---SNIP--- public void DoStuff() { using (new SessionScope()) { holder.CreateSession(typeof(ARClass)).Lock(this, LockMode.None); ...Do some work... } } } So, as I'm sure you can guess, I am doing this so that I can access lazy loaded references in the object. It works great, however I am worried about creating an ISession like this and just dropping it. Does it get properly registered with the SessionScope and will the scope properly tare my ISession down when it is disposed of? Or do I need to do more to manage it myself?

    Read the article

  • Data Structure for a particular problem??

    - by AGeek
    Hi, Which data structure can perform insertion, deletion and searching operation in O(1) time in the worst case. We may assume the set of elements are integers drawn from a finite set 1,2,...,n, and initialization can take O(n) time. I can only think of implementing a hash table. Implementing it with Trees will not give O(1) time complexity for any of the operation. Or is it possible?? Kindly share your views on this, or any other data structure apart from these.. Thanks..

    Read the article

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