Search Results

Search found 11238 results on 450 pages for 'miserable variable'.

Page 27/450 | < Previous Page | 23 24 25 26 27 28 29 30 31 32 33 34  | Next Page >

  • problem with adding url variable with javascript

    - by Richard
    Hello, Can someone help me with this I am trying to set and catch the url variable It begins with a form wich has the standard action set to "/autorisation/logout" Then a button with an inline javascript function function tbPayout() { parent.location = "/autorisation/logout?rcgo=payout"; return true; } <input src="/images/go02.gif" type=image border=0 name="go1" onClick="return tbPayout();"> In the autorisation controller I try to catch it if ( isset($_GET['rcgo']) ) { but it doesn't work and I can't see the variable in the url and therefore the default forms action is performed? I also have another redirect page with content="3; url=http://www.domain.nl/index/index?rcgo=logout" /> and that works fine How can I get the javascript to work because I have three submit buttons that need to be set to different get variables. Thanks, Richard

    Read the article

  • Know if a variable is a native object in javascript

    - by mck89
    Hi, is there a way to know if a variable passed into a function is a native object? I mean, i have a function that requires only native objects as arguments, for every other type of variable it throws an error. So: func(Array); //works func(String); //works func(Date); //works func(Object); //works ... func([]); //Throwr error func({}); //Throws error I want to know if there's a way to distinguish between native objects and everything else.

    Read the article

  • How to use a variable in an awk expression

    - by lugte098
    I'm trying to make this command: sed bla bla filename | awk '{printf "%s %s_entry_%.3f %.3f %.3f %.3f",$1,$3,$4,$5,$6,$7}' But the thing is, i want the %.3f part to be variable. So in one case it could be %.3f and in another it could be %.3f %.3f %.3f. So i'll just use a static one in my example code for clarity. So if i want 4 of these %.3f and put them in variable $values like so: values="%.3f %.3f %.3f %.3f" Then how can i put this string in the awk expression, without making awk to just put literally "${values}" in there. The following is my non-working-attempt: sed bla bla filename | awk '{printf "%s %s_entry_${values}",$1,$3,$4,$5,$6,$7}'

    Read the article

  • global scope of variable

    - by shantanuo
    The following shell scrip will check the disk space and change the variable "diskfull" to 1 if the usage is more than 10% The last echo always shows 0 I tried the global diskfull=1 in the if clause but it did not work. How do I change the variable to 1 if the disk consumed is more than 10% #!/bin/sh diskfull=0 ALERT=10 df -HP | grep -vE '^Filesystem|tmpfs|cdrom' | awk '{ print $5 " " $1 }' | while read output; do #echo $output usep=$(echo $output | awk '{ print $1}' | cut -d'%' -f1 ) partition=$(echo $output | awk '{ print $2 }' ) if [ $usep -ge $ALERT ]; then diskfull=1 exit fi done echo $diskfull

    Read the article

  • passing a variable to a ajax request Jquery

    - by user304735
    Hello, I am trying to pass a variable to an ajax request via jquery. I have a triggered event that defines the variable. I want to do this so that I can have one ajax request handle multiple urls. I have alerted the url and it come back fine, but when I plug it into the URL slot of a $.ajax request my targeted content does not load. Here is my code. $(document).ready(function(){ $('a').live('click', function(){ var link = $(this).attr("href"); $.ajax({ url: link, success: function(html){ $('#load').html(html) } }); }); }); this has been a real headache and I feel I am just misusing something. Please help.

    Read the article

  • Can Flash AS3 listbox data contain variable info?

    - by Anne
    I'm populating a listbox like this: dp.addItem( {label:"red dress", data:"OV4MP/23OL.swf"} ); Instead of data:"OV4MP/23OL.swf", I would like to make part of the data file name a variable from a dynamic textbox named centerPt that belongs to the parent movieclip, so I did this: dp.addItem( {label:"red dress", data:"OV4MP/23"+MovieClip(parent.parent).centerPt.text+".swf"} ); When I trace the selectedItem.data using: trace("you have selected: "+ overlays.selectedItem.data); trace(MovieClip(parent.parent).centerPt.text); I'm getting: you have selected: OV4MP/23.swf. What I should get is OV4MP/23OL.swf. It is not picking up what is in the dynamic centerPt.text field which are the letters OL eventhough that text field is tracing correctly. Is it possible that data can not hold a variable? Thank you in advance for any help. Anne

    Read the article

  • Xpath help. Get childnode with variable name

    - by Kim Andersen
    I have the following XML: <StatsContainer> <Variant1>0</Variant1> <Variant2>0.5</Variant2> <Variant3>1.2</Variant3> <Variant4>4.1</Variant4> <Variant5>93.9</Variant5> <Variant6>0.3</Variant6> <Variant7>0</Variant7> <Variant8>0</Variant8> <Variant9>0</Variant9> <Variant10>0</Variant10> <Variant11>0</Variant11> <Variant12>0</Variant12> <GlobalVariant1>4.6</GlobalVariant1> <GlobalVariant2>40.4</GlobalVariant2> <GlobalVariant3>13.8</GlobalVariant3> <GlobalVariant4>2.8</GlobalVariant4> <GlobalVariant5>35.6</GlobalVariant5> <GlobalVariant6>2.8</GlobalVariant6> <GlobalVariant7>0</GlobalVariant7> <GlobalVariant8>0</GlobalVariant8> <GlobalVariant9>0</GlobalVariant9> <GlobalVariant10>0</GlobalVariant10> <GlobalVariant11>0</GlobalVariant11> <GlobalVariant12>0</GlobalVariant12> <MosaicType>Boligtype</MosaicType> <OverRepresentedVariant>5</OverRepresentedVariant> </StatsContainer> As you can see I have a number in the "OverRepresentedVariant"-tag. This number can change from time to time. What i Need is to grab the "Variant"-tag with the right number. In the above case I need to get the value from the "Variant5"-tag (93.9). Tomorrow the "OverRepresentedVariant"-value might have changed to 3, this would mean that I should now grab the "Variant3"-value instead. So this is what I got. I have a variable called $btOver which contains the above XML. I also have a variable called $btId which contains the "OverRepresentedVariant"-value like this: <xsl:variable name="btId" select="$btOver/OverRepresentedVariant" /> So now I need some help finding the Variant-tags with the right ID. The tags that I need will always be named "Variant" followed by an id. So how can I get the right tag? Thanks a lot in advance folks. /Kim Andersen

    Read the article

  • Compile redeclaration error of global variable in C++, but not in C.

    - by coelhudo
    Suppose that I have those three files: a.h //a.h header #include <stdio.h> int int_variable; void a_f() { printf("int_variable: %d\n", int_variable) int_variable++; } b.h //b.h header #include <stdio.h> int int_variable; void b_f() { printf("int_variable: %d\n", int_variable) int_variable++; } main.c //main.c #include "a.h" #include "b.h" int main() { a_f(); b_f(); return 0; } Why compiling in C++ generates redefinition error, but in C doesn't? I am C++ developer, then in C++ makes sense to me, but why in C this is not an error? When I executed the C generated code, the output was: int variable: 0 int variable: 1 Thanks

    Read the article

  • ASP.NET Error when referencing a code-behind variable

    - by mattgcon
    I have an aspx page that is supposed to reference a code-behind variable but I am receiving an error of "The name [variable] does not exist in the current context" Here is the aspx code <%@ Control Language="C#" AutoEventWireup="true" Inherits="IPAM.Website.Controls.controls_event_header" Codebehind="event_header.ascx.cs" %> <%# strEventLink %> <h3><%# strEventDate %></h3> <%# strLinks %> Here is part of the aspx.cs code declaring those variables: public string strEventLink = ""; public string strEventDate; public string strLinks = ""; Here is the part of the aspx.cs code where it sets those variables: strEventLink = "<h2>" + parent.Name + "</h2>"; strLinks += "<p><font size=\"+1\"><a href=\"" + Page.ResolveUrl("~" + strScheduleLink) + "\"><b>" + strScheduleLinkText + "</b></a></font></p>\n"; strEventDate = ei.DateSpan; Please help me with this problem

    Read the article

  • Dereferencing pointers without pointing them at a variable

    - by Miguel
    I'm having trouble understanding how some pointers work. I always thought that when you created a pointer variable (p), you couldn't deference and assign (*p = value) unless you either malloc'd space for it (p = malloc(x)), or set it to the address of another variable (p = &a) However in this code, the first assignment works consistently, while the last one causes a segfault: typedef struct { int value; } test_struct; int main(void) { //This works int* colin; *colin = 5; //This never works test_struct* carter; carter->value = 5; } Why does the first one work when colin isn't pointing at any spare memory? And why does the 2nd never work? I'm writing this in C, but people with C++ knowledge should be able to answer this as well.

    Read the article

  • Variable height header with scrollable content area filling remaining viewport area

    - by Neutrino
    I've seen versions of this simple problem raised a dozen times here and elsewhere on the web, but I haven't seen a solution that works for me yet so I'm asking it again. I want a webpage with a variable height full width header (height based on contents). Below that I want a content area that fills the rest of the browser viewport. If the content is larger than the remaining space in the viewport then I want the content area to scroll. I don't need this to work on IE6. I don't care whether the solution uses CSS, tables or a mixture of the two, just no frames and no Javascript. For a bonus point fix a variable height footer to the bottom of the page.

    Read the article

  • Jquery Text Variable

    - by Batfan
    I am trying to get jquery to pick up variable that I am defining and I'm having issues doing it. $.ajax({ url: "sitemap.php", cache: false, success: function(html){ $("#results").append(html); var $seriestitle = $("#define-title").text(); $('#results a:contains("$seriestitle")').addClass('current-series'); $('a:not(".current-series")').hide(); } }); This is the code I am using. You can view the page at the following URL: http://benjammindesigns.com/XML/details/1231.html There is a span on the page, with the ID 'define-title', that contains text. I am trying to pull the text from that span and use it as my variable. Any info is greatly appreciated.

    Read the article

  • Embedding a YouTube Video Based on a PHP Variable

    - by jeffpm
    I have a website that I am creating for a class project. The website shows information about bands (which is stored in a mysql database). I am trying to spruce up the site a bit, and I would like to embed a YouTube video based on the band's name. Say, for instance, I have "Led Zeppelin" stored in my database. How can I take a PHP variable containing "Led Zeppelin", search YouTube using that variable, find a random video, and then embed that in the website? From the research I've done, it seems you can only embed YouTube videos if you know the exact address of the video. Thanks!

    Read the article

  • Ant ignores attempt to override the LANG environment variable

    - by Steen
    We need to test a java build with the languages set to different values. I can manually (i.e. via export LANG=en_DK.UTF-8 and export LANG=en_DK) test that the unit tests run with the ant build script behaves differently, but I need to set the environment variable from ant. I have tried setting it using these methods (with the shell $LANG set to en_DK.UTF-8): using -D on the command line: ant -DLANG=en_DK using a build.properties file with the line LANG=en_DK in it using the following statements in the build.xml file (sorry for the formatting, I can't get SO to display it otherwise): : <property environment="ANTENV"/> <property name="ANTENV.LANG" value="en_DK"/> Using any of the three possibilities, and when run with -debug, ant reports that: Override ignored for property "LANG" What can I do to set the LANG environment variable from within ant?

    Read the article

  • PHP reading 'get' variable that may or may not have been set

    - by thecoshman
    Simply put, if you try to read the value of a get variable, what happens if said variable had not be put into the URL. Example: you request the page test.php, in that file it tries to read the value of $_GET['message']. What happens in this case? dose the value just get returned as ''? Dose this mean, that if I am always expecting a value to be entered, and am not willing to accept a value of '' that I can just do something like $foo = $_GET['bar']; if($foo == ''){ // Handle my 'error' } else { // $foo should now have a value that I can work with } Please bare in mind I know that I could use isset($_GET['bar']) But I don't just want to know if it is set, I don't care if it is or not, I just care if it has a value that is more then just an empty string.

    Read the article

  • PHP/Javascript - get php variable within javascript

    - by McNabbToSkins
    I have run into an interesting problem. I am currently developing php page and need to access a php variable within the javascript onload. $(document).ready(function() { var temp = <?php $page_id ?> } is this valid? I know that this might seem weird and not be allowed but I am developing a page that has two popup windows. The windows are created using the same view template and there is no way to distinguish between each other. If I stored a hidden value on the page with information unique to the page like so <input type="hidden" value="<?php $page_id ?> id="page_id" /> if there are two views open at the same time there is no way for me to get a unique page id like so var temp = $("#page_id").val(); Because there are two views witht he same input id that is not unique. Long story short is it valid to reference a php variable in the javascript.

    Read the article

  • How to Access a Private Variable?

    - by SoulBeaver
    This question isn't meant to sound as blatantly insulting as it probably is right now. This is a homework assignment, and the spec sheet is scarce and poorly designed to say the least. We have a function: double refuel( int liter, GasStation *gs ) { // TODO: Access private variable MaxFuel of gs and decrement. } Sound simple enough? It should be, but the class GasStation comes with no function that accesses the private variable MaxFuel. So how can I access it anyway using the function refuel? I'm not considering creating a function setFuel( int liter ) because the teacher always complains rather energetically if I change his specification. So... I guess I have to do some sort of hack around it, but I'm not sure how to go about this without explicitely changing the only function in GasStation and giving it a parameter so that I can call it here. Any hints perhaps?

    Read the article

  • Unable to access global variable defined in settings.php [Drupal]

    - by Senthil
    I am developing a website using Drupal 6.16. I want to define a variable in settings.php like $ge_path = 'some/path/here'; And I want to use it inside my modules. function mymodule_block(....) { global $ge_path; $fullPath = $ge_path . '/another/path'; doSomething($fullPath); } But I am getting NULL as the value of $ge_path. Why am I not able to access the global variable defines in settings.php? How can I get the proper value inside my module functions? The funny thing is, I am able to access $db_url['default'] and $db_url['mydatabase'] etc.. which are defined just two lines above $ge_path in settings.php!

    Read the article

  • How can I return a sql select into a sql variable

    - by Matt
    Hi, I'm trying to put the results of a SELECT into a variable and loop through the results to manipulate that data, all in the same stored proceedure... Here's what I have so far: DECLARE @i int @Result = (SELECT * FROM UserImport) SET @i = 0 WHILE @i < (SELECT Count(@Result) As Count) BEGIN /* Do Stuff */ END I know I'm way off because it's saying @Result was not declared, but I'm not sure how to declare a variable to be able to hold the results of a SELECT statement. Can anyone tell me where i'm going wrong and how to fix it? Thanks, Matt

    Read the article

  • plupload variable upload path?

    - by SoulieBaby
    Hi all, I'm using plupload to upload files to my server (http://www.plupload.com/index.php), however I wanted to know if there was any way of making the upload path variable. Basically I need to select the upload path folder first, then choose the files using plupload and then upload to the initially selected folder. I've tried a few different ways but I can't seem to pass along the variable folder path to the upload.php file. I'm using the flash version of plupload. If someone could help me out, that would be fantastic!! :) Here's my plupload jquery: jQuery.noConflict(); jQuery(document).ready(function() { jQuery("#flash_uploader").pluploadQueue({ // General settings runtimes: 'flash', url: '/assets/upload/upload.php', max_file_size: '10mb', chunk_size: '1mb', unique_names: false, // Resize images on clientside if we can resize: {width: 500, height: 350, quality: 100}, // Flash settings flash_swf_url: '/assets/upload/flash/plupload.flash.swf' }); }); And here's the upload.php file: <?php /** * upload.php * * Copyright 2009, Moxiecode Systems AB * Released under GPL License. * * License: http://www.plupload.com/license * Contributing: http://www.plupload.com/contributing */ // HTTP headers for no cache etc header('Content-type: text/plain; charset=UTF-8'); header("Expires: Mon, 26 Jul 1997 05:00:00 GMT"); header("Last-Modified: ".gmdate("D, d M Y H:i:s")." GMT"); header("Cache-Control: no-store, no-cache, must-revalidate"); header("Cache-Control: post-check=0, pre-check=0", false); header("Pragma: no-cache"); // Settings $targetDir = $_SERVER['DOCUMENT_ROOT']."/tmp/uploads"; //temp directory <- need these to be variable $finalDir = $_SERVER['DOCUMENT_ROOT']."/tmp/uploads2"; //final directory <- need these to be variable $cleanupTargetDir = true; // Remove old files $maxFileAge = 60 * 60; // Temp file age in seconds // 5 minutes execution time @set_time_limit(5 * 60); // usleep(5000); // Get parameters $chunk = isset($_REQUEST["chunk"]) ? $_REQUEST["chunk"] : 0; $chunks = isset($_REQUEST["chunks"]) ? $_REQUEST["chunks"] : 0; $fileName = isset($_REQUEST["name"]) ? $_REQUEST["name"] : ''; // Clean the fileName for security reasons $fileName = preg_replace('/[^\w\._]+/', '', $fileName); // Create target dir if (!file_exists($targetDir)) @mkdir($targetDir); // Remove old temp files if (is_dir($targetDir) && ($dir = opendir($targetDir))) { while (($file = readdir($dir)) !== false) { $filePath = $targetDir . DIRECTORY_SEPARATOR . $file; // Remove temp files if they are older than the max age if (preg_match('/\\.tmp$/', $file) && (filemtime($filePath) < time() - $maxFileAge)) @unlink($filePath); } closedir($dir); } else die('{"jsonrpc" : "2.0", "error" : {"code": 100, "message": "Failed to open temp directory."}, "id" : "id"}'); // Look for the content type header if (isset($_SERVER["HTTP_CONTENT_TYPE"])) $contentType = $_SERVER["HTTP_CONTENT_TYPE"]; if (isset($_SERVER["CONTENT_TYPE"])) $contentType = $_SERVER["CONTENT_TYPE"]; if (strpos($contentType, "multipart") !== false) { if (isset($_FILES['file']['tmp_name']) && is_uploaded_file($_FILES['file']['tmp_name'])) { // Open temp file $out = fopen($targetDir . DIRECTORY_SEPARATOR . $fileName, $chunk == 0 ? "wb" : "ab"); if ($out) { // Read binary input stream and append it to temp file $in = fopen($_FILES['file']['tmp_name'], "rb"); if ($in) { while ($buff = fread($in, 4096)) fwrite($out, $buff); } else die('{"jsonrpc" : "2.0", "error" : {"code": 101, "message": "Failed to open input stream."}, "id" : "id"}'); fclose($out); unlink($_FILES['file']['tmp_name']); } else die('{"jsonrpc" : "2.0", "error" : {"code": 102, "message": "Failed to open output stream."}, "id" : "id"}'); } else die('{"jsonrpc" : "2.0", "error" : {"code": 103, "message": "Failed to move uploaded file."}, "id" : "id"}'); } else { // Open temp file $out = fopen($targetDir . DIRECTORY_SEPARATOR . $fileName, $chunk == 0 ? "wb" : "ab"); if ($out) { // Read binary input stream and append it to temp file $in = fopen("php://input", "rb"); if ($in) { while ($buff = fread($in, 4096)){ fwrite($out, $buff); } } else die('{"jsonrpc" : "2.0", "error" : {"code": 101, "message": "Failed to open input stream."}, "id" : "id"}'); fclose($out); } else die('{"jsonrpc" : "2.0", "error" : {"code": 102, "message": "Failed to open output stream."}, "id" : "id"}'); } //Moves the file from $targetDir to $finalDir after receiving the final chunk if($chunk == ($chunks-1)){ rename($targetDir . DIRECTORY_SEPARATOR . $fileName, $finalDir . DIRECTORY_SEPARATOR . $fileName); } // Return JSON-RPC response die('{"jsonrpc" : "2.0", "result" : null, "id" : "id"}'); ?>

    Read the article

  • variable names in function definition, call and declaration

    - by yCalleecharan
    Hi, I see C books that use the same variable names in the function definition, calling function and declaration. Others use the same variable names in the calling function and in the declaration/prototype but a different one in the definition as in: void blabla(int something); //prototype blabla(something) // calling function inside main after something has been initialized to int void blabla(int something_else) //definition I have two questions: What convention is best to use in C?; Does the convention apply regardless whether a value is being passed "by-value" or if it's being passed by a pointer? Thanks a lot...

    Read the article

  • Using device variable by multiple threads on CUDA

    - by ashagi
    I am playing around with cuda. At the moment I have a problem. I am testing a large array for particular responses, and when I get the response, I have to copy the data onto another array. For example, my test array of 5 elements looks like this: [ ][ ][v1][ ][ ][v2] Result must look like this: [v1][v2] The problem is how do I calculate the address of the second array to store the result? All elements of the first array are checked in parallel. I am thinking to declare a device variable int addr = 0. Every time I find a response, I will increment the addr. But I am not sure about that because it means that addr may be accessed by multiple threads at the same time. Will that cause problems? Or will the thread wait until another thread finishes using that variable?

    Read the article

  • Search a variable for an address

    - by chrissygormley
    Hello, I am trying to match information stored in a variable. I have a list of uuid's and ip addresses beside them. The code I have is: r = re.compile(r'urn:uuid:5EEF382F-JSQ9-3c45-D5E0-K15X8M8K76') m = r.match(str(serv)) if m1: print'Found' The string serv contains is: urn:uuid:7FDS890A-KD9E-3h53-G7E8-BHJSD6789D:[u'http://10.10.10.20:12365/7FDS890A-KD9E-3h53-G7E8-BHJSD6789D/'] --------------------------------------------- urn:uuid:5EEF382F-JSQ9-3c45-D5E0-K15X8M8K76:[u'http://10.10.10.10:42365'] --------------------------------------------- urn:uuid:8DSGF89S-FS90-5c87-K3DF-SDFU890US9:[u'http://10.10.10.40:5234'] --------------------------------------------- So basically I am wanting to find the uuid string and find out what it's address is and store it as a variable. So far I have just tried to get it to match the string to no avail. Can anyone point out a solution to this. Thanks

    Read the article

  • What happened to the TMP environment variable?

    - by Mark0978
    I always heard that the proper way to find the temporary folder on a UNIX machine was to look at the TMP environment variable. When writing code that worked on Windows as well as Linux, I would check for TEMP and TMP. Today, I discovered that my Ubuntu install does not have that environment variable at all. I know it seems you can always count on /tmp being there to put your temporary files in, but I understood that TMP was the way the user could tell you to put the temporary files someplace else. Is that still the case?

    Read the article

  • Variable declarations following if statements

    - by Anthony Pegram
    An issue came up on another forum and I knew how to fix it, but it revealed a feature of the compiler peculiar to me. The person was getting the error "Embedded statement cannot be a declaration or labeled statement" because they had a declaration of a variable following an if statement with no brackets. That was not their intent, but they had commented out the line of code immediately following the if statement, which made the variable declaration the de facto line of code to execute. Anyway, that's the background, which brings me to this. The following code is illegal if (true) int i = 7; However, if you wrap that in brackets, it's all legal. if (true) { int i - 7; } Neither piece of code is useful. Yet the second one is OK. What specifically is the explanation for this behavior? I have a hypothesis, but I'd rather ask the brilliant people on stackoverflow.

    Read the article

< Previous Page | 23 24 25 26 27 28 29 30 31 32 33 34  | Next Page >