Posts

c# - Why is this field declared as private and also readonly? -

निम्न कोड में: सार्वजनिक वर्ग MovieRepository: IMovieRepository {निजी केवल पढ़ने के लिए IHtmlDownloader _downloader; सार्वजनिक मूवी रिपोजिटरी (IHtml डाउनलोडर डाउनलोडर) {_downloader = downloader; } सार्वजनिक मूवी FindMovieById (स्ट्रिंग आईडी) {var आईडीयूआरआई = ... बिल्ड यूआरआई ...; Var html = _downloader.DownloadHtml (आईडीयूआरआई); वापसी ... पार्स आईडी HTML ...; } सार्वजनिक मूवी FindMovieByTitle (स्ट्रिंग शीर्षक) {var titleUri = ... build URI ...; Var html = _downloader.DownloadHtml (शीर्षकयूआरआई); वापसी ... शीर्षक शीर्षक एचटीएमएल ...; }} , और किसी ने इस दृष्टिकोण का सुझाव दिया मेरा प्रश्न यह है कि क्यों IHtmlDownloader चर केवल पढ़ने योग्य है? अगर यह निजी है और readonly , लाभ यह है कि आप इसे अनजाने में इसे उस कक्षा के दूसरे भाग से बदल नहीं सकते हैं, इसके आरंभ होने के बाद। केवल पढ़ने के लिए संशोधक यह सुनिश्चित करता है कि फ़ील्ड को केवल इसके आरंभीकरण या उसके वर्ग के कंस्ट्रक्टर के दौरान एक मान दिया जा सकता है। प्रारंभ करने के बाद कार्यात्मक रूप से कुछ परिवर्तन नहीं करना ...

iphone - When do you need to use a view controller? -

I am diving into iPhone development and am trying to see my head around one of my original ideas If you see an example of GL Paint on Apple Dev site, you will see a project that an app representative class a uiwindow subclass and a uiview subclass and the uiview subclass applies all core graphics painting logic and possible to touch events The Creeper. My questions are ... Why is no visual controller implemented to handle that visual argument? Can you use a visual controller to implement that logic, or to implement it in the UIV sub-class? And finally, when you should use a visual controller to apply visual logic code? Thank you very much for your help! One view knows how to interact with the user. It knows how to display some data, how to manage events, and how to give feedback to the user. A visual controller knows what, but now how. It knows what data is displayed, and what to do in response to user action. A UIButan knows how to display a title and...

garbage collection - Lua userdata gc -

Is it possible to capture the context of a lua object for a piece of leaked usager? (Like a table, or the second piece of user data?). In fact, what should I know: Can I create a piece of user data like this when GC runs, then user data can say: "Hey! I hold the references of these others Edit: Answer to lhf: Suppose I have: struct vertex {Double X, Y, z; } Straight quaternion {double w, x, y, z; } Now, I can: struct Foo {Vertex v; Quaternion q; } but instead I think that: struct bar {Vertex * v; Quaternion * q; } [i.e. Suppose, the Vertex & amp; Quaternion is actually a big piece of user data]. Now, suppose I have a LEA user function that takes UserDataVertex and UserDate Quaternion and creates a UserData bar (I do not want to use a UserDoq because I want to save space) - so I do not want GC-ED for UserData Vertex * * * * * * Quantanians * Is it possible to capture the reference of the object object for a piece of data user? No. A. Use...

Android Assets - Unable to access -

Using this code, it should return a list of assets, but when I call the list method, the "source Not found, edit source search parse ... "with the message it crashes: @override Create a bundle savedinstancestate {public at zero} {super.onCreate (savedInstanceState) ; SetContentView (R.layout.main); AssetManager property = this.getAssets (); Try {// error occurs on the next line of the string [] l = assets.list (null); } Hold it (IOException E) {}} Use it instead: string [] arr = getAssets (). List ("");

perl - How can I conditionally insert lines when using Tie::File? -

How can I change this code to include missing lines without deleting the existing code? Tie my @ lines, 'tie :: file', $ fn or die "Could not tie the file: $!"; ($ My $ i = 0; $ i & lt; @lines; $ i ++) {If ($ ln_title == 0) {if ($ i Your requirements seem a bit unclear, so it's hard to tell What do you want. If you want to insert a TITLE "" line after the line instead of the (overwritten) line instead of the TRACK line TRACK line, then you can use the following in place of $ rows [$ i + 1] = ... : Splice @ line, $ i + 1, 0, 'TITLE' '';

c# - How to set a default value with Html.TextBoxFor? -

Simple question, if you use HTML Helper from ASP.NET Framework 1, then it's easy to set a default value The text box is because there is a surcharge Html.TextBox (string name, object value) . When I tried to use the Html.TextBoxFor method, my first guess was that it should not work: Should I stay with HTML.TextBox (string, object) for now? You can try it

Should I dive into ASP.NET MVC or start with ASP.NET Webforms? -

I'm planning to take Silverlight in the future. The possibility of going to Microsoft WPF Currently aiming to learn c 2.0 w / coco I already know the pros and cons of ASP.NET MVC versus ASP.NET webform. What I want to know is that what would be more "efficient" to know the above circumstances? By skillful I mean once learning a design pattern and then using it again. Objective C I think the MVC uses the approach? What about Silverlight? WPF? I will go to B & N tomorrow to take an ASP.NET book so that I have to make a decision between webform and MVC right now. Also, as a side question, it is true that ASP.NET webform is often used in large enterprises by freelancers / small companies and ASP.Net MVC. I believe that ASP.NET MVC is more, how the Web works as a workform, but that does not mean that someone should deform ASP.NET webforms and just use ASP.NET MVC I think you try to see both of them What should be your future plans, even though. As ...