Search Results

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

Page 115/632 | < Previous Page | 111 112 113 114 115 116 117 118 119 120 121 122  | Next Page >

  • How to insert variables in R twitteR updates?

    - by analyticsPierce
    Hello, I am using the twitteR package in R to update my twitter status with results from analysis. The static tweet function works: library(twitteR) sess = initSession('username','password') tweet = tweet('I am a tweet', sess) However, when I add a variable to display some specific results I get an error. library(twitteR) sess = initSession('username','password') res = c(3,5,8) msg = cat('Results are: ', res, ', that is nice right?') tweet = tweet(msg, sess) Results in: Error in twFromJSON(rawToChar(out)) : Error: Client must provide a 'status' parameter with a value. Any suggestions are appreciated.

    Read the article

  • Confusion with cookie session token and oauth2.0 don't know where to go anymore

    - by byte_slave
    Hi guys, I'm completely confused, frustrated and nothing seems to make sense and work any more. I' dev some iframe fb app and i've been using the javascript sdk (FB.Init()) to get the access_token, but doesn't always work, sometimes i'm already logged into FB and doesn't works... Did some reading, and read also that there is problems using cookies in iframes in Opera and IE, so I was thinking in use the OAuth 2.0 but i'm not sure how via facebook sdk c# and now I'm now completely lost, don't know if i still need to use the javascript FB.Init(). Documentation out there is poor and unclear, a lot of stuff refers to old code, and after hours of reading, jumping on examples, i'm completely messed up and confused. Can some, please, point/explain/enlightening me about this? Thanks a lot guys, appreciated! Merry christmas!

    Read the article

  • adding two variables together

    - by James Trusler
    I have been trying for... about 4 hours now lmao. currentCalc returns 50 currentSum returns 0 when i alert them. Yet I cannot add them together with parseInt???? what am i doing wrong :'( var identRow = $('tr.identRow'); identRow.each( function(){ var getIdentClass = $(this).attr('class').split(' ').slice(1); $('tr.ohp' + getIdentClass + ' td.EURm').each( function(index){ var currentCalc = parseInt($(this).text().replace('.',''), 10); var currentSum = $('tr.' + getIdentClass + ' td.totalEURm', this).text().replace('.',''); total = parseInt(currentCalc, 10) + parseInt(currentSum, 10); $('tr.' + getIdentClass + ' td.totalEURm').text(total); if (index==6){ alert(total); } } ); } );

    Read the article

  • PHP Redirect location with htaccess

    - by Wayne
    In one of the page I have is where administrators are allowed, however, I use if the session isn't set, the header will redirect them to index.php and that method works. If I replace index.php with home which is for the htaccess which changes it to index.php but it gives an error in the browser This works: if(!isset($_SESSION['MEMBER'])){ header("Location: index.php"); } This does not work: if(!isset($_SESSION['MEMBER'])){ header("Location: home"); } htaccess: RewriteRule ^home$ index.php The error in Firefox: The page isn't redirecting properly Firefox has detected that the server is redirecting the request for this address in a way that will never complete. This problem can sometimes be caused by disabling or refusing to accept cookies. What's wrong with it? How do I get this method to work?

    Read the article

  • "Overriding" instance variables in subtype: Possible risks?

    - by sebastiangeiger
    Say I had a class SuperClass and two subclasses SubClassA and SubClassB that inherit from SuperClass. abstract class SuperClass{ ... List someList; ... } class SubClassA extends SuperClass{ ... List<String> someList; ... } class SubClassB extends SuperClass{ ... List<Integer> someList; ... } That way it is convenient because I can get someList.size() in Superclass and have Typesafety in the Subclasses. The problem is that it does not "feel" right, can you think of potential hazards this apporach has that I am not aware of?

    Read the article

  • Query on the scope of local variables in C

    - by darkie15
    All, Consider the following code: void func(void) { int a; printf ("%d", a); } int main(int argc, char **argv) { int a = 3; func(); printf("%d", a); } According to my understanding, the output should be: <junk value><3> Can anyone please confirm my understanding? My basic query is, does the compiler refer to the outer scope for a variable that has been declared but not defined? Regards, darkie

    Read the article

  • how to pass session_id() throught out the php pages?

    - by Piyush
    when user clicks on login button(index.php) I am calling chechlogin.php where I am checking loginId an password as- if($count==1) { // Register $myusername, $mypassword and redirect to file "login_success.php" session_register("myusername"); session_register("mypassword"); $_SESSION['UserId'] = $myusername; $_session['SessionId'] = session_id(); header("location:LoggedUser.php"); } in LiggedUser.php <?php session_start(); //starting session if (!isset($_SESSION['SessionId']) || $_SESSION['SessionId'] == '') { header("location:index.php"); } ? Problem: It is always going back to index.php page although I am entering right userid and password.I think session_id() is not working properly or ??

    Read the article

  • How to know from a bash script if the user abruptly closes ssh session

    - by Figo
    I have a bash script that acts as the default shell for a user loging in trough ssh. It provides a menu with several options one of wich is sending a file using netcat. The netcat of the embedded linux I'm using lacks the -w option, so if the user closes the ssh connection without ever sending the file, the netcat command waits forever. I need to know if the user abruptly closes the connection so the script can kill the netcat command and exit gracefully. Things I've tried so far: Trapping the SIGHUP: it is not issued. The only signal issued i could find is SIGCONT, but I don't think it's reliable and portable. Playing with the -t option of the read command to detect a closed stdin: this would work if not for a silly bug in the embedded read command (only times out on the first invocation)

    Read the article

  • Using MySQL variables in a query

    - by Jon Tackabury
    I am trying to use this MySQL query: SET @a:=0; UPDATE tbl SET sortId=@a:=@a+1 ORDER BY sortId; Unfortunately I get this error: "Parameter '@a' must be defined" Is it possible to batch commands into 1 query like this, or do I need to create a stored procedure for this?

    Read the article

  • How to pass extra variables in URL with Wordpress

    - by Chuck D
    I am having trouble trying to pass an extra variable in the url to my wordpress installation. For example /news?c=123 For some reason, it works only on the website root www.example.com?c=123 but it does not work if the url contains any more information www.example.com/news?c=123. I have the following code in my functions.php file in the theme directory. if (isset($_GET['c'])) { setcookie("cCookie", $_GET['c']); } if (isset($_SERVER['HTTP_REFERER'])) { setcookie("rCookie", $_SERVER['HTTP_REFERER']); } Any Ideas?

    Read the article

  • how to access method variables from within an anonomous function in javascript

    - by Hussain
    I'm writing a small ajax class for personal use. In the class, I have a "post" method for sending post requests. The post method has a callback parameter. In the onreadystatechange propperty, I need to call the callback method. Something like this: this.requestObject.onreadystatechange = function() { callback(this.responseText); } However, I can't access the callback variable from within the anonomous function. How can I bring the callback variable into the scope of the onreadystatechange anonomous function?

    Read the article

  • variables in abstract classes C++

    - by wyatt
    I have an abstract class CommandPath, and a number of derived classes as below: class CommandPath { public: virtual CommandResponse handleCommand(std::string) = 0; virtual CommandResponse execute() = 0; virtual ~CommandPath() {} }; class GetTimeCommandPath : public CommandPath { int stage; public: GetTimeCommandPath() : stage(0) {} CommandResponse handleCommand(std::string); CommandResponse execute(); }; All of the derived classes have the member variable 'stage'. I want to build a function into all of them which manipulates 'stage' in the same way, so rather than defining it many times I thought I'd build it into the parent class. I moved 'stage' from the private sections of all of the derived classes into the protected section of CommandPath, and added the function as follows: class CommandPath { protected: int stage; public: virtual CommandResponse handleCommand(std::string) = 0; virtual CommandResponse execute() = 0; std::string confirmCommand(std::string, int, int, std::string, std::string); virtual ~CommandPath() {} }; class GetTimeCommandPath : public CommandPath { public: GetTimeCommandPath() : stage(0) {} CommandResponse handleCommand(std::string); CommandResponse execute(); }; Now my compiler tells me for the constructor lines that none of the derived classes have a member 'stage'. I was under the impression that protected members are visible to derived classes? The constructor is the same in all classes, so I suppose I could move it to the parent class, but I'm more concerned about finding out why the derived classes aren't able to access the variable. Also, since previously I've only used the parent class for pure virtual functions, I wanted to confirm that this is the way to go about adding a function to be inherited by all derived classes.

    Read the article

  • My IF statement is changing variables in PHP

    - by user1902509
    I am fairly new to the whole programming thing, so forgive me if this is a stupid question. It seems odd that I haven't run into it before. I am trying to make an order form for a cake. You fill out the form, submit it, and it will then display the order in a new window, where you then hit "submit," and upload it to the Database. I have a series of If Statements to check for errors in the form before submitting it. Here is a simplified version of the code. Writing means any writing you want on the cake, Name is your name, and cake is what type of cake you want (the default is "None"). try { $name = trim($params->name); $cake = trim($params->cake); $writing = trim($params->writing); if (strlen($name) < 3){ throw new Exception("Please enter Your name."); } if ($cake = "None") { throw new Exception("Please select a Cake" } if ($cake = "Caramel Apple Pie" or $cake = "Pumpkin Pie" or $cake = "Eggnog Pie" and strlen($writing) > 1) { throw new Exception("We are sorry, but you can't write on any of our specialty pies."); } } catch(Exception $x) { $error = $x->getmessage(); } So what is happening is that when I go and hit submit the first time, the correct cake type comes up, but when you submit it the second time, the error comes up saying that I have "None" selected. All the other values are there and remain the same. I think the problem is that the first "IF" statement (Where it says "If($cake = "None")) is automatically changing $cake to "None" because I have tried commenting just that statement out, and it will then change the cake to be "Caramel Apple Pie," which is in the top of the next IF statement. Anyone know why it is doing this? And how to fix it?

    Read the article

  • C++, using one byte to store two variables

    - by 2di
    Hi All I am working on representation of the chess board, and I am planning to store it in 32 bytes array, where each byte will be used to store two pieces. (That way only 4 bits are needed per piece) Doing it in that way, results in a overhead for accessing particular index of the board. Do you think that, this code can be optimised or completely different method of accessing indexes can be used? c++ char getPosition(unsigned char* c, int index){ //moving pointer c+=(index>>1); //odd number if (index & 1){ //taking right part return *c & 0xF; }else { //taking left part return *c>>4; } } void setValue(unsigned char* board, char value, int index){ //moving pointer board+=(index>>1); //odd number if (index & 1){ //replace right part //save left value only 4 bits *board = (*board & 0xF0) + value; }else { //replacing left part *board = (*board & 0xF) + (value<<4); } } int main() { char* c = (char*)malloc(32); for (int i = 0; i < 64 ; i++){ setValue((unsigned char*)c, i % 8,i); } for (int i = 0; i < 64 ; i++){ cout<<(int)getPosition((unsigned char*)c, i)<<" "; if (((i+1) % 8 == 0) && (i > 0)){ cout<<endl; } } return 0; } I am equally interested in your opinions regarding chess representations, and optimisation of the method above, as a stand alone problem. Thanks a lot

    Read the article

  • Objective C instance variables - Newbie

    - by Dwayne King
    OK - so I'm sure my confusion here is just a result of being stuck in a "Java mindset" and not understanding how Obj C differs in this case. In Java, I can declare a variable in a class, like this, and each instance of that class will have it's own: MyClass { String myVar; MyClass() { // constructor } } In Obj C I tried to do the same thing by declaring a variable only in the .m file like this: #import "MyClass.h" @implementation MyClass NSString *testVar; @end My expectation here was that this variable has a scope limited to this class. So I created a second class (identical): #import "MySecondClass.h" @implementation MySecondClass NSString *testVar; @end What I'm seeing (and has me baffled) is that changing the variable in one class, affects the value seen in the other class. In fact, if I set a breakpoint, and then "Jump to Definition" of the variable, it takes me to th I've created an extremely small XCode project that demonstrates the problem here Nothing more humbling than moving to a new language :) Thanks in advance.

    Read the article

  • Horizontal Scaling of Tomcat in Microsoft Azure

    - by Fabe
    Hey everyone, I am working on this quiet a while, but still no conclustion. I want to do horizontal scaling of Tomcat instances in Microsoft Azure (1,2,3,... Tomcat instances for one service). I read lots of articles about session replication, clustering,... with Tomcat. Since Azure does not support Multicasts, there is no easy way to cluster Tomcat. Also sticky sessions is no options, because Azure does round robin load balancing. Setting up two services - one with Terracotta or Apache mod_jk - and the other with Tomcat instances seems overkill for me (if even doable)... Is this even possible? Thanks in advance for reading and answering my question. Every comment/idea is highly appreciated.

    Read the article

  • Ruby on Rails: instance & class variables not maintaining value in controller

    - by DerNalia
    at the top of my controller, outside of any method, I have @@javascript_is_disabled = false and I have methods that that the view calls and invokes something like this @@javascript_is_disabled = params[:javascript_disabled] but when I need the @@javascript_is_disabled in completely different method.. it is always false. I know it changes in the method with params args... cause those methods behave differently, and appropriately And ideas?

    Read the article

  • how to exchange variables between extern iframe and site

    - by helle
    hey guys, for developement reasons (working with facebook-connect) i put the connect iframe in an iframe. on that way i am able to work on the connect-thing independent of my ip and don't have to develop on the live-server. the iframe holding the connect-button iframe is on my server, accessing the same db-server as the developer version (developer version is running on localhsot). as far as good ... BUT how can i let the parent site know, that the user has connected, so that i get his profile-picture displayd as reaction to this? how can i react in generally on an action/event/JS in an iframe? is there a way? can the iframe post data to the parent site? like a time-stamp and fb_userid? if the iframe stuff doesn't work ... i thougt of saving the ip to the fb_userid (to db) and check matches ... but i don't like this idea.

    Read the article

  • Detect session hang and kill it

    - by Jack Juiceson
    Hi all, I have an asp.net page that runs certain algorithm and returns it's output. I was wondering what will happen and how to handle a case where the algorithm due to a bug goes into infinite loop. It will hog the cpu and other sessions will be served very slowly. I would love to have a way to tell IIS, if processing Algo.aspx takes more than 5 seconds, kill it or something like that. Thanks in advance

    Read the article

  • [Visual C++]Forcing memory alignment of variables/data-structures

    - by John
    I'm looking at using SSE and I gather aligning data on 16byte boundaries is recommended. There are two cases to consider: float data[4]; struct myystruct { float x,y,z,w; }; I'm not sure the first case can be done explicitly, though there's perhaps a compiler option I could use? In the second case I remember being able to control packing in old versions of GCC several years back, is this still possible?

    Read the article

  • Table Variables in SSIS

    - by aceinthehole
    In one SQL Task can I create a table variable DELCARE @TableVar TABLE (...) Then in another SQL Task or DataSource destination and select or insert into the table variable? The other option I have considered is using a Temp Table. CREATE TABLE #TempTable (...) I would prefer to use Table Variable so that it remains in memory. But can use temp table if it is not possible to use table variable. Also I cannot use the record set destination as I need to preform straight SQL tasks on it later on.

    Read the article

  • struct with template variables in c++

    - by monkeyking
    I'm playing around with template, so I'm not trying to reinvent the std::vector, I'm trying to get a grasp of templateting in c++. Can I do the following template <typename T> typedef struct{ size_t x; T *ary; }array; What I'm trying to do is a basic templated version of typedef struct{ size_t x; int *ary; }iArray; It looks like its working if I use a class instead of struct, so is it not possible with typedef structs? thanks

    Read the article

< Previous Page | 111 112 113 114 115 116 117 118 119 120 121 122  | Next Page >