Search Results

Search found 15797 results on 632 pages for 'session variables'.

Page 137/632 | < Previous Page | 133 134 135 136 137 138 139 140 141 142 143 144  | Next Page >

  • How Google is managing authentication between multiple domains?

    - by vaibhav
    I think everyone here would be knowing that, if I am logged in any of the google's website(i.e www.orkut.com), I don't need to authenticate again for www.gmail.com. How google is managing this. I think, it would be a cookie stored on user's browser. But, if it is a cookie, how different domains are able to read this cookie. What do you say.

    Read the article

  • How do I display a sting, based on which id is set as selected?

    - by Cam
    I'd like to display a text string (to be positioned above ul) depending on which link is set to selected by the chgClass fuction. The ids for each display via an alert right now, but I can't seem to make them appear in "english". I know I can set up an array stating "id=text string" but when I do it seems to break the code I already have... <script type="text/javascript"> var Lst; function CngClass(obj){ if (typeof(obj)=='string') obj=document.getElementById(obj); if (Lst) Lst.className=''; obj.className='selected'; Lst=obj; alert(obj.id); } </script> </head> <body onload="CngClass('POSITION_WITHOUT_NOTIFY')"> <div class="slider"> <ul class="bar"> <li class="deny"><a onclick="CngClass(this);" id="POSITION_NOT_ALLOWED" href="#">Deny</a></li> <li class="askDeny"><a onclick="CngClass(this);" id="NOTIFY_POSITION_IF_GRANTED" href="#">Ask Deny</a></li> <li class="askAllow"><a onclick="CngClass(this);" id="NOTIFY_POSITION_IF_NO_RESPONSE" href="#">Ask Allow</a></li> <li class="notify"><a onclick="CngClass(this);" id="NOTIFY_POSITION" href="#">Notfiy</a></li> <li class="allow"><a onclick="CngClass(this);" id="POSITION_WITHOUT_NOTIFY" href="#">Allow</a></li> </ul> </div> </body> </html>

    Read the article

  • Can you get the previous value of a variable in Java?

    - by The Special One
    Say way have a variable (let's say String Str) and the value of Str starts of as " " then as some code is running it is set to "test" then somewhere else in the code it is changed again to say "tester". Now in the program I want to find out what the previous value of Str was. Is this possible in Java? So I am saying that the variable gets changed twice, and you want to find out what Str was before it got changed for the second time. So in the example above the latest value of Str would be "tester" but I wanted to find out what Str was before this (assuming you had no idea what it was before it was changed to tester) in this case I would want to be able to find out that Str was "test". Is it at all possible to do this in Java?

    Read the article

  • Printing Variable names and contents as debugging tool; looking for emacs/Python shortcut

    - by Schof
    I find myself adding debugging "print" statements quite often -- stuff like this: print("a_variable_name: %s" % a_variable_name) How do you all do that? Am I being neurotic in trying to find a way to optimize this? I may be working on a function and put in a half-dozen or so of those lines, figure out why it's not working, and then cut them out again. Have you developed an efficient way of doing that? I'm coding Python in Emacs.

    Read the article

  • Long variable names

    - by RaouL
    Lets say i have a variable that contains the number of search engine names in a file, what would you name it? number_of_seach_engine_names search_engine_name_count num_search_engines engines engine_names other name? The first name describes what the variable contains precisely, but isn't it too long?, any advice for choosing variable names? especially how to shorten a name that is too long or what kind of abbreviations to use?

    Read the article

  • Flex Application for PlayBook Text Input Variable

    - by user568128
    I know this is probably a very simple question, but can someone please walk me through how to take what a user inputs into a s:TextInput and use that as a variable in a JSON data request? Basically, I want to have a user enter a search term, like "math" and then have that placed into a variable so I can use it in a JSON request. Something like public var q:String, except that my search box (and hence user input) is on another "view" of the application. I've just started with Flex Mobile applications and I might be way out of my league. Does anyone know how to do this?

    Read the article

  • Should I convert data arrays to objects in PHP in a CouchDB/Ajax app?

    - by karlthorwald
    I find myself converting between array and object all the time in PHP application that uses couchDB and Ajax. Of course I am also converting objects to JSON and back (for sometimes couchdb but mostly Ajax), but this is not so much disturbing my workflow. At the present I have php objects that are returned by the CouchDB modules I use and on the other hand I have the old habbit to return arrays like array("error"="not found","data"=$dataObj) from my functions. This leads to a mixed occurence of real php objects and nested arrays and I cast with (object) or (array) if necessary. The worst thing is that I know more or less by heart what a function returns, but not what type (array or object), so I often run into type errors. My plan is now to always cast arrays to objects before returning from a function. Of course this implies a lot of refactoring. Is this the right way to go? What about the conversion overhead? Other ideas or tips?

    Read the article

  • Trying to instantiate a class member in C++ with a variable name

    - by MarcZero
    Hello. I am writing a program for class that is asking us to create a class of "book". We are then supposed to create new instantiations of that class upon demand from the user. I am new to C++ so I am attempting to code this out but am running into a problem. The main problem is how do I instantiate a class with a variable if I don't know how many I will have to do ahead of time. The user could ask to add 1 book or 1000. I am looking at this basic code: This is the simple code I started with. I wanted to have an index int keep a number and have the book class I create be called by that int (0, 1, 2, etc...) So I attempted to convert the incoming index int into a string, but I'm kind of stuck from here. void addBook(int index){ string bookName; std::stringstream ss; ss << index; book bookName; cout << "Enter the Books Title: "; cin >> bookName.title; } But obviously this doesn't work as "bookName" is a string to the computer and not the class member I tried to create. All of the tutorials I have seen online and in my text show the classes being instantiated with names in the code, but I just don't know how to make it variable so I can create any amount of "books" that the user might want. Any insight on this would be appreciated. Thank you for your time.

    Read the article

  • Is this the right way to set a cookie?

    - by AAA
    // if login is ok then we add a cookie $_POST['user_name'] = stripslashes($_POST['user_name']); $hour = time() + 3600; setcookie(ID_my_site, $_POST['user_name'], $hour); setcookie(Key_my_site, $_POST['password'], $hour); Is this a right way to set cookies? Its been causing me serious redirect errors. See here: PHP Redirect problem with subdomain

    Read the article

  • Javascript Global Variable in Array

    - by user1387727
    My question may be very easy to lots of people, but I am new to Javascript. I really do not know what is wrong with the following codes. var newValue = 1; function getCurrentAmount() { return [newValue,2,3]; } var result = getCurrentAmount(); console.log(result[0] + "" + result[1] + result[2]); In the above code, the result shown in console is: undefined23 Why is the result not "123"? I am trying to use global variable because I want to increment newValue by 1 each time when the function is called. I want something like the following: var newValue = 1; function getCurrentAmount() { newValue ++; return [newValue,2,3]; } setInterval(function(){ var result = getCurrentAmount(); console.log(result[0] + "" + result[1] + result[2]); }, 1000); Also, I just tired the following codes and it works as expected. var newValue =1; function test() { newValue ++; return newValue; } console.log(test()); So I think the problem is about the Array. I hope my question is clear enough. Thanks in advance.

    Read the article

  • How do I execute a sql statement through a variable (dyname sql) that tries to do an insert into a variable table?

    - by Testifier
    If I do what I wanna do with a TEMPORARY TABLE, it works fine: DECLARE @CTRFR VARCHAR(MAX) SET @CTRFR = 'select blah blah blah' -- <-- very long select statement. this returns a 0 or some greater number. Please note! --> I NEED THIS NUMBER. IF EXISTS ( SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo][#CTRFRResult]') AND type IN ( N'U' ) ) DROP TABLE [dbo].[#CTRFRResult] CREATE TABLE #CTRFRResult ( CTRFRResult VARCHAR(MAX) ) SET @CTRFR = 'insert into #CTRFRResult ' + @CTRFR EXEC(@CTRFR) The above works fine. The problem is that several databases are using the same TEMP table. Therefore I need to use a VARIABLE table (instead of a temporary table). What I have below is not working because it says that the table must be declared. DECLARE @CTRFRResult TABLE ( CTRFRResult VARCHAR(MAX) ) SET @CTRFR = 'insert into @CTRFRResult ' + @CTRFR -- I think the issue is here. EXEC(@CTRFR) Setting @CTRFR to 'insert into...' is not working because I'm assuming the table name is out of scope. How would I go about mimicking the temporary table code using a variable table?

    Read the article

  • Android Static Variable Scope and Lifetime

    - by Edison
    I have an application that has a Service uses a ArrayList to store in the background for a very long time, the variable is initialized when the service started. The service is in the background and there will be frequent access to the variable (that's why i don't want to use file management or settings since it will be very expensive for a file I/O for the sake of battery life). The variable will likely to be ~1MB-2MB over its life tie. Is it safe to say that it will never be nulled by GC or the system or is there any way to prevent it? Thanks.

    Read the article

  • [iphone] use NSString in other method?!

    - by user134282
    It's really embarrassing but i stuck on it for two hours of trial and error. I declared an NSString in the interface as: NSString *testString; Then i made a property and synthesized it. I allocate it in viewDidLoad with: testString = [[NSString alloc] initWithFormat:@"thats my value: %i", row]; If i want to get the value of the string in another method it always return (null). So the string is empty, but why? how do i make it accessible for every function inside of one class? So i don't want to make a global var just a "global variable inside the class" It's really confusing because as long as i code i never ran into this problem :( thanks a lot for helping me!

    Read the article

  • Changing the value of a variable

    - by neirpycc
    I'm trying to build a simple scoring app but I'm running into a problem trying to keep it so I don't have to repeat a bunch of code to deal with each 'base' individually. The basic idea is that when I click a button the script will; 1) grab the ID of said button 2) split the ID into two parts - (a) the bases name and (b) the button type (plus/minus) 3) if it's plus - add to the bases score, if it's minus - subtract from the bases score 4) update the assigned div with the new value The part I'm stuck at is adding and subtracting. I can't seem to get this to work. Here is the code: $('.base button').click(function() { var b1Score = 0; var b2Score = 0; var b3Score = 0; var b4Score = 0; var b5Score = 0; var clickedButton = $(this).attr('id'); var buttonInfo = clickedButton.split('-'); var baseClicked = buttonInfo[0]; var baseDirection = buttonInfo[1]; var baseDiv = ('#' + baseClicked); console.log('You clicked ' + clickedButton + '.'); if (baseDirection.indexOf('plus') >= 0) { console.log('Increasing ' + baseClicked + '!'); ++; $(baseDiv).val(); } else { console.log('Decreasing ' + baseClicked + '!'); --; $(baseDiv).val(); } }); ++; and --; are placeholders for where the adding and subtracting needs to happen. I just can't figure out how to get it to add or subtract from the correct value. Any help is appreciated. Thanks.

    Read the article

  • JavaScript: Can I declare a variable by querying which function is called? (Newbie)

    - by belle3WA
    I'm working with an existing JavaScript-powered cart module that I am trying to modify. I do not know JS and for various reasons need to work with what is already in place. The text that appears for my quantity box is defined within an existing function: function writeitems() { var i; for (i=0; i<items.length; i++) { var item=items[i]; var placeholder=document.getElementById("itembuttons" + i); var s="<p>"; // options, if any if (item.options) { s=s+"<select id='options"+i+"'>"; var j; for (j=0; j<item.options.length; j++) { s=s+"<option value='"+item.options[j].name+"'>"+item.options[j].name+"</option>"; } s=s+"</select>&nbsp;&nbsp;&nbsp;"; } // add to cart s=s+method+"Quantity: <input id='quantity"+i+"' value='1' size='3'/> "; s=s+"<input type='submit' value='Add to Cart' onclick='addtocart("+i+"); return false;'/></p>"; } placeholder.innerHTML=s; } refreshcart(false); } I have two different types of quantity input boxes; one (donations) needs to be prefaced with a dollar sign, and one (items) should be blank. I've taken the existing additem function, copied it, and renamed it so that there are two identical functions, one for items and one for donations. The additem function is below: function additem(name,cost,quantityincrement) { if (!quantityincrement) quantityincrement=1; var index=items.length; items[index]=new Object; items[index].name=name; items[index].cost=cost; items[index].quantityincrement=quantityincrement; document.write("<span id='itembuttons" + index + "'></span>"); return index; } Is there a way to declare a global variable based on which function (additem or adddonation) is called so that I can add that into the writeitems function so display or hide the dollar sign as needed? Or is there a better solution? I can't use HTML in the body of the cart page because of the way it is currently coded, so I'm depending on the JS to take care of it. Any help for a newbie is welcome. Thanks!

    Read the article

  • global counter in application: bad practice?

    - by Martin
    In my C++ application I sometimes create different output files for troubleshooting purposes. Each file is created at a different step of our pipelined operation and it's hard to know file came before which other one (file timestamps all show the same date). I'm thinking of adding a global counter in my application, and a function (with multithreading protection) which increments and returns that global counter. Then I can use that counter as part of the filenames I create. Is this considered bad practice? Many different modules need to create files and they're not necessarily connected to each other.

    Read the article

  • used structdelete and now Elementemployee.id is undefined in SESSION.

    - by Robert
    using coldfuion 9 I used structdelete(session,"Elementemployee.id") in one of my .cfm display files.Also in my application.cfc it defined as is <cfset tArray[1][2] = "#session.employee_id#"> and the error is `Elementemployee.id is undefined in SESSION.` Is there a way that i can reset it without following the method shown below Navigate to the page Server Settings => Memory Variablesin the Coldfusion Administrator. Uncheck the option Use J2EE session variables and check the options Enable Application Variables and Enable Session Variables. Click the button to submit the changes.

    Read the article

  • send javaScript variable to php variable

    - by mrbunyrabit
    First i thought that i had to convert javascript to php, but then i found out that cant because of server and client side executions. So now I simply want to send ONE variable <script type="text/javascript"> function scriptvariable() { var theContents = "the variable"; } </script> to a php variable <?php $phpvariable ?> That function in the javascript executes when lets say i click on a button. Now i have Nooo idea how to get that phpvariable Equal to the javascript one so i can use that phpvariable to look up stuff in my Database. I know i can add it to my url or some thing, and just refresh the page.. But id like to do it with AJAX as further in my webpage i might have to use this Ajax method.. So is there an easy way to do this without having to dump pages of code on my page to do one simple thing?

    Read the article

  • What is the best place to store globals in Rails app?

    - by Nick Gorbikoff
    Hello. I was wondering if there is the best practice on where to store global settings in a rails app. What I mean by that is i.e: I have a few globals defined that may change, but not likely and it seems inappropriate to store them in DB since they are used so much. For instance I have SYSTEM_EMAIL & SYSTEM_EMAIL_SIGNATURE & SYSTEM_STORAGE_ROOT. Right now I keep them in environment.rb, but I'm not sure if this is the right palce to store them. Thank you

    Read the article

  • [Bash] Save part of matching pattern to variable

    - by Ben
    I want to extract a substring matching a pattern and save it to a file. An example string: Apr 12 19:24:17 PC_NMG kernel: sd 11:0:0:0: [sdf] Attached SCSI removable disk I want to extract the part between the brackets, in this case []. I tried to do something like grep -e '[$subtext]' to save the text in the brackets to a variable. Of course it doesn't work, but I am looking for a way similar to this. It would be very elegant to include a variable in a regex like this. What can I do best? Thanks!

    Read the article

< Previous Page | 133 134 135 136 137 138 139 140 141 142 143 144  | Next Page >