Search Results

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

Page 5/297 | < Previous Page | 1 2 3 4 5 6 7 8 9 10 11 12  | Next Page >

  • Pass quoted argument string to Start-Process in PowerShell

    - by Luke Puplett
    Hello I'm trying to very simply run an executable and pass a file path in as the first argument. In DOS, this would be the command: import.exe "C:\Some Path\With\Spaces.txt" By placing the path in quotes, the path is correctly parsed as the first token into the executable. In PowerShell I'm using this: $feeds = dir 'T:\Documents\Company\Product Development\Data foreach ($feed in $feeds) { start -FilePath import.exe -ArgumentList $feed.FullName } The problem with the Start-Process cmdlet in PowerShell is that it uses a string array for arguments, so the path is broken up and sent to the executable as separate tokens. Quotes in PowerShell force $feed.FullName to be treated literally. Double quotes "" make PowerShell not see anything in the argument list. "The argument is null or empty." it tells me. I expect that this is a known headache and has had a known workaround from day one. Thanks Luke

    Read the article

  • Boat passing under a bridge in a 2D tile based RTS

    - by aleguna
    I'm writing a 2D tile based RTS. And I want to add a 'pseudo 3D' feature to it - bridges over the rivers. I havent't start any coding yet, just trying to think how it fits the collision detection model. A boat passing under the bridge and a unit moving over the bridge will eventually occupy the same cell on the map. How to prement them from colliding? Is there a common approach to solve such a problem? Or I need to implement a 3D world to do this?

    Read the article

  • Argument list too long and copying to Samba Share

    - by Copy Run Start
    Ubuntu 12.04 LTS 64 bit. I'm trying to make a scheduled task copy from a directory with thousands of files to a samba share (while skipping duplicates). I mapped my Samba share through the GUI. The command I tried: cp /home/security/Brick/* ~/.gvfs/"cam on atm-bak-01.local/Brick" -n I found this but I don't know how to change the syntax to what I need. find -maxdepth 1 -name '*.prj' -exec mv -t ../prjshp {} + Any hints are greatly appreciated.

    Read the article

  • Passing data between engine layers

    - by spaceOwl
    I am building a software system (game engine with networking support ) that is made up of (roughly) these layers: Game Layer Messaging Layer Networking Layer Game related data is passed to the messaging layer (this could be anything that is game specific), where they are to be converted to network specific messages (which are then serialized to byte arrays). I'm looking for a way to be able to convert "game" data into "network" data, such that no strong coupling between these layers will exist. As it looks now, the Messaging layer sits between both layers (game and network) and "knows" both of them (it contains Converter objects that know how to translate between data objects of both layers back and forth). I am not sure this is the best solution. Is there a good design for passing objects between layers? I'd like to learn more about the different options.

    Read the article

  • Unable to remove a file which have a name like a command argument

    - by Justin
    By inadvertance, I've created a file called -r into my home directory. Please don't ask me how and why, I don't recall. But the fact is that now I cannot get rid of it : rm -rf rm: missing operand Try 'rm --help' for more information. Other try : rm /-/r rm: cannot remove ‘/-/r’: No such file or directory Another one : rm \-r rm: missing operand Try 'rm --help' for more information. Is there a way to remove this file without deleting the whole directory ? Thanks.

    Read the article

  • Argument on Ranking of SEO Links

    SEO and link building can be a marketing tool considering the fact that the amount of traffic a site generates is a direct outcome of the links it has been given by the owner. Committed Link building is very essential for good standing of a virtual address.

    Read the article

  • Passing a value from one function to another in jquery...

    - by Pandiya Chendur
    Consider these jquery statements... $(document).ready(function() { getRecordspage(0, itemsPerPage); $(".pager").pagination(maxNumberOfElementsHere, { //my def }); }); I get the value for maxNumberOfElementsHere from getRecordspage function... How to pass that value from getRecordspage function to the next one $(".pager").pagination(maxNumberOfElementsHere.... Any suggestion...

    Read the article

  • Passing List (Of ChildClass) as parameter to method expecting List (Of ParentClass)?

    - by Nicholas
    Hi, I have implemented inheritance for two parent classes called Table and Field. Each parent class has several child classes. In the Table parent class, I created a method that expects parameter List(Of Field). I get an error when trying to pass in parameter List(Of ChildField) to the method that expects a parameter of List(Of Field). The error message is as below: Value of type 'System.Collections.Generic.List(Of com.hlb.icisbatch.data.ChildField)' cannot be converted to 'System.Collections.Generic.List(Of com.hlb.icisbatch.data.Field)' My question, is it possible to pass in list of child class as parameter? If it is not a list then it works fine. But somehow it is not possible with lists? Below is sample class structure: Table Field | | ChildTable ChildField I have a method in the parent class: Public Class Table Public Sub New() End Sub Public Overridable Sub setFields(ByVal list As List(Of Field) 'Do work here' End Sub End Class and method in child class: Public Class ChildTable Public Sub New(ByVal list As List(Of ChildField) setFields(ChildField) End Sub End Class

    Read the article

  • Passing Values from a View to itself with parameters getting null values ?

    - by vsj
    Hi all, I am trying to get values from a view which i have the code below and I am taking the start date value from the view input text box and posting it back but I am still getting null except for the apikey and userkey.Here are the two views.. public ActionResult View1(string apiKey, string userId) { StartGoalViewModel vm = new StartGoalViewModel(); vm.ApiKey = apiKey; vm.UserId = userId; vm.GoalTypeId =1; vm.StartDate = null; return View(vm); } VIEW1.ASPX <% Html.BeginForm(); %> <%= Html.TextBox("name", Model.StartDate) %> <input type="submit" value="Start" /> <% Html.EndForm(); %> [HttpPost] public ActionResult VIEW1 (StartGoalViewModel fm) { // I get StartDate null... }

    Read the article

  • Passing variables from PHP to C++

    - by Alex
    I’m new to this so I’m sorry if my question is trivial. I have the following situation: I need to call a program from PHP and pass some vars and/or sets of key-value pairs to it. Now, my question is: how do I pass these vars, through arguments to the called function (e.g. exec("/path/to/program flag1 flag2 [key1=A,key2=B]");)? Or is there a better method to achieve this? Somebody suggested me to write them into a txt file and pass the path to it to as an argument instead (e.g. exec("/path/to/program path_to_txt_file);), but I’m not to excited about this method.

    Read the article

  • Passing values between Activities using MonoDroid

    - by Wallym
    Been doing some work in MonoDroid and found that I needed to pass a user entered value from on Activity to another Activity in MonoDroid.  Here's how I did it. In my sending Activity, I need to take some user user entered data and send it to my second activity.  Here is the code:             string UserId = Convert.ToString(et.Text);            if (!String.IsNullOrEmpty(UserId))            {                Intent i = new Intent();                i.SetClass(this, typeof(CustomList));                i.AddFlags(ActivityFlags.NewTask);                i.PutExtra("TwitterId", UserId);                StartActivity(i);            }  In this code, I have called .PutExtra and  passed it with a key.  In this case, I am passing a Twitter id.  In the code that is receiving the data, the code to retrieve the Twitter id is: string twitterId = Intent.GetStringExtra("TwitterId"); The call to GetStringExtra() returns the value passed on the key.

    Read the article

  • Passing Date Parameter to BAM

    - by mona.rakibe(at)oracle.com
    In the past I wrote a blog on passing ADF parameter to a BAM page. This sample can be further extended for parameter of any data type. Here is the  similar sample for Date type, the steps  to create application remain same.Sample : PassDate.zipSteps to RunCreate this Data Object on BAM server    ID(integer)    Date(datetime)     1             01/12/2010 4:22:34 AM     2             10/12/2009 5:22:20 PM     3             10/10/1999 5:22:10 PM     4             11/11/1980 4:23:10 PM Open adfc-config.xml and run InputValueProvide some date value and click on "Filter Records"Verify that the data is filtered in next page.   

    Read the article

  • Is there a tool to do round trip software engineering between a sequence diagram and a group of objects that message back and forth?

    - by DeveloperDon
    Is there a tool to do round trip software engineering between a sequence diagram and a group of objects that message back and forth? Perhaps this seems a little exotic, but it seems like a function that includes message calls or even method invocations on other objects could be automatically converted to a sequence diagram given that it is not hard to do manually. Similarly, when a sequence diagram is modified, based on the message name and type of message, should it not be possible to add a message or method to the calling object?

    Read the article

  • Exposing API through a DLL

    - by MageNewbie
    I have a C++ application; I would like to expose an API from that application allowing me to control the C++ app from a VB6 app. I want to expose the API through a DLL file. Is this a viable option (is it possible) ? I haven’t been able to find any literature on using DLLs in this way. In fact from what I have read it seems like this is not possible because DLLs create their own new instance for every application they are linked in. If you have meet theses requirements in an application you built or if your knowledgeable on the subject, please give me a push in the right direction.

    Read the article

  • Passing text message to web page from web user control

    - by Narendra Tiwari
    Here is a brief summary how we can send a text message to webpage by a web user control. Delegates is the slolution. There are many good articles on .net delegates you can refer some of them below. The scenario is we want to send a text message to the page on completion of some activity on webcontrol. 1/ Create a Base class for webcontrol (refer code below), assuming we are passing some text messages to page from web user control  - Declare a delegate  - Declare an event of type delegate using System; using System.Data; using System.Configuration; using System.Web; using System.Web.Security; using System.Web.UI; using System.Web.UI.WebControls; using System.Web.UI.WebControls.WebParts; using System.Web.UI.HtmlControls; //Declaring delegate with message parameter public delegate void SendMessageToThePageHandler(string messageToThePage); public         } class ControlBase: System.Web.UI.UserControl { public ControlBase() { // TODO: Add constructor logic here }protected override void OnInit(EventArgs e) { base.OnInit(e); }private string strMessageToPass;/// <summary> /// MessageToPass - Property to pass text message to page /// </summary> public string MessageToPass { get { return strMessageToPass; } set { strMessageToPass = value; } }/// <summary> /// SendMessageToPage - Called from control to invoke the event /// </summary> /// <param name="strMessage">Message to pass</param> public void SendMessageToPage(string strMessage) {   if (this.sendMessageToThePage != null)       this.sendMessageToThePage(strMessage); } 2/ Register events on webpage on page Load eventthis.AddControlEventHandler((ControlBase)WebUserControl1); this.AddControlEventHandler((ControlBase)WebUserControl2); /// <summary> /// AddControlEventHandler- Hooking web user control event /// </summary> /// <param name="ctrl"></param> private void AddControlEventHandler(ControlBase ctrl) { ctrl.sendMessageToThePage += delegate(string strMessage) {   //display message   lblMessage.Text = strMessage; }; } References: http://www.akadia.com/services/dotnet_delegates_and_events.html     3/

    Read the article

  • Attachments in Oracle BPM 11g – Create a BPM Process Instance by passing an Attachment

    - by Venugopal Mangipudi
    Problem Statement: On a recent engagement I had  a requirement where we needed to create BPM instances using a message start event. The challenge was that the instance needed to be created after polling a file location and attaching the picked up file (pdf) as an attachment to the instance. Proposed Solution: I was contemplating using process API to accomplish this,but came up with a solution which involves a BPEL process to pickup the file and send a notification to the BPM process by passing the attachment as a payload. The following are some of the brief steps that were used to build the solution: BPM Process to receive an attachment as part of the payload: The BPM Process is a very simple process which has a Message Start event that accepts the attachment as an argument and a Simple User Task that the user can use to view the attachment (as part of the OOTB attachment panel). The Input payload is based on AttachmentPayload.xsd.  The 3 key elements of the the payload are: <xsd:element name="filename" type="xsd:string"/> <xsd:element name="mimetype" type="xsd:string"/> <xsd:element name="content" type="xsd:base64Binary"/> A screenshot of the Human task data assignment that need to performed to attach the file is provided here. Once the process and the UI project (default generated UI) are deployed to the SOA server, copy the wsdl location of the process service (from EM). This WSDL would be used in the BPEL project to create the Instances in the BPM process after a file is polled. BPEL Process to Poll for File and create instances in the BPM process: For the BPEL process a File adapter was configured as a Read service (File Streaming option and keeping the Schema as Opaque). Once a location and the file pattern to poll are provided the Readservice Partner Link was wired to Invoke the BPEL Process. Also, using the BPM Process WSDL, we can create the Webservice reference and can invoke the start operation. Before we do the assignment for the Invoke operation, a global variable should be created to hold the value of the fileName of the file. The mapping to the global variable can be done on the Receive activity properties (jca.file.FileName).  So for the assign operation before we invoke the BPM process service, we can get the content of the file from the receive input variable and the fileName from the jca.file.FileName property. The mimetype needs to be hard coded to the mime-type of the file: application/pdf (I am still researching ways to derive the mime type as it is not available as part of the jca.file properties).  The screenshot of the BPEL process can be found here and the Assign activity can be found here. The project source can be found at the following location. A sample pdf file to test the project and a screenshot of the BPM Human task screen after the successful creation of the instance can be found here. References: [1] https://blogs.oracle.com/fmwinaction/entry/oracle_bpm_adding_an_attachment

    Read the article

  • Passing the CAML thru the EY of the NEEDL

    - by PointsToShare
    © 2011 By: Dov Trietsch. All rights reserved Passing the CAML thru the EY of the NEEDL Definitions: CAML (Collaborative Application Markup Language) is an XML based markup language used in Microsoft SharePoint technologies  Anonymous: A camel is a horse designed by committee  Dov Trietsch: A CAML is a HORS designed by Microsoft  I was advised against putting any Camel and Sphinx rhymes in here. Look it up in Google!  _____ Now that we have dispensed with the dromedary jokes (BTW, I have many more, but they are not fit to print!), here is an interesting problem and its solution.  We have built a list where the title must be kept unique so I needed to verify the existence (or absence) of a list item with a particular title. Two methods came to mind:  1: Span the list until the title is found (result = found) or until the list ends (result = not found). This is an algorithm of complexity O(N) and for long lists it is a performance sucker. 2: Use a CAML query instead. Here, for short list we’ll encounter some overhead, but because the query results in an SQL query on the content database, it is of complexity O(LogN), which is significantly better and scales perfectly. Obviously I decided to go with the latter and this is where the CAML s--t hit the fan.   A CAML query returns a SPListItemCollection and I simply checked its Count. If it was 0, the item did not already exist and it was safe to add a new item with the given title. Otherwise I cancelled the operation and warned the user. The trouble was that I always got a positive. Most of the time a false positive. The count was greater than 0 regardles of the title I checked (except when the list was empty, which happens only once). This was very disturbing indeed. To solve my immediate problem which was speedy delivery, I reverted to the “Span the list” approach, but the problem bugged me, so I wrote a little console app by which I tested and tweaked and tested, time and again, until I found the solution. Yes, one can pass the proverbial CAML thru the ey of the needle (e’s missing on purpose).  So here are my conclusions:  CAML that does not work:  Note: QT is my quote:  char QT = Convert.ToChar((int)34); string titleQuery = "<Query>><Where><Eq>"; titleQuery += "<FieldRef Name=" + QT + "Title" + QT + "/>"; titleQuery += "<Value Type=" + QT + "Text" + QT + ">" + uniqueID + "</Value></Eq></Where></Query>"; titleQuery += "<ViewFields><FieldRef Name=" + QT + "Title" + QT + "/></ViewFields>";  Why? Even though U2U generates it, the <Query> and </Query> tags do not belong in the query that you pass. Start your query with the <Where> clause.  Also the <ViewFiels> clause does not belong. I used this clause to limit the returned collection to a single column, and I still wish to do it. I’ll show how this is done a bit later.   When you use the <Query> </Query> tags in you query, it’s as if you did not specify the query at all. What you get is the all inclusive default query for the list. It returns evey column and every item. It is expensive for both server and network because it does all the extra processing and eats plenty of bandwidth.   Now, here is the CAML that works  string titleQuery = "<Where><Eq>"; titleQuery += "<FieldRef Name=" + QT + "Title" + QT + "/>"; titleQuery += "<Value Type=" + QT + "Text" + QT + ">" + uniqueID + "</Value></Eq></Where>";  You’ll also notice that inside the unusable <ViewFields> clause above, we have a <FieldRef> clause. This is what we pass to the SPQuery object. Here is how:  SPQuery query = new SPQuery(); query.Query = titleQuery; query.ViewFields = "<FieldRef Name=" + QT + "Title" + QT + "/>"; query.RowLimit = 1; SPListItemCollection col = masterList.GetItems(query);  Two thing to note: we enter the view fields into the SPQuery object and we also limited the number of rows that the query returns. The latter is not always done, but in an existence test, there is no point in returning hundreds of rows. The query will now return one item or none, which is all we need in order to verify the existence (or non-existence) of items. Limiting the number of columns and the number of rows is a great performance enhancer. That’s all folks!!

    Read the article

  • what pattern to use for multi-argument method?

    - by Omid S
    I have a method with the following signature: foo (Sample sample, Aliquot aliquot) "foo" needs to alter a Sample object, either the first argument or from the second argument it can extract its Sample. For example: foo (Sample sample, Aliquot aliquot) { Sample out = null; if (sample != null) out = sample else out = aliquot.getSample() return out; } But that is so un-elegant, other than reading the API a developer does not know the reference of the first argument overrides the Sample of the second argument. Now, I could change "foo" to foo (SomeMagicalObject bar) where SomeMagicalObject is a tuple for Sample and Aliquot and holds some logic ... etc. But I am wondering, are there some patterns for this question?

    Read the article

  • Apply dynamic list of templates to an argument

    - by Diego Martinez
    I need apply a variable sequence of templates to an argument. example 1: arg:tpl1():tpl2():...:tplN() Suppose that i have other multi valued argument, and each value is the name for a dynamic template invocation. ¿What is the better form of apply all the templates from the list to my argument? tplNames : {name | <(name)(arg)>} not works, just apply a template ever to the same innitial value of my argument, i need the same result of example 1 but in a dynamic way. Thank you!!

    Read the article

  • Why are argument substitutions not replaced during rescanning?

    - by James McNellis
    Consider the following macro definitions and invocation: #define x x[0] #define y(arg) arg y(x) This invocation expands to x[0] (tested on Visual C++ 2010, g++ 4.1, mcpp 2.7.2, and Wave). Why? Specifically, why does it not expand to x[0][0]? During macro replacement, A parameter in the replacement list...is replaced by the corresponding argument after all macros contained therein have been expanded. Before being substituted, each argument’s preprocessing tokens are completely macro replaced (C++03 §16.3.1/1). Evaluating the macro invocation, we take the following steps: The function-like macro y is invoked with x as the argument for its arg parameter The x in the argument is macro-replaced to become x[0] The arg in the replacement list is replaced by the macro-replaced value of the argument, x[0] The replacement list after substitution of all the parameters is x[0]. After all parameters in the replacement list have been substituted, the resulting preprocessing token sequence is rescanned...for more macro names to replace (C++03 §16.3.4/1). If the name of the macro being replaced is found during this scan of the replacement list...it is not replaced. Further, if any nested replacements encounter the name of the macro being replaced, it is not replaced (C++03 §16.3.4/2). The replacement list x[0] is rescanned (note that the name of the macro being replaced is y): x is identified as an object-like macro invocation x is replaced by x[0] Replacement stops at this point because of the rule in §16.3.4/2 preventing recursion. The replacement list after rescanning is x[0][0]. I have clearly misinterpreted something since all of the preprocessors I've tested say I am wrong. In addition, this example is a piece of a larger example in the C++0x FCD (at §16.3.5/5) and it too says that the expected replacement is x[0]. Why is x not replaced during rescanning? C99 and C++0x effectively have the same wording as C++03 in the quoted sections.

    Read the article

  • PHPUnit test for error thrown with wrong argument type

    - by Spencer Mark
    I'm just starting with PHPUnit and am ok with all assert* methods, but can't figure out how to test for error thrown when the wrong argument is provided to the method - say hinted with array like so: public function(array $list) { } and then tested with null as argument. Could someone please provide an example of how to test for this sort of errors? I've checked quite a few posts on stackoverflow, but couldn't find the answer to this specific issue. Edit Ok - just to give you an idea of what I'm testing - here's the ArrayHelper::removeIfValueIsEmpty() method: public static function removeIfValueIsEmpty(array $array) { if (empty($array)) { return array(); } return array_filter($array, function($value) { return !Helper::isEmpty($value); }); } and now test: class ArrayHelperTest extends PHPUnit_Framework_TestCase { public function testRemoveIfValueIsEmpty() { $this->assertEmpty( \Cmd\Helper\ArrayHelper::removeIfValueIsEmpty(null), '\Cmd\Helper\ArrayHelper::removeIfValueIsEmpty method failed (checking with null as argument)' ); } } This throws an error: PHPUnit_Framework_Error : Argument 1 passed to Cmd\Helper\ArrayHelper::removeIfValueIsEmpty() must be of the type array, null given

    Read the article

  • argument promotions in C function calls

    - by HaoCheng
    I learned from ----As to when default promotions kick in: default argument promotions are used exactly when the expected type of the argument is unknown, which is to say when there's no prototype or when the argument is variadic. But an example confusing me is: void func(char a, char b) { printf("a=%p,b=%p\n",&a,&b); } int main(void) { char a=0x11,b=0x22; func(a,b); return 0; } It is cleard in the above example: when calling func in main, there is no need to promote the arguments a and b, but the output shows &a = &b +4 not &a = &b+1. If no promotion occured, why 4 bytes between two CHAR argument?

    Read the article

< Previous Page | 1 2 3 4 5 6 7 8 9 10 11 12  | Next Page >