Search Results

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

Page 12/297 | < Previous Page | 8 9 10 11 12 13 14 15 16 17 18 19  | Next Page >

  • Using JSON, passing variable from php to javascript

    - by Ryan Fung
    I wonder why it is not working? check_login.php <?php session_start(); $data = array("username" => "true"); echo json_encode($data); ?> my js file var linkName; $.ajax({ type: "POST", url: "check_login.php", dataType: "json", success: function(json){ if(json.username != "true") { //do something } } }); I am trying to get the username after checking whether or not the user has signed in yet in the php file, something like passing a session variable. But currently passing a string seems to already have a problem. Any know what I did wrong here? Still not working the code above. Anyone want to help me out here?

    Read the article

  • Passing arguments to java vm from NSIS script

    - by CodeBuddy
    I'm developing my first java application using Eclipse. I've recently needed to adjust the amount of memory allocated by passing -Xmx256M to the JVM. The application is currently package up as a runnable jar and installed using the NSIS. I'm having a problem passing arguments to the jar file once its installed. What is the common practice for doing this? Here is what I'm currently doing in my nsi file: CreateShortcut "$SMPROGRAMS\$StartMenuGroup\$(^Name).lnk" "$SYSDIR\javaw.exe" "-jar -Xmx256M $INSTDIR\Foo.jar" This results in the following being created as the shortcut Target on windows: C:\WINDOWS\system32\javaw.exe -jar -Xmx256M C:\Program Files\Foo\Foo.jar Unfortunately this does not work due to the space in C:\Program Files, If I change the link created manually to include quotes all is well: C:\WINDOWS\system32\javaw.exe -jar -Xmx256M "C:\Program Files\Foo\Foo.jar"

    Read the article

  • Passing ASP.NET User by Dependency Injection

    - by UpTheCreek
    In my web application I have various components that need to access the currently authenticated user (HttpContext.User). There are two obvious ways a component can access this: 1) Accessing getting the User from HttpContext.Current 2) Passing the user around in constructors Is not ideal because it makes testing difficult and ties application components to web concerns, when they really shouldn't know about it. Is just messy and complicates everything. So I've been thinking about passing in the current user (or perhaps just the name/id) to any component that needs it using an IoC container (via dependency injection). Is anyone using this technique to supply the current ASP.NET user to parts of the application? Or, Does this sound like a sensible approach? I would like know how this has worked out for people. Thanks

    Read the article

  • Conventional Approaches for Passing Data to Back-End?

    - by Calvin
    Hi guys, I'm fairly new to web development, so please pardon the painfully newbie question that's about to follow. My computer science class group and I are developing a web application for class, which is built in Python (under Django) and uses jQuery on the front end. It's primarily an AJAX-ified application, and passing data from the backend to the front end is done through AJAX calls to specific URLs which return JSON. This is probably a stupid question, but what's the conventional approach for passing data in the opposite direction? We don't want to reload the page or anything, so is it an AJAX pass going the other way or something? Thanks in advance for your help!

    Read the article

  • c# passing method names as the argument in a method

    - by Alan Bennett
    hi guys, I have a recuring method which shows up many times in my code its basically checking to make sure that the connection to the odbc is ok and then connects but each time this method is called it calls another method and each instance of the main method this one is different, as each method is about 8 lines of code having it 8 times in the code isnt ideal. so basically i would like to have just one method which i can call passing the name of the new method as an arguement. so basically like: private void doSomething(methodToBeCalled) { if(somthingistrue) { methodToBeCalled(someArgument) } } is this possible? thanks in advance

    Read the article

  • Creating new process with Lua interpreater, failures in passing argumets

    - by user1131997
    I need help with passing arguments in CreateProcess() //Windows I want to: BOOL status = CreateProcess(L"C:\\Program Files (x86)\\Lua\\lua52.exe", NULL, NULL, NULL, FALSE, NULL, NULL, NULL, &si, &pi); But with passing some arguments.... Lua interpreater accepts file with lua-scripts, so I have prepared it and want to do: lua52 C:\1.lua for example... I have the path of some lua-script and want the interpreater of Lua to interpreate it and than get the result of program on Lua from Created process. I have tried in some ways to do it, but no success. Please, help! Thank you!

    Read the article

  • fetchedResultsController objectAtIndexPath: i "Passing argument 1 of objectAtIndexPath: makes pointer from integer without cast

    - by cocos2dbeginner
    NSMutableDictionary* dict = [[NSMutableDictionary alloc] init]; id <NSFetchedResultsSectionInfo> sectionInfo = [[self.fetchedResultsController sections] objectAtIndex:0]; for (int i; i<[sectionInfo numberOfObjects]; i++) { NSManagedObject *o = [self.fetchedResultsController objectAtIndexPath:i]; [dict setObject:[[o valueForKey:@"frontCard"] description] forKey:@"frontCard"]; [dict setObject:[[o valueForKey:@"flipCard"] description] forKey:@"flipCard"]; } In this line NSManagedObject *o = [self.fetchedResultsController objectAtIndexPath:i]; i get this warning: warning: passing argument 1 of 'objectAtIndexPath:' makes pointer from integer without a cast

    Read the article

  • passing dynamic values in callback method

    - by swastican
    is there a way to pass dynamic values to callback function in js or jquery or nodejs. for(var i = 0; i < 10; i++) { filename = 'file'+i+'.html'; request(url, function(error, response, body) { test(error, response, body, filename); }); function test(error, response, body, filename) { console.log('file name ' + filename); if(response.statusCode == 200){ console.log('done'); } } I refered this so article for passing values to callback function. link: [JavaScript: Passing parameters to a callback function the output always seems to be 9 How can i pass values dynamically? The callback function always refers the last value of filename.

    Read the article

  • Crystal reports - connection to JDBC failed

    - by Gabriela
    Hello, I am trying to make a connection to JDBC(JNDI) in Crystal Reports and I get the following error : Invalid Argument provided. Details: Java Server startup failure. Please verify the PATH (JDK), CLASSPATH and IORFileLocation properties in the CRConfig.xml file. In addition, please verify you are using JDK 1.4. I am using the connector : mysql-connector-java-5.1.6-bin.jar, jDK 1.6. Thank you!

    Read the article

  • storing passed arguments in separate variables -shell scripting

    - by Nathan Pk
    In my script "script.sh" , I want to store 1st and 2nd argument to some variable and rest to another separate variable. What command I must use to implement this task? Number of arguments that is passed to a script is random) When I run the command in console ./script.sh abc def ghi jkl mn o p qrs xxx #It can have any number of arguments In this case, I want my script to store "abc" and "def" in one variable. "ghi jkl mn o p qrs xxx" should be stored in another variable.

    Read the article

  • In GWT 2.1.0.M2 the options "-style pretty" couldn't be recognized

    - by Whistle
    I am using GWT eclipse plugin and try to add option "-style pretty" inside arguments tab of debug configuration window in eclipse. But after click debug it just prompts "Unknown argument: -style". I used to use webcreator to create gwt app. this is my first time to use plugin and i am not sure i put it into the right place or gwt 2.1.0.M2 just doesn't support this option (which is wired). Please help me thanks in advance.

    Read the article

  • Telerik asp.net mvc datepicker "Invalid argument" in Internet Explorer (IE) 8

    - by GlobalCompe
    I am using Telerik asp.net mvc extensions. I have an issue that happens only in IE. I have IE 8. I don't have this issue in Firefox (3.6.3) or Chrome (4.1.249.1059) The problem happens when I want to pick a particular date by first clicking on the year on top and then the month. At that time, I get Invalid Argument error in jquery-1.4.2.min.js I am using VS2008 SP1 with ASP.NET MVC 2 RC2. I have tried this in a new asp.net mvc solution after "manually" modifiying it to become MVC 2 compliant and then doing all that telerik says on this page link text And finally using Datepicker in the Home/Index.aspx <%= Html.Telerik().DatePicker() .Name("DatePicker") % Has anybody else run into this issue?

    Read the article

  • "TypeError: draw() takes exactly 1 non-keyword argument (3 given)"

    - by Amorack
    I wrote this code to open a window with Pyglet in Python... import pyglet from pyglet import window class Window(pyglet.window.Window): def __init__(self): super(Window, self).__init__() myLabel = pyglet.text.Label("Prototype") windowText = myLabel.draw(Window, "Hello World", font_name = "Times New Roman", font_size = 36, color = (193, 205, 193, 255)) def on_draw(self): self.clear() self.label.draw() if __name__ == '__main__': window = Window() pyglet.app.run() however every time I run it I get this error: TypeError: draw() takes exactly 1 non-keyword argument (3 given) AFAIK the "(3 given)" means the problem is with the font_size or color arguments but I'm not sure. Could someone explain what's wrong and help me make this work?

    Read the article

  • Covariance and Contravariance on the same type argument

    - by William Edmondson
    The C# spec states that an argument type cannot be both covariant and contravariant at the same time. This is apparent when creating a covariant or contravariant interface you decorate your type parameters with "out" or "in" respectively. There is not option that allows both at the same time ("outin"). Is this limitation simply a language specific constraint or are there deeper, more fundamental reasons based in category theory that would make you not want your type to be both covariant and contravariant? Edit: My understanding was that arrays were actually both covariant and contravariant. public class Pet{} public class Cat : Pet{} public class Siamese : Cat{} Cat[] cats = new Cat[10]; Pet[] pets = new Pet[10]; Siamese[] siameseCats = new Siamese[10]; //Cat array is covariant pets = cats; //Cat array is also contravariant since it accepts conversions from wider types cats = siameseCats;

    Read the article

  • Invalid Argument IE 8 jQuery

    - by Deshiknaves
    Hi, I have this particular script that runs so that the flash elements don't show up on top of my slide out navigation. This redraws that flash element with wmode as opaque and so it shows up under the navigation. Works perfectly with Chrome and FireFox but not with IE. In IE I get an Invalid Argument in jquery.min.js code 0 Line 103 char 460. Can anyone help me as to why? If I comment out the second line of code inside the function then there is no error, but then doesn't work in FireFox. Any help is appriciated. $(window).load(function(){ $('embed').attr('wmode','opaque'); $('object').append('<param name="wmode" value="opaque">'); $('object').wrap('<div>'); });

    Read the article

  • ASP .NET - Substitution and page output (donut) caching - How to pass custom argument to HttpRespons

    - by zzare
    I would like to use substitution feature of donut caching. public static string GetTime(HttpContext context) { return DateTime.Now.ToString("T"); } ... The cached time is: <%= DateTime.Now.ToString("T") %> <hr /> The substitution time is: <% Response.WriteSubstitution(GetTime); %> ...But I would like to pass additional parameter to callback function beside HttpContext. so the question is: How to pass additional argument to GetTime callback? for instance, something like this: public static string GetTime(HttpContext context, int newArgument) { // i'd like to get sth from DB by newArgument // return data depending on the db values // ... this example is too simple for my usage if (newArgument == 1) return ""; else return DateTime.Now.ToString("T"); }

    Read the article

  • Problem with email validation: Invalid procedure call or argument: 'Mid'

    - by Huseyin
    I tried to control email address and reviewer's name with the following code but I received this error. Microsoft VBScript runtime error '800a0005' Invalid procedure call or argument: 'Mid' Cant I compare Mid(REVIEWEREMAIL, InStr(1, REVIEWEREMAIL, "@", 1), 1) to "@"? If Len(REVIEWERNAME) < 2 Then with response .write "Error! Please fill in valid name. <br />" end with ElseIf Len(REVIEWEREMAIL) < 3 Then with response .write "Error! Please fill in valid email address. <br />" end with ElseIf Mid(REVIEWEREMAIL, InStr(1, REVIEWEREMAIL, "@", 1), 1) <> "@" Then with response .write "Error! Please fill in valid email address. <br />" end with Else insert... End If

    Read the article

  • "Invalid Postback or callback argument" on modifying the DropDownList on the client side

    - by gnomixa
    I know why it's happening and i turned the validation on the page level, but is there a way to turn it off on the control level? "Invalid Postback or callback argument . Event validation is enabled using in configuration or <%@ Page EnableEventValidation="true" %in a page. For security purposes, this feature verifies that arguments to Postback or callback events originate from the server control that originally rendered them. If the data is valid and expected, use the ClientScriptManager.RegisterForEventValidation method in order to register the Postback or callback data for validation."

    Read the article

  • Python "draw() must be called with Label instance as first argument (got _WindowMetaclass instance i

    - by Amorack
    This is a class I made using Python with pyglet to display a window. class Window(pyglet.window.Window): def __init__(self): super(Window, self).__init__() pyglet.text.Label("Prototype") windowText = text.Label.draw(Window, "Hello World", font_name = "Times New Roman", font_size = 36, color = (193, 205, 193, 255)) def on_draw(self): self.clear() self.label.draw() Every time I try to run it I get the error "TypeError: unbound method draw() must be called with Label instance as first argument (got _WindowMetaclass instance instead)". I'm pretty sure I know what I have to do (find how to get Label's instance) just not how to do it. Could someone help me understand how to make this work?

    Read the article

  • Specify an inline callback function as an argument.

    - by Matthias Vance
    LS, Let me first explain what I'm trying to achieve using some pseudo-code (JavaScript). // Declare our function that takes a callback as as an argument, and calls the callback with true. B(func) { func(true); } // Call the function B(function(bool success) { /* code that uses success */ }); I hope this says it all. If not, please comment on my question so I can write a little more to clarify my issue. What I want is to have code like this in C++. I have tried to use lambda functions, but I was unable to specify a parameter type for those. Kind regards, Matthias Vance

    Read the article

  • expr non-numeric argument shell script

    - by Kimi
    The below check is not working : expr non-numeric argument shell script. Always it is going to else. Please tell me what is the mistake. Earlier I was no using while so the same thing was woring fine now suddenly when I did put it in the while loop it is no working. echo "`${BOLD}` ***** Checking Memory Utilization User*****`${UNBOLD}`" echo "===================================================" IFS='|' cat configMachineDetails.txt | grep -v "^#" | while read MachineType UserName MachineName do export MEMORY_USAGE1=`ssh -f -T ${UserName}@${MachineName} prstat -t -s rss 1 2 | tr '%' ' '| awk '$5>5.0'` export LEN=`echo "$MEMORY_USAGE1"|wc -l` export CNPROC=`echo "$MEMORY_USAGE1"|grep "NPROC"|wc -l` export CTotal=`echo "$MEMORY_USAGE1"|grep "Total"|wc -l` **if [ $LEN = `expr $CNPROC + $CTotal` ] then echo "`${BOLD}`**************All usages are normal !!!!!! *************`${UNBOLD}`" else echo "`${BOLD}`**** Memory(%) is more than 5% in MachineType $MachineType UserName $UserName MachineName $MachineName *******`${UNBOLD}`" echo "====================================================" echo "$MEMORY_USAGE1" fi** done

    Read the article

  • msginit email address command line argument?

    - by C.W.Holeman II
    msginit prompts for an email address. Is there a way to tell msginit what email address to use without being prompted for it such as a command line argument? cat >hellogt.cxx <<EOF // hellogt.cxx #include <libintl.h> #include <locale.h> #include <iostream> int main (){ setlocale(LC_ALL, ""); bindtextdomain("hellogt", "./"); textdomain( "hellogt" ); std::cout << gettext("hello, world!") << std::endl; } EOF g++ -ohellogt hellogt.cxx xgettext -d hellogt -o hellogt.pot hellogt.cxx msginit -l es_MX -o spanish.po -i hellogt.pot

    Read the article

  • The second argument to copy() function cannot be a directory

    - by Jorm
    Anyone know why this: $title = trim($_POST['title']); $description = trim($_POST['description']); // Array of allowed image file formats $allowedExtensions = array('jpeg', 'jpg', 'jfif', 'png', 'gif', 'bmp'); foreach ($_FILES as $file) { if ($file['tmp_name'] > '') { if (!in_array(end(explode(".", strtolower($file['name']))), $allowedExtensions)) { echo '<div class="error">Invalid file type.</div>'; } } } if (strlen($title) < 3) echo '<div class="error">Too short title</div>'; else if (strlen($description) > 70) echo '<div class="error">Too long desccription.</div>'; else { move_uploaded_file($_FILES['userfile']['tmp_name'], 'c:\wamp\www\uploads\images/'); } Gives: Warning: move_uploaded_file() [function.move-uploaded-file]: The second argument to copy() function cannot be a directory in C:\wamp\www\upload.php on line 41 Warning: move_uploaded_file() [function.move-uploaded-file]: Unable to move 'C:\wamp\tmp\php1AB.tmp' to 'c:\wamp\www\uploads\images/' in C:\wamp\www\upload.php on line 41

    Read the article

  • setTimeout(fun) with a single argument

    - by Elazar Leibovich
    The HTML5 specifications states that setTimeout can be run without the additional "timeout" argument which is supposed to say after how many milliseconds will the function "handler" be scheduled. handle = window . setTimeout( handler [, timeout [, arguments ] ] ) Schedules a timeout to run handler after timeout milliseconds. Any arguments are passed straight through to the handler. However, I failed to find anywhere which explains what happens when no "timeout" time period is set. An example usage is, the animation implementation int the Raphael library. animationElements[length] && win.setTimeout(animation);

    Read the article

< Previous Page | 8 9 10 11 12 13 14 15 16 17 18 19  | Next Page >