Search Results

Search found 15081 results on 604 pages for 'passing by reference'.

Page 71/604 | < Previous Page | 67 68 69 70 71 72 73 74 75 76 77 78  | Next Page >

  • passing variable from vbscript to batch file

    - by sushant
    i am using vbscript to call a batch file. my script looks like: dim shell set shell=createobject("wscript.shell") shell.run "a.bat" set shell=nothing my batch file is simple and looks like: D: cd D:\d winzip32.exe -min -a D:\a i want to pass a variable from a script to the batch file. lets say the destination folder. how do i do that? any help is very much appreciated.

    Read the article

  • Passing domain name to PayPal

    - by ilhan
    I'm trying to sell something to domain owners. I need to know their domain names. Before the payment procedure I'll ask their domain names in my web site, I'll store the data in the cookies or the url, then I want to pass the data (domain name) to the PayPal so that I'll know who paid for what domain name. I know PHP and HTML in advanced level but I don't know how to pass the data to PayPal. How I'll do that? Thanks in advance!

    Read the article

  • Haskell type classes and type families (cont'd)

    - by Giuseppe Maggiore
    I need some help in figuring a compiler error which is really driving me nuts... I have the following type class: infixl 7 --> class Selectable a s b where type Res a s b :: * (-->) :: (CNum n) => (Reference s a) -> (n,(a->b),(a->b->a)) -> Res a s b which I instance twice. First time goes like a charm: instance Selectable a s b where type Res a s b = Reference s b (-->) (Reference get set) (_,read,write) = (Reference (\s -> let (v,s') = get s in (read v,s')) (\s -> \x -> let (v,s') = get s v' = write v x (_,s'') = set s' v' in (x,s''))) since the type checker infers (-->) :: Reference s a -> (n,a->b,a->b->a) -> Reference s b and this signature matches with the class signature for (--) since Res a s b = Reference s b Now I add a second instance and everything breaks: instance (Recursive a, Rec a ~ reca) => Selectable a s (Method reca b c) where type Res a s (Method reca b c) = b -> Reference s c (-->) (Reference get set) (_,read,write) = \(x :: b) -> from_constant( Constant(\(s :: s)-> let (v,s') = get s :: (a,s) m = read v ry = m x :: Reference (reca) c (y,v') = getter ry (cons v) :: (c,reca) v'' = elim v' (_,s'') = set s' v'' in (y,s''))) :: Reference s c the compiler complains that Couldn't match expected type `Res a s (Method reca b c)' against inferred type `b -> Reference s c' The lambda expression `\ (x :: b) -> ...' has one argument, which does not match its type In the expression: \ (x :: b) -> from_constant (Constant (\ (s :: s) -> let ... in ...)) :: Reference s c In the definition of `-->': --> (Reference get set) (_, read, write) = \ (x :: b) -> from_constant (Constant (\ (s :: s) -> ...)) :: Reference s c reading carefully the compiler is telling me that it has inferred the type of (--) thusly: (-->) :: Reference s a -> (n,a->(Method reca b c),a->(Method reca b c)->a) -> (b -> Reference s c) which is correct since Res a s (Method reca b c) = b -> Reference s c but why can't it match the two definitions? Sorry for not offering a more succint and standalone example, but in this case I cannot figure how to do it...

    Read the article

  • .NET (C#) passing messages from a custom control to main application

    - by zer0c00l
    A custom windows form control named 'tweet' is in a dll. The custom control has couple of basic controls to display a tweet. I add this custom control to my main application. This custom control has a button named "retweet", when some user clicks this "retweet" button, i need to send some message to the main application. Unfortunately the this tweet control has no idea about this main application (both or in their own namespaces) How can i send messages from this custom control to the main application?

    Read the article

  • passing an "unknown enumeration" to a method

    - by firoso
    I'm currently trying to make a class that can register strings as identifiers and accociate them with different types of Enumerations, these enumerations are being evaluated only in so much that I am ensuring that when it's used, that the parameter passed to broadcast (messageType) is an instance of the associated Enum Type. This would work something like this: Diagnostics.RegisterIdentifier("logger", typeof(TestEnum)); Diagnostics.Broadcast("logger", TestEnum.Info, null, "Hello World", null); here's the code I currently have, I need to be able to verify that messageTypesEnum is contained in messageTypesFromIdentifier. private static Dictionary<string, Type> identifierMessageTypeMapping = new Dictionary<string, Type>(); private static List<IListener> listeners = new List<IListener>(); public static void RegisterIdentifier(string identifier, Type messageTypesEnum) { if (messageTypesEnum.BaseType.FullName == "System.Enum") { identifierMessageTypeMapping.Add(identifier, messageTypesEnum); } else { throw new ArgumentException("Expected type of messageTypesEnum to derive from System.Enum", "messageTypesEnum"); } } public static void Broadcast(string identifier, object messageType, string metaIdentifier, string message, Exception exception) { if (identifierMessageTypeMapping.ContainsKey(identifier)) { Type messageTypesFromIdentifier = identifierMessageTypeMapping[identifier]; foreach (var listener in listeners) { DiagnosticsEvent writableEvent = new DiagnosticsEvent(identifier, messageType, metaIdentifier, message, exception); listener.Write(writableEvent); } } }

    Read the article

  • passing values from exe to dll c++

    - by jello
    so I have this executable which takes values from a joystick and outputs those values (i have the code). I want to pass those values to a dll, which is read in a program (i have the code for the dll). how can I pass those values from the exe to the dll?

    Read the article

  • Sinatra not passing header with redirect

    - by emson
    Hi All I have a simple Sinatra proxy, which when an endpoint is called, will redirect to another endpoint on the same Sinatra proxy. When I make a request with a header, the proxy doesn't seem to pass this header through to the second endpoint when the request redirects in the first. This is my code: get '/first' do # get the header from the request username = env['HTTP_USERNAME'] # set the header for the response response['username'] = username redirect '/second' end get '/second' do # This doesn't exist when redirected from /first puts env['HTTP_USERNAME'] # Here is a list of all headers env.each_key do |key| puts "KEY: #{key} VALUE: #{env[key]}" unless key.nil? end "DONE" end Any tips would be greatly appreciated. Thanks

    Read the article

  • detecting object-reference duplication across JavaScript files

    - by AnC
    I have a number of files with contents like this: function hello() { ... element1.text = foo.locale.lorem; element2.text = foo.locale.ipsum; ... elementn.text = foo.locale.whatever; ... } function world() { ... var label = bar.options.baz.blah; var toggle = bar.options.baz.use_toggle; ... } This could be written more efficiently, and also be more readable, by creating a shortcut to the locale object: function hello() { var loc = foo.locale; ... element1.text = loc.lorem; element2.text = loc.ipsum; ... elementn.text = loc.whatever; ... } function world() { var options = bar.options.baz; ... var label = options.blah; var toggle = options.use_toggle; ... } Is there a simple way to detect occurrences of such duplication for any arbitrary object (it's not always as simple as "locale", or foo.something)? Basically, I wanna know where lengthy object references appear two or more times within a function. Thanks!

    Read the article

  • Help passing _POST Form Data PHP

    - by Mikey1980
    I apologize in advance, I am a PHP noob! I have form with some hidden fields. I need the values to POST to "submit_rma.php" so that they're not missing from the db--I need $qty, $estmate_id and $rma_type. The rest of the fields are just displaying data for the user and are readonly. Currently I only get value from the qty text field. Is there any easier way to pass these values? URL is out of the question due to security issues. <form method="post" action="submit_rma.php";> <table> <tr> <td> Quantity </td> <td> <input type="text" name="qty" value="<?php echo $qty ?>" size="1"/><br/> </td> </tr> <tr> <td> Part # </td> <td> <input type="text" name="" value="<?php echo $model ?>" size="8" READONLY/><br/> </td> </tr> <tr> <td> Description </td> <td> <input type="text" name="" value="<?php echo $name_EN ?>" size="50" READONLY/><br/> </td> </tr> <tr> <td> Paid Date </td> <td> <input type="text" name="" value="<?php echo $sold_date ?>" size="6" READONLY/><br/> </td> </tr> <tr> <td> Amount Each </td> <td> <input type="text" name="" value="<?php echo $dealer_price ?>" size="8" READONLY/> </td> </tr> </table> <input type="hidden" name="estmate_id" value="<?php echo $estmate_id ?>"> <input type="hidden" name="rma_type" value="Short Shipped"> <input type="submit" name="submit";"> </form>

    Read the article

  • Objective-C Passing a variable to another IBAction

    - by StuR
    This works fine: NSString *myVariable; - (IBAction) doFirstAction { myVariable = @"123456789"; } - (IBAction) doSecondAction { NSLog(@"%@",myVariable); } However, if I do this (substituting the @"123456789" for some code which returns the same value ie "123456789") I cannot access the value in doSecondAction. NSString *myVariable; - (IBAction) doFirstAction { myVariable = [imageNode getAttributeName:@"value"]; } - (IBAction) doSecondAction { NSLog(@"%@",myVariable); } Any clue as to why I cant access myVariable outside of doFirstAction?

    Read the article

  • printf not passing correct Hex Address to stack

    - by kriss
    I have a hickup in using printf . I am on ubuntu 10.04. Basically i have a C program asking for some input and then prints it back. It is OK for printing something after inputing. I tried to insert some Hex Address to Stack by following format:- printf "hello world!\x12\x23\x34" | ./input1 But i don't know what is the problem. If i give only string beyond 12 bytes it overwrites BUT If I give hex address(through printf), it doesn't overwrite on return address. Instead it stores some other thing. Could anyone help??? I can't proceed further becoz of this. Thanks in advance

    Read the article

  • Passing a WHERE clause for a Linq-to-Sql query as a parameter

    - by Mantorok
    Hi all This is probably pushing the boundaries of Linq-to-Sql a bit but given how versatile it has been so far I thought I'd ask. I have 3 queries that are selecting identical information and only differ in the where clause, now I know I can pass a delegate in but this only allows me to filter the results already returned, but I want to build up the query via parameter to ensure efficiency. Here is the query: from row in DataContext.PublishedEvents join link in DataContext.PublishedEvent_EventDateTimes on row.guid equals link.container join time in DataContext.EventDateTimes on link.item equals time.guid where row.ApprovalStatus == "Approved" && row.EventType == "Event" && time.StartDate <= DateTime.Now.Date.AddDays(1) && (!time.EndDate.HasValue || time.EndDate.Value >= DateTime.Now.Date.AddDays(1)) orderby time.StartDate select new EventDetails { Title = row.EventName, Description = TrimDescription(row.Description) }; The code I want to apply via a parameter would be: time.StartDate <= DateTime.Now.Date.AddDays(1) && (!time.EndDate.HasValue || time.EndDate.Value >= DateTime.Now.Date.AddDays(1)) Is this possible? I don't think it is but thought I'd check out first. Thanks

    Read the article

  • vb.net session variable passing "space" from one page to another

    - by iuret
    i have 2 aspx webpages with vb.net code. On the first page, I have a text box, on first page that says "Enter Hobby", but its not a required textbox. So if the user clicks submit, it'll load up the second page. Now in the second page i have textbox "hobby" which has maxlength = 10. and in the vb.net code i have hobby.text = session("hobby"). if the user doesnt fill up hobby in first page, the session comes with 10 "spaces" since maxlength is 10. I tried hobby.text = TRIM(session("hobby"), but nothing happens. Any idea how i can lose the spaces if nothing is inputted?

    Read the article

  • Validating parameters according to a fixed reference

    - by James P.
    The following method is for setting the transfer type of an FTP connection. Basically, I'd like to validate the character input (see comments). Is this going overboard? Is there a more elegant approach? How do you approach parameter validation in general? Any comments are welcome. public void setTransferType(Character typeCharacter, Character optionalSecondCharacter) throws NumberFormatException, IOException { // http://www.nsftools.com/tips/RawFTP.htm#TYPE // Syntax: TYPE type-character [second-type-character] // // Sets the type of file to be transferred. type-character can be any // of: // // * A - ASCII text // * E - EBCDIC text // * I - image (binary data) // * L - local format // // For A and E, the second-type-character specifies how the text should // be interpreted. It can be: // // * N - Non-print (not destined for printing). This is the default if // second-type-character is omitted. // * T - Telnet format control (<CR>, <FF>, etc.) // * C - ASA Carriage Control // // For L, the second-type-character specifies the number of bits per // byte on the local system, and may not be omitted. final Set<Character> acceptedTypeCharacters = new HashSet<Character>(Arrays.asList( new Character[] {'A','E','I','L'} )); final Set<Character> acceptedOptionalSecondCharacters = new HashSet<Character>(Arrays.asList( new Character[] {'N','T','C'} )); if( acceptedTypeCharacters.contains(typeCharacter) ) { if( new Character('A').equals( typeCharacter ) || new Character('E').equals( typeCharacter ) ){ if( acceptedOptionalSecondCharacters.contains(optionalSecondCharacter) ) { executeCommand("TYPE " + typeCharacter + " " + optionalSecondCharacter ); } } else { executeCommand("TYPE " + typeCharacter ); } } }

    Read the article

  • Passing extended parameter into Sql 2008 connection string

    - by Pita.O
    Hi, I have a need to support extensive auditing capabilities for a system backing into Sql Server 2008. Since I plan to use LINQ (with no Stored Procs), the database would be a clean, zero contact data repository. However, I need to pratically record a snapshot of every change that happens in the db. So, I thought I should use triggers. But then, I need a user id for the particular user (not the connection string user id) to flow through into the database. In oracle, I should have been able to set up a PROXY USER and the trigger would be able to pick that up. Last I checked, there was no proxy user concept in Sql Server. Does anyone know if there's any extender property I can use to flow through my authenticated user name? ps: I don't mind the impact on connection pooling (if any). Thanks. P

    Read the article

  • returning reference to a vector from a method and using its public members

    - by memC
    dear experts, I have a vector t_vec that stores references to instances of class Too. The code is shown below. In the main , I have a vector t_vec_2 which has the same memory address as B::t_vec. But when I try to access t_vec_2[0].val1 it gives error val1 not declared. Could you please point out what is wrong? Also, if you know of a better way to return a vector from a method, please let me know! Thanks in advance. class Too { public: Too(); ~Too(){}; int val1; }; Too::Too(){ val1 = 10; }; class B { public: vector<Too*> t_vec; Too* t1; vector<Too*>& get_tvec(); B(){t1 = new Too();}; ~B(){delete t1;}; }; vector<Too*>& B::get_tvec(){ t_vec.push_back(t1); return t_vec; } int main(){ B b; b = B(); vector<Too*>& t_vec_2 = b.get_tvec(); // Getting error std::cout << "\n val1 = " << t_vec_2[0].val1; return 0; }

    Read the article

  • PostgreSQL storing paths for reference in scripts

    - by Brian D.
    I'm trying to find the appropriate place to store a system path in PostgreSQL. What I'm trying to do is load values into a table using the COPY command. However, since I will be referring to the same file path regularly I want to store that path in one place. I've tried creating a function to return the appropriate path, but I get a syntax error when I call the function in the COPY command. I'm not sure if this is the right way to go about it, but I'll post my code anyway. COPY command: COPY employee_scheduler.countries (code, name) FROM get_csv_path('countries.csv') WITH CSV; Function Definition: CREATE OR REPLACE FUNCTION employee_scheduler.get_csv_path(IN file_name VARCHAR(50)) RETURNS VARCHAR(250) AS $$ DECLARE path VARCHAR(200) := E'C:\\Brian\\Work\\employee_scheduler\\database\\csv\\'; file_path VARCHAR(250) := ''; BEGIN file_path := path || file_name; RETURN file_path; END; $$ LANGUAGE plpgsql; If anyone has a different idea on how to accomplish this I'm open to suggestions. Thanks for any help!

    Read the article

  • Passing array to another class - Objective C

    - by Darko Hebrang
    I manage to pass the following array from MessagesTableViewController.m to arraySelectedCategory in another class called MessageDetailViewController.m: self.messageDetailViewController.arraySelectedCategory = [[NSMutableArray alloc] initWithObjects:@"Value 1",@"Value 2", @"Value 3", nil]; but how do I hand over an array stored in: NSMutableArray *categories; self.messageDetailViewController.arraySelectedCategory = ????? Thanks!

    Read the article

  • Passing list of values to django view via jQuery ajax call

    - by finspin
    I'm trying to pass a list of numeric values (ids) from one web page to another with jQuery ajax call. I can't figure out how to pass and read all the values in the list. I can successfully post and read 1 value but not multiple values. Here is what I have so far: jQuery: var postUrl = "http://localhost:8000/ingredients/"; $('li').click(function(){ values = [1, 2]; $.ajax({ url: postUrl, type: 'POST', data: {'terid': values}, traditional: true, dataType: 'html', success: function(result){ $('#ingredients').append(result); } }); }); /ingredients/ view: def ingredients(request): if request.is_ajax(): ourid = request.POST.get('terid', False) ingredients = Ingredience.objects.filter(food__id__in=ourid) t = get_template('ingredients.html') html = t.render(Context({'ingredients': ingredients,})) return HttpResponse(html) else: html = '<p>This is not ajax</p>' return HttpResponse(html) With Firebug I can see that POST contains both ids but probably in the wrong format (terid=1&terid=2). So my ingredients view picks up only terid=2. What am I doing wrong? EDIT: To clarify, I need the ourid variable pass values [1, 2] to the filter in the ingredients view.

    Read the article

  • How to reference object values from subview?

    - by Frank Martin
    I have a ViewController and add programmatically a subview. During the initialization of the subview (initWithFrame) i want to set some attributes to values according to attributes that belong to another ViewControllers Child-Object (not a view). -(id)initWithFrame:(CGRect)frame { if (self = [super initWithFrame:frame]) { // The following is kind of what i want self.myAttribute = [self.viewController.otherObject otherValue]; } return self; } Thanks in advance for any answers and comments how to improve the question. Frank

    Read the article

  • Approximate Number of CPU Cycles for Various Operations

    - by colordot
    I am trying to find a reference for approximately how many CPU cycles various operations require. I don't need exact numbers (as this is going to vary between CPUs) but I'd like something relatively credible that gives ballpark figures that I could cite in discussion with friends. As an example, we all know that floating point division takes more CPU cycles than say doing a bitshift. I'd guess that the difference is that the division is around 100 cycles, where as a shift is 1 but I'm looking for something to cite to back that up. Can anyone recommend such a resource?

    Read the article

  • Passing dynamic string in hyperlink as parameter in jsp

    - by user3660263
    I am trying to pass a dynamic string builder variable in jsp I am generating a string through code. String Builder variable has some value but i am not able to pass it in at run time.It doesn't get the value. CODE FOR VARIABLE <% StringBuilder sb=new StringBuilder(""); if(request.getAttribute("Brand")!=null) { String Brand[]=(String[])request.getAttribute("Brand"); for(String brand:Brand) { sb.append("Brand="); sb.append(brand); sb.append("&&"); } } if(request.getAttribute("Flavour")!=null) { String Flavour[]=(String[])request.getAttribute("Flavour"); for(String flavour:Flavour) { sb.append(flavour); sb.append("&&"); } sb.trimToSize(); pageContext.setAttribute("sb", sb); } out.print("this is string"+sb); %> CODE FOR HYPERLINK <a href="Filter_Products?${sb}page=${currentPage + 1}" style="color: white;text-decoration: none;">Next</a></td>

    Read the article

< Previous Page | 67 68 69 70 71 72 73 74 75 76 77 78  | Next Page >