Search Results

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

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

  • variables reference value of string

    - by xdevel2000
    How can I get the reference value of a string object? If I hava a class like class T() { } T t = new T(); System.out.println( t); print out T@a3455467 that is the reference value inside t but for string? maybe with method hashCode()??

    Read the article

  • cmd.exe Command Line Parsing of Environment Variables

    - by Artefacto
    I can't figure how to have cmd.exe not interpret something like %PATH% as an environment variable. Given this program: #include<stdio.h> #include<windows.h> int main(int argc, char *argv[]) { int i; printf("cmd line: %s\n", GetCommandLine()); for (i = 0; i < argc; i++) { printf("%d: %s\n", i, argv[i]); } return 0; } I have these different outputs according to the position of the arguments: >args "k\" o" "^%PATH^%" cmd line: args "k\" o" "%PATH%" 0: args 1: k" o 2: %PATH% >args "^%PATH^%" "k\" o" cmd line: args "^%PATH^%" "k\" o" 0: args 1: ^%PATH^% 2: k" o I guess it's because cmd.exe doesn't recognize the escaped \" and sees the escaped double quote as closing the first, leaving in the first case %PATH% unquoted. I say this, because if I don't quote the argument, it always works: >args ^%PATH^% "k\" o" cmd line: args %PATH% "k\" o" 0: args 1: %PATH% 2: k" o but then I can have no spaces...

    Read the article

  • regular expresson of variables

    - by Kevinniceguy
    what is re of string of 0 and 1 that contain an even number of zeros and even number of ones..... its not or in the middle....its an and...and even number of ones so i got something like (1*01*01*)*(0*10*10*)* does it look good?

    Read the article

  • C++ Storing variables and inheritance

    - by Kaa
    Hello Everyone, Here is my situation: I have an event driven system, where all my handlers are derived from IHandler class, and implement an onEvent(const Event &event) method. Now, Event is a base class for all events and contains only the enumerated event type. All actual events are derived from it, including the EventKey event, which has 2 fields: (uchar) keyCode and (bool)isDown. Here's the interesting part: I generate an EventKey event using the following syntax: Event evt = EventKey(15, true); and I ship it to the handlers: EventDispatch::sendEvent(evt); // void EventDispatch::sendEvent(const Event &event); (EventDispatch contains a linked list of IHandlers and calls their onEvent(const Event &event) method with the parameter containing the sent event. Now the actual question: Say I want my handlers to poll the events in a queue of type Event, how do I do that? x Dynamic pointers with reference counting sound like too big of a solution. x Making copies is more difficult than it sounds, since I'm only receiving a reference to a base type, therefore each time I would need to check the type of event, upcast to EventKey and then make a copy to store in a queue. Sounds like the only solution - but is unpleasant since I would need to know every single type of event and would have to check that for every event received - sounds like a bad plan. x I could allocate the events dynamically and then send around pointers to those events, enqueue them in the array if wanted - but other than having reference counting - how would I be able to keep track of that memory? Do you know any way to implement a very light reference counter that wouldn't interfere with the user? What do you think would be a good solution to this design? I thank everyone in advance for your time. Sincerely, Kaa

    Read the article

  • jQuery ajax : error while passing variables in data

    - by Tristan
    Hello, just a quick question : var h = $('#hebergeurJQUERY').val(); var t = $('#typeJQUERY').val(); function requestData() { $.ajax({ type: "GET", url: '12months/months.php', data : "hosting="+h+"&type="+t+"", ...... doesnt work while data : "hosting=Something&type=Something", Works. Any idea to something stupid i did (again ?) ;) Thanks

    Read the article

  • Does python have a session variable concept???

    - by gizgok
    I have a datetime.date variable in python.I need to pass it to a function do operations according to the date given and then increment the date for the next set of operations.The problem is I have to do the operations in diff pages and hence I need the date as a variable which can go from page to page. Can we do this in python.......

    Read the article

  • C# XOR on two byte variables will not compile without a cast

    - by Ash
    Why does the following raise a compile time error: 'Cannot implicitly convert type 'int' to 'byte': byte a = 25; byte b = 60; byte c = a ^ b; This would make sense if I were using an arithmentic operator because the result of a + b could be larger than can be stored in a single byte. However applying this to the XOR operator is pointless. XOR here it a bitwise operation that can never overflow a byte. using a cast around both operands works: byte c = (byte)(a ^ b);

    Read the article

  • c++ volatile multithreading variables

    - by anon
    I'm writing a C++ app. I have a class variable that more than one thread is writing to. In C++, anything that can be modified without the compiler "realizing" that it's being changed needs to be marked volatile right? So if my code is multi threaded, and one thread may write to a var while another reads from it, do I need to mark the var volaltile? [I don't have a race condition since I'm relying on writes to ints being atomic] Thanks!

    Read the article

  • Google Map V3 Constants as Variables

    - by Beardy
    In the example below I am trying to update the map type depending on the value of the selected option type. Unfortunately it doesn't seem to load the maptype into the google.maps.MapTypeId which is frustrating. I have tried it as a string as well as var gmapsMapType = google.maps.MapTypeId.++maptype; and I feel I am missing something here. HTML <select id="maptype" name="maptype"> <option selected="selected" value="RoadMap">Road Map</option> <option value="Satellite">Satellite</option> <option value="Hybrid">Hybrid</option> <option value="Terrain">Terrain</option> </select> JQUERY var maptype = $('#maptype>option:selected').val().toUpperCase(); var gmapsMapType = google.maps.MapTypeId.+maptype; map.setMapTypeId(gmapsMapType); Help is appreciated.

    Read the article

  • the best way to make codeigniter website multi-language. calling from lang arrays depends on lang se

    - by artmania
    Hi friends, I'm researching hours and hours, but I could not find any clear, efficient way to make it :/ I have a codeigniter base website in English and I have to add a Polish language now. What is the best way to make my site in 2 language depending visitor selection? is there any way to create array files for each language and call them in view files depends on Session from lang selection? I don't wanna use database. Appreciate helps! I'm running out of deadline :/ thanks!!

    Read the article

  • Using variables before include()ing them

    - by phenry
    I'm using a file, page.php, as an HTML container for several content files; i.e., page.php defines most of the common structure of the page, and the content files just contain the text that's unique to every page. What I would like to do is include some PHP code with each content file that defines metadata for the page such as its title, a banner graphic to use, etc. For example, a content file might look like this (simplified): <?php $page_title="My Title"; ?> <h1>Hello world!</h1> The name of the file would be passed as a URL parameter to page.php, which would look like this: <html> <head> <title><?php echo $page_title; ?></title> </head> <body> <?php include($_GET['page']); ?> </body> </html> The problem with this approach is that the variable gets defined after it is used, which of course won't work. Output buffering also doesn't seem to help. Is there an alternate approach I can use? I'd prefer not to define the text in the content file as a PHP heredoc block, because that smashes the HTML syntax highlighting in my text editor. I also don't want to use JavaScript to rewrite page elements after the fact, because many of these pages don't otherwise use JavaScript and I'd rather not introduce it as a dependency if I don't have to.

    Read the article

  • Django: How/Where to store a value for a session without unnecessary DB hits

    - by GerardJP
    Hi all, I have an extended userprofile with AUTH_PROFILE_MODULE (ref: http://tinyurl.com/yhracqq) I would like to set a user.is_guru() method similar to user.is_active(). This would results for al views (or rather templates) to e.g. disable/enable certain user messages, displaying of widgets, etc. The boolean is stored in the extended user profile model, but I want to avoid hitting the DB for every view. So the questions is .. Do I use a context_processor, a template tag, session_dict or what have you to, possible cached, store this info for the duration of the users visit. Note: I dont have performance issues, so it's definitely filed under premature optimization. I just want to avoid generating extra work in the future :). Any pointers are very welcome. Thanx and greetz! Gerard.

    Read the article

  • AJAX: Problems returning multiple variables

    - by fwaokda
    First off sorry if I'm missing something simple just started working with AJAX today. I have an issue where I'm trying to get information from my database, but different records have different amounts of values. For instance, each record has a "features" column. In the features column I store a string. (ex: Feature1~Feature2~Feature3~Feature4... ) When I'm building the object I take apart the string and store all the features into an array. Some objects can have 1 feature others can have up to whatever. So... how do I return this values back to my ajax function from my php page? Below is my ajax function that I was trying and I'll provide a link with my php file. [ next.php : http://pastebin.com/SY74jV7X ] $("a#next").click(function() { $.ajax({ type : 'POST', url : 'next.php', dataType : 'json', data : { nextID : $("a#next").attr("rel") }, success : function ( data ) { var lastID = $("a#next").attr("rel"); var originID = $("a#next").attr("rev"); if(lastID == 1) { lastID = originID; } else { lastID--; } $("img#spotlight").attr("src",data.spotlightimage); $("div#showcase h1").text(data.title); $("div#showcase h2").text(data.subtitle); $("div#showcase p").text(data.description); $("a#next").attr("rel", lastID); for(var i=0; i < data.size; i++) { $("ul#features").append("<li>").text(data.feature+i).append("</li>"); } /* for(var j=1; j < data.picsize; j++) { $("div.thumbnails ul").append("<li>").text(data.image+j).append("</li>"); } */ }, error : function ( XMLHttpRequest, textStatus, errorThrown) { $("div#showcase h1").text("An error has occured: " + errorThrown); } }); });

    Read the article

  • perl regular expressions substitution/replacement using variables with special characters

    - by user961627
    Okay I've checked previous similar questions and I've been juggling with different variations of quotemeta but something's still not right. I have a line with a word ID and two words - the first is the wrong word, the second is right. And I'm using a regex to replace the wrong word with the right one. $line = "ANN20021015_0104_XML_16_21 A$xAS A$xASA"; @splits = split("\t",$line); $wrong_word = quotemeta $splits[1]; $right_word = quotemeta $splits[2]; print $right_word."\n"; print $wrong_word."\n"; $line =~ s/$wrong_word\t/$right_word\t/g; print $line; What's wrong with what I'm doing? Edit The problem is that I'm unable to retain the complete words - they get chopped off at the special characters. This code works perfectly fine for words without special characters. The output I need for the above example is: ANN20021015_0104_XML_16_21 A$xASA A$xASA But what I get is ANN20021015_0104_XML_16_21 A A Because of the $ character.

    Read the article

  • Android and PHP - Do I need to use sessions?

    - by jtnire
    I have created an Android App that communicates with a PHP web server. They both send JSON to each other. My App is almost finished, however there is one thing left to do: authentication. Since the user's username and password will be stored in Android SharedPreferences, is there any need to use PHP sessions, given that the user won't need to enter the username/password at every request? Since I can just send the username and password in the HTTP POST header for every request, and that I will be using SSL, is this sufficient? I guess I could add an extra field in the header called 'random' that just adds a random value, just to use as a salt so that the encrypted SSL payload will be different everytime. The reason why I don't want to use sessions is that my Android App would either have to handle cookies, or managed the storage of the session ID. If there are some serious cons to using my method above, then I'm more than happy to use sessions, however all advice is appreciated. Thanks

    Read the article

  • Reducing unnecessary same values in Class member variables ....

    - by Freshblood
    class A { public int a; public int c; } i will create 10 instances from A.Then i will create 15 instances from A again... go on. first 10 instance will have same value for a variable and next 15 instances will have again same value for a.But I don't mean that both group has same values for a .Problem is create same a value 10 times in first group and 15 times in second group on memory unnecessary. What would be Best solution or solutions for reduce unnecessary datas in this situation?

    Read the article

  • Accessing global variables within functions in PHP

    - by st3
    There are multiple times in one page where I need to connect and subsequently query a MySQL database, yet my code won't let me. I think it might be something to do with how my files are nested but it makes no sense. I am opening the SQL connection in the header file. The top of the offending page looks like the following: <?php $page_title = 'Dashboard'; include('templates/header.inc'); // includes a 'require_once('mysqli_connect.php') and a small query to the database; require_once('includes/functions.php'); require_once('includes/dashboard_sql.php'); // Contains functions which connect to database (which are failing.) ?> I get the PHP error Notice: Undefined variable: dbc in /Library/WebServer/Documents/pediatory_site/includes/dashboard_sql.php Where $dbc is the database connection defined in mysqli_connect.php. If anyone could help me out that would be great.

    Read the article

  • How to create session with iphone sdk ?

    - by jaydp13
    Hi, I made story book with iphone sdk . I created different views by coding. When user read story book I want to know that currently which view is read by user because I want to store value of current view and If user closed the application and start again at a time user can read from current. So guide me about the problem. Thanks !

    Read the article

  • interface variables are final and static by default and methods are public and abstract

    - by sap
    The question is why it's been decided to have variable as final and static and methods as public and abstract by default. Is there any particular reason for making them implicit,variable as final and static and methods as public and abstract. Why they are not allowing static method but allowing static variable? We have interface to have feature of multiple inheritance in Java and to avoid diamond problem. But how it solves diamond problem,since it does not allow static methods. In the following program, both interfaces have method with the same name..but while implementing only one we implement...is this how diamond problem is solved? interface testInt{ int m = 0; void testMethod(); } interface testInt1{ int m = 10; void testMethod(); } public class interfaceCheck implements testInt, testInt1{ public void testMethod(){ System . out . println ( "m is"+ testInt.m ); System . out . println ( "Hi World!" ); } }

    Read the article

  • Local and global variables in javascript

    - by caramel1991
    Today,I started to code a page that prompt the user to choose their PC spec,and the code is as follow <html> <title>Computer Specification Chooser</title> <head> <script type="text/javascript"> var compSpec = document.compChooser; function processorUnavailable_onclick() { alert("Sorry that processor speed is currently unavailable"); compSpec.processor[2].checked = true; } </script> </head> <body> <form name="compChooser"> <p>Tick all components you wan included on your computer</p> <p> DVD-ROM <input type="checkbox" name="chkDVD" value="DVD-ROM" /> <br /> CD-ROM <input type="checkbox" name="chkCD" value="CD-ROM" /> <br /> Zip Drive <input type="checkbox" name="chkZIP" value="ZIP DRIVE" /> </p> <p> Select the processor speed you require <br /> <input type="radio" name="processor" value="3.8" /> 3.8 GHZ <input type="radio" name="processor" value="4.8" onclick="processorUnavailable_onclick()" /> 4.8 GHZ <input type="radio" name="processor" value="6" /> 6 GHZ </p> <input type="button" name="btnCheck" value="Check Form" /> </form> </body> </html> The problem I'm facing is on the function that I've tie to the event handler,when I try to choose the radio button of the processor value 4.8 GHZ,yes it alert me with the message inside the function,but after that,it doest not execute the next statement inside the function,that is to check the next processor value 6 GHZ. I've try my effort to change it and test on it,and find out when I set the var compSpec = document.compChooser as a local variable inside the function instead of a global variable,the next statement could be executed. But I thought for a global variable,it is accessible in everywhere on the page and also inside a function.But why now I can't accesses it inside my function??Any idea?? Besides,I stumble upon a weird article while googling,it says that when a global variable is created,it is added to window object.I just curious why this happen??And what's the benefits and uses of it?? THANK YOU

    Read the article

  • Annonymous functions accessing local variables [ActionScript - Flex 3.5]

    - by Ali
    Hi All, I am having a situation with my actionscript/flex front end. for each (var sym:String in ["A","B","C"]) { const handler = function (data:Object):void { Alert.show(sym); } asyncCallback(handler); } I am expecting to have 3 Alert windows containing A, B and C. But the actual result is 3 alert windows all showing C ! I appreciate your comments. -A

    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

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