Search Results

Search found 1870 results on 75 pages for 'matt mcclellan'.

Page 54/75 | < Previous Page | 50 51 52 53 54 55 56 57 58 59 60 61  | Next Page >

  • Why is Func<T> ambiguous with Func<IEnumerable<T>>?

    - by Matt Hamilton
    This one's got me flummoxed, so I thought I'd ask here in the hope that a C# guru can explain it to me. Why does this code generate an error? class Program { static void Main(string[] args) { Foo(X); // the error is on this line } static String X() { return "Test"; } static void Foo(Func<IEnumerable<String>> x) { } static void Foo(Func<String> x) { } } The error in question: Error 1 The call is ambiguous between the following methods or properties: 'ConsoleApplication1.Program.Foo(System.Func<System.Collections.Generic.IEnumerable<string>>)' and 'ConsoleApplication1.Program.Foo(System.Func<string>)' C:\Users\mabster\AppData\Local\Temporary Projects\ConsoleApplication1\Program.cs 12 13 ConsoleApplication1 It doesn't matter what type I use - if you replace the "String" declarations with "int" in that code you'll get the same sort of error. It's like the compiler can't tell the difference between Func<T> and Func<IEnumerable<T>>. Can someone shed some light on this?

    Read the article

  • StringBuilder/StringBuffer vs. "+" Operator

    - by matt.seil
    I'm reading "Better, Faster, Lighter Java" (by Bruce Tate and Justin Gehtland) and am familiar with the readability requirements in agile type teams, such as what Robert Martin discusses in his clean coding books. On the team I'm on now, I've been told explicitly not to use the "+" operator because it creates extra (and unnecessary) string objects during runtime. But this article: http://www.ibm.com/developerworks/java/library/j-jtp01274.html Written back in '04 talks about how object allocation is about 10 machine instructions. (essentially free) It also talks about how the GC also helps to reduce costs in this environment. What is the actual performance tradeoffs between using "+," "StringBuilder," or "StringBuffer?" (In my case it is StringBuffer only as we are limited to Java 1.4.2.) StringBuffer to me results in ugly, less readable code, as a couple of examples in Tate's book demonstrates. And StringBuffer is thread-synchronized which seems to have its own costs that outweigh the "danger" in using the "+" operator. Thoughts/Opinions?

    Read the article

  • Finding the right version of the right JAR in a maven repository

    - by Matt McHenry
    I'm converting a build that has 71 .jar files in its global lib/ directory to use Maven. Of course, these have been pulled from the web by lots of developers over the past ten years of this project's history, and weren't always added to VCS with all the necessary version info, etc. Is there an easy, automated way to go from that set of .jar files to the corresponding <dependency/> elements for use in my pom.xml files? I'm hoping for a web page where I can submit the checksum of a jar file and get back an XML snippet. The google hits for 'maven repository search' are basically just finding name-based searches. And http://repo1.maven.org/ has no search whatsoever, as far as I can see. Update: GrepCode looks like it can find projects given an MD5 checksum. But it doesn't provide the particular details (groupId, artifactId) that Maven needs.

    Read the article

  • How do I write sql data into a textbox after a submit type event

    - by Matt
    Finishing up some homework and Im having trouble with figuring out how to take information generated in sql column(a primary key set up to assign a record number to a customer example 1046) at submit and writing it to my redirected recipt page. I call it recipt.aspx. Any takers Professor says to use a datareader...but things go bad after that. public partial class _Default : System.Web.UI.Page { String cnStr = "EDITED FOR THE PURPOSE OF NOT DISPLAYED SQL SERVERta Source=111.11.111.11; uid=xxxxxxx; password=xxxx; database=xxxxxx; "; String insertStr; SqlDataReader reader; SqlConnection myConnection = new SqlConnection(); protected void submitbutton_Click(object sender, EventArgs e) { myConnection.ConnectionString = cnStr; try { //more magic happens as myConnection opens myConnection.Open(); insertStr = "insert into connectAssignment values ('" + TextBox2.Text + "','" + TextBox3.Text + "','" + TextBox4.Text + "','" + TextBox5.Text + "','" + bigtextthing.Text + "','" + DropDownList1.SelectedItem.Value + "')"; //magic happens as Connection string is assigned to connection object and passes in the SQL statment //associate the command to the the myConnection connection object SqlCommand cmd = new SqlCommand(insertStr, myConnection); cmd.ExecuteNonQuery(); Session["passmyvalue1"] = TextBox2.Text; Session["passmyvalue2"] = TextBox3.Text; Session["passmyvalue3"] = TextBox4.Text; Session["passmyvalue4"] = TextBox5.Text; Session["passmyvalue5"] = bigtextthing.Text; Session["I NEED SOME HELP RIGHT HERE"] =Textbox6.Text; Response.Redirect("receipt.aspx"); } catch { bigtextthing.Text = "Error submitting" + "Possible casues: Internet is down,server is down, check your settings!"; } finally { myConnection.Close(); TextBox2.Text = ""; TextBox3.Text = ""; TextBox4.Text = ""; TextBox5.Text = ""; bigtextthing.Text = ""; } //reset validators? } The recipt page public partial class _Default : System.Web.UI.Page { protected void Page_Load(object sender, EventArgs e) { if(Session["passmyvalue1"] != null) { TextBox1.Text = (string)Session["passmyvalue1"]; TextBox2.Text = (string)Session["passmyvalue2"]; TextBox3.Text = (string)Session["passmyvalue3"]; TextBox4.Text = (string)Session["passmyvalue4"]; TextBox5.Text = (string)Session["passmyvalue5"]; TextBox6.Text = I don't know ; } } } THanks for the help

    Read the article

  • How to debug Fluent nHibernate

    - by Matt Thrower
    Hi, I'm having some trouble with Fluent nHibernate. I added a column to a table and I thought I'd correctly changed the mappings and the connected data objects to correctly reflect this. However when I tried to run my application again I kept getting this error: System.Data.SqlClient.SqlException: Invalid column name 'Workflow_id'. I really couldn't see what the problem was with the changes I'd made so I reverted back to the original versions of the mapping and data object files from source control and removed the offending column from the database. But I'm still getting the same error. I'd like some advice on how to debug this. The SQL that gets reported on the error is semi-nonsensical: SELECT regions0_.Page_id as Page5_1_, regions0_.Id as Id1_, regions0_.Id as Id27_0_, regions0_.RegionId as RegionId27_0_, regions0_.RegionTemplate_id as RegionTe3_27_0_, regions0_.Workflow_id as Workflow4_27_0_ FROM [Region] regions0_ WHERE regions0_.Page_id=? And it won't execute as valid SQL anyway. Any ideas as to where to go from here?

    Read the article

  • Will iPhone OS4 make your life easier or harder as a lone app developer?

    - by Matt
    I am interested to hear what people feel about the new iPhone OS4 release. It is obviously very exciting having access to all the new features, apparently (from apple.com) it has over 1500 new APIs. My original thoughts were "Wow, this is awesome", and I suppose it is. I was just getting comfortable with OS 3.2 development though, and now there is a raft of additional stuff to learn in order to keep up with the pack. So I am feeling quite frustrated! Do you think, when working as an individual app developer, having access to these additional features would improve your applications or just water down the quality? I guess being giving the opportunity to improve applications and provide better features should be welcomed. I think frustration comes from struggling to keep up with the continuous changes, but thats the industry we are in I suppose! Any thoughts/comments?

    Read the article

  • Help debugging Apache, Passenger and Rails problem

    - by Matt Dressel
    We have an environment running that uses Apache, Passenger and rails. The system is handling most request normally, yet certain requests do not make it to the rails application. For instance, a request to /books is successful, but /books/1 hits apache and passenger, but does not even make it to rails. We set the apache log level to debug and the passenger log level to 3 so that we could monitor all incoming requests. We could see each request coming through and even the /books/1 request is being handled by passenger. But it never gets to rails. Is there any way to determine where the request goes between Passenger and rails or where debugging information might live? Has anyone ever seen any problems with passenger spawning or queuing? We have spawning set to conservative. Also, we have had some permission/ownership problems in the past, so I am not ruling this out yet. Thanks in advance

    Read the article

  • Error HRESULT E_FAIL when creating Exchange mailbox (CDOEXM.IMailboxStore.CreateMailbox)

    - by Matt
    I am trying to automate the process of creating an Exchange Mailbox for AD users and am running into an issue. When calling the CreateMailbox method I am receiving the error "Error HRESULT E_FAIL has been returned from a call to a COM component". I have installed and referenced the Exchange Management Tools and am using impersonation for permissions. Here is the code: ActiveDs.IADsUser adUser = (ActiveDs.IADsUser)user.NativeObject; adUser.AccountDisabled = !Active; user.CommitChanges(); //Set Password user.Invoke("SetPassword", Password); user.CommitChanges(); //Create Mailbox IMailboxStore mailbox; mailbox = (IMailboxStore)adUser; mailbox.CreateMailbox("LDAP://CN=StandardUsers,CN=StandardUsers,CN=InformationStore,CN=xxxxx," + "CN=Servers,CN=First Administrative Group,CN=Administrative Groups," + "CN=xxxxx Main,CN=Microsoft Exchange,CN=Services,CN=Configuration,DC=xxxxx,DC=com"); user.CommitChanges();

    Read the article

  • ActionController::RoutingError (No route matches {:action=>"show", :controller=>"users", :id=>nil}):

    - by Matt Bishop
    I have been trying to fix this routing error for a long time. I would appreciate any assistance! This error is preventing me from being able to authenticate. Here is what I am getting in my Heroku logs. app/controllers/authentications_controller.rb:12:in `create' ActionController::RoutingError (No route matches {:action=>"show", :controller=>"users", :id=>nil}) Here is the routes.rb file: Company::Application.routes.draw do resources :profile_individual resources :careers match 'careers' => 'careers#index' match 'about' => 'about#index' constraints(:subdomain => /^$|www/) do devise_for :users resources :authentications, :identities #, :beta_invitations resources :users do resources :invitations, :controller => 'UserInvitation' do post :upload, :on => :collection get :email_template, :on => :collection get :plaintext_template, :on => :collection get :facebook_invitation, :on => :collection end member do get :summary get :recruits get :friends_events get :events_near_me get :recent_activity get :impact get :campaigns end end resources :password_resets do get 'password_reset' => 'password_resets#show', :as => 'password_reset' end resources :events, :only => [:new, :index, :create] resources :organizations, :only => [:index, :create] resources :orders do post :ipn, :on => :member resource :payment do member do post :relay_response get :receipt end end resource :paypal_integration do member do get :authorize get :cancel post :finalize end end end match '/users/:id/impact/money/:d' => 'users#impact_money_graph', :constraints => {:d => /\d+{4}_\d+{2}-\d+{2}/}, :as => :user_impact_money match '/users/:id/impact/money' => 'users#impact_money_graph', :as => :user_impact_money match '/users/:id/impact/recruits/:d' => 'users#impact_recruits_graph', :constraints => {:d => /\d+{4}_\d+{2}-\d+{2}/}, :as => :user_impact_recruits match '/users/:id/impact/recruits' => 'users#impact_recruits_graph', :as => :user_impact_recruits match '/auth/failure' => 'authentications#failure' match '/auth/:provider/callback' => 'authentications#create' match '/auth/:provider/callback' => 'authentications#show', :controller => 'users', :as => :login match '/logout' => 'authentications#destroy', :as => :logout match '/login' => 'authentications#new', :as => :login match "/join_team/:id" => "team_members#join", :as => :join_team match "/rsvp/:id" => "rsvps#show", :as => :rsvp match "/signup" => 'authentications#signup', :as => :signup match "/beacon/:id.gif" => "email_beacons#show", :as => :email_beacon root :to => "homes#show" match '/corporate_giving' => "homes#corporate_giving" end constraints(Subdomain) do resource :organization, :path => "/", :only => [:edit, :update] do member do get :org_photos_videos get :org_recent_activity end end resources :events, :except => [:index] do post :publish, :on => :member resource :supporter_invite resource :team_management do post :mailer, :on => :member end resource :team_member do post :invite, :on => :member end resource :rsvp do put :make_order, :on => :collection get :make_order, :on => :collection end resources :invites do post :upload, :on => :collection end resources :ticket_tiers, :team_members end match "/events" => redirect("/") root :to => "organizations#show" end namespace :admin do resources :stats resources :organizations resources :campaigns do resources :rewards resources :contents put :header, :action => 'header_update' end resources :users do member do post :grant_access post :revoke_access end end resources :nonprofits do member do put :approve put :revoke end end end resources :campaigns do get :find_charities, :on => :collection get :how_many_charities, :on => :collection member do post :join get :join post :header, :action => 'header_creation' put :header, :action => 'header_update' end resources :rewards resources :contents resource :donations do resource :paypal_integration, :controller => 'donations' do member do get :authorize get :cancel post :finalize end end end end match '/campaigns/:id/graph/:d' => 'campaigns#graph', :constraints => {:d => /\d+{4}_\d+ {2}-\d+{2}/}, :as => :graph_campaign match '/campaigns/:id/graph' => 'campaigns#graph', :as => :graph_campaign resources :business_campaigns, :controller => 'campaigns' resources :businesses do put :logo, :on => :collection, :action => 'upload_logo' member do get :summary get :recruits get :friends_events get :events_near_me get :recent_activity get :impact get :campaigns end end resources :nonprofit_campaigns, :controller => 'campaigns' resources :nonprofits do put :logo, :on => :collection, :action => 'upload_logo' member do get :summary get :recruits get :friends_events get :events_near_me get :recent_activity get :impact get :campaigns get :supporting_campaigns end end resources :publicities match '/campaigns/:campaign_id/rewards/:id' => 'campaigns#reward', :via => :get match "/robots.txt" => "application#robots_txt" match "/beta_invitations" => redirect('/') resource :sitemap resources :referrals end Here is my authentications_controller.rb file class AuthenticationsController < ApplicationController skip_before_filter :require_beta_access before_filter :redirect_to_profile_if_logged_in, :only => [:create, :new] layout :resolve_layout def create omniauth = request.env["omniauth.auth"] authentication = Authentication.find_by_provider_and_uid(omniauth['provider'], omniauth['uid']) if authentication && authentication.user.present? sign_in(:user, authentication.user) redirect_to session[:redirect_to] || user_path(current_user, :subdomain => nil) elsif current_user current_user.authentications.create!(:provider => omniauth['provider'], :uid => omniauth['uid']) redirect_to session[:redirect_to] || user_path(current_user, :subdomain => nil) else user = User.new user.apply_omniauth(omniauth) logger.debug "=======================auth=============================" logger.debug session[:referrer_token] logger.debug "========================================================" if session[:referrer_token] publicity = Publicity.find_by_token(session[:referrer_token]) user.invited_by = publicity user.recruited_by = publicity end if user.save sign_in(user) unless session[:redirect_to] session[:referrer_token] = nil end redirect_to session[:redirect_to] || user_path(current_user, :subdomain => nil) #redirect_to session[:redirect_to] || campaigns_url(:tc => request.env['omniauth.params']['tc']) #tc is for AB testing else session[:omniauth] = omniauth.except('extra') redirect_to signup_path end end end def failure flash[:error] = "Please check your email and password and try again" redirect_to login_path end def destroy reset_session redirect_to root_path end def signup # end private def redirect_to_profile_if_logged_in redirect_to user_path(current_user.permalink) if current_user end def resolve_layout case action_name when "new", "signup" "authentication" else "selfcontained" end end end I am adding my appplication_controller.rb too: class ApplicationController < ActionController::Base #Wrote by George for beta users -before_filter :require_beta_access before_filter :save_referrer_token protect_from_forgery helper_method :organization_admin?, :team_member?, :profile_url, :current_profile def set_headers # Set our headers here end def save_referrer_token #session.delete(:referrer_token) if params[:ref] publicity = Publicity.find_by_token(params[:ref]) logger.debug "========================================================" logger.debug current_profile.nil? logger.debug publicity.creator logger.debug current_profile logger.debug current_profile != publicity.creator session[:referrer_token] = params[:ref] if current_profile.nil? or publicity.creator != current_profile logger.debug session[:referrer_token] logger.debug "========================================================" end end def robots_txt robots = File.read(Rails.root + "public/robots.#{Rails.env}.txt") render :text => robots, :layout => false, :content_type => "text/plain" end def load_organization @organization = Organization.find_by_permalink(request.subdomain) raise ActiveRecord::RecordNotFound if @organization.nil? end def require_user unless current_user session[:redirect_to] = request.url redirect_to login_url(:host => request.domain) end end def require_beta_access if !current_user redirect_to root_url(:host => request.domain) elsif !current_user.beta_access? redirect_to new_beta_invitation_url(:host => request.domain) end end def require_organization_admin unless organization_admin? redirect_to root_url(:subdomain => @organization.permalink) end end def team_member? if current_user && @event.team_memberships.where(:user_id => current_user.id).count != 0 true end end def organization_admin? if current_user && current_user.beta_access? && @organization && @organization.memberships.where(:user_id => current_user.id, :role => 'admin').count != 0 true end end def profile_url(profile, opt = nil) if profile == current_user user_url(profile, :host => opt[:host]) elsif profile.is_a? BusinessProfile business_url(profile) elsif profile.is_a? NonprofitProfile nonprofit_url(profile) end end def set_current_profile(profile) session[:current_profile] = profile end def current_user @current_user ||= User.find_by_auth_token!(cookies[:auth_token]) if cookies[:auth_token] end def current_profile #if session session[:current_profile] || current_user #else # nil #end end IGIVEMORE_HTML5_OPTIOINS = { :style => 'z-index: 0;',:width => '290', :height => '200', :frameborder => '0', :url_params => {:wmode=>"opaque"} } def campaign_header_body(camp, opt = IGIVEMORE_HTML5_OPTIOINS) if camp.header_type == Campaign::HEADER_YOUTUBE youtube_html5(camp.header_url, opt).html_safe elsif camp.header_type == Campaign::HEADER_IMAGE "<img src=\"#{camp.header_url}\" width=\"#{opt[:width]}\" height=\"#{opt[:height]}\"/>'".html_safe else "Unsupported Type!!" end end def youtube_html5(url, opt) begin video = YouTubeIt::Client.new.video_by(url) video.embed_html5(opt).gsub(/http:\/\//,"https://") rescue => e "<div style='color:red; width:290px; height:100px; padding-top:100px'>Given Video URL has problem.</div>" end end end

    Read the article

  • How do I send telnet option codes?

    - by Matt
    I've written a socket listener in Java that just sends some data to the client. If I connect to the server using telnet, I want the server to send some telnet option codes. Do I just send these like normal messages? Like, if I wanted the client to print "hello", I would do this: PrintWriter out = new PrintWriter(clientSocket.getOutputStream()); out.print("hello"); out.flush(); But when I try to send option codes, the client just prints them. Eg, the IAC char (0xff) just gets printed as a strange y character when I do this: PrintWriter out = new PrintWriter(clientSocket.getOutputStream()); out.print((char)0xff); out.flush();

    Read the article

  • Multithreaded Delegates/Events

    - by Matt
    I am trying to disable parts of the UI in a .NET app based on polling done on a background thread. The background thread checks to see if the global database connection the app uses is still open and operable. What I need to do, and would prefer to do it without polling on the UI thread, is to add an event handler that can be raised by the background thread if the connection status changes. That way, any form can have a handler that will disable those parts of the UI that require the connection to function. Attempting to use a straight event declaration in the class that holds the thread sub, and raising the event in the background thread causing cross-thread execution errors regarding accessing UI controls from other threads. Obviously, there is a correct way to do this, but we have limited experience with events (single threaded apps mainly), and almost none with delegates. I've read through documentation and examples for delegates, and it seems to be closer to what we need, but I'm not sure how to make it work in this instance. The app is written mainly in VB.NET, but an example or help in C# is fine too.

    Read the article

  • Subversion: setting up a remote repository and running my site off it?

    - by Matt Andrews
    Hi all. I'm new to SVN and have experimented with it locally on my Dreamhost test server (which has a Subversion "one-click-install" function). Having found my way around the functionality I'm definitely sold, but a little lost about using it to manage my work website (not hosted with Dreamhost, so not offering a one-click SVN installation). Am I correct in thinking that I can set up a repository on my website root (which contains all the files), and then when I develop new features and run a commit, this will update my site? Is this the proper workflow for this sort of thing? If so, is there a standard way to set this kind of thing up on my remote server? Thanks.

    Read the article

  • Override Maven's default resource filter replacement pattern.

    - by Matt Campbell
    By default maven will filter resources like this: <properties> <replace.me>value</replace.me> </properties> <some-tag> <key>${replace.me}</key> </some-tag> will get you: <some-tag> <key>value</key> </some-tag> Is there a way to override the way maven selects the strings to replace? Specifically, I want to be able to use this: <some-tag> <key>@replace.me@</key> </some-tag> to get the same result as above.

    Read the article

  • Outlook 2007 VSTO Add-in deployed by click-once doesn't detect published updates

    - by Matt
    I have created an outlook 2007 add-in project in vs2008, targeting .net 3.5, then migrated the project to vs2010. I have then published the project from vs2010 to a web site, and installed the add-in using click-once to a virtual machine running xp, .net 3.5 sp1, and outlook 2007. This all works great and I can see my add-in within outlook. Publish update settings are set to update the add-in at startup rather than every 7 days. However when I then make a simple change to the add-in, update the AssemblyVersion and AssemblyFileVersion of the add-in project, and then publish the updates, when I run outlook it doesn't detect that there is a new version, and just runs the current one that is installed. I can see that the publish has generated a new setup.exe and added a new folder to the 'Application Files' folder with the current (autogenerated) publish version. Can anyone suggest anything how I can get the update to be deployed to the client?

    Read the article

  • How to specify MQ channel table location for .net web application using web.config

    - by Matt
    I've been going around in circles for a while on this one now. I'm trying to connect to a distributed queue manager using a supplied channel table file. I can get this to work if I specify the environmental variable MQCHLLIB and MQCHLTAB on my server. However the IBM documentation states that the .net config file can override these variables. Here is what I have placed in my web.config file: ... <configSections> <section name="CHANNELS" type="System.Configuration.NameValueSectionHandler" /> </configSections> <CHANNELS> <add key="ChannelDefinitionDirectory" value="C:\temp"></add> <add key="ChannelDefinitionFile" value="DSM_MOM_TEST.tab"></add> </CHANNELS> ... And here is the code that is executing: Hashtable properties = new Hashtable(); //Add managed connection type to parameters. const String connectionType = MQC.TRANSPORT_MQSERIES_CLIENT; properties.Add(MQC.TRANSPORT_PROPERTY, connectionType); return new MQQueueManager(queueManagerName, properties); queueManagerName is set to the generic queue manager "*Q101T". However this isn't working and I get an error returned: 2058 MQRC_Q_MGR_NAME_ERROR I've been unable to find any more documentation on how to get this to work other than the environmental variables and the standard mqclient.ini should be overriden by the channels stanza in the web.config. Is there something that I've missed in the code? Any tips would be greatly appreciated.

    Read the article

  • Parsing and validating arbitrary date formats in ruby (on rails)

    - by Matt Briggs
    I have a requirement to handle custom date formats in an existing app. The idea is that the users have to do with multiple formats from outside sources they have very little control over. We will need to be able to take the format and both validate Dates against it, as well as parse strings specifically in that format. The other thing is that these can be completely arbitrary, like JA == January, FE == February, etc... to my understanding, chronic only handles parsing (and does it in a more magical way then I can use), and enter code here DateTime#strptime comes close, but doesn't really handle the whole two character month scenario, even with custom formatters. The 'nuclear' option is to write in custom support for edge cases like this, but I would prefer to use a library if something like this exists.

    Read the article

  • Dispose a Web Service Proxy class?

    - by Matt
    When you create and use a Web Service proxy class in the ASP.Net framework, the class ultimately inherits from Component, which implements IDisposable. I have never seen one example online where people dispose of a web proxy class, but was wondering if it really needs to be done. When I call only one method, I normally wrap it in a using statement, but if I have a need to call it several times throughout the page, I might end up using the same instance, and just wondered what the ramifications are of not disposing it.

    Read the article

  • mysqli and php requesting rows returned in object oriented scripting...

    - by Matt
    in object oriented php mysqli I am trying to request a username, and return if it matches a row, without actually returning any user data. How would I write this?...so far I have... $sql = "SELECT NULL FROM database WHERE usernick=?"; $stmt = $link->prepare($sql) $stmt->bind_param('s', $snr); $stmt->execute(); After this step I need to see if a row matched the query...but I have no idea how to write it, everyone here pretty much writes in mysql if I dont mention I want object oriented mysqli :S

    Read the article

  • Flash AS3: automate property assignment to new instance from arguments in constructor

    - by matt lohkamp
    I like finding out about tricky new ways to do things. Let's say you've got a class with a property that gets set to the value of an argument in the constructor, like so: package{ public class SomeClass{ private var someProperty:*; public function SomeClass(_someProperty:*):void{ someProperty = _someProperty; } } } That's not exactly a hassle. But imagine you've got... I don't know, five properties. Ten properties, maybe. Rather then writing out each individual assignment, line by line, isn't there a way to loop through the constructor's arguments and set the value of each corresponding property on the new instance accordingly? I don't think that the ...rest or arguments objects will work, since they only keep an enumerated list of the arguments, not the argument names - I'm thinking something like this would be better: for(var propertyName:String in argsAsAssocArray){this[propertyName] = argsAsAssocArray[propertyName];} ... does something like this exist?

    Read the article

  • Good IM/Chat solution for pasting code

    - by Matt Miller
    We've got several distributed developers working together on a couple of projects. We've been using Skype to host chats with all the developers, and it works okay except for one thing: It REALLY mangles any code we copy and paste into the chats -- especially the whitespace in Python. This question has tons of opinions about chat clients & servers, but no one has much to say about pasting in code. (http://stackoverflow.com/questions/36415/best-chat-im-tool-for-developers) Is anybody out there using a chat or im client that handles source code really well?

    Read the article

  • Is it possible to have a Shared/Static Dependency Property?

    - by Matt H.
    [using VB.NET, but I can easily read C# code in responses] I have a class called QuestionClipboard with ALL shared methods/properties. I previously had a QuesitonClipboard.doesClipboardHaveContent function that returned true/false if there was a Object on my 'clipboard'. I'd prefer to implement a Dependency Property so I can allow this true/false value to participate in data binding. The "GetValue(dp as DependencyProperty)" method requires an object instance, which would mean that my Property CAN'T be shared! Here is what the code would look like in my perfect world... Of course, the word "Shared" before the property declaration renders this code useless. Private Shared clipboardHasContentPropertyKey As DependencyPropertyKey = DependencyProperty.RegisterReadOnly("clipboardHasContent", GetType(Boolean), GetType(QuestionClipboard), _ New PropertyMetadata(False, Nothing, New CoerceValueCallback(AddressOf coerceClipboardHasContent))) Private Shared clipboardHasContentProperty As DependencyProperty = clipboardHasContentPropertyKey.DependencyProperty Public SHARED Property clipboardHasContent As Boolean Get Return GetValue(clipboardHasContentProperty) End Get Set(ByVal value As Boolean) SetValue(value) End Set End Property

    Read the article

  • How to fix: unrecognized selector sent to instance

    - by Matt
    I am having a problem that may be simple to fix, but not simple for me to debug. I simple have a button inside a view in IB; the file's owner is set to the view controller class I am using and when making the connections, everything seems fine, ie. the connector is finding the method I am trying to call etc. however, I am receiving this error: Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '*** -[UIApplication getStarted:]: unrecognized selector sent to instance 0x3d19130' My code is as follows: RootViewController.h @interface RootViewController : UIViewController { IBOutlet UIButton* getStartedButton; } @property (nonatomic, retain) UIButton* getStartedButton; - (IBAction) getStarted: (id)sender; @end RootViewController.m #import "RootViewController.h" #import "SimpleDrillDownAppDelegate.h" @implementation RootViewController @synthesize getStartedButton; - (void)viewDidLoad { [super viewDidLoad]; } - (IBAction) getStarted: (id)sender { NSLog(@"Button Tapped!"); //[self.view removeFromSuperview]; } - (void)dealloc { [getStartedButton release]; [super dealloc]; } @end Seems simple enough...any thoughs?

    Read the article

< Previous Page | 50 51 52 53 54 55 56 57 58 59 60 61  | Next Page >