Posts

asp.net mvc 3 - Strategies for Organizing Dependencies/IOC Containers in an MVC3 .Net app with Castle Windsor -

So I'm new to using Castle Windsor and I became rather how ugly your controllers me your project the IOC, which has been found to work I'm most people is less than half the problems now announced a ton of dependency in your controller constructors I know that I'm down. Are there any good specimens to manage them, so I'm not copying / pasting it in every new controller and / or section of the site I created? public Home Controller (Aiookelaijeshn service location service, // ugly events service, media server service Uttrsewa, Aitivitr Fds service Twitter service, Aiafsbuksewayrsewaisewaisej, Aistitingssewa Setingssewayr, Aiiakstainetdeta service Bahreedeta service, Aiyuesaars service Ugrsewa, Aiaianstent message service instant messaging service, the Aisiaelanders Karenjr Received, Iloggr logger) {// These are some things} to link I hope this makes sense. I can add more information for clarification. It looks like your administrator or try to do too much o...

php - Assign changed variable to the same variable is safe? -

Is this a good practice and do I have any possibility of furrow if I entrusted the changing value of my own variable? For example $ myVar = 1; $ MyVar = $ myVar + 33 9 5 9 2; $ MyVar = rtrim ($ myVar, 2); $ MyVar = explosion (",", $ myVar); I know this will work but what is safe to do this in PHP? This violates the practice of using good variable names If the variable actually represents the same thing then I consider reassigning it. As it does not represent the same thing in this matter, I consider it a "bad" or "code odor". (However, "work safely" otherwise) Happy coding.

getClass() of a Generic Method Parameter in a Java -

निम्नलिखित जावा विधि को संकलित करने में विफल रहता है: & lt; T संख्या बढ़ाता है & gt; शून्य foo (टी टी) {क्लास & lt ;? T & gt; क्लास = टी.गेटक्लास (); } त्रुटि प्राप्त हुई है: प्रकार बेमेल: कक्षा & lt; कैप्चर # 3-से परिवर्तित नहीं किया जा सकता है? संख्या & gt; से कक्षा & lt ;? को बढ़ाता है टी & gt; बढ़ाता है क्या कोई समझा सकता है क्यों class & lt ;? T & gt; विस्तारित है, लेकिन कक्षा & lt ;? संख्या बढ़ती है; ठीक है? का कहना है: वास्तविक परिणाम प्रकार वर्ग & lt ;? है एक्स | एक्स | & gt; जहां | X | यह अभिव्यक्ति के स्थिर प्रकार का विलोपन है जिस पर getclass कहा जाता है। उदाहरण के लिए, इस कोड के टुकड़े में कोई कलाकार की आवश्यकता नहीं है: संख्या n = 0; क्लास के लिए & lt ;? संख्या & gt; फैली C = n.getClass (); क्योंकि T वर्ग 'प्रकार का विस्तार नहीं होता है से T इसके बजाय, यह संख्या से फैली हुई है, ठीक उसी तरह जैसा कि आपने खुद को & lt; T में विस्तारित किया है & gt; इतना ही आसान। ...

memcached - Django cache performance -

We are now using Redis for in-memory cache for our Django application (we used the first memcatch The difference in performance is no big, and we're using Redis because the disc dump feature). The problem is that Django cache's performance in my view - terrible, we have a view with 102 cache hits (no miss), and it has 81 ms (only the cash part, which is with the DJBugBug toolbar Is measured). In my opinion - this is a very long time, I know, asking for a question for DB can be 10x more (or 100x) time, but that is also not good with cash performance of that fact. We are running radis (and the first memacatch) on different hosts, connected to the local network with other servers. Is there a way to maximize cache performance in Django? Instead of displaying problem cache, there is a possibility of the number of items to be received for each page 102 Cash calls mean long time lost due to network latency. With full control of the code, you may be able to fix it with m...

c# - Confused over DLL entry points (entry point not found exception) -

I'm learning how to use DLL in C #. I have a very simple DLL to do my basic test. // using the MainForm.cs system; Using System.Collections.Generic; Using System.ComponentModel; Using System.Data; Using System.Drawing; Using System.Linq; Using System.Text; Using System.Windows.Forms; Using System.Runtime.InteropServices; Namespace DLL_Test {public partial class} Form 1: Form {{DllImport ("TestDLL.dll", EntryPoint = "? @ @ YGHHH Add @, Accurate Spelling = True, Calling Communication = Calling Conference. STCL}] Add public static extern int ( Int a, int b); public form 1 () {initialization ();} private zeros button 1_Click (object sender, eventArgs e) {int num; try {num = add (2, 3); RichTextBox1.AppendText (num. ToString () + "\ n");} Hold (DllNotFoundException Pre) {Message Box.Show (ex.ToString ());} Hold (EntryPointNotFoundException Pre) {Message Box.Show (ex.ToString ())}} }} more DLL code: // TestDLL.cpp __declspec (dllexport) Add int __std...

c# - determine if a field is returned from a datareader -

I'm dynamically selecting a table to select and a field that is not present on all tables. Inside the reader, how can I see if this area is present in the collection or not? I am using it, but it only determines whether it is zero ... No, whether it exists or not: if (myReader .GetValue (myReader.GetOrdinal ("prepay")! = DB.NLL.value) myModel.PrePay = myReader.GetBoolean (myReader.GetOrdinal ("prepay"); Take a look at (MyReader is a SqlDataReader to handle).

javascript - jquery length of characters in a collection -

Is there a way to get the length of the characters in the jQuery collection? For example, you match a bunch of divs and you want to calculate the character of only matched divs Yes ... you can do this, var count = 0; $ ("Selector") .each (function () {count + = $ (this) .text (). Length;}); Warning (count); See here