Search Results

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

Page 77/632 | < Previous Page | 73 74 75 76 77 78 79 80 81 82 83 84  | Next Page >

  • Accessing PerSession service simultaneously in WCF using C#

    - by krishna555
    1.) I have a main method Processing, which takes string as an arguments and that string contains some x number of tasks. 2.) I have another method Status, which keeps track of first method by using two variables TotalTests and CurrentTest. which will be modified every time with in a loop in first method(Processing). 3.) When more than one client makes a call parallely to my web service to call the Processing method by passing a string, which has different tasks will take more time to process. so in the mean while clients will be using a second thread to call the Status method in the webservice to get the status of the first method. 4.) when point number 3 is being done all the clients are supposed to get the variables(TotalTests,CurrentTest) parallely with out being mixed up with other client requests. 5.) The code that i have provided below is getting mixed up variables results for all the clients when i make them as static. If i remove static for the variables then clients are just getting all 0's for these 2 variables and i am unable to fix it. Please take a look at the below code. [ServiceBehavior(InstanceContextMode = InstanceContextMode.PerSession)] public class Service1 : IService1 { public int TotalTests = 0; public int CurrentTest = 0; public string Processing(string OriginalXmlString) { XmlDocument XmlDoc = new XmlDocument(); XmlDoc.LoadXml(OriginalXmlString); this.TotalTests = XmlDoc.GetElementsByTagName("TestScenario").Count; //finding the count of total test scenarios in the given xml string this.CurrentTest = 0; while(i<10) { ++this.CurrentTest; i++; } } public string Status() { return (this.TotalTests + ";" + this.CurrentTest); } } server configuration <wsHttpBinding> <binding name="WSHttpBinding_IService1" closeTimeout="00:10:00" openTimeout="00:10:00" receiveTimeout="00:10:00" sendTimeout="00:10:00" bypassProxyOnLocal="false" transactionFlow="false" hostNameComparisonMode="StrongWildcard" maxBufferPoolSize="524288" maxReceivedMessageSize="2147483647" messageEncoding="Text" textEncoding="utf-8" useDefaultWebProxy="true" allowCookies="false"> <readerQuotas maxDepth="2147483647" maxStringContentLength="2147483647" maxArrayLength="2147483647" maxBytesPerRead="2147483647" maxNameTableCharCount="2147483647" /> <reliableSession ordered="true" inactivityTimeout="00:10:00" enabled="true" /> <security mode="Message"> <transport clientCredentialType="Windows" proxyCredentialType="None" realm="" /> <message clientCredentialType="Windows" negotiateServiceCredential="true" algorithmSuite="Default" establishSecurityContext="true" /> </security> </binding> </wsHttpBinding> client configuration <wsHttpBinding> <binding name="WSHttpBinding_IService1" closeTimeout="00:10:00" openTimeout="00:10:00" receiveTimeout="00:10:00" sendTimeout="00:10:00" bypassProxyOnLocal="false" transactionFlow="false" hostNameComparisonMode="StrongWildcard" maxBufferPoolSize="524288" maxReceivedMessageSize="2147483647" messageEncoding="Text" textEncoding="utf-8" useDefaultWebProxy="true" allowCookies="false"> <readerQuotas maxDepth="2147483647" maxStringContentLength="2147483647" maxArrayLength="2147483647" maxBytesPerRead="2147483647" maxNameTableCharCount="2147483647" /> <reliableSession ordered="true" inactivityTimeout="00:10:00" enabled="true" /> <security mode="Message"> <transport clientCredentialType="Windows" proxyCredentialType="None" realm="" /> <message clientCredentialType="Windows" negotiateServiceCredential="true" algorithmSuite="Default" establishSecurityContext="true" /> </security> </binding> </wsHttpBinding> Below mentioned is my client code class Program { static void Main(string[] args) { Program prog = new Program(); Thread JavaClientCallThread = new Thread(new ThreadStart(prog.ClientCallThreadRun)); Thread JavaStatusCallThread = new Thread(new ThreadStart(prog.StatusCallThreadRun)); JavaClientCallThread.Start(); JavaStatusCallThread.Start(); } public void ClientCallThreadRun() { XmlDocument doc = new XmlDocument(); doc.Load(@"D:\t72CalculateReasonableWithdrawal_Input.xml"); bool error = false; Service1Client Client = new Service1Client(); string temp = Client.Processing(doc.OuterXml, ref error); } public void StatusCallThreadRun() { int i = 0; Service1Client Client = new Service1Client(); string temp; while (i < 10) { temp = Client.Status(); Thread.Sleep(1500); Console.WriteLine("TotalTestScenarios;CurrentTestCase = {0}", temp); i++; } } } Can any one please help.

    Read the article

  • having issue while making the client calls persession in c# wcf

    - by krishna555
    1.) I have a main method Processing, which takes string as an arguments and that string contains some x number of tasks. 2.) I have another method Status, which keeps track of first method by using two variables TotalTests and CurrentTest. which will be modified every time with in a loop in first method(Processing). 3.) When more than one client makes a call parallely to my web service to call the Processing method by passing a string, which has different tasks will take more time to process. so in the mean while clients will be using a second thread to call the Status method in the webservice to get the status of the first method. 4.) when point number 3 is being done all the clients are supposed to get the variables(TotalTests,CurrentTest) parallely with out being mixed up with other client requests. 5.) The code that i have provided below is getting mixed up variables results for all the clients when i make them as static. If i remove static for the variables then clients are just getting all 0's for these 2 variables and i am unable to fix it. Please take a look at the below code. [ServiceBehavior(InstanceContextMode = InstanceContextMode.PerSession)] public class Service1 : IService1 { public int TotalTests = 0; public int CurrentTest = 0; public string Processing(string OriginalXmlString) { XmlDocument XmlDoc = new XmlDocument(); XmlDoc.LoadXml(OriginalXmlString); this.TotalTests = XmlDoc.GetElementsByTagName("TestScenario").Count; //finding the count of total test scenarios in the given xml string this.CurrentTest = 0; while(i<10) { ++this.CurrentTest; i++; } } public string Status() { return (this.TotalTests + ";" + this.CurrentTest); } } server configuration <wsHttpBinding> <binding name="WSHttpBinding_IService1" closeTimeout="00:10:00" openTimeout="00:10:00" receiveTimeout="00:10:00" sendTimeout="00:10:00" bypassProxyOnLocal="false" transactionFlow="false" hostNameComparisonMode="StrongWildcard" maxBufferPoolSize="524288" maxReceivedMessageSize="2147483647" messageEncoding="Text" textEncoding="utf-8" useDefaultWebProxy="true" allowCookies="false"> <readerQuotas maxDepth="2147483647" maxStringContentLength="2147483647" maxArrayLength="2147483647" maxBytesPerRead="2147483647" maxNameTableCharCount="2147483647" /> <reliableSession ordered="true" inactivityTimeout="00:10:00" enabled="true" /> <security mode="Message"> <transport clientCredentialType="Windows" proxyCredentialType="None" realm="" /> <message clientCredentialType="Windows" negotiateServiceCredential="true" algorithmSuite="Default" establishSecurityContext="true" /> </security> </binding> </wsHttpBinding> client configuration <wsHttpBinding> <binding name="WSHttpBinding_IService1" closeTimeout="00:10:00" openTimeout="00:10:00" receiveTimeout="00:10:00" sendTimeout="00:10:00" bypassProxyOnLocal="false" transactionFlow="false" hostNameComparisonMode="StrongWildcard" maxBufferPoolSize="524288" maxReceivedMessageSize="2147483647" messageEncoding="Text" textEncoding="utf-8" useDefaultWebProxy="true" allowCookies="false"> <readerQuotas maxDepth="2147483647" maxStringContentLength="2147483647" maxArrayLength="2147483647" maxBytesPerRead="2147483647" maxNameTableCharCount="2147483647" /> <reliableSession ordered="true" inactivityTimeout="00:10:00" enabled="true" /> <security mode="Message"> <transport clientCredentialType="Windows" proxyCredentialType="None" realm="" /> <message clientCredentialType="Windows" negotiateServiceCredential="true" algorithmSuite="Default" establishSecurityContext="true" /> </security> </binding> </wsHttpBinding> Below mentioned is my client code class Program { static void Main(string[] args) { Program prog = new Program(); Thread JavaClientCallThread = new Thread(new ThreadStart(prog.ClientCallThreadRun)); Thread JavaStatusCallThread = new Thread(new ThreadStart(prog.StatusCallThreadRun)); JavaClientCallThread.Start(); JavaStatusCallThread.Start(); } public void ClientCallThreadRun() { XmlDocument doc = new XmlDocument(); doc.Load(@"D:\t72CalculateReasonableWithdrawal_Input.xml"); bool error = false; Service1Client Client = new Service1Client(); string temp = Client.Processing(doc.OuterXml, ref error); } public void StatusCallThreadRun() { int i = 0; Service1Client Client = new Service1Client(); string temp; while (i < 10) { temp = Client.Status(); Thread.Sleep(1500); Console.WriteLine("TotalTestScenarios;CurrentTestCase = {0}", temp); i++; } } } Can any one please help.

    Read the article

  • Why doesn't my environment variable get set?

    - by reprogrammer
    I have to set an environment variable called GDK_NATIVE_WINDOWS to fix the problem with Eclipse buttons in Ubuntu. To set the environment variable, I added the following line to ~/.pam_environment. GDK_NATIVE_WINDOWS DEFAULT=true Surprisingly, the environment variable doesn't get set when I echo $GDK_NATIVE_WINDOWS in a terminal. However, all other environment variables that I've listed in ~/.pam_environment are set properly. Besides, when I switch to a tty, e.g. Alt+Ctrl+F1, the environment variable gets set correctly. Can anyone tell what's wrong with setting this environment variable in ~/.pam_environment?

    Read the article

  • Sharing an Apache configuration between testing vs. production

    - by Kevin Reid
    I have a personal web site with a slightly nontrivial Apache configuration. I test changes on my personal machine before uploading them to the server. The path to the files on disk and the root URL of the site are of course different between the test and production conditions, and they occur many places in the configuration (especially <Directory blocks for special locations which have scripts or no directory listing or ...). What is the best way to share the common elements of the configuration, to make sure that my production environment matches my test environment as closely as possible? What I've thought of is to use SetEnv to store the paths for the current machine in environment variables, then Include a common configuration file with ${} everywhere there's something machine specific. Any hazards of this method?

    Read the article

  • Caching of path environment variable on windows?

    - by jwir3
    I'm assisting one of our testers in troubleshooting a configuration problem on a Windows XP SP3 system. Our application uses an environment variable, called APP_HOME, to refer to the directory where our application is installed. When the application is installed, we utilize the following environment variables: APP_HOME = C:\application\ PATH = %PATH%;%APP_HOME%bin Now, the problem comes in that she's working with multiple versions of the same application. So, in order to switch between version 7.0 and 8.1, for example, she might use: APP_HOME = C:\application_7.0\ (for 7.0) and then change it to: APP_HOME = C:\application_8.1\ (for 8.1) The problem is that once this change is made, the PATH environment variable apparently still is looking at the old expansion of the APP_HOME variable. So, for example, after she has changed APP_HOME, PATH still refers to the 7.0 bin directory. Any thoughts on why this might be happening? It looks to me like the PATH variable is caching the expansion of the APP_HOME environment variable. Is there any way to turn this behavior off?

    Read the article

  • Apache 2: SetEnvIf "IP Range"

    - by BlaM
    In my Apache config I want to set an environment variable if I see that the visitor comes from an specific IP range. Currently I do it this way: SetEnvIfNoCase Remote_Addr "^194\.8\.7[45]\." banned=spammer-ip SetEnvIfNoCase Remote_Addr "^212\.156\.170\." banned=spammer-ip What I would prefer is something like this: SetEnvIfIpRange 194.8.74.0/23 banned=spammer-ip SetEnvIfIpRange 212.156.170.0/24 banned=spammer-ip ... because I think that converting an IP address to a string and then do an regular expression is a total waste of ressources. I could do an Deny From 194.8.74.0/23 ... but then I don't get a variable that I can check in my 403 error page - to find the reason why access has been denied. Any suggestions what I might miss? Is there an Apache2 MOD that can set environment variables based on "IP Address Ranges"?

    Read the article

  • Why doesn't my environment variable get set?

    - by reprogrammer
    I have to set an environment variable called GDK_NATIVE_WINDOWS to fix the problem with Eclipse buttons in Ubuntu. To set the environment variable, I added the following line to ~/.pam_environment. GDK_NATIVE_WINDOWS DEFAULT=true Surprisingly, the environment variable doesn't get set when I echo $GDK_NATIVE_WINDOWS in a terminal. However, all other environment variables that I've listed in ~/.pam_environment are set properly. Besides, when I switch to a tty, e.g. Alt+Ctrl+F1, the environment variable gets set correctly. Can anyone tell what's wrong with setting this environment variable in ~/.pam_environment?

    Read the article

  • Why does subshell not inherit exported variable (PS1)?

    - by amn
    After some debugging I finally narrowed down the problem as to why my X session xterm prompt does not appear according to my PS1 setting. If I run sh -c env, it doesn't even show PS1 in the list. Why? export PS1='test' sh -c env # No PS1 in the list, default prompt appearance (shell name + version) Substituting sh with bash yields same result, alas the behavior appears to be the same for both shells/modes. As far as I understood from man bash, the environment resulting from command run by shell with -c should include the exported variables. And it does - exporting FOOBAR results in FOOBAR listed in env run by subshell. It appears that the story is different if the variable is PS1 however. What is going on? I want my prompt propagated throughout the process tree and system. For matters sake, it is set in /etc/profile.d/user.sh (a file I created myself) with the following: PS1='\u@\H \w \$ ' export PS1 I am running Arch Linux (updated yesterday.)

    Read the article

  • How to tell start-stop-daemon to update $HOME and $USER accordingly to --chuid parameter

    - by iElectric
    I'm trying to run a service that uses $HOME and $USER environment variables. I could set them in service itself, but that would only be a temporary solution. Let's say I have a script test.sh with following content: echo $USER And I run it with start-stop-daemon to see my results: $ start-stop-daemon --start --exec `pwd`/test.sh --user guest --group guest --chuid -guest root Seems like it does not update environment, maybe that should be reported as a bug? I have found a nasty hacky solution, which only works (for unknown reason) on my this simple use case: $ start-stop-daemon --exec /usr/bin/sudo --start -- -u guest -i 'echo $USER' guest I'm sure someone else stumbled upon this, I'm interested in clean solution. $ start-stop-daemon --version start-stop-daemon 1.13.11+gentoo

    Read the article

  • overload environment

    - by Richo
    I've recently switched across to nesting my home directory across all my machines in an svn repo, meaning that my utility scripts, configuration (irssi, vim, zsh, screen etc) as well as my .profile and so forth are easier to keep up to date across all the places I login. I use a set of sourced .local files to override them on a per site basis as required. As it stands, many of my scripts inherit some form of configuration, and for the most part I've been setting an environment variable in .profile, and then if needed on a per site basis overriding it in .profile.local This works great, but are there pitfalls in having a stack of environment variables? If I take my default environment from within an X session before any of my personal configuration I have not even increased it by 50% but some of the machines I work on are low resource, am I bloating my system unneccessarily, or being needlessly paranoid? Should I start moving this config into seperate flatfiles that are loaded as needed? This means extra infrastructure, or alternately writing a single module for storing config that all of my utilities can inherit.

    Read the article

  • HOSTNAME environment variable on Linux

    - by infogrind
    On my Linux box (Gentoo Linux 2.6.31 to be specific) I have noticed that the HOSTNAME environment variable is available in my shell, but not in scripts. For example, $ echo $HOSTNAME returns xxxxxxxx.com, but $ ruby -e 'puts ENV["HOSTNAME"]' returns nil On the other hand, the USER environment variable, for instance, is available both in the shell and in scripts. I have noticed that USER appears in the list of environment variables that appears when I type export i.e., declare -x USER="infogrind" but HOSTNAME doesn't. I suspect the issue has something to do with that. My questions: 1) how can I make HOSTNAME available in scripts, and 2) for my better understanding, where is this variable initially set, and why is it not "exported"?

    Read the article

  • Mac OS X keeps "old" environment variable around

    - by Xymak1y
    So far I had /Applications/play-1.2.5/ added to my $PATH variable. Now I'm working with 2.2.1, which I installed in /Applications/play-2.2.1 and changed in ~/.bash_profile (which is getting sourced at startup). However, when printing $PATH, 1.2.5 is somehow still around: mbp:~ user$ echo $PATH /usr/local/share/npm/bin:/Applications/play-2.2.1:/usr/local/heroku/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/Applications/play-1.2.5:/Applications/XAMPP/xamppfiles/bin/:/opt/X11/bin As far as I now, I only entered $PATH variables in .bash_profile, which looks like this: mbp:~ user$ cat .bash_profile source ~/.git-completion.bash ### Added by the Heroku Toolbelt export PATH="/usr/local/heroku/bin:$PATH" ### Play Framework export PATH="/Applications/play-2.2.1:$PATH" export PATH="/usr/local/share/npm/bin:$PATH" I'm also not sure where the XAMPP extension to the variable comes from. Can I see somewhere which other files are being sourced on startup?

    Read the article

  • Why can't I use %USERPROFILE% in %PATH%?

    - by Zano
    On my Windows 7 machine, using the System Properties Environment Variables tool, I try to add %USERPROFILE%\Bin to the system variable PATH. For some reason, that doesn't work, even though %SystemRoot%\system32 works fine. When I try to run commands from the console, files in my Bin folder are not found, even though files in the System32 folder are found. The only difference between UserProfile and SystemRoot that I can see is that the former is a user variable while the latter is a system variable. I i write echo %USERPROFILE%\Bin it yields c:\Users\zano, and if I add c:\Users\zano\Bin explicitly, everything work fine. What's the problem here?

    Read the article

  • Declaration of arrays before "normal" variables in c?

    - by bjarkef
    Hi We are currently developing an application for a msp430 MCU, and are running into some weird problems. We discovered that declaring arrays withing a scope after declaration of "normal" variables, sometimes causes what seems to be undefined behavior. Like this: foo(int a, int *b); int main(void) { int x = 2; int arr[5]; foo(x, arr); return 0; } foo sometimes is passed a pointer as the second variable, that does not point to the arr array. We verify this by single stepping through the program, and see that the value of the arr variable in the main scope is not the same as the value of the b pointer variable in the foo scope. And no, this is not really reproduceable, we have just observed this behavior once in a while. Changing the example seems to solve the problem, like this: foo(int a, int *b); int main(void) { int arr[5]; int x = 2; foo(x, arr); return 0; } Does anybody have any input or hints as to why we experience this behavior? Or similar experiences? The MSP430 programming guide specifies that code should conform to the ANSI C89 spec. and so I was wondering if it says that arrays has to be declared before non-array variables? Any input on this would be appreciated.

    Read the article

  • Python Django Global Variables

    - by Joe J
    Hi all, I'm looking for simple but recommended way in Django to store a variable in memory only. When Apache restarts or the Django development server restarts, the variable is reset back to 0. More specifically, I want to count how many times a particular action takes place on each model instance (database record), but for performance reasons, I don't want to store these counts in the database. I don't care if the counts disappear after a server restart. But as long as the server is up, I want these counts to be consistent between the Django shell and the web interface, and I want to be able to return how many times the action has taken place on each model instance. I don't want the variables to be associated with a user or session because I might want to return these counts without being logged in (and I want the counts to be consistent no matter what user is logged in). Am I describing a global variable? If so, how do I use one in Django? I've noticed the files like the urls.py, settings.py and models.py seems to be parsed only once per server startup (by contrast to the views.py which seems to be parsed eache time a request is made). Does this mean I should declare my variables in one of those files? Or should I store it in a model attribute somehow (as long as it sticks around for as long as the server is running)? This is probably an easy question, but I'm just not sure how it's done in Django. Any comments or advice is much appreciated. Thanks, Joe

    Read the article

  • AS3 variables handling by AVM/compiler/scope

    - by jchmielewski
    I have couple of questions about AS3 variables handling by AVM/compiler/scope .1. This code in Flash will throw an error: function myFunction() { var mc:MovieClip=new MovieClip(); var mc:MovieClip=new MovieClip(); } but it won`t throw an error in Flex (only warning in Editor). Why? .2. How Flash sees variables in loops? Apparently this: for (var i:int=0; i<2; i++) { var mc:MovieClip=new MovieClip(); } isn`t equal to just: var mc:MovieClip=new MovieClip(); var mc:MovieClip=new MovieClip(); because it will throw an error again as earlier in Flash, but in Flex in function not? Is Flash changing somehow my loop before compilation? .3. Where in a class in equivalent to timeline in Flash - where in class I would put code which I put normally on timeline (I assume it is not constructor because of what I have written earlier, or maybe it`s a matter of Flash/Flex compiler)?

    Read the article

  • Controller changes format on variables when publishing

    - by Christoffer
    I am a newbie to ROR but catching on quickly. I have been working on this problem for a couple of hours now and it seems like a bug. I does not make any sense. I have a database with the following migration: class CreateWebsites < ActiveRecord::Migration def self.up create_table :websites do |t| t.string :name t.integer :estimated_value t.string :webhost t.string :purpose t.string :description t.string :tagline t.string :url t.integer :adsense t.integer :tradedoubler t.integer :affiliator t.integer :adsense_cpm t.boolean :released t.string :empire_type t.string :oldid t.string :old_outlink_policy t.string :old_inlink_policy t.string :old_priority t.string :old_profitability t.integer :priority_id t.integer :project_id t.integer :outlink_policy_id t.integer :inlink_policy_id t.timestamps end end def self.down drop_table :websites end end I have verified that what is created in the database also is integers, strings etc according to this migration. I have not touched the controller after generating it through scaffold, i.e. it is the standard controller with show, index etc. Now. When I enter data into the database, either through the web form, in rails console or directly in the database - such as www.domain.com for url or 500 for adsense - it will be created in the db without problem. However, when it is being published on the website the variables go completely nuts. Adsense (integer) turns into date, url (string) turns into a float, and so on. This only happens to a few of the variables. This will also create a problem with "argument out of range" since I input 500 and Rails will try to output it as date = crash and "argument out of range". So, how do I fix/trouble shoot this? Why do the formats change? Could it be because of the respond_to in the controller? Cheers, Christoffer

    Read the article

  • PostGreSQL - bind variables and date addition

    - by azp74
    I need to update some timestamp columns in a table in a PostGres (8.3) database. My query (simplified) look like this: update table1 set dateA = dateA + interval '10 hours' where id = 1234; This is part of a script and there's a lot to update so my preference is to use bind variables, rather than to have to build the query string each time. This means my query becomes: update table1 set dateA = dateA + interval '? hours' where id = ?; When I do this, the complaint is that I've supplied 2 bind variables when only one is required. If I try to put the ? outside the quote marks: update table1 set dateA = dateA + interval ? ' hours' where id = ?; I get: ... syntax error at or near "' hours'" It looks as though the query has been interpreted as ... dateA = dateA + interval '10' ' hours' ... I can't find anything in the documentation to help ... any suggestions? Thanks

    Read the article

  • Accessing C# Variables in JavaScript

    - by mshahbazm
    I am Developing Windows 8 application in which i have to access variables of C# class in java script function, But Unfortunately i don not know how to do this: My C# class code is: using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace Pakistan_Tour { public class UniversalValues { public static double xC; public static double yC; public static int selectedcity; public int retcity() { return selectedcity; } public void setcity(int val) { selectedcity=val; } public void setxy(double x, double y) { xC = x; yC = y; } public double getx() { return xC; } public double gety() { return yC; } } } I have to access the value of variables: xC and yc in java script I am doing like: function initialize() { var x = "<%=xC%>"; var y = "<%=yC%>"; } but is not working, Kindly help me with this, Thanks in advance.

    Read the article

  • How to paginate Django with other get variables?

    - by vagabond
    I am having problems using pagination in Django. Take the URL below as an example: http://127.0.0.1:8000/users/?sort=first_name On this page I sort a list of users by their first_name. Without a sort GET variable it defaults to sort by id. Now if I click the next link I expect the following URL: http://127.0.0.1:8000/users/?sort=first_name&page=2 Instead I lose all get variables and end up with http://127.0.0.1:8000/users/?page=2 This is a problem because the second page is sorted by id instead of first_name. If I use request.get_full_path I will eventually end up with an ugly URL: http://127.0.0.1:8000/users/?sort=first_name&page=2&page=3&page=4 What is the solution? Is there a way to access the GET variables on the template and replace the value for the page? I am using pagination as described in Django's documentation and my preference is to keep using it. The template code I am using is similar to this: {% if contacts.has_next %} <a href="?page={{ contacts.next_page_number }}">next</a> {% endif %}

    Read the article

  • Session variables not getting set but only in Internet Explorer and not on all machines

    - by gaoshan88
    Logging into a site I'm working on functions as expected on my local machine but fails on the remote server but ONLY in Internet Explorer. The kicker is that it works in IE locally, just not on the remote machine. What in the world could cause this? I have stepped through the code on the remote machine and can see the entered login values being checked in the database, they are found and then a login function is called. This sets two $_SESSION variables and redirects to the main admin page. However, in IE only (and not when run on local machine... this is key) the $_SESSION variables are not present by the time you get to the main admin page. var_dump($_SESSION) gives me what I expect on every browser when I am running this in my local environment and in every browser except IE 6, 7 and 8 when run on the remote server (where I get a null value as if nothing has been set for $_SESSION). This really has me stumped so any advice is appreciated. For an example... in IE, run locally, var_dump gives me: array 'Username' => string 'theusername' length=11 'UserID' => string 'somevalue' length=9 Run on the remote server (IE only... works fine in other browsers) var_dump gives me: array(0){} Code: $User = GetUser($Username, $Password); if ($User->UserID <> "") { // this works so we call Login()... Login($User); // this also works and gives expected results. on to redirect... header("Location: index.php"); // a var_dump at index.php shows that there is no session data at all in IE, remotely. } else { header("Location: login.php"); } function Login($data) { $_SESSION['Username'] = $data->Username; $_SESSION['UserID'] = $data->UserID; // a var dump here gives the expected data in every browser }

    Read the article

  • Unpacking varargin to individual variables

    - by Richie Cotton
    I'm writing a wrapper to a function that takes varargin as its inputs. I want to preserve the function signature in the wrapper, but nesting varargin causes all the variable to be lumped together. function inner(varargin) %#ok<VANUS> % An existing function disp(nargin) end function outer(varargin) % My wrapper inner(varargin); end outer('foo', 1:3, {}) % Uh-oh, this is 1 I need a way to unpack varargin in the outer function, so that I have a list of individual variables. There is a really nasty way to do this by constructing a string of the names of the variables to pass the inner, and calling eval. function outer2(varargin) %#ok<VANUS> % My wrapper, second attempt inputstr = ''; for i = 1:nargin inputstr = [inputstr 'varargin{' num2str(i) '}']; %#ok<AGROW> if i < nargin inputstr = [inputstr ', ']; %#ok<AGROW> end end eval(['inner(' inputstr ')']); end outer2('foo', 1:3, {}) % 3, as it should be Can anyone think of a less hideous way of doing things, please?

    Read the article

  • JavaScript: List global variables in IE

    - by Quandary
    I'm trying to get the instance name of my class. The way I do this is I loop through all global objects and compare it with the this pointer. It works in Chrome and FF, but in IE, it doesn't. The problem seems to be the global variables don't seem to be in window. How can I loop through the global variables in IE ? PS: I know it only works as long as there is only one instance, and I don't want to pass the instance's name as a parameter. function myClass() { this.myName = function () { // search through the global object for a name that resolves to this object for (var name in this.global) { if (this.global[name] == this) return name } } } function myClass_chrome() { this.myName = function () { // search through the global object for a name that resolves to this object for (var name in window) { if (window[name] == this) return name ; } } ; } // store the global object, which can be referred to as this at the top level, in a // property on our prototype, so we can refer to it in our object's methods myClass.prototype.global = this //myClass_IE.prototype.global = this // create a global variable referring to an object // var myVar = new myClass() var myVar = new myClass_chrome() //var myVar = new myClass_IE() alert(myVar.myName() );// returns "myVar"

    Read the article

  • PHP & MYSQL: How can i neglect empty variables from select

    - by cash-cash
    hello all; if i have 4 variables and i want to select DISTINCT values form data base <?php $var1 = ""; //this variable can be blank $var2 = ""; //this variable can be blank $var3 = ""; //this variable can be blank $var4 = ""; //this variable can be blank $result = mysql_query("SELECT DISTINCT title,description FROM table WHERE **keywords ='$var1' OR author='$var2' OR date='$var3' OR forums='$var4'** "); ?> note: some or all variables ($var1,$var2,$var3,$var4) can be empty what i want: i want to neglect empty fields lets say that $var1 (keywords) is empty it will select all empty fileds, but i want if $var1 is empty the result will be like $result = mysql_query("SELECT DISTINCT title,description FROM table WHERE author='$var2' OR date='$var3' OR forums='$var4' "); if $var2 is empty the result will be like $result = mysql_query("SELECT DISTINCT title,description FROM table WHERE keywords ='$var1' OR date='$var3' OR forums='$var4' "); if $var1 and $var2 are empty the result will be like $result = mysql_query("SELECT DISTINCT title,description FROM table WHERE date='$var3' OR forums='$var4' "); and so on

    Read the article

  • Is it possible to send back a json array along with seperate variables

    - by Scarface
    Hey guys I have an ajax jquery function that receives data from a php script. I want to return an array with all the online users which is retrieved from a mysql statement, and I want to send other separate variables I need for other purposes along with it. If anyone has any ideas, I would greatly appreciate it. NOTE: the example below is to illustrate what I want to do, I understand that json-encoding the array with other variables is dysfunctional. JQUERY $.ajax({ type: "POST", data: "parameters", url: "retrieval.php", dataType: 'json', success: function(json) { $('#div1').html(json.array); $('#div2').html(json.variable1); $('#div3').html(json.variable2); } }) PHP $qryuserscount1="SELECT * FROM active_users"; $userscount1=mysql_query($qryuserscount1); while ($row = mysql_fetch_array($userscount1)) { $onlineuser= $row['username']; $id=$row['id']; $data[]=$onlineuser.$id; //for example there are 3 users, should send 3 entries back } $data['variable1']='something'; $data['variable2']='something else'; $out = json_encode($data); print $out;

    Read the article

< Previous Page | 73 74 75 76 77 78 79 80 81 82 83 84  | Next Page >