Search Results

Search found 7418 results on 297 pages for 'argument passing'.

Page 26/297 | < Previous Page | 22 23 24 25 26 27 28 29 30 31 32 33  | Next Page >

  • C++ "delayed" template argument

    - by aaa
    hello. Is there direct way to do the following: template < class > struct f {}; template < class F > void function() { F<int>(); //for example // ? F template <int>(); } function < f >(); I have workaround by using extra class around template struct. I am wondering if it's possible to do so directly. Thanks

    Read the article

  • Passing dynamic parameter to a JavaScript function using innerHTML

    - by user958263
    I am having issues passing a dynamic parameter to a JavaScript function using innerHTML. Included below is the current code that I am using: var name = "test"; frm.innerHtml = '<button name="close" id="close" title="Cancel" type="button" onclick="closeTab('+name+');">Return</button>'; When I debug the code of the CloseTab() function, the parameter specified by the name variable is null. I believe there is a problem with the declaration of the value while modifying the innerHTML property. Any help would be greatly appreciated. Thanks

    Read the article

  • Passing arguments by value or by reference in objective C

    - by Rafael
    Hello, I'm kind of new with objective c and I'm trying to pass an argument by reference but is behaving like it were a value. Do you know why this doesn't work? This is the function: - (void) checkRedColorText:(UILabel *)labelToChange { NSComparisonResult startLaterThanEnd = [startDate compare:endDate]; if (startLaterThanEnd == NSOrderedDescending){ labelToChange.textColor = [UIColor redColor]; } else{ labelToChange.textColor = [UIColor blackColor]; } } And this the call: UILabel *startHourLabel; (this is properly initialized in other part of the code) [self checkRedColorText:startHourLabel]; Thanks for your help

    Read the article

  • Passing context between templatetags, django

    - by Kasper Gadensgaard
    Hi overflowers, I am using django to create a web-application. I have created a template in where I load a templatetag. In this templatetag i load another templatetag. From the template I pass context to the first templatetag, but the context is not available from the second templatetag (inside the first templatetag) - see below. I hope this makes sense, and that one of you have the answer. Thanks in advance Regards Kasper Gadensgaard Template snippit: {% load templatetags %} {% some_tag argument %} some_tag Templatetag: {% load templatetags %} {% some_other_tag another_argument %} some_other_tag Templatetag: In this templatetag i am trying to access context to get user info i.e. using request = context['request'] request.user

    Read the article

  • Passing javascript objects as function arguments

    - by Prashant
    Hello all I want to pass a javascript object (JSON) as an argument to another function. But i am getting following error: missing ] after element list the function is called on onclick event of href like "<a href='javascript:void(0);' onclick='javascript:openTab("+ sTab +");'>"+ sTab['SavedTab']['title'] +"</a><br/>"; When i pass whole value : sTab['SavedTab']['title'] , it works fine but i want to pass whole object, not just single value out of it. Please help me out. Thanks.

    Read the article

  • Passing constructor arguments when using StructureMap

    - by Mosh
    Hello, I'm using StructureMap for my DI. Imagine I have a class that takes 1 argument like: public class ProductProvider : IProductProvider { public ProductProvider(string connectionString) { .... } } I need to specify the "connectionString at run-time when I get an instance of IProductProvider. I have configured StructureMap as follows: ForRequestedType<IProductProvider>.TheDefault.Is.OfConcreteType<ProductProvider>(). WithCtorArgument("connectionString"); However, I don't want to call EqualTo("something...") method here as I need some facility to dynamically specify this value at run-time. My question is: how can I get an instance of IProductProvider by using ObjectFactory? Currently, I have something like: ObjectFactory.GetInstance<IProductProvider>(); But as you know, this doesn't work... Any advice would be greatly appreciated.

    Read the article

  • Boost signals and passing class method

    - by Ockonal
    Hello, I've defined some signal: typedef boost::signals2::signal<void (int temp)> SomeSig; typedef SomeSig::slot_type SomeSigType; I have some class: class SomeClass { SomeClass() { SomeSig.connect(&SomeClass::doMethod); } void doMethod(const SomeSig &slot); }; And got a lot of errors: error: ‘BOOST_PP_ENUM_SHIFTED_PARAMS_M’ was not declared in this scope error: ‘T’ was not declared in this scope error: a function call cannot appear in a constant-expression error: a function call cannot appear in a constant-expression error: template argument 1 is invalid error: ‘BOOST_SIGNALS2_MISC_STATEMENT’ has not been declared error: expected identifier before ‘~’ token error: expected ‘)’ before ‘~’ token error: expected ‘;’ before ‘~’ token

    Read the article

  • Passing arguments and values form HTML to jQuery (events)

    - by Jaroslav Moravec
    What is the practice to pass arguments from HTML to jQuery events function. For example getting id of row from db: <tr class="jq_killMe" id="thisItemId-id"> ... </tr> and jQuery: $(".jq_killMe").click(function () { var tmp = $(this).attr('id).split("-"); var id = tmp[0] // ... } What's the best practise, if I want to pass more than one argument? Is it better not to use jQuery? For example: <tr onclick="killMe('id')"> ... </tr> I didn't find the answer on my question, I will be glad even for links. Thanks.

    Read the article

  • Passing arguments via header in php

    - by Prasoon Saurav
    I have got 3 files with me. login.html login_check.php welcome.php In login.html when the username and password is entered and submit button is clicked login_check.php checks whether the username entry is in the database on the basis of $_POST['username'] and some SQL querry. Now I have put the following code at the bottom of login_check.php login_check.php header('Location:welcome.php') But I want to pass $_POST['username'] from login_check.php to welcome.php so that I can make use of $_POST['username'] in my welcome page. Is there any way by which I can pass an argument like in the above case?

    Read the article

  • C++ Passing `this` into method by reference

    - by David
    I have a class constructor that expects a reference to another class object to be passed in as an argument. I understand that references are preferable to pointers when no pointer arithmetic will be performed or when a null value will not exist. This is the header declaration of the constructor: class MixerLine { private: MIXERLINE _mixerLine; public: MixerLine(const MixerDevice& const parentMixer, DWORD destinationIndex); ~MixerLine(); } This is the code that calls the constructor (MixerDevice.cpp): void MixerDevice::enumerateLines() { DWORD numLines = getDestinationCount(); for(DWORD i=0;i<numLines;i++) { MixerLine mixerLine( this, i ); // other code here removed } } Compilation of MixerDevice.cpp fails with this error: Error 3 error C2664: 'MixerLine::MixerLine(const MixerDevice &,DWORD)' : cannot convert parameter 1 from 'MixerDevice *const ' to 'const MixerDevice &' But I thought pointer values could be assigned to pointers, e.g. Foo* foo = new Foo(); Foo& bar = foo;

    Read the article

  • Django - Passing arguments to models through ForeignKey attributes

    - by marshall
    I've got a class like this: class Image (models.Model): ... sizes = ((90,90), (300,250)) def resize_image(self): for size in sizes: ... and another class like this: class SomeClassWithAnImage (models.Model): ... an_image = models.ForeignKey(Image) what i'd like to do with that class is this: class SomeClassWithAnImage (models.Model): ... an_image = models.ForeignKey(Image, sizes=((90,90), (150, 120))) where i'm can specify the sizes that i want the Image class to use to resize itself as a argument rather than being hard coded on the class. I realise I could pass these in when calling resize_image if that was called directly but the idea is that the resize_image method is called automatically when the object is persisted to the db. if I try to pass arguments through the foreign key declaration like this i get an error straight away. is there an easy / better way to do this before I begin hacking down into django?

    Read the article

  • passing parameter to dowork?

    - by safi
    How can i Pass parameter to background_DoWork? public void bgw1_DoWork(Object sender, DoWorkEventArgs e) { make_zip_file argumentest = e.Argument as make_zip_file; Thread.Sleep(100); argumentest.return_path = argumentest.Makezipfile(files, IsOriginal); e.Result = argumentest; } i need to pass files,isOrginal parameter...? i am calling this method: public string run_async() { bgw1.DoWork += bgw1_DoWork; bgw1.RunWorkerCompleted += bgw1_RunWorkerCompleted; make_zip_file mzf2 = new make_zip_file(); bgw1.RunWorkerAsync(); return return_path; }

    Read the article

  • Uploadify: Passing a form's ID as a parameter with scriptData

    - by Matt
    I need the ability to have multiple upload inputs on one page (potentially hundreds) using Uploadify. The upload PHP file will be renaming the uploaded file based on the ID of the input button used to submit it, so it will need that ID. Since I will be having hundreds of upload buttons on one page, I wanted to create a universal instantiation, so I did this using the class of the forms rather than the ID of the forms. However, when one of the inputs is clicked, I would like to pass the ID of that input as scriptData to the PHP. This is not working; PHP says 'formId' is undefined. Is there a good way get the ID attribute of the form input being used, and passing it to the upload PHP? Or is there a completely different and better method of accomplishing this? Thank you in advance!! <script type="text/javascript"> $(document).ready(function() { $('.uploady').uploadify({ 'uploader' : '/uploadify/uploadify.swf', 'script' : '/uploadify/uploadify.php', 'cancelImg' : '/uploadify/cancel.png', 'folder' : '/uploadify', 'auto' : true, // LINE IN QUESTION 'scriptData' : {'formId':$(this).attr('id')} }); }); </script> </head> The inputs look like this: <input id="file_upload1" class="uploady" name="file_upload" type="file" /> <input id="file_upload2" class="uploady" name="file_upload" type="file" /> <input id="file_upload3" class="uploady" name="file_upload" type="file" />

    Read the article

  • DataContract Known Types - passing array

    - by Erup
    Im having problems when passing an generic List, trough a WCF operation. In this case, there is a List of int. The example 4 is described here in MSDN. Note that in MSDN sample, is described: // This will serialize and deserialize successfully because the generic List is equivalent to int[], which was added to known types. Above, is the DataContract: [DataContract] [KnownType(typeof(int[]))] [KnownType(typeof(object[]))] public class AccountData { [DataMember] public object accNumber1; [DataMember] public object accNumber2; [DataMember] public object accNumber3; [DataMember] public object accNumber4; } In client side, Im calling the operation like this: DataTransfer.Service.AccountData data = new DataTransfer.Service.AccountData() { accNumber1 = 100, accNumber2 = new int[100], accNumber3 = new List<int>(), accNumber4 = new ArrayList() }; cService.AddAccounts(data); Also, here is the decorations of the generated AccountData obj (WCF proxy): [System.Diagnostics.DebuggerStepThroughAttribute()] [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Runtime.Serialization", "3.0.0.0")] [System.Runtime.Serialization.DataContractAttribute(Name="AccountData", Namespace="http://schemas.datacontract.org/2004/07/DataTransfer.Service")] [System.SerializableAttribute()] [System.Runtime.Serialization.KnownTypeAttribute(typeof(DataTransfer.Client.CustomerServiceReference.PurchaseOrder))] [System.Runtime.Serialization.KnownTypeAttribute(typeof(DataTransfer.Client.CustomerServiceReference.Customer))] [System.Runtime.Serialization.KnownTypeAttribute(typeof(int[]))] [System.Runtime.Serialization.KnownTypeAttribute(typeof(object[]))]

    Read the article

  • Passing a LINQ DataRow Reference in a GridView's ItemTemplate

    - by Bob Kaufman
    Given the following GridView: <asp:GridView runat="server" ID="GridView1" AutoGenerateColumns="false" DataKeyNames="UniqueID" OnSelectedIndexChanging="GridView1_SelectedIndexChanging" > <Columns> <asp:BoundField HeaderText="Remarks" DataField="Remarks" /> <asp:TemplateField HeaderText="Listing"> <ItemTemplate> <%# ShowListingTitle( ( ( System.Data.DataRowView ) ( Container.DataItem ) ).Row ) %> </ItemTemplate> </asp:TemplateField> <asp:BoundField HeaderText="Amount" DataField="Amount" DataFormatString="{0:C}" /> </Columns> </asp:GridView> which refers to the following code-behind method: protected String ShowListingTitle( DataRow row ) { Listing listing = ( Listing ) row; return NicelyFormattedString( listing.field1, listing.field2, ... ); } The cast from DataRow to Listing is failing (cannot convert from DataRow to Listing) I'm certain the problem lies in what I'm passing from within the ItemTemplate, which is simply not the right reference to the current record from the LINQ to SQL data set that I've created, which looks like this: private void PopulateGrid() { using ( MyDataContext context = new MyDataContext() ) { IQueryable < Listing > listings = from l in context.Listings where l.AccountID == myAccountID select l; GridView1.DataSource = listings; GridView1.DataBind(); } }

    Read the article

  • Simple .HTACCESS Passing Variables

    - by Willie Murray III
    Let's says I have a classifieds site which has a URL structure similar to the one which I have listed below: Ex. http://takarat.com/openclassifieds/?category=iphone&location=tennessee This is what shows up when I click "tennessee" as the location and then click on "iphone" as the category. Now let's say this site has a search box and I wanted a URL which comes up after using this search box to show up as opposed to the previous URL. Let's say that whenever I search for the word "iphone" while WITHIN the iphone CATEGORY the following link shows up: Iphone SEARCH Ex. http://takarat.com/openclassifieds/?s=iphone&category=iphone&location=tennessee Ok, I want THAT iphone SEARCH to come up whenever anyone clicks Tennessee Iphone..How would I do this [by the way, I want this to be dynamic so that I can use the code for different combinations of locations and products etc..I want the code to use the CATEGORY name to conduct the search basically]? I believe that this will involve "Passing varibles" from the original link... I am new to programming so I may have my terminology wrong. Any help would be appreciated. Thanks in advance. TURN THIS: takarat.com/openclassifieds/?category=iphone[var 1]&location=tennessee[var2] INTO THIS: takarat.com/openclassifieds/?s=iphone[var 1]&category=iphone[var 1]&location=tennessee[var2]

    Read the article

  • Passing two variables to separate table...associations problem

    - by bgadoci
    I have developed an application and I seem to be having some problems with my associations. I have the following: class User < ActiveRecord::Base acts_as_authentic has_many :questions, :dependent => :destroy has_many :sites , :dependent => :destroy end Questions class Question < ActiveRecord::Base has_many :sites, :dependent => :destroy has_many :notes, :through => :sites belongs_to :user end Sites (think of this as answers to questions) class Site < ActiveRecord::Base acts_as_voteable :vote_counter => true belongs_to :question belongs_to :user has_many :notes, :dependent => :destroy has_many :likes, :dependent => :destroy has_attached_file :photo, :styles => { :small => "250x250>" } validates_presence_of :name, :description end When a Site (answer) is created I am successfully passing the question_id to the Sites table but I can't figure out how to also pass the user_id. Here is my SitesController#create def create @question = Question.find(params[:question_id]) @site = @question.sites.create!(params[:site]) respond_to do |format| format.html { redirect_to(@question) } format.js end end

    Read the article

  • Passing row from UIPickerView to integer CoreData attribute

    - by Gordon Fontenot
    I'm missing something here, and feeling like an idiot about it. I'm using a UIPickerView in my app, and I need to assign the row number to a 32-bit integer attribute for a Core Data object. To do this, I am using this method: -(void)pickerView:(UIPickerView *)pickerView didSelectRow:(NSInteger)row inComponent:(NSInteger)component { object.integerValue = row; } This is giving me a warning: warning: passing argument 1 of 'setIntegerValue:' makes pointer from integer without a cast What am I mixing up here? --EDIT 1-- Ok, so I can get rid of the errors by changing the method to do the following: NSNumber *number = [NSNumber numberWithInteger:row]; object.integerValue = rating; However, I still get a value of 0 for object.integerValue if I use NSLog to print it out. object.integerValue has a max value of 5, so I print out number instead, and then I'm getting a number above 62,000,000. Which doesn't seem right to me, since there are 5 rows. If I NSLog the row variable, I get a number between 0 and 5. So why do I end up with a completely different number after casting the number to NSNumber?

    Read the article

  • Passing an instance variable through RJS?

    - by Elliot
    Hey guys here is my code (roughly): books.html.erb <% @books.each do |book| %> <% @bookid = book.id %> <div id="enter_stuff"> <%= render "input", :bookid => @bookid %> </div> <%end%> _input.html.erb <% @book = Book.find_by_id(@bookid) %> <strong>your book is: <%=h @book.name %></strong> create.rjs page.replace_html :enter_stuff, :partial => 'input', :object => @bookid The problem here is that only create.js doesn't seem to work (though, if instead of passing the partial I passed "..." it does work, so I know its that there are instance variables in the partial that aren't being reset. Any ideas?) So the final question, is how do I pass an instance variable to a partial through the create.rjs file? p.s. I know I will have duplicate div IDs, I'm not worrying about that for now though. Best, Elliot

    Read the article

  • Passing Key-Value pair to a COM method in C#

    - by Sinnerman
    Hello, I have the following problem: I have a project in C# .Net where I use a third party COM component. So the problem is that the above component has a method, which takes a string and a number of key-value pairs as arguments. I already managed to call that method through JavaScript like that: var srcName srcName = top.cadView.addSource( 'Database', { driver : 'Oracle', host : '10.10.1.123', port : 1234, database : 'someSID', user : 'someuser', password : 'somepass' } ) if ( srcName != '' ) { ... } ... and it worked perfectly well. However I have no idea how to do the same using C#. I tried passing the pairs as Dictionary and Struct/Class but it throws me a "Specified cast is not valid." exception. I also tried using Hashtable like that: Hashtable args = new Hashtable(); args.Add("driver", "Oracle"); args.Add("host", "10.10.1.123"); args.Add("port", 1234); args.Add("database", "someSID"); args.Add("user", "someUser"); args.Add("password", "samePass"); String srcName = axCVCanvas.addSource("Database", args); and although it doesn't throw an exception it still won't do the job, writing me in a log file [ Error] [14:38:33.281] Cad::SourceDB::SourceDB(): missing parameter 'driver' Any help will be appreciated, thanks.

    Read the article

  • Passing arguments to commandline with directories having spaces

    - by superstar
    Hi guys, I am making a system call from perl for ContentCheck.pl and passing parameters with directories (having spaces). So I pass them in quotes, but they are not being picked up in the ContentCheck.pl file Random.pm my $call = "$perlExe $contentcheck -t $target_path -b $base_path -o $output_path -s $size_threshold"; print "\ncall: ".$call."\n"; system($call); Contentcheck.pl use vars qw($opt_t $opt_b $opt_o $opt_n $opt_s $opt_h); # initialize getopts('t:b:o:n:s:h') or do{ print "*** Error: Invalid command line option. Use option -h for help.\a\n"; exit 1}; if ($opt_h) {print $UsagePage; exit; } my $tar; if ($opt_t) {$tar=$opt_t; print "\ntarget ".$tar."\n";} else { print " in target"; print "*** Error: Invalid command line option. Use option -h for help.\a\n"; exit 1;} my $base; if ($opt_b) {$base=$opt_b;} else { print "\nin base\n"; print "*** Error: Invalid command line option. Use option -h for help.\a\n"; exit 1;} This is the output in the commandline call: D:\tools\PacketCreationTool/bin/perl/winx64/bin/perl.exe D:/tools/PacketCr eationTool/scripts/ContentCheck.pl -t "C:/Documents and Settings/pkkonath/Deskto p/saved/myMockName.TGZ" -b "input file/myMockName.TGZ" -o myMockName.validate -s 10 target C:/Documents in base *** Error: Invalid command line option. Use option -h for help. Any suggestions are welcome! Thanks.

    Read the article

  • passing values between forms (winforms)

    - by dnkira
    Hello. Vierd behaviar when passing values to and from 2nd form. ParameterForm pf = new ParameterForm(testString); works ParameterForm pf = new ParameterForm(); pf.testString="test"; doesn't (testString defined as public string) maybe i'm missing something? anyway i'd like to make 2nd variant work properly, as for now - it returns null object reference error. thanks for help. posting more code here: calling Button ParametersButton = new Button(); ParametersButton.Click += delegate { ParameterForm pf = new ParameterForm(doc.GetElementById(ParametersButton.Tag.ToString())); pf.ShowDialog(this); pf.test = "test"; pf.Submit += new ParameterForm.ParameterSubmitResult(pf_Submit); }; definition and use public partial class ParameterForm : Form { public string test; public XmlElement node; public delegate void ParameterSubmitResult(object sender, XmlElement e); public event ParameterSubmitResult Submit; public void SubmitButton_Click(object sender, EventArgs e) { Submit(this,this.node); Debug.WriteLine(test); } } result: Submit - null object reference test - null object reference

    Read the article

  • Passing Object to Service in WCF

    - by hgulyan
    Hi, I have my custom class Customer with its properties. I added DataContract mark above the class and DataMember to properties and it was working fine, but I'm calling a service class's function, passing customer instance as parameter and some of my properties get 0 values. While debugging I can see my properties values and after it gets to the function, some properties' values are 0. Why it can be so? There's no code between this two actions. DataContract mark workes fine, everything's ok. Any suggestions on this issue? I tried to change ByRef to ByVal, but it doesn't change anything. Why it would pass other values right and some of integer types just 0? Maybe the answer is simple, but I can't figure it out. Thank You. <DataContract()> Public Class Customer Private Type_of_clientField As Integer = -1 <DataMember(Order:=1)> Public Property type_of_client() As Integer Get Return Type_of_clientField End Get Set(ByVal value As Integer) Type_of_clientField = value End Set End Property End Class <ServiceContract(SessionMode:=SessionMode.Allowed)> <DataContractFormat()> Public Interface CustomerService <OperationContract()> Function addCustomer(ByRef customer As Customer) As Long End Interface type_of_client properties value is 6 before I call addCustomer function. After it enters that function the value is 0. UPDATE: The issue is in instance creating. When I create an instance of a class on client side, that is stored on service side, some of my properties pass 0 or nothing, but when I call a function of a service class, that returns a new instance of that class, it works fine. What's is the difference? Could that be serialization issue?

    Read the article

  • Passing array values in an HTTP request in .NET

    - by Zarjay
    What's the standard way of passing and processing an array in an HTTP request in .NET? I have a solution, but I don't know if it's the best approach. Here's my solution: <form action="myhandler.ashx" method="post"> <input type="checkbox" name="user" value="Aaron" /> <input type="checkbox" name="user" value="Bobby" /> <input type="checkbox" name="user" value="Jimmy" /> <input type="checkbox" name="user" value="Kelly" /> <input type="checkbox" name="user" value="Simon" /> <input type="checkbox" name="user" value="TJ" /> <input type="submit" value="Submit" /> </form> The ASHX handler receives the "user" parameter as a comma-delimited string. You can get the values easily by splitting the string: public void ProcessRequest(HttpContext context) { string[] users = context.Request.Form["user"].Split(','); } So, I already have an answer to my problem: assign multiple values to the same parameter name, assume the ASHX handler receives it as a comma-delimited string, and split the string. My question is whether or not this is how it's typically done in .NET. What's the standard practice for this? Is there a simpler way to grab the multiple values than assuming that the value is comma-delimited and calling Split() on it? Is this how arrays are typically passed in .NET, or is XML used instead? Does anyone have any insight on whether or not this is the best approach?

    Read the article

  • Passing a URL as a URL parameter

    - by Andrea
    I am implementing OpenId login in a CakePHP application. At a certain point, I need to redirect to another action, while preserving the information about the OpenId identity, which is itself a URL (with GET parameters), for instance https://www.google.com/accounts/o8/id?id=31g2iy321i3y1idh43q7tyYgdsjhd863Es How do I pass this data? The first attempt would be function openid() { ... $this->redirect(array('controller' => 'users', 'action' => 'openid_create', $openid)); } but the obvious problem is that this completely messes up the way CakePHP parses URL parameters. I'd need to do either of the following: 1) encode the URL in a CakePHP friendly manner for passing it, and decoding it after that, or 2) pass the URL as a POST parameter but I don't know how to do this. EDIT: In response to comments, I should be more clear. I am using the OpenId component, and I have a working OpenId implementation. What I need to do is to link OpenId with an existing user system. When a new user logs in via OpenId, I ask for more details, and then create a new user with this data. The problem is that I have to keep the OpenId URL throughout this process.

    Read the article

< Previous Page | 22 23 24 25 26 27 28 29 30 31 32 33  | Next Page >