Search Results

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

Page 63/297 | < Previous Page | 59 60 61 62 63 64 65 66 67 68 69 70  | Next Page >

  • Leaks in passing the request using URL at NSString, Objective-C.

    - by Madan Mohan
    Hi Guys, I getting the leak in this method even the allocated nsstring is released. -(BOOL)getTicket:(NSString*)userName passWord:(NSString*)aPassword isLogin:(BOOL)isLogin { login =[self getloginList]; username = login.name; password = login.password; NSString* str=@""; if (isLogin == YES) { str = @"https://accounts.=true&LOGIN_ID="; str = [str stringByAppendingString:[self _encodeString:username]]; str = [str stringByAppendingString:@"&PASSWORD="]; str = [str stringByAppendingString:[self _encodeString:password]]; } else if (isLogin == NO) { str = @"https://accounts.=true&LOGIN_ID="; str = [str stringByAppendingString:[self _encodeString:userName]]; str = [str stringByAppendingString:@"&PASSWORD="]; str = [str stringByAppendingString: [self _encodeString:aPassword]]; } NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:str] cachePolicy:NSURLRequestReloadIgnoringCacheData timeoutInterval:25.0]; [request setHTTPMethod: @"POST"]; NSData *returnData = [NSURLConnection sendSynchronousRequest:request returningResponse:nil error:nil];//****************** i am getting leak here showing as nsstring is leaking NSString *returnString = [[NSString alloc] initWithData:returnData encoding:NSUTF8StringEncoding]; printf("\n returnString in getticket:%s",[returnString UTF8String]); NSRange textRange; textRange =[returnString rangeOfString:@"TICKET"]; if(textRange.location != NSNotFound) { printf("\n **********************"); NSArray* splitValues = [returnString componentsSeparatedByString:@"TICKET="]; NSString* str1 = [splitValues objectAtIndex:1]; NSArray* splitValues1 = [str1 componentsSeparatedByString:@"RESULT"]; NSString* ticket1 = [splitValues1 objectAtIndex:0]; self.ticket = ticket1; self.isCorrectLogin = YES; [returnString release]; return YES; } else { self.isCorrectLogin = NO; [returnString release]; return NO; } return NO; } Please help me out of this problem.

    Read the article

  • Passing a outside variable into a <asp:sqldatasource> tag. ASP.NET 2.0

    - by MadMAxJr
    I'm designing some VB based ASP.NET 2.0, and I am trying to make more use of the various ASP tags that visual studio provides, rather than hand writing everything in the code-behind. I want to pass in an outside variable from the Session to identify who the user is for the query. <asp:sqldatasource id="DataStores" runat="server" connectionstring="<%$ ConnectionStrings:MY_CONNECTION %>" providername="<%$ ConnectionStrings:MY_CONNECTION.ProviderName %>" selectcommand="SELECT THING1, THING2 FROM DATA_TABLE WHERE (THING2 IN (SELECT THING2 FROM RELATED_DATA_TABLE WHERE (USERNAME = @user)))" onselecting="Data_Stores_Selecting"> <SelectParameters> <asp:parameter name="user" defaultvalue ="" /> </SelectParameters> </asp:sqldatasource> And on my code behind I have: Protected Sub Data_Stores_Selecting(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.SqlDataSourceSelectingEventArgs) Handles Data_Stores.Selecting e.Command.Parameters("user").Value = Session("userid") End Sub Oracle squaks at me with ORA-01036, illegal variable name. Am I declaring the variable wrong in the query? I thought external variables share the same name with a @ prefixed. from what I understand, this should be placing the value I want into the query when it executes the select. EDIT: Okay, thanks for the advice so far, first error was corrected, I need to use : and not @ for the variable declaration in the query. Now it generates an ORA-01745 invalid host/bind variable name. EDIT AGAIN: Okay, looks like user was a reserved word. It works now! Thanks for other points of view on this one. I hadn't thought of that approach.

    Read the article

  • Passing parameter to base class constructor or using instance variable?

    - by deamon
    All classes derived from a certain base class have to define an attribute called "path". In the sense of duck typing I could rely upon definition in the subclasses: class Base: pass # no "path" variable here def Sub(Base): def __init__(self): self.path = "something/" Another possiblity would be to use the base class constructor: class Base: def __init__(self, path): self.path = path def Sub(Base): def __init__(self): super().__init__("something/") What would you prefer and why? Is there a better way?

    Read the article

  • Passing the "enter key" event to flash player in an ATL Window?

    - by Adam Naylor
    I have a Flash player (flash9.ocx) embedded in an ATL window and have coded functionality into the swf to respond to the return/enter key being pressed. Works fine from the standalone swf player but as soon as its played from within my embedded player it doesn't execute. It's as if my window is getting in the way somehow? Is there any way to pass the keypress through to the player? FYI, there isn't anything to weird in place on the form. Thanks!

    Read the article

  • void foo(int &x) -> Ruby? Passing integers by reference?

    - by Earlz
    Hello, as a way to spice up my C++ programming homework, I've decided to instead of typing the C++ from the book onto my computer, instead reforming it in Ruby. Yes it's a bit silly, but I'm bored. Anyway, I'm having trouble converting this kind of function to Ruby void swap(int &a,int &b){ int c=b; b=a; a=c } What would the equivalent ruby code looking inside a function ?

    Read the article

  • passing get parameters through named route and then to controller model; stringify_keys!

    - by user368937
    Hey, I'm just learning ruby on rails and I've been stumped on this for awhile now. Here's my url request: http://192.168.2.20:8080/Location/new/123.123,-123.123/ Here's my routes.rb: map.connect '/Location/new/:coords/', :controller => 'Location', :action => 'new', :coords => /\d+.\d+,-\d+.\d+/ map.connect '/Location/list/', :controller => 'Location', :action => 'list' map.connect '/Location/create/', :controller => 'Location', :action => 'create' Here's my location_controller.rb def new @coords = Location.new(params[:coords]) end Here's the error message it gives me: NoMethodError in LocationController#new undefined method `stringify_keys!' for "123.123,-123.123":String

    Read the article

  • Javascript (using jQuery) in a large Project... organization, passing data, private method, etc.

    - by gaoshan88
    I'm working on a large project that is organized like so: Multiple javascript files are included as needed and most code is wrapped in anonymous functions... // wutang.js //Included Files Go Here // Public stuff var MethodMan; // Private stuff (function() { var someVar1; MethodMan = function(){...}; var APrivateMethod = function(){...}; $(function(){ //jquery page load stuff here $('#meh').click(APrivateMethod); }); })(); I'm wondering about a few things here. Assuming that there are a number of these files included on a page, what has access to what and what is the best way to pass data between the files? For example, I assume that MethodMan() can be accessed by anything on any included page. It is public, yes? var someVar1 is only accessible to the methods inside that particular anonymous function and nowhere else, yes? Also true of var APrivateMethod(), yes? What if I want APrivateMethod() to make something available to some other method in a different anonymous wrapped method in a different included page. What's the best way to pass data between these private, anonymous functions on different included pages? Do I simply have to make whatever I want to use between them public? How about if I want to minimize global variables? What about the following: var PootyTang = function(){ someVar1 = $('#someid').text(); //some stuff }; and in another included file used by that same page I have: var TangyPoot = function(){ someVar1 = $('#someid').text(); //some completely different stuff }; What's the best way to share the value of someVar1 across these anonymous (they are wrapped as the first example) functions?

    Read the article

  • Is it possible to use instanceof when passing objects between Threads?

    - by Risser
    I've run into an issue where instanceof works, and then it doesn't. Going into details is difficult, but I think this might be the problem: Reading this: http://www.theserverside.com/news/thread.tss?thread_id=40229 (search for Thread.currentThread), it seems to imply that, even if the two objects are the same class, if you pass them between threads with different class loaders, instanceof (and isAssignableFrom) might still fail. This certainly would explain the behavior I'm having, but I was wondering if anyone could verify it? (I wish the article linked at the beginning of the discussion was still available, but it doesn't seem like it is.) Thanks, Peter

    Read the article

  • Prompting for authentication from a wxPython program and passing it along to IIS?

    - by MetaHyperBolic
    I have a client (written in Python, with a wxPython front end in dead-simple wizard style) which communicates a website running IIS. A python script receives requests and does the usual client-server dance. I would have written this as a browser application, but for the requirement that certain things happen on the local PC that the web can't help with (file manipulation, interfacing with certain USB hardware, etc.) Right now, I am simply using the logon credentials, compounded as a string from os.environ['USERDOMAIN'] and os.environ['USERNAME'], to pass along to the server, which connects to Active Directory and enumerates the members of the group, looking for those logon credentials. It's an ugly hack, but it works. Obviously, I could make people log out of the generic helper accounts and log back into Windows using specific accounts. However, I wondered how feasible it would be to provide some kind of logon prompt wherein the user can type in a name and password, then some kind of authorization token could be passed on to IIS. This seems like something I would not want to do myself, given that amateurs almost always make huge security mistakes. Now you can see why I am wishing this was purely web-based. What's a good way to handle this?

    Read the article

  • Need help in creating test appliaction in Java and passing parameters into a new designed Java API.

    - by Christophe
    Need help, Please!!! By following the protocol, the Request should be built in 5 byte length, including 1 byte for changing Braud rate (Speed), and send request to a RS-232 port. Protocol: --------------- Request for the command processing, with optional extra byte for changing Baud Rate: LGT : length message ( LGT = 5 ) TYPE : 0x06 TO(time out): 0x0000 CMD : (1 byte) 0x02 application update Baud Rate : (1 byte) 0xNN (optional parameter to change baud rate of the Mnt App) where NN can be: 0x00 = No Baud Rate Change (similar to 4-byte command above) 0x09 = Change to 9600 Baud for Application Update speed 0x0A = Change to 19200 Baud for Application Update speed 0x0E = Change to 115200 Baud for Application Update speed All other bytes are not accepted and will result in a status of 0x01. ------------------ I'm trying to test if my code works or not by creating another class (TestApplication.java) and pass the "3 differenr Baut rate" to this CPXAppliaction. the 3 Baud Rate is supposed to input by reading a file.txt. Question: How do you think these code (first half)? please don't warry about the details about the "sending part". I mean, do I need setter/getter for the "speed" parameter pass? I created the demo test class DemoApp.java (input speed by reading a txt file, and pass into CPXAppliaction). how do you think about that code? Many thanks to you guys!! public class CPXApplication extends CPXCommand { private int speed; . public CPXApplication() { speed = 9600; } public CPXApplication(int speedinit) { speed = speedinit; // TODO: where to get the speed? } protected void buildRequest() throws ElitePortException { String trans = ""; // build the full-qualified message following the protocol trans = addToRequest(trans, (char) 0); trans = addToRequest(trans, (char) 5); trans = addToRequest(trans, (char) 6); trans = addToRequest(trans, (char) 0); trans = addToRequest(trans, (char) 0); trans = addToRequest(trans, (char) 2); switch (speed) { case 9600: trans = addToRequest(trans, (char) 0x09); break; case 19200: trans = addToRequest(trans, (char) 0x0A); break; case 115200: trans = addToRequest(trans, (char) 0x0E); break; default: // TODO: unexpected baud rate. throw(); break; } trans = EncryptBinary(trans); trans = "F0." + trans; wrapRequest(trans); } protected String addToRequest(String req, char c) { return req + c; } protected String addToRequest(String req, String s) { return req + s; } protected String addToRequest(String req) { return req; } public void analyzeResponse() { //.............. } } Here is the demo test code: package com.ingenico.testApp; import com.ingenico.EliteFd.; import java.util.Scanner; import java.io.; class Run { public static void run() { CPXAppliactionUpdate input = new CpXApplicationUpdate(); int lineno = 0; try { FileReader fr = new FileReader("baudRateSpeed.txt"); BufferedReader reader = new BufferedReader(fr); String line = reader.readLine(); Scanner scan = null; while (line != null) { scan = new Scanner(line); String speed; speed = scan.next(); if (lineno == 0) { input.speed = speed; lineno++; } else { input = cpxapplicationupdate(speed, input); } line = reader.readLine(); } reader.close(); } catch (FileNotFoundException e) { System.out.println("Could not find the file"); } catch (IOException e) { System.out.println("Had a problem reading from file"); } } public class DemoApp{ public void main(String args[]) { run(); } } }

    Read the article

  • Question on passing a pointer to a structure in C to a function?

    - by worlds-apart89
    Below, I wrote a primitive singly linked list in C. Function "addEditNode" MUST receive a pointer by value, which, I am guessing, means we can edit the data of the pointer but can not point it to something else. If I allocate memory using malloc in "addEditNode", when the function returns, can I see the contents of first-next ? Second question is do I have to free first-next or is it only first that I should free? I am running into segmentation faults on Linux. #include <stdio.h> #include <stdlib.h> typedef struct list_node list_node_t; struct list_node { int value; list_node_t *next; }; void addEditNode(list_node_t *node) { node->value = 10; node->next = (list_node_t*) malloc(sizeof(list_node_t)); node->next->value = 1; node->next->next = NULL; } int main() { list_node_t *first = (list_node_t*) malloc(sizeof(list_node_t)); first->value = 1; first->next = NULL; addEditNode(first); free(first); return 0; }

    Read the article

  • Passing user_id, site_id, and question_id to same table on create...

    - by bgadoci
    I can't seem to figure out how to do this. I am trying to pass four different variables to a single table. To be more specific I am trying to create a "like" in a likes table that also captures the site_id (like an answer), user_id, and the question_id. Here is the set up. class Like < ActiveRecord::Base belongs_to :site belongs_to :user belongs_to :question end I will spare you the reverse, has_many associations but they are there. Here is the likes controller where I think the problem is. class LikesController < ApplicationController def create @user = current_user @site = Site.find(params[:site_id]) @like = @site.likes.create!(params[:like]) @like.user = current_user @like.save respond_to do |format| format.html { redirect_to @site} format.js end end end This code successfully passes the like and site_id but after many different variations of trying I can't get it to pass the question id. Here is my form: /views/sites/_site.html.erb (though the partial is being displayed in the /views/questions/show.html.erb file). <% remote_form_for [site, Like.new] do |f| %> <%= f.hidden_field :site_name, :value => "#{site.name}" %> <%= f.hidden_field :ip_address, :value => "#{request.remote_ip}" %> <%= f.hidden_field :like, :value => "1" %> <%= submit_tag "^" , :class => 'voteup' %> <% end %>

    Read the article

  • Passing page control from jscript to pagemethod in the codebehind?

    - by brandonprry
    Hi, I am looking write a javascript method as such called when a dropdownlist changes value function GetStuff(sender, destID){ var dest = document.getElementById(destID); this.PageMethods.GetStuffs(sender, dest, null, null); } GetStuffs() is in the Codebehind as follows: [WebMethod] public static void GetStuffs(object sender, object dest) { DropDownList s = sender as DropDownList; DropDownList d = dest as DropDownList; d.Items.Add(new ListItem(s.SelectedValue)); } I have a break point set at the method and alerts in the GetStuff() jscript method fire up until the PageMethod call, at which nothing happens. I have set OnSuccess and OnFailure methods up with alerts and they don't get fired. Any thoughts? Am I doing something inherently wrong?

    Read the article

  • Getting values from another winform and passing it to current!

    - by klm9971
    Hello: I have 2 windows forms. The 1st one who gets active during start of the program has a button in which another 2nd windows form appears which has text field in which user type their name and HIT okay. Now in the 1st form I have a variable name: nameproccessed which takes the name from the second form. But the problem is my button which is in the 1st form has more functions besides taking name, how can I stop the flow of the compiler to take first the name from the second form and then process the rest execution of the function??? Here is the snippet of my code: //1st form //Class1 public string _nameProcessed = ""; private void btnGetSomething_Click(object sender, EventArgs e) { showdial(); //some more functionalities in this function!!! } private void showdial() { InputName inm = new InputName(); inm.Show(); } //2nd form //Class2 public string name; private void btnEnterName_Click(object sender, EventArgs e) { name = tbxName.Text; Class1 ict = new Class1(); ict._nameProcessed = name; this.Close(); } Now I want to take the 'name' from the second form put it on the _nameprocessed in the 1st form and then execute the rest of the function. How can I do that? Any help!

    Read the article

  • How can I declare an object with properties that I will be passing around inside of my function using Typescript?

    - by Marilou
    I've been using the following: var modal = { content: '', form: '', href: '' } But now I have started to use Typescript is there a better way I can declare an object and how can I declare the types of my properties. The reason I am using this object is that it's inside of a function and inside that function I have other functions that set and use the values of the properties. Is this the best way for me to do this or is there another way I could better do this with typescript?

    Read the article

  • C# Dataset usage necessary before passing to GridView datasource?

    - by Goober
    Scenario Lets say for example I have a series of events that fire continually every half second presenting me with an object containing some bits of information. There are always between 10 and 15 objects that are being updated constantly. Since these bits of information are changing continually I want to display them in a GridView. When I do so, I want the user to see the data displayed in the gridview and actually be updated as opposed to just a continually extending list being printed and incrementing (like writeline on the console). Question Is the best way to achieve this to map my objects to a dataset and have the dataset mapped to the gridview? Thoughts Will this allow the gridview to just be "UPDATED" as opposed to being added to? Any implementation suggestions would be greatly appreciated. EDIT: it MUST be windows forms (I use DevExpress too)

    Read the article

  • Need help in creating test application in Java and passing parameters into a new designed Java API.

    - by Christophe
    Need help, Please!!! By following the protocol, the Request should be built in 5 byte length, including 1 byte for changing Braud rate (Speed), and send request to a RS-232 port. Protocol: Request for the command processing, with optional extra byte for changing Baud Rate: LGT : length message ( LGT = 5 ) TYPE : 0x06 TO(time out): 0x0000 CMD : (1 byte) 0x02 application update Baud Rate : (1 byte) 0xNN (optional parameter to change baud rate of the Mnt App) where NN can be: 0x00 = No Baud Rate Change (similar to 4-byte command above) 0x09 = Change to 9600 Baud for Application Update speed 0x0A = Change to 19200 Baud for Application Update speed 0x0E = Change to 115200 Baud for Application Update speed All other bytes are not accepted and will result in a status of 0x01. I'm trying to test if my code works or not by creating another class (TestApplication.java) and pass the "3 differenr Baut rate" to this CPXAppliaction. the 3 Baud Rate is supposed to input by reading a file.txt. Question: How do you think these code (first half)? please don't warry about the details about the "sending part". I mean, do I need setter/getter for the "speed" parameter pass? I created the demo test class DemoApp.java (input speed by reading a txt file, and pass into CPXAppliaction). how do you think about that code? Many thanks to you guys!! public class CPXApplication extends CPXCommand { private int speed; . public CPXApplication() { speed = 9600; } public CPXApplication(int speedinit) { speed = speedinit; // TODO: where to get the speed? } protected void buildRequest() throws ElitePortException { String trans = ""; // build the full-qualified message following the protocol trans = addToRequest(trans, (char) 0); trans = addToRequest(trans, (char) 5); trans = addToRequest(trans, (char) 6); trans = addToRequest(trans, (char) 0); trans = addToRequest(trans, (char) 0); trans = addToRequest(trans, (char) 2); switch (speed) { case 9600: trans = addToRequest(trans, (char) 0x09); break; case 19200: trans = addToRequest(trans, (char) 0x0A); break; case 115200: trans = addToRequest(trans, (char) 0x0E); break; default: // TODO: unexpected baud rate. throw(); break; } trans = EncryptBinary(trans); trans = "F0." + trans; wrapRequest(trans); } protected String addToRequest(String req, char c) { return req + c; } protected String addToRequest(String req, String s) { return req + s; } protected String addToRequest(String req) { return req; } public void analyzeResponse() { //.............. } } Here is the demo test code: class Run { public static void run() { CPXAppliaction input = new CpXApplication(); int lineno = 0; try { FileReader fr = new FileReader("baudRateSpeed.txt"); BufferedReader reader = new BufferedReader(fr); String line = reader.readLine(); Scanner scan = null; while (line != null) { scan = new Scanner(line); String speed; speed = scan.next(); if (lineno == 0) { input.speed = speed; lineno++; } else { input = cpxapplication(speed, input); } line = reader.readLine(); } reader.close(); } catch (FileNotFoundException e) { System.out.println("Could not find the file"); } catch (IOException e) { System.out.println("Had a problem reading from file"); } } } public class DemoApp{ public void main(String args[]) { run(); }

    Read the article

  • does passing __m128i objects by reference to inline function cause these objects to be moved to stac

    - by ~buratinas
    Hello, I'm writing transpose function for 8x16bit vectors with SSE2 intrinsics. Since there are 8 arguments for that function (a matrix of 8x8x16bit size), I can't do anything but pass them by reference. Will that be optimized by the compiler (I mean, will these __m128i objects be passed in registers instead of stack)? Code snippet: inline void transpose (__m128i &a0, __m128i &a1, __m128i &a2, __m128i &a3, __m128i &a4, __m128i &a5, __m128i &a6, __m128i &a7) { .... }

    Read the article

  • iphone application development -- passing data to and from the server.

    - by SAPNA
    i have to develop an -phone application .user logs in through the i-phone and gets data stored in the database.our database is created in MY SQL. and website is developed in (classic) ASP.interface is created in i-phone SDK. connection is remaining.what should i use for transferring data to server and from the server. JSON or SOAP.is XML parsing necessary.actually i am very new to this field. so a bit confused. we have some time left for completing our application.so in urgent need of help. thank you in advance.

    Read the article

  • Php, passing data between pages without using the url?

    - by terabytest
    I have a php page that has a form that asks for an e-mail. When you press the send button, it gets to another php page, which gets the form data and does its stuff. I need to then be able to go back to the old page (the one that contained the form) and give it some data so that it will be able to change itself and say "You've sent your e-mail successfully, and will not display the form. How do I do it?

    Read the article

  • Is passing a struct value to a method by-reference in C# an acceptable optimization?

    - by Arc
    Say I have a struct: struct MyStruct { public int X public int Y } And a method in some class that is iterated over many times elsewhere: public bool MyMethod( MyStruct myStruct ) { return ... } Is changing the MyMethod signature to the following an acceptable optimization? public bool MyMethod( ref MyStruct myStruct ) If so, how much of an advantage would it really be? If not, about how many fields would a struct need for a big enough advantage using ref this way?

    Read the article

  • What's the differenct between passing a function and the function call itself in javascript?

    - by Mingus Rude
    In the application I'm building I'm polling for a status update and I have noticed that if the call is made as follows the timeout fires continuously: setTimeout($.get("http://localhost:8080/status", function(data) { UpdateStatus(data);}), 1000); While if use a function instead the timeout fires every 1000 ms: setTimeout(function() {$.get("http://localhost:8080/status", function(data) { UpdateStatus(data);})}, 1000); Why?

    Read the article

< Previous Page | 59 60 61 62 63 64 65 66 67 68 69 70  | Next Page >