Daily Archives

Articles indexed Thursday April 1 2010

Page 33/126 | < Previous Page | 29 30 31 32 33 34 35 36 37 38 39 40  | Next Page >

  • Solving a cyclical dependency in Ninject (Compact Framework)

    - by Alex
    I'm trying to use Ninject for dependency injection in my MVP application. However, I have a problem because I have two types that depend on each other, thus creating a cyclic dependency. At first, I understand that it was a problem, because I had both types require each other in their constructors. Therefore, I moved one of the dependencies to a property injection instead, but I'm still getting the error message. What am I doing wrong? This is the presenter: public class LoginPresenter : Presenter<ILoginView>, ILoginPresenter { public LoginPresenter( ILoginView view ) : base( view ) { } } and this is the view: public partial class LoginForm : Form, ILoginView { [Inject] public ILoginPresenter Presenter { private get; set; } public LoginForm() { InitializeComponent(); } } And here's the code that causes the exception: static class Program { /// <summary> /// The main entry point for the application. /// </summary> [MTAThread] static void Main() { // Show the login form Views.LoginForm loginForm = Kernel.Get<Views.Interfaces.ILoginView>() as Views.LoginForm; Application.Run( loginForm ); } } The exception happens on the line with the Kernel.Get<>() call. Here it is: Error activating ILoginPresenter using binding from ILoginPresenter to LoginPresenter A cyclical dependency was detected between the constructors of two services. Activation path: 4) Injection of dependency ILoginPresenter into property Presenter of type LoginForm 3) Injection of dependency ILoginView into parameter view of constructor of type LoginPresenter 2) Injection of dependency ILoginPresenter into property Presenter of type LoginForm 1) Request for ILoginView Suggestions: 1) Ensure that you have not declared a dependency for ILoginPresenter on any implementations of the service. 2) Consider combining the services into a single one to remove the cycle. 3) Use property injection instead of constructor injection, and implement IInitializable if you need initialization logic to be run after property values have been injected. Why doesn't Ninject understand that since one is constructor injection and the other is property injection, this can work just fine? I even read somewhere looking for the solution to this problem that Ninject supposedly gets this right as long as the cyclic dependency isn't both in the constructors. Apparently not, though. Any help resolving this would be much appreciated.

    Read the article

  • How can I make multi-line, vertically and horizontally aligned labels for radio buttons in HTML Form

    - by Patrick Klingemann
    Assuming the following markup: <fieldset> <legend>Radio Buttons</legend> <ol> <li> <input type="radio" id="x"> <label for="x"><!-- Insert multi-line markup here --></label> </li> <li> <input type="radio" id="x"> <label for="x"><!-- Insert multi-line markup here --></label> </li> </ol> </fieldset> How do I style radio button labels so that they look like the following in most browsers (IE6+, FF, Safari, Chrome:

    Read the article

  • How can I move all my modification to a branch

    - by michael
    Hi, I create a working repository in HG. And I have modified some files. How can i move my all my modification to a branch (a branch that I have not created)? (kind of 'git stash' and the move the stash away change to a branch. Actually, I am not sure how I can do that in git either. If you know, I appreciate if you can tell me in git as well) Thank you.

    Read the article

  • C# 4.0 RC, Silverlight 4.0 RC Covariance

    - by Ant
    Hi, I am trying to develop a Silverlight 4 application using C# 4.0. I have a case like this: public class Foo<T> : IEnumerable<T> { .... } Elsewhere: public class MyBaseType : MyInterface { ... } And the usage where I am having problems: Foo<MyBaseType> aBunchOfStuff = new Foo<MyBaseType>(); Foo<MyInterface> moreGeneralStuff = myListOFStuff; Now I believe this was impossible in C# 3.0 because generic type were "Invariant". However I thought this was possible in C# 4.0 through the new covariance for generics technology? As I understand it, in C# 4.0 a lot of common interfaces (like IEnumerable) have been modified to support variance. In this case does my Foo class need to anything special in order to become covariant? And is covariance supported in Silverlight 4 (RC) ?

    Read the article

  • how to remove listview items in android

    - by kavitha
    Hi all,, Can somebody please give me an example code of removing all ListView items and replacing with new items. I tried replacing the adapter items.Still no results. my code is at first i am calling populateList(){ results -populated arraylist with strings ArrayAdapter<String> adapter = new ArrayAdapter<String>(this, android.R.layout.simple_list_item_1, results); listview.setAdapter(adapter); adapter.notifyDataSetChanged(); listview.setOnItemClickListener(this); } // now populating list again repopulateList(){ results1-populated arraylist with strings ArrayAdapter<String> adapter1 = new ArrayAdapter<String>(this, android.R.layout.simple_list_item_1, results1); listview.setAdapter(adapter1); adapter1.notifyDataSetChanged(); listview.setOnItemClickListener(this); } Here replpulateList() method will add to listview items. It doent remove/replace all listview items. Please Help.

    Read the article

  • iPhone 3G S sync services problem

    - by Ryan McCue
    When I try and synchronise my iPhone with iTunes, I get a dialog informing me that "syncing has been disabled on this computer". (I've never disabled syncing myself, and it worked perfectly fine a day ago) Music synchronises fine, as do videos, however, my contacts do not. Google Contacts no longer appears in the list to choose from, and the select box is empty. When I choose to re-enable syncing, iTunes informs me that "iTunes was unable to load provider data from Sync Services". I've followed several steps I've found on the internet, including deleting the C:\Users\Ryan\AppData\Roaming\Apple Computer\Sync Services directory, but to no avail. Any ideas on what could be causing this? Is there a Service (in the Windows-form-of-daemon sense) that I accidentally disabled?

    Read the article

  • Creating cookieless application on development machine with asp.net

    - by zaladane
    I tried posting this on ServerFault with no luck so i am trying here. I am thinking about setting up a new domain to host static content on my website and have it cookieless just like Stackoverflow with their static domain. So before going ahead and buying the domain and setting it up I wanted to test it on my developement machine first under localhost (I have to mention that i am planning on having IIS running on my new domain for the static files). I therefore created a new application under IIS and disabled session state and forms authentication. When my main application needs resources like css, images and js , I use the path to the "static" application where they are hosted. The problem is that when I look at the request and the response for the requested files, they still have the session_id cookie defined as well as the asp.net authentication cookie. Is it at all possible to accomplish what i am trying to do on a development machine or do i have to just go ahead and purchase the new domain which hopefully with make things right? I tried to read about cookieless domain but can't figure out what i might be missing.

    Read the article

  • what's wrong with concatenation in blackberry application?

    - by sexitrainer
    For the life of me, I can't understand why adding a concatenated string to the MainScreen is causing the BB simulator to throw an exception. If I run a VERY simple hello program with the following control, all is well: RichTextField rtfHello = new RichTextField("Hello There !!!"); add(rtfItemDescription); But if I add a concatenated string, the entire app breaks: String MyName = "John Doe"; RichTextField rtfHello = new RichTextField("Hello There !!!" + MyName); add(rtfItemDescription); So what am I doing wrong? Why would the simulator throw an exception for the second example?

    Read the article

  • How do I expose the columns collection of GridView control that is inside a user control

    - by Christopher Edwards
    See edit. I want to be able to do this in the aspx that consumes the user control. <uc:MyControl ID="MyGrid" runat="server"> <asp:BoundField DataField="FirstColumn" HeaderText="FirstColumn" /> <asp:BoundField DataField="SecondColumn" HeaderText="SecondColumn" /> </uc> I have this code (which doesn't work). Any ideas what I am doing wrong? VB Partial Public Class MyControl Inherits UserControl <System.Web.UI.IDReferenceProperty(GetType(DataControlFieldCollection))> _ Public Property Columns() As DataControlFieldCollection Get Return MyGridView.Columns End Get Set(ByVal value As DataControlFieldCollection) ' The Columns collection of the GridView is ReadOnly, so I rebuild it MyGridView.Columns.Clear() For Each c As DataControlField In value MyGridView.Columns.Add(c) Next End Set End Property ... End Class C# public partial class MyControl : UserControl {         [System.Web.UI.IDReferenceProperty(typeof(DataControlFieldCollection))]     public DataControlFieldCollection Columns {         get { return MyGridView.Columns; }         set {             MyGridView.Columns.Clear();             foreach (DataControlField c in value) {                 MyGridView.Columns.Add(c);             }         }     } ... } EDIT: Actually it does work, but auto complete does not work between the uc:MyControl opening and closing tags and I get compiler warnings:- Content is not allowed between the opening and closing tags for element 'MyControl'. Validation (XHTML 1.0 Transitional): Element 'columns' is not supported. Element 'BoundField' is not a known element. This can occur if there is a compilation error in the Web site, or the web.config file is missing. So I guess I need to use some sort of directive to tell the complier to expect content between the tags. Any ideas?

    Read the article

  • Statement.RETURN_GENERATED_KEYS concept

    - by rits
    import java.sql.* ; import java.util.* ; import java.io.* ; class DataBaseFactory{ public static Connection getConnection(){ ... ... ... ... } } class Demo{ public static void main(String []args) throws SQLException{ Connection con = DataBaseFactory.getConnection() ; //This is throwing exception //PreparedStatement ps = con.prepareStatement("insert into user values(?,?)", Statement.RETURN_GENERATED_KEYS) ; //But this is working fine PreparedStatement ps = con.prepareStatement("insert into user values(?,?)") ; } } thnx in advance to all the java people here....

    Read the article

  • impersonation problem

    - by ZX12R
    i am trying to implement impersonation in a project. this is the first time i am trying it this is what i have done. <identity impersonate="true" userName="NS1\name" password="secret" /> i am using the username and password provided as the plesk credantials. I don't if my username format is correct. These are the details. Windows 2003 shared server IIS6 provider name : space2host thanks in advance

    Read the article

  • write regex code in java for following data

    - by giri
    <table> <tr> <td style="width:180px"> <a href="/search?q=user:240698+[java]" class="post-tag" title="show all posts by this user in 'java'">java</a><span class="item-multiplier">&times;&nbsp;176</span><br> <a href="/search?q=user:240698+[servlets]" class="post-tag" title="show all posts by this user in 'servlets'">servlets</a><span class="item-multiplier">&times;&nbsp;25</span><br> <a href="/search?q=user:240698+[jsp]" class="post-tag" title="show all posts by this user in 'jsp'">jsp</a><span class="item-multiplier">&times;&nbsp;11</span><br> <a href="/search?q=user:240698+[core]" class="post-tag" title="show all posts by this user in 'core'">core</a><span class="item-multiplier">&times;&nbsp;9</span><br> </tr> </table> from the above code I need to fetch only java, servlets, jsp and core. Can anybody plz help me out to write a regex in java to fetch those? Thanks

    Read the article

  • Active directory select and display with asp.net (oledb) (error code: DB_E_ERRORSINCOMMAND(0x80040E1

    - by Phil
    I am trying to make a page which displays some user information returned from active directory. Here is my code so far: Dim oConnection As OleDbConnection Dim oCmd As OleDbCommand Dim strADOQuery As String Dim oleReader As OleDbDataReader oConnection = New OleDbConnection() oCmd = New OleDbCommand() oConnection.ConnectionString = "Provider=ADsDSOObject;" oConnection.Open() oCmd.Connection = oConnection strADOQuery = "select distinguishedName, cn, givenname, sn, mail, middleName, displayName, description, telephonenumber, physicalDeliveryOfficeName, employeeID from 'LDAP://dc=foo,dc=ac,dc=uk' WHERE objectCategory='Person' AND objectClass='user' AND sAMAccountName='" & Uname & "'""" oCmd.CommandText = strADOQuery oCmd.CommandTimeout = 600 oCmd.ExecuteReader() While oleReader.Read ADDN = r("distinguishedName") ADCommonName = r("cn") ADFirstName = r("givenname") ADLastName = r("sn") ADEmail = r("mail") ADFirstandLast = r("displayName") ADDescription = r("description") ADTelephone = r("telephonenumber") ADOffice = r("physicalDeliveryOfficeName") ADStaffnum = r("employeeID") End While oConnection.Close() oleReader.Close() I'm finding it hard to see exactly what is wrong with the code. The error message presented is vague: 'ADsDSOObject' failed with no error message available, result code: DB_E_ERRORSINCOMMAND(0x80040E14). Any assistance would be greatly appreciated Thanks.

    Read the article

  • What Belongs to the Aggregate Root

    - by jlembke
    This is a practical Domain Driven Design question: Conceptually, I think I get Aggregate roots until I go to define one. I have an Employee entity, which has surfaced as an Aggregate root. In the Business, some employees can have work-related Violations logged against them: Employee-----*Violations Since not all Employees are subject to this, I would think that Violations would not be a part of the Employee Aggregate, correct? So when I want to work with Employees and their related violations, is this two separate Repository interactions by some Service? Lastly, when I add a Violation, is that method on the Employee Entity? Thanks for the help!

    Read the article

  • Winform custom control in WPF

    - by Erika
    Hi, I'm inserting a custom winform control in a WPF/ XAML window, however i'm realising that the sizing seems to be very different, what i designed in winform to be 730pixels wide for instance, when placed via a WindowsFormsHost, in a container 730pixels (or at least i think they're pixels..) wide, the control looks much larger and doesnt fit in the host and results in clipping from the right and bottom. Would anyone know how to make these sizes match or something? I'm really at a loss and its very difficult to fix a custom control to make it look as it should off hand on WPF! Please help!

    Read the article

  • How to insert into a table with just one IDENTITY column (SQL Server CE)

    - by Hei
    Hello I am trying to insert a value in a one IDENTITY column Table in SQL Server CE 3.5. I Tried the following: INSERT Target DEFAULT VALUES INSERT Target (ID) VALUES (DEFAULT) INSERT Target (ID) VALUES () But none of them worked. This is the SQL command I used to create the table (Using SQL Server Management Studio): CREATE TABLE Target( ID int NOT NULL IDENTITY (1, 1) PRIMARY KEY ); Microsoft help site (http://msdn.microsoft.com/en-us/library/ms174633%28SQL.90%29.aspx) mentions that DEFAULT values are not valid for identity columns however they do not mention any alternative. They mention something about uniqueidentifier and ROWGUID but I have not been able to make it work. I would appreciate any pointers on how to solve this problem or links to documentation about valid sql commands for sql server CE. Thank you

    Read the article

  • How can I play a music such that it automatically replay it after its end?

    - by iSharreth
    AVAudioPlayer *myExampleSound; NSString *myExamplePath = [[NSBundle mainBundle] pathForResource:@"myaudiofile" ofType:@"caf"]; myExampleSound =[[AVAudioPlayer alloc] initWithContentsOfURL:[NSURL fileURLWithPath:myExamplePath] error:NULL]; myExampleSound.delegate = self; [myExampleSound play]; How can I play myExampleSound such that it automatically replay after its end? Anyone please help.

    Read the article

  • for loop in #define

    - by hspim
    #include <stdio.h> #define UNITS {'*', '#', '%', '!', '+', '$', '=', '-'} #define PrintDigit(c, d) (for (i=0; i < c ; i++)putchar(unit[d]);) char unit[] = UNITS; //void PrintDigit(c, element) { // int i; // for (i=0; i < c ; i++) // putchar(unit[element]); //} int main( ) { int i, element=4; PrintDigit(10, element); putchar('\n'); return 0; } I have the function here PrintDigit() which works as expected. When attempting to turn the function into a #define however gcc keeps throwing a syntax error on the for loop. Any idea what the problem is?

    Read the article

  • PHP on Server 2003: Enabling PHP_APC.DLL creates Error

    - by james.527.
    When trying to enable PHP_APC.DLL, PHP crashes returning invalid access to memory location. Any ideas? I am running 5.2.12 in ISAPI mode. Here is what I have enabled extension wise: ;extension=php_bz2.dll ;extension=php_curl.dll ;extension=php_dba.dll ;extension=php_dbase.dll ;extension=php_exif.dll ;extension=php_fdf.dll extension=php_gd2.dll ;extension=php_gettext.dll ;extension=php_gmp.dll ;extension=php_ifx.dll ;extension=php_imap.dll ;extension=php_interbase.dll extension=php_ldap.dll ;extension=php_mbstring.dll extension=php_mcrypt.dll ;extension=php_mhash.dll ;extension=php_mime_magic.dll ;extension=php_ming.dll ;extension=php_msql.dll ;extension=php_mssql.dll extension=php_mysql.dll extension=php_mysqli.dll ;extension=php_oci8.dll ;extension=php_openssl.dll extension=php_pdo.dll ;extension=php_pdo_firebird.dll ;extension=php_pdo_mssql.dll extension=php_pdo_mysql.dll ;extension=php_pdo_oci.dll ;extension=php_pdo_oci8.dll ;extension=php_pdo_odbc.dll ;extension=php_pdo_pgsql.dll extension=php_pdo_sqlite.dll ;extension=php_pgsql.dll ;extension=php_pspell.dll ;extension=php_shmop.dll ;extension=php_snmp.dll ;extension=php_soap.dll ;extension=php_sockets.dll extension=php_sqlite.dll ;extension=php_sybase_ct.dll ;extension=php_tidy.dll ;extension=php_xmlrpc.dll ;extension=php_xsl.dll extension=php_zip.dll extension=php_win32service.dll ultimately i'm trying to create a PHP based uploader with a progress bar. From what I understand PHP_APC is the only way to do this. If anyone could help me stabilize PHP_APC or know of another UL with progress bar method, it would be appreciated.

    Read the article

< Previous Page | 29 30 31 32 33 34 35 36 37 38 39 40  | Next Page >