Search Results

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

Page 36/297 | < Previous Page | 32 33 34 35 36 37 38 39 40 41 42 43  | Next Page >

  • passing variable to a function.

    - by sushant
    its kind of silly question. but i dont know what mistake i am making. if any one could help. function zips(s) document.write(s) end function dim x,y x="sushant" clickme sorry i dont know how to format it. but i am no getting the desired output. any help is very much appreciated

    Read the article

  • Java: JAX-WS passing authentication info to a call to webservice

    - by agnieszka
    I am using JAX-WS. I am connecting to .NET webservice that requires authentication. I first call the Authentication.asmx so that I can be authenticated. The call returns me a LoginResult that contains a cookie name. Then I call another webservice and I need to somehow pass this cookie or a cookie name. and I don't know how. Here is the code: //first service that returns login information Authentication auth = new Authentication(new URL("the_url"), new QName("http://schemas.microsoft.com/sharepoint/soap/", "Authentication")); LoginResult result = auth.getAuthenticationSoap().login(HTTPuserName, HTTPpassword); //i need to pass cookie or cookie name or any other login information to call to this service Copy copyService = new Copy(new URL("service_url"), new QName("http://schemas.microsoft.com/sharepoint/soap/", "Copy")); BindingProvider p = (BindingProvider) copyService.getCopySoap();

    Read the article

  • Problem passing strings with PHP post

    - by andy
    Hi Guys, Basically I'm developing a (very) simple search engine. You can enter a search term and you are taken to the results page - which works fine. However on the results page, I have a button that will take you to the next 10 results: where $term is the $_POST['term'] value. echo "<input type='hidden' name='term' value='" . $term . "'>"; This causes the following problem with the term is for example "aidan's". When the next 10 button is clicked, the term becomes aidan\ and no further results are found. I am not doing anything to $term. I usually use Java, but am required to use PHP for this uni assignment! Any help would be greatly appreciated.

    Read the article

  • Passing Validation exceptions via WCF REST

    - by Coppermill
    I am using WCF and REST, and I have complex types, which are working fine. Now I need to check for validation, I am thinking of using DataAnnotations e.g. public class Customer { [Required] public string FirstName {get;set;} } Now where the issue is how do I pass this validation down to the REST service? ALso I need to validate the object when it comes back, and throw an exception, if I am to throw an exception then what is the best way of doing this using REST?

    Read the article

  • Passing empty list as parameter to JPA query throws error

    - by Tuukka Mustonen
    If I pass an empty list into a JPA query, I get an error. For example: List<Municipality> municipalities = myDao.findAll(); // returns empty list em.createQuery("SELECT p FROM Profile p JOIN p.municipality m WHERE m IN (:municipalities)") .setParameter("municipalities", municipalities) .getResultList(); Because the list is empty, Hibernate generates this in SQL as "IN ()", which gives me error with Hypersonic database. There is a ticket for this in Hibernate issue tracking but there are not many comments/activity there. I don't know about support in other ORM products or in JPA spec either. I don't like the idea of having to manually check for null objects and empty lists every time. Is there some commonly known approach/extension to this? How do you handle these situations?

    Read the article

  • Passing a non-iterable to list.extend ()

    - by JS
    Hello, I am creating a public method to allow callers to write values to a device, call it write_vals() for example. Since these values will by typed live, I would like to simplify the user's life by allowing them type in either a list or a single value, depending on how many values they need to write. For example: write_to_device([1,2,3]) or write_to_device(1) My function would like to work with a flat list, so I tried to be clever and code something like this: input_list = [] input_list.extend( input_val ) This works swimmingly when the user inputs a list, but fails miserably when the user inputs a single integer: TypeError: 'int' object is not iterable Using list.append() would create a nested list when a list was passed in, which would be an additional hassle to flatten. Checking the type of the object passed in seems clumsy and non-pythonic and wishing that list.extend() would accept non-iterables has gotten me nowhere. So has trying a variety of other coding methods. Suggestions (coding-related only, please) would be greatly appreciated.

    Read the article

  • Doctrine DQL execute passing params

    - by Karim web Developer
    I used this DQL in Doctrine $q->update('product') ->set('quantity','?') ->where('id=?'); $q->execute(array(20,5)); I check the server for the query and this the generated sql UPDATE product SET quantity = '20', updated_at = '5' WHERE (id = '2010-04-26 14:34); So I need to know why the arguments aren't in the correct places?

    Read the article

  • Update configSource of XML element in web.config using Powershell by passing in Parameters

    - by Howard
    I am trying to figure out a way to update my web.config for different environments by updating the configSource for the appSettings element in the web.config. Here are the way I know how to do it. $xml.get_DocumentElement().appSettings.configSource = $replaced_test The problem is that I want one base script where I can pass in different nodes to the script that I want to change and update but I am not sure how to do it. For example, I want to be able to call a powershell script like this changeWebConfig.ps1 nodeToChange newValueofNode I hope this was clear enough. This is the code I have now. $webConfigPath = "C:\web.config" # Get the content of the config file and cast it to XML $xml = [xml](get-content $webConfigPath) #this was the trick I had been looking for $root = $xml.get_DocumentElement()."system.serviceModel".client.configSource = $replace # Save it $xml.Save($webConfigPath)

    Read the article

  • passing java mail message object from between applications

    - by jezhilvalan
    I'm using java mail api 1.4.1 to obtain new emails. Two classes are being used to obtain emails and then parsing it. "GetMail" class communicates with mail server(Gmail,yahoo etc) and obtains the message object. Then the message object is passed to yet another class "MailFormatter" class, which then parses the message object, obtains the email headers (From,To,Subject etc) and then it parses the Multipart content to obtain the main body and attachments.Since both "Mail getting" and "Mail formatting" process are very resource intensive, these classes are going to be implemented as separate web applications.This application is going to monitor new emails for numerous email ids.If these ("GetMail" and "MailFormatter") are implemented as separate web applications, how can I pass the message object from "GetMail" app to "MailFormatter" app ? Is there a way through which I can persist the obtained message object in a certain location (a location which is common to both "GetMail" and "MailFormatter" applications), so that "GetMail" can persist the message object in that location, and then "MailFormatter" app can read "Message" objects from that location and carry out the parsing process. Message objects cannot be serialized. If they cannot be serialized how can I persist the state of java mail message object? please do help me to resolve this issue.

    Read the article

  • image submit button passing value

    - by air
    I have one image submit button like this <input id="enter" name="enter" type="image" value="Login" src="images/btn_login.jpg"/> once i click on this image i got following values enter.x=39&enter.y=11 but i want to get enter=Login on submit how to get enter value as login on submit? Thanks

    Read the article

  • Passing Querystring style parameters into Javascript file

    - by Mike Mengell
    Hi, Not sure if this is possible or even if I should do it, but I think it's quite interesting. I have a javascript file which I'm referencing in a flat HTML page. I'd like to pass in a parameter or two via the path to the script. Like this; <script src="/scripts/myJavascriptFile.js?config1=true" type="text/javascript"></script> Not really sure if it can work but it would make my solution a little easier for others to take my script and implement (arguable). Cheers, Mike

    Read the article

  • iphone - passing an object on an UIToolbarButton action

    - by Mike
    Is that possible to make a UIToolbarButton pass an object to its target by using some exoteric method (as it seems not to be possible using regular button use)? I mean something like UIBarButtonItem *Button = [[UIBarButtonItem alloc] initWithImage:buttonImage style:UIBarButtonItemStylePlain target:self action:@selector(doSomething:) **withObject:usingThis**]; I know I can trigger a method that will launch the full method with the object, but for the sake of elegance I was trying to minimize the code... I suspect it is not possible, but as you guys out there are insanely good you may come with an transcendental answer... who knows...

    Read the article

  • Fetch Latitude Longitude by passing postcodes to maps.google.com using Javascript

    - by Nirmal
    Hello All... I have Postcode in my large database, which contains values like SL5 9JH, LU1 3TQ etc. Now when I am pasting above postcode to maps.google.com it's pointing to a perfect location.. My requirement is like I want to pass post codes to maps.google.com and it should return a related latitude and longitude of that pointed location, that I want to store in my database. So, most probably there should be some javascript for that... If anybody have another idea regarding that please provide it.. Thanks in advance...

    Read the article

  • Passing parametrized ArrayList to a function in java

    - by user150505
    I have the following fucntion. func(ArrayList <String> name) { ........ } The function fills the ArrayList. (I don't want to return the ArrayList) However, in the caller function the ArrayList obtained has all items of ArrayList as null. For eg. 1 name = new ArrayList[num]; 2 func(name); 3 System.out.println(name[0]); I get NullPointerException at line 3. Is this because of line 1, i.e. I am not parametrizing? If yes, is there another way this can be done? Because java does not allow creating a generic array of parametrized ArrayList.

    Read the article

  • Passing Boost uBLAS matrices to OpenGL shader

    - by AJM
    I'm writing an OpenGL program where I compute my own matrices and pass them to shaders. I want to use Boost's uBLAS library for the matrices, but I have little idea how to get a uBLAS matrix into OpenGL's shader uniform functions. matrix<GLfloat, column_major> projection(4, 4); // Fill matrix ... GLuint projectionU = glGetUniformLocation(shaderProgram, "projection"); glUniformMatrix4fv(projectionU, 1, 0, (GLfloat *)... Um ...); Trying to cast the matrix to a GLfloat pointer causes an invalid cast error on compile.

    Read the article

  • Passing data between states PHP

    - by esryl
    So I am using Limonade PHP which has a RESTful design which emulates PUT, POST, DELETE routes for create, update, delete. I am trying to develop some form validation which is going well. The major problem I am facing though is how to return my filtered data (which has failed validation) back to repopulate the create or edit form. How would this be done? I currently have for creating a page: /admin/page/new -> GET function /admin/page -> POST function + validate + pass, update db + fail, add errors to flash, redirect to /admin/page/mew It all falls down as I do not know how to populate the /admin/page/new with the invalid, but filtered data.

    Read the article

  • Passing additional arguments into the OnClick event handler of a LinkButton using Javascript

    - by Jens Ameskamp
    Hi! I have a ASP.NET Website, where, in a GridView item template, automatically populated by a LinqDataSource, there is a LinkButton defined as follows: <asp:LinkButton ID="RemoveLinkButton" runat="server" CommandName="Remove" CommandArgument='<%# DataBinder.GetPropertyValue(GetDataItem(), "Id")%>' OnCommand="removeVeto_OnClick" OnClientClick='return confirm("Are you sure?");' Text="Remove Entry" /> This works fine. Whenever the Button is Clicked, a confirmation dialog is displayed. What I am trying to do now, is to allow the user to enter a reason for the removal, and pass this on the the OnClick event handler. How would I do this? I tried OnClientClick='return prompt("Enter your reason!");', but, of course, that did not work =)

    Read the article

  • Delphi - Using DeviceIoControl passing IOCTL_DISK_GET_LENGTH_INFO to get flash media physical size (Not Partition)

    - by SuicideClutchX2
    Alright this is the result of a couple of other questions. It appears I was doing something wrong with the suggestions and at this point have come up with an error when using the suggested API to get the media size. Those new to my problem I am working at the physical disk level, not within the confines of a partition or file system. Here is the pastebin code for the main unit (Delphi 2009) - http://clutchx2.pastebin.com/iMnq8kSx Here is the application source and executable with a form built to output the status of whats going on - http://www.mediafire.com/?js8e6ci8zrjq0de Its probably easier to use the download, unless your just looking for problems within the code. I will also paste the code here. unit Main; interface uses Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms, Dialogs, StdCtrls; type TfrmMain = class(TForm) edtDrive: TEdit; lblDrive: TLabel; btnMethod1: TButton; btnMethod2: TButton; lblSpace: TLabel; edtSpace: TEdit; lblFail: TLabel; edtFail: TEdit; lblError: TLabel; edtError: TEdit; procedure btnMethod1Click(Sender: TObject); private { Private declarations } public { Public declarations } end; TDiskExtent = record DiskNumber: Cardinal; StartingOffset: Int64; ExtentLength: Int64; end; DISK_EXTENT = TDiskExtent; PDiskExtent = ^TDiskExtent; TVolumeDiskExtents = record NumberOfDiskExtents: Cardinal; Extents: array[0..0] of TDiskExtent; end; VOLUME_DISK_EXTENTS = TVolumeDiskExtents; PVolumeDiskExtents = ^TVolumeDiskExtents; var frmMain: TfrmMain; const FILE_DEVICE_DISK = $00000007; METHOD_BUFFERED = 0; FILE_ANY_ACCESS = 0; IOCTL_DISK_BASE = FILE_DEVICE_DISK; IOCTL_VOLUME_BASE = DWORD('V'); IOCTL_DISK_GET_LENGTH_INFO = $80070017; IOCTL_VOLUME_GET_VOLUME_DISK_EXTENTS = ((IOCTL_VOLUME_BASE shl 16) or (FILE_ANY_ACCESS shl 14) or (0 shl 2) or METHOD_BUFFERED); implementation {$R *.dfm} function GetLD(Drive: Char): Cardinal; var Buffer : String; begin Buffer := Format('\\.\%s:',[Drive]); Result := CreateFile(PChar(Buffer),GENERIC_READ Or GENERIC_WRITE,FILE_SHARE_READ,nil,OPEN_EXISTING,0,0); If Result = INVALID_HANDLE_VALUE Then begin Result := CreateFile(PChar(Buffer),GENERIC_READ,FILE_SHARE_READ,nil,OPEN_EXISTING,0,0); end; end; function GetPD(Drive: Byte): Cardinal; var Buffer : String; begin If Drive = 0 Then begin Result := INVALID_HANDLE_VALUE; Exit; end; Buffer := Format('\\.\PHYSICALDRIVE%d',[Drive]); Result := CreateFile(PChar(Buffer),GENERIC_READ Or GENERIC_WRITE,FILE_SHARE_READ,nil,OPEN_EXISTING,0,0); If Result = INVALID_HANDLE_VALUE Then begin Result := CreateFile(PChar(Buffer),GENERIC_READ,FILE_SHARE_READ,nil,OPEN_EXISTING,0,0); end; end; function GetPhysicalDiskNumber(Drive: Char): Byte; var LD : DWORD; DiskExtents : PVolumeDiskExtents; DiskExtent : TDiskExtent; BytesReturned : Cardinal; begin Result := 0; LD := GetLD(Drive); If LD = INVALID_HANDLE_VALUE Then Exit; Try DiskExtents := AllocMem(Max_Path); DeviceIOControl(LD,IOCTL_VOLUME_GET_VOLUME_DISK_EXTENTS,nil,0,DiskExtents,Max_Path,BytesReturned,nil); If DiskExtents^.NumberOfDiskExtents > 0 Then begin DiskExtent := DiskExtents^.Extents[0]; Result := DiskExtent.DiskNumber; end; Finally CloseHandle(LD); end; end; procedure TfrmMain.btnMethod1Click(Sender: TObject); var PD : DWORD; CardSize: Int64; BytesReturned: DWORD; CallSuccess: Boolean; begin PD := GetPD(GetPhysicalDiskNumber(edtDrive.Text[1])); If PD = INVALID_HANDLE_VALUE Then Begin ShowMessage('Invalid Physical Disk Handle'); Exit; End; CallSuccess := DeviceIoControl(PD, IOCTL_DISK_GET_LENGTH_INFO, nil, 0, @CardSize, SizeOf(CardSize), BytesReturned, nil); if not CallSuccess then begin edtError.Text := IntToStr(GetLastError()); edtFail.Text := 'True'; end else edtFail.Text := 'False'; CloseHandle(PD); end; end. I placed a second method button on the form so I can write a different set of code into the app if I feel like it. Only minimal error handling and safeguards are there is nothing that wasn't necessary for debugging this via source. I tried this on a Sony Memory Stick using a PSP as the reader because I cant find the adapter for using a duo in my machine. The target is an MS and half of my users use a PSP for a reader half dont. However this should work fine on SD cards and that is a secondary target for my work as well. I tried this on a usb memory card reader and several SD cards. Now that I have fixed my attempt I get an error returned. 50 ERROR_NOT_SUPPORTED The request is not supported. I have found an application that uses this API as well as alot of related functions for what I am trying todo. I am getting ready to look into it the application is called DriveImage and its source is here - http://sourceforge.net/projects/diskimage/ The only thing I have really noticed from that application is there use of TFileStream and using that to get a handle on the physical disk.

    Read the article

  • ASP.NET MVC AuthorizeAttribute passing values to ActionMethod?

    - by subskii
    Hi everyone I'm only a newcomer to ASP.NET MVC and am not sure how to achieve a certain task the "right way". Essentially, I store the logged in userId in HttpContext.User.Identity and have written an EnhancedAuthorizeAttribute to perform some custom authorization. In the overriden OnAuthorization method, my domain model hits the database to ensure the current user id can access the passed in routeValue "BatchCode". The prototype is: ReviewGroup GetReviewGroupFromBatchCode(string batchCode); It will return null if the user can't access the ReviewGroup and the OnAuthorization then denies access. Now, I know the decorated action method will only get executed if OnAuthorization passes, but I don't want to hit the database a second time to get the ReviewGroup again. I am thinking of storing the ReviewGroup in HttpContext.Items["reviewGroup"] and accessing this from the controller at the moment. Is this a feasible solution, or am I on the wrong path? Thanks!

    Read the article

  • problems with passing html to the server with jquery

    - by CoffeeCode
    i have an ajax call $.ajax({ url: '<%=Url.Action("SaveDetails","Survey") %>', dataType: 'JSON', cache: false, data: { Id: selectedRow.Id, Value: surveyValue, FileName: filename, FileGuid: fileguid }, success: function(data) { ... } }); where the surveyValue is a html string. this call doesn't work. but is i change the surveyValue to an ordinary text i works fine. how can i pass the html to the server?

    Read the article

  • SSRS Passing values between list and subreport

    - by mjmcloug
    So this is like my third SSRS question and I've only been looking at it for a day :S This question may be a little sketchy as I'm still not up with the terminology. Basically I have a list that is bound to a "Select" of SiteId's. Inside this list I have a sub report. The idea is to pass these SiteId's into the sub report one at a time to generate a report for each site Id. But I can't figure out the expression required to pass this value in? Way off the mark? or is there an answer to this question

    Read the article

  • Passing data to a non-static listBox, by calling function from another class

    - by Andrew A
    I have a simple forms program that I have been fighting with for a while now. I simply want to be able to call a method from a different class file (when a certain step is triggered in the code in that class file) in order to insert a string in the listBox. Here is my main method, pretty standard: class Program { [STAThread] static void Main(string[] args) { Application.EnableVisualStyles(); Application.SetCompatibleTextRenderingDefault(false); Application.Run(new MainForm()); } } Here is the function which resides in my MainForm.cs file, which I can call just fine from that class file (via 'TextToBox(myString);'): public partial class MainForm : Form { ... // Function to output results to main Listbox window public void TextToBox(string aString) { // Place messages in Main Display list box window this.listBox1.Items.Insert(0, aString); } ... } But my problem is when I am in another class and I want to call 'TextToBox(myString);'. If I create another object reference of the MainForm, the code compiles fine but nothing will show up in the listBox. How do I do this? I cannot simply make TextToBox() static. I know I must create the object reference but I can't figure out how to reference the ORIGINAL MainForm, the one that was created in the Main method. Thanks in advance...

    Read the article

< Previous Page | 32 33 34 35 36 37 38 39 40 41 42 43  | Next Page >