Search Results

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

Page 96/632 | < Previous Page | 92 93 94 95 96 97 98 99 100 101 102 103  | Next Page >

  • RAILS :"session contains objects whose class definition isn\'t available."

    - by Surya
    Session contains objects whose class definition isn\'t available. Remember to require the classes for all objects kept in the session I am trying to integrate http://github.com/binarylogic/authlogic for authentication into my rails application . I follwed all the steps into mentioned in the documentation . Now i seem to be getting this error when i hit a controller . Looks like i am missing something obvious . stacktrace /Library/Ruby/Gems/1.8/gems/actionpack-2.3.5/lib/action_controller/session/abstract_store.rb:77:in `stale_session_check!' /Library/Ruby/Gems/1.8/gems/actionpack-2.3.5/lib/action_controller/session/abstract_store.rb:61:in `load!' /Library/Ruby/Gems/1.8/gems/actionpack-2.3.5/lib/action_controller/session/abstract_store.rb:28:in `[]' /Library/Ruby/Gems/1.8/gems/authlogic-2.1.3/lib/authlogic/session/session.rb:48:in `session_credentials' /Library/Ruby/Gems/1.8/gems/authlogic-2.1.3/lib/authlogic/session/session.rb:33:in `persist_by_session' /Library/Ruby/Gems/1.8/gems/activesupport-2.3.5/lib/active_support/callbacks.rb:178:in `send' /Library/Ruby/Gems/1.8/gems/activesupport-2.3.5/lib/active_support/callbacks.rb:178:in `evaluate_method' /Library/Ruby/Gems/1.8/gems/activesupport-2.3.5/lib/active_support/callbacks.rb:166:in `call' /Library/Ruby/Gems/1.8/gems/activesupport-2.3.5/lib/active_support/callbacks.rb:93:in `run' /Library/Ruby/Gems/1.8/gems/activesupport-2.3.5/lib/active_support/callbacks.rb:92:in `each' /Library/Ruby/Gems/1.8/gems/activesupport-2.3.5/lib/active_support/callbacks.rb:92:in `send' /Library/Ruby/Gems/1.8/gems/activesupport-2.3.5/lib/active_support/callbacks.rb:92:in `run' /Library/Ruby/Gems/1.8/gems/activesupport-2.3.5/lib/active_support/callbacks.rb:276:in `run_callbacks' /Library/Ruby/Gems/1.8/gems/authlogic-2.1.3/lib/authlogic/session/callbacks.rb:79:in `persist' /Library/Ruby/Gems/1.8/gems/authlogic-2.1.3/lib/authlogic/session/persistence.rb:55:in `persisting?' /Library/Ruby/Gems/1.8/gems/authlogic-2.1.3/lib/authlogic/session/persistence.rb:39:in `find' /Users/suryagaddipati/myprojects/groceryplanner/app/controllers/application_controller.rb:12:in `current_user_session' /Users/suryagaddipati/myprojects/groceryplanner/app/controllers/application_controller.rb:17:in `current_user' /Users/suryagaddipati/myprojects/groceryplanner/app/controllers/application_controller.rb:30:in `require_no_user' /Library/Ruby/Gems/1.8/gems/activesupport-2.3.5/lib/active_support/callbacks.rb:178:in `send' /Library/Ruby/Gems/1.8/gems/activesupport-2.3.5/lib/active_support/callbacks.rb:178:in `evaluate_method' /Library/Ruby/Gems/1.8/gems/activesupport-2.3.5/lib/active_support/callbacks.rb:166:in `call' /Library/Ruby/Gems/1.8/gems/actionpack-2.3.5/lib/action_controller/filters.rb:225:in `call' /Library/Ruby/Gems/1.8/gems/actionpack-2.3.5/lib/action_controller/filters.rb:629:in `run_before_filters' /Library/Ruby/Gems/1.8/gems/actionpack-2.3.5/lib/action_controller/filters.rb:615:in `call_filters' /Library/Ruby/Gems/1.8/gems/actionpack-2.3.5/lib/action_controller/filters.rb:610:in `perform_action_without_benchmark' /Library/Ruby/Gems/1.8/gems/actionpack-2.3.5/lib/action_controller/benchmarking.rb:68:in `perform_action_without_rescue' /Library/Ruby/Gems/1.8/gems/activesupport-2.3.5/lib/active_support/core_ext/benchmark.rb:17:in `ms' /Library/Ruby/Gems/1.8/gems/activesupport-2.3.5/lib/active_support/core_ext/benchmark.rb:10:in `realtime' /Library/Ruby/Gems/1.8/gems/activesupport-2.3.5/lib/active_support/core_ext/benchmark.rb:17:in `ms' /Library/Ruby/Gems/1.8/gems/actionpack-2.3.5/lib/action_controller/benchmarking.rb:68:in `perform_action_without_rescue' /Library/Ruby/Gems/1.8/gems/actionpack-2.3.5/lib/action_controller/rescue.rb:160:in `perform_action_without_flash' /Library/Ruby/Gems/1.8/gems/actionpack-2.3.5/lib/action_controller/flash.rb:146:in `perform_action' /Library/Ruby/Gems/1.8/gems/actionpack-2.3.5/lib/action_controller/base.rb:532:in `send' /Library/Ruby/Gems/1.8/gems/actionpack-2.3.5/lib/action_controller/base.rb:532:in `process_without_filters' /Library/Ruby/Gems/1.8/gems/actionpack-2.3.5/lib/action_controller/filters.rb:606:in `process' /Library/Ruby/Gems/1.8/gems/actionpack-2.3.5/lib/action_controller/base.rb:391:in `process' /Library/Ruby/Gems/1.8/gems/actionpack-2.3.5/lib/action_controller/base.rb:386:in `call' /Library/Ruby/Gems/1.8/gems/actionpack-2.3.5/lib/action_controller/routing/route_set.rb:437:in `call' /Library/Ruby/Gems/1.8/gems/actionpack-2.3.5/lib/action_controller/dispatcher.rb:87:in `dispatch' /Library/Ruby/Gems/1.8/gems/actionpack-2.3.5/lib/action_controller/dispatcher.rb:121:in `_call' /Library/Ruby/Gems/1.8/gems/actionpack-2.3.5/lib/action_controller/dispatcher.rb:130:in `build_middleware_stack' /Library/Ruby/Gems/1.8/gems/activerecord-2.3.5/lib/active_record/query_cache.rb:29:in `call' /Library/Ruby/Gems/1.8/gems/activerecord-2.3.5/lib/active_record/query_cache.rb:29:in `call' /Library/Ruby/Gems/1.8/gems/activerecord-2.3.5/lib/active_record/connection_adapters/abstract/query_cache.rb:34:in `cache' /Library/Ruby/Gems/1.8/gems/activerecord-2.3.5/lib/active_record/query_cache.rb:9:in `cache' /Library/Ruby/Gems/1.8/gems/activerecord-2.3.5/lib/active_record/query_cache.rb:28:in `call' /Library/Ruby/Gems/1.8/gems/activerecord-2.3.5/lib/active_record/connection_adapters/abstract/connection_pool.rb:361:in `call' /Library/Ruby/Gems/1.8/gems/actionpack-2.3.5/lib/action_controller/string_coercion.rb:25:in `call' /Users/suryagaddipati/.gem/ruby/1.8/gems/rack-1.0.1/lib/rack/head.rb:9:in `call'

    Read the article

  • Environment variable names with parentheses, like %ProgramFiles(x86)%, in PowerShell?

    - by jwfearn
    How does one get the value of environment variable whose name contains parentheses in a PowerShell script? To complicate matters, some variables names contains parentheses while others have similar names without parenteses. For example (using cmd.exe): C:\>set | find "ProgramFiles" CommonProgramFiles=C:\Program Files\Common Files CommonProgramFiles(x86)=C:\Program Files (x86)\Common Files ProgramFiles=C:\Program Files ProgramFiles(x86)=C:\Program Files (x86) We see that %ProgramFiles% is not the same as %ProgramFiles(x86)%. My PowerShell code is failing in a weird way because it's ignoring the part of the environment variable name after the parentheses. Since this happens to match the name of a different, but existing, environment variable I don't fail, I just get the right value of the wrong variable. Here's a test function in the PowerShell scripting language to illustrate my problem: function Do-Test { $ok = "C:\Program Files (x86)" # note space between 's' and '( $bad = "$Env:ProgramFiles" + "(x86)" # uses %ProgramFiles% $bin32 = "$Env:ProgramFiles(x86)" # LINE 6, I want to use %ProgramFiles(x86)% if ( $bin32 -eq $ok ) { Write-Output "Pass" } elseif ( $bin32 -eq $bad ) { Write-Output "Fail: %ProgramFiles% used instead of %ProgramFiles(x86)%" } else { Write-Output "Fail: some other reason" } } And here's the output: PS> Do-Test Fail: %ProgramFiles% used instead of %ProgramFiles(x86)% Is there a simple change I can make to line 6 above to get the correct value of %ProgramFiles(x86)%? *NOTE: In the text of this post I am using batch file syntax for environment variables as a convenient shorthand. For example %SOME_VARIABLE% means "the value of the environment variable whose name is SOME_VARIABLE". If I knew the properly escaped syntax in PowerShell, I wouldn't need to ask this question.*

    Read the article

  • JAVA - Create variable names using a loop?

    - by SeerUK
    Hi, first time poster, long time reader so be gentle with me :) See the following code which works to generate me timestamps for the beginning and end of every month in a financial year. int year = 2010; // Financial year runs from Sept-Aug so earlyMonths are those where year = FY-1 and lateMonths are those where year = FY int[] earlyMonths = {8, 9, 10, 11}; // Sept to Dec int earlyYear = year -1; for (int i : earlyMonths) { month = i; Calendar cal = Calendar.getInstance(); cal.clear(); cal.set(earlyYear,month,1,0,0,0); Long start = cal.getTimeInMillis(); cal.clear(); cal.set(earlyYear,month,1); lastDayofMonth = cal.getActualMaximum(GregorianCalendar.DAY_OF_MONTH); cal.set(earlyYear,month,lastDayofMonth,23,59,59); Long end = cal.getTimeInMillis(); } int[] lateMonths = {0, 1, 2, 3, 4, 5, 6, 7}; // Jan to Aug for (int i : lateMonths) { month = i; Calendar cal = Calendar.getInstance(); cal.clear(); cal.set(year,month,1,0,0,0); Long start = cal.getTimeInMillis(); cal.clear(); cal.set(year,month,1); lastDayofMonth = cal.getActualMaximum(GregorianCalendar.DAY_OF_MONTH); cal.set(year,month,lastDayofMonth,23,59,59); Long end = cal.getTimeInMillis(); } So far so good, but in order to use these results I need these timestamps to be output to variables named by month (to be used in a prepared statement later in the code. e.g. SeptStart = sometimestamp, SeptEnd = some timestamp etc etc. I don't know if it is possible to declare new variables based on the results of each loop. Any ideas?

    Read the article

  • Create variable names using a loop in Java?

    - by SeerUK
    Hi, first time poster, long time reader so be gentle with me :) See the following code which works to generate me timestamps for the beginning and end of every month in a financial year. int year = 2010; // Financial year runs from Sept-Aug so earlyMonths are those where year = FY-1 and lateMonths are those where year = FY int[] earlyMonths = {8, 9, 10, 11}; // Sept to Dec int earlyYear = year -1; for (int i : earlyMonths) { month = i; Calendar cal = Calendar.getInstance(); cal.clear(); cal.set(earlyYear,month,1,0,0,0); Long start = cal.getTimeInMillis(); cal.clear(); cal.set(earlyYear,month,1); lastDayofMonth = cal.getActualMaximum(GregorianCalendar.DAY_OF_MONTH); cal.set(earlyYear,month,lastDayofMonth,23,59,59); Long end = cal.getTimeInMillis(); } int[] lateMonths = {0, 1, 2, 3, 4, 5, 6, 7}; // Jan to Aug for (int i : lateMonths) { month = i; Calendar cal = Calendar.getInstance(); cal.clear(); cal.set(year,month,1,0,0,0); Long start = cal.getTimeInMillis(); cal.clear(); cal.set(year,month,1); lastDayofMonth = cal.getActualMaximum(GregorianCalendar.DAY_OF_MONTH); cal.set(year,month,lastDayofMonth,23,59,59); Long end = cal.getTimeInMillis(); } So far so good, but in order to use these results I need these timestamps to be output to variables named by month (to be used in a prepared statement later in the code. e.g. SeptStart = sometimestamp, SeptEnd = some timestamp etc etc. I don't know if it is possible to declare new variables based on the results of each loop. Any ideas?

    Read the article

  • Email function using templates. Includes via ob_start and global vars

    - by Geo
    I have a simple Email() class. It's used to send out emails from my website. <? Email::send($to, $subj, $msg, $options); ?> I also have a bunch of email templates written in plain HTML pierced with a few PHP variables. E.g. /inc/email/templates/account_created.php: <p>Dear <?=$name?>,</p> <p>Thank you for creating an account at <?=$SITE_NAME?>. To login use the link below:</p> <p><a href="https://<?=$SITE_URL?>/account" target="_blank"><?=$SITE_NAME?>/account</a></p> In order to have the PHP vars rendered I had to include the template into my function. But since include does not return the contents but rather just sends it directly to the output, I had to wrap it with the buffer functions: <? abstract class Email { public static function send($to, $subj, $msg, $options = array()) { /* ... */ ob_start(); include '/inc/email/templates/account_created.php'; $msg = ob_get_clean(); /* ... */ } } After that I realized that the PHP vars are not rendered as they are being inside of the function scope, so I had to globalize the variables inside of the template: <? global $SITE_NAME, $SITE_URL, $name; ?> <p>Dear <?=$name?>,</p> ... So the question is whether there is a more elegant solution to this? Mainly I am concerned about my workarounds using ob_start() and global. For some reason that seems to me odd. Or this is pretty much the common practice?

    Read the article

  • C++: Copy contructor: Use Getters or access member vars directly?

    - by cbrulak
    Have a simple container class: public Container { public: Container() {} Container(const Container& cont) //option 1 { SetMyString(cont.GetMyString()); } //OR Container(const Container& cont) //option 2 { m_str1 = cont.m_str1; } public string GetMyString() { return m_str1;} public void SetMyString(string str) { m_str1 = str;} private: string m_str1; } So, would you recommend this method or accessing the member variables directly? In the example, all code is inline, but in our real code there is no inline code. Update (29 Sept 09): Some of these answers are well written however they seem to get missing the point of this question: this is simple contrived example to discuss using getters/setters vs variables initializer lists or private validator functions are not really part of this question. I'm wondering if either design will make the code easier to maintain and expand. Some ppl are focusing on the string in this example however it is just an example, imagine it is a different object instead. I'm not concerned about performance. we're not programming on the PDP-11

    Read the article

  • Pass a variable from the source file to an included file in PHP

    - by Alpha1
    For my website I want to store the general format of the site in a single PHP file in a single location, and each of the different pages content in the local location of the page. I then want to pass the title and content address to the included file via a variable. However I can't get the included format file to read the variables storing the title and content data. AKA, the called file for the individual page would be: <?php $title = 'Some Title'; $source_file = 'content.php'; readfile('http:...../format.php'); ?> The format file would be: <html> ... <title> <?php echo $title; ?> </title> ... <?php include($source_file); ?> ... I recall reading somewhere I need to include something to get the variables at the start of the format file, however I can't remember what it is or find where I found that information.

    Read the article

  • linux bash script: set date/time variable to auto-update (for inclusion in file names)

    - by user1859492
    Essentially, I have a standard format for file naming conventions. It breaks down to this: target_dateUTC_timeUTC_tool So, for instance, if I run tcpdump on a target of 'foo', then the file would be foo_dateUTC_timeUTC_tcpdump. Simple enough, but a pain for everyone to constantly (and consistently) enter... so I've tried to create a bash script which sets system variables like so: FILENAME=$TARGET\_$UTCTIME\_$TOOL Then, I can just call the variable at runtime, like so: tcpdump -w $FILENAME.lpc All of this works like a champ. I've got a menu-driven .sh which gives the user the options of viewing the current variables as well as setting them... file generation is a breeze. Unfortunately, by setting the date/time variable, it is locked to the value at the time of creation (naturally). I set the variable like so: UTCTIME=$(/bin/date --utc +"%Y%m%d_%H%M%Z") What I really need is either a way to create a variable which updates at runtime, or (more likely) another way to skin this cat. While scouring for solutions, I came across a similar issues... like this. But, to be honest, I'm stumped on how to marry the two approaches and create a simple, distributable solution. I can post the entire .sh if anyone cares to review (about 120 lines)

    Read the article

  • Calculating with a variable outside of its bounds in C

    - by aquanar
    If I make a calculation with a variable where an intermediate part of the calculation goes higher then the bounds of that variable type, is there any hazard that some platforms may not like? This is an example of what I'm asking: int a, b; a=30000; b=(a*32000)/32767; I have compiled this, and it does give the correct answer of 29297 (well, within truncating error, anyway). But the part that worries me is that 30,000*32,000 = 960,000,000, which is a 30-bit number, and thus cannot be stored in a 16-bit int. The end result is well within the bounds of an int, but I was expecting that whatever working part of memory would have the same size allocated as the largest source variables did, so an overflow error would occur. This is just a small example to show my problem, I am trying to avoid using floating points by making the fraction be a fraction of the max amount able to be stored in that variable (in this case, a signed integer, so 32767 on the positive side), because the embedded system I'm using I believe does not have an FPU. So how do most processors handle calculations out of the bounds of the source and destination variables?

    Read the article

  • NSCollectionView subclass doesn't call drawRect during drag session despite setNeedsDisplay

    - by Alain Vitry
    Greetings, I am puzzled as to how and when drawRect is supposed to be called in a NSCollectionView subclass. I implement drag and drop operation in order to move NSCollectionViewItems within the collection, and would like to draw a visual indication of where the drop would end. The subclass does not call drawRect during the drag session. (It does during scroll) Is this the intended operation ? Any hint on how to implement this behavior properly are welcome. A full xcode project of the following code is available at: http://babouk.ovh.org/dload/MyCollectionView.zip Best regards Code sample: @interface CollectionViewAppDelegate : NSObject <NSApplicationDelegate> { NSWindow *window; NSMutableArray *collectionContent; } /* properties declaration */ /* KVC compliance declarations */ @end @interface MyCollectionView : NSCollectionView @end @interface ItemModel { NSString *name; } @property (copy) NSString *name; @end @implementation MyCollectionView - (void)drawRect:(NSRect)rect { NSLog(@"DrawRect"); } - (void)mouseDragged:(NSEvent *)aEvent { NSPoint localPoint = [self convertPoint:[aEvent locationInWindow] fromView:nil]; [self dragImage:[NSImage imageNamed:@"Move.png"] at:localPoint offset:NSZeroSize event:aEvent pasteboard:nil source:self slideBack:NO]; } - (BOOL)prepareForDragOperation:(id < NSDraggingInfo >)sender { return YES; } - (NSDragOperation)draggingEntered:(id <NSDraggingInfo>)sender { return NSDragOperationEvery; } - (NSDragOperation)draggingUpdated:(id <NSDraggingInfo>)sender { [self setNeedsDisplay:YES]; return NSDragOperationEvery; } - (NSDragOperation)draggingSourceOperationMaskForLocal:(BOOL)isLocal { return NSDragOperationEvery; } - (void)mouseDown:(NSEvent *)theEvent { } @end @implementation CollectionViewAppDelegate @synthesize window, collectionContent, collectionView; - (void)applicationDidFinishLaunching:(NSNotification *)aNotification { NSMutableArray *data = [[NSMutableArray alloc] init]; /* Fill in data */ [self setCollectionContent:data]; [data release]; } /* dealloc */ /* KVC implementation */ @end @implementation ItemModel @synthesize name; /* dealloc */ @end

    Read the article

  • ps forrest for session id

    - by azatoth
    Often I want to get a nice readout what process are running and their relationship; I usually by habit runs ps auxfww and eventual grep for the process in question. Having been thinking about the problem I tried to create an oneliner to get the process tree in ps ufww format for all processes which has the session id specified by arbitrary process name(s); ending up in following code: ps ufww --sid=$(ps -C apache2 -o sess --no-headers | sort | uniq | grep -v -E '^ +0$' | awk 'NR==1{x=$0;next}NF{x=x","$0};END{gsub(/[[:space:]]*/,"",x);print x}') giving for example following output: USER PID %CPU %MEM VSZ RSS TTY STAT START TIME COMMAND root 4157 0.0 0.1 41264 3120 ? Ss Jun11 0:00 /usr/sbin/apache2 -k start www-data 4329 0.0 0.0 41264 1976 ? S Jun11 0:00 \_ /usr/sbin/apache2 -k start www-data 4330 0.0 0.0 41264 2028 ? S Jun11 0:00 \_ /usr/sbin/apache2 -k start www-data 4331 0.0 0.0 41264 2028 ? S Jun11 0:00 \_ /usr/sbin/apache2 -k start www-data 4332 0.0 0.0 41264 2028 ? S Jun11 0:00 \_ /usr/sbin/apache2 -k start www-data 4333 0.0 0.0 41264 2032 ? S Jun11 0:00 \_ /usr/sbin/apache2 -k start www-data 6648 0.0 0.0 41264 1884 ? S Jun11 0:00 \_ /usr/sbin/apache2 -k start www-data 6654 0.0 0.0 41264 1884 ? S Jun11 0:00 \_ /usr/sbin/apache2 -k start www-data 6655 0.0 0.0 41264 1884 ? S Jun11 0:00 \_ /usr/sbin/apache2 -k start I do wonder now if anyone has an better idea to solve this issue? Are there anything out there that is easier to "oneline" and gives above or better information? For example I would actually want to have included all childs relative any parent. (uncertain if this should be on SF instead, but felt it was more like an programming question)

    Read the article

  • SQL Exception: "Impersonate Session Security Context" cannot be called in this batch because a simul

    - by kasey
    When opening a connection to SQL Server 2005 from our web app, we occasionally see this error: "Impersonate Session Security Context" cannot be called in this batch because a simultaneous batch has called it. We use MARS and connection pooling. The exception originates from the following piece of code: protected SqlConnection Open() { SqlConnection connection = new SqlConnection(); connection.ConnectionString = m_ConnectionString; if (connection != null) { try { connection.Open(); if (m_ExecuteAsUserName != null) { string sql = Format("EXECUTE AS LOGIN = {0};", m_ExecuteAsUserName); ExecuteCommand(connection, sql); } } catch (Exception exception) { connection.Close(); connection = null; } } return connection; } I found an MS Connect article which suggests that the error is caused when a previous command has not yet terminated before the EXECUTE AS LOGIN command is sent. Yet how can this be if the connection has only just been opened? Could this be something to do with connection pooling interacting strangely with MARS? UPDATE: For the short-term we have implemented a workaround by clearing out the connection pool whenever this happens, to get rid of the bad connection, as it otherwise keeps getting handed back to various users. (Not too bad as this only happens a couple of times a day.) But if anyone has any further ideas, we are still looking out for a real solution...

    Read the article

  • Facebook Graph API authentication in canvas app and track session

    - by cdpnet
    Short question is: how can i use graph api oauth redirects mechanism to authenticate user and save retrieved access_token and also use javascript SDK when needed (the problem is javascript SDK will have different access_token when initialized). I have initially setup my facebook iframe canvas app, with single sign on. This works well with graph api, as I am able to use access_token saved by facebook's javascript when it detects sessionchange(user logged in). But, I want to rather not do single sign-on. But, use graph api redirect and force user to send to a permissions dialog. But, if he has already given permissions, I shouldn't redirect user. How to handle this? Another question: I have done graph api redirects for authentication and have retrieved access_token also. But then, what if I want to use javascript call FB.ui to do stream.Publish? I think it will use it's own access_token which is set during FB.init and detecting session. So, I am looking for some path here. How to use graph api for authentication and also use facebook's javascript SDK when needed. P.S. I'm using ASP .NET MVC 2. I have an authentication filter developed, which needs to detect the user's authentication state and redirect.(currently it does this to graph api authorize url)

    Read the article

  • Log off from Remote Desktop Session does not closing Session, showing the login screen again on Wind

    - by Santhosha
    Hi As per requirement we have written one custom GINA. I have observed one interesting behavior in Windows XP 32 Bit(SP2). Customized GINA internally calls windows default Windows GINA(msgina.dll) and shows one extra window as per our requirement. I used to do remote desktop to XP machine from my machine. After replacing Windows GINA with customized GINA I tried to log off from the XP Machine(I am Using Remote Desktop Connection to log in), Log off completes successfully(After showing saving your settings, Closing network connections etc) and I will get log in screen which we get during log on, this is not expected comapred to other flavors of Windows OD. Where as in other operating systems such as Windows XP 64 Bit/ Windows 2003 32/64 Bit even after replacing the Windows Gina with custom GINA remote desktop session closes after log off from the machine. I have tried installing Novell GINA on Windows XP 32 Bit but i have not find any issue with that. I have Tried upgrading XP SP2 to SP3, still i am facing the same issue. Whether anyone faced Such issues when worked with Windows GINA? Thanks in advance Santhosha K S

    Read the article

  • Ninject problem binding to constant value in MVC3 with a RavenDB session

    - by Jim
    I've seen a lot of different ways of configuring Ninject with ASP.NET MVC, but the implementation seems to change slightly with each release of the MVC framework. I'm trying to inject a RavenDB session into my repository. Here is what I have that's almost working. public class MvcApplication : NinjectHttpApplication { ... protected override void OnApplicationStarted() { base.OnApplicationStarted(); AreaRegistration.RegisterAllAreas(); RegisterGlobalFilters(GlobalFilters.Filters); RegisterRoutes(RouteTable.Routes); } protected override IKernel CreateKernel() { return new StandardKernel(new MyNinjectModule()); } public static IDocumentSession CurrentSession { get { return (IDocumentSession)HttpContext.Current.Items[RavenSessionKey]; } } ... } public class MyNinjectModule : NinjectModule { public override void Load() { Bind<IUserRepository>().To<UserRepository>(); Bind<IDocumentSession>().ToConstant(MvcApplication.CurrentSession); } } When it tries to resolve IDocumentSession, I get the following error. Error activating IDocumentSession using binding from IDocumentSession to constant value Provider returned null. Activation path: 3) Injection of dependency IDocumentSession into parameter documentSession of constructor of type UserRepository Any ideas on how to make the IDocumentSession resolve?

    Read the article

  • @WebServices as @Stateless session bean in ejb jar

    - by kislo_metal
    Hi! Scenario: Creating some web service as @Stateless bean, package it as ejb jar. Result - can`t access to wsdl file. Goal: I want to use @WebServices as @Stateless session using ejb jar packaging with accessible wsdl file form web. Web service: @Stateless @WebService(serviceName = "ws.isp.SecurityService", wsdlLocation = "META-INF/wsdl/SecurityService.wsdl") public class SecurityService{ @EJB private Kerberos factory; @EJB private UsersServiceBean uService; public SecurityService() { } @WebMethod @WebResult(name = "SimpleResponse") public SimpleResponse LogOut( @WebParam(name = "sessionUUID", targetNamespace = "https://secure.co.ua/ws/") String sessionUUID ) { SimpleResponse resp = new SimpleResponse(); try{ factory.removeSession(sessionUUID); resp.setError(WSErrorCodes.SUCCESS); }catch (Exception e){ e.printStackTrace(); resp.setError(WSErrorCodes.UNRELOSVED_ERROR); } return resp; } @WebMethod public MySession logIn( @WebParam(name = "username", targetNamespace = "https://secure.co.ua/ws/") String username, @WebParam(name = "password", targetNamespace = "https://secure.co.ua/ws/") String password){ MySession result = new MySession(); try { UserSession us = factory.creatSession(uService.getUser(username, password).getId()); result.setSessionID(us.getSessionUUID().toString()); result.setError(WSErrorCodes.SUCCESS); } catch (NullPointerException e){ e.printStackTrace(); result.setError(WSErrorCodes.UNRELOSVED_USER); } catch (Exception e){ e.printStackTrace(); result.setError(WSErrorCodes.UNRELOSVED_ERROR); } return result; } } In this case I getting Invalid wsdl request http://192.168.44.48:8181/ws.isp.SecurityService/SecurityService when I try to access to wsdl and if do not use description of wsdlLocation I getting blank page. Web service as it self working good. Q1: what is the rule of describing wsdl file location for web services as stateless in ejb jar. Q2: is it possible to generate wsdl file during maven packaging ? Q3: how to generate wsdl file for web service where we have such annotation as @Stateless and @EJB (currently I can generate it only by commenting those annotations) environment: mave 2, ejb 3.1, glassfish v3, jax-ws 2.x Thank you!

    Read the article

  • NHibernate correct way to reattach cached entity to different session

    - by Chris Marisic
    I'm using NHibernate to query a list of objects from my database. After I get the list of objects over them I iterate over the list of objects and apply a distance approximation algorithm to find the nearest object. I consider this function of getting the list of objects and apply the algorithm over them to be a heavy operation so I cache the object which I find from the algorithm in HttpRuntime.Cache. After this point whenever I'm given the supplied input again I can just directly pull the object from Cache instead of having to hit the database and traverse the list. My object is a complex object that has collections attached to it, inside the query where I return the full list of objects I don't bring back any of the sub collections eagerly so when I read my cached object I need lazy loading to work correctly to be able to display the object fully. Originally I tried using this to re-associate my cached object back to a new session _session.Lock(obj, LockMode.None); However when accessing the page concurrently from another instance I get the error Illegal attempt to associate a collection with two open sessions I then tried something different with _session.Merge(obj); However watching the output of this in NHProf shows that it is deleting and re-associating my object's contained collections with my object, which is not what I want although it seems to work fine. What is the correct way to do this? Neither of these seem to be right.

    Read the article

  • Using EhCache for session.createCriteria(...).list()

    - by James Smith
    I'm benchmarking the performance gains from using a 2nd level cache in Hibernate (enabling EhCache), but it doesn't seem to improve performance. In fact, the time to perform the query slightly increases. The query is: session.createCriteria(MyEntity.class).list(); The entity is: @Entity @Cache(usage = CacheConcurrencyStrategy.NONSTRICT_READ_WRITE) public class MyEntity { @Id @GeneratedValue private long id; @Column(length=5000) private String data; //---SNIP getters and setters--- } My hibernate.cfg.xml is: <!-- all the normal stuff to get it to connect & map the entities plus:--> <property name="hibernate.cache.region.factory_class"> net.sf.ehcache.hibernate.EhCacheRegionFactory </property> The MyEntity table contains about 2000 rows. The problem is that before adding in the cache, the query above to list all entities took an average of 65 ms. After the cache, they take an average of 74 ms. Is there something I'm missing? Is there something extra that needs to be done that will increase performance?

    Read the article

  • Possible to Dynamic Form Generation Using PHP global variables

    - by J M 4
    I am currently a fairly new programmer but am trying to build a registration page for a medical insurance idea we have which captures individual information and subsequent pieces of information about that individual's sub parts. In this case, it is a fight promoter enrolling his 15+ boxers for fight testing services. Right now, I have the site fully laid out to accept 7 fighters worth of information. This is collected during the manager's enrollment. However, each fighter's information is passed and stored in session super globals such as: $_SESSION['F1Firstname']; and $_SESSION['F3SSN3'];. The issue I am running into is this, I want to create a drop down menu selector for the manager to add information for up to 20-30 fighters. Right now I use PHP to state: if ($_SESSION['Num_Fighters'] 6) ... then display the table form fields to collect consumer data. If I have to build hidden elements for 30 fighters AND provide javascript/php validation (yes I am doing both) then I fear the file size for the document will be unnecessarily large for the maanger who only wants to enroll 2 fighters. Can anybody help?

    Read the article

  • PHP session corrupt

    - by Baversjo
    Using symfony framework 1.4 I have created a website. I'm using sfguard for authentication. Now, this is working great on WAMP (windows). I can login to several accounts on different browsers and use the website. I have ubuntu server 9.10 running apache (everything up to date and default configuration). On my server, when I login to the website in one browser it works great. When I on my other computer login with another user account on the public website, the login is successful. But when I refresh/go to another page the first user is shown as logged in instead! Also, when I press logout, It's not showing that I'm logged out after page load. When I press f5 again I'm logged out. As mentioned, all this works as expected on my local installation. I'm thinking there something wrong with my PHP session configuration on my ubuntu server, but I've never touched it.. Please help me. This is a school project and I'm presenting it today :(

    Read the article

  • PHP session token can be used multipletimes?

    - by kornesh
    I got page A which is a normal HTML page and page which is an AJAX response page. And I want to prevent CSRF attacks by tokens. Lets say I use this method for an autocomplete form, is it possible to use same token multiple times (of course the session is only set one time) because i tired this method but the validation keep failing after the first suggestion (obviously the token has changed, somehow) page A <?php session_start(); $token = md5(uniqid(rand(), TRUE)); $_SESSION['token'] = $token; ?> <input id="token" value="<?php echo $token; ?>" type="hidden"></input> <input id="autocomplete" placeholder="Type something"></input> .... The form is autosubmitted every time theres a change using Jquery. page B <?php session_start(); if($_REQUEST['token'] == $_SESSION['token']){ echo 'Im working fine'; } ?>

    Read the article

  • Facebook API - Detect if session is active OR NOT active

    - by Tom Doe
    I'm sure I'm simply overlooking something in the Facebook API docs. Basically, after I've loaded the FB Graph, I need to know if the session is active... I cannot simply assume they're logged out and simply re-render if they're logged in once the 'auth.statusChange' event is triggered. I need to know right off the bat. Below is the code that I've used. Most importantly the FB.getLoginStatus/getAuthResponse/getAccessToken don't work like I'd expect; essentially where it indicates, when invoked, whether they're logged in or out. (function(d) { // Create fb-root var fb_root = document.createElement('div'); fb_root.id = "fb-root"; document.getElementsByTagName('body')[0].appendChild( fb_root ); // Load FB Async var js, id = 'facebook-jssdk', ref = d.getElementsByTagName('script')[0]; if (d.getElementById(id)) {return;} js = d.createElement('script'); js.id = id; js.async = true; js.src = "//connect.facebook.net/en_US/all.js"; ref.parentNode.insertBefore(js, ref); // App config-data var config = { appId : XXXX, cookie: true, status: true, frictionlessRequests: true }; window.fbAsyncInit = function() { // This won't work. // I can't assume they're logged out and rely on this to tell me they're logged in. FB.Event.subscribe('auth.statusChange', function(response) {}); // Init FB.init(config); // These do not inidicate if the user is logged out :( FB.getLoginStatus(function(response) { }); FB.getAuthResponse(function(response) { }); FB.getAccessToken(function(response) { }); }; }(document)); Any help is much appreciated. :)

    Read the article

  • login script in php using session variables

    - by kracekumar
    ? username: '; } else { $user=$_POST['user']; $query="select name from login where name='$user'"; $result=mysql_query($query) or die(mysql_error()); $rows=mysql_num_rows($result)or die(mysql_error()); session_start(); //echo "results"; $username=mysql_fetch_array($result) or die(mysql_error()); $fields=mysql_num_fields($result) or die(mysql_error()); echo "username:$username[0]"; $_SESSION['username']=$username[0]; $sesion_username=$_SESSION['username']; //echo "rows:$rows"." "."fields:$fields"; echo""."username:$sesion_username"; } ? i wanted to create a site where user can login and upload their details depending on their user name have stored their details in a database,the problem i am facing is two people 'a' and 'b' login one after other session_variable $_SESSION['username'] will have 'b's' username ,so i can't display 'a's' details now. . . . what i want to achieve is when a user logins in i want to store his name and other details in session variable and navigate him according and display his details

    Read the article

  • Serious Memory Clash: Variables clashing in C

    - by Soham
    int main(int argc, char*argv[]) { Message* newMessage; Asset* Check; //manipulation and initialization of Check, so that it holds proper values. newMessage = parser("N,2376,01/02/2011 09:15:01.342,JPASSOCIAT FUTSTK 24FEB2011,B,84.05,2000,0,0",newMessage); // MessageProcess(newMessage,AssetMap); printf("LAST TRADE ADDRESS %p LAST TRADE TIME %s\n",Check->TradeBook,Check->Time); } Message* parser(char *message,Message* new_Message) { char a[9][256]; char* tmp =message; bool inQuote=0; int counter=0; int counter2=0; new_Message = (Message*)malloc(sizeof(Message)); while(*tmp!='\0') { switch(*tmp) { case ',': if(!inQuote) { a[counter][counter2]='\0'; counter++; counter2=0; } break; case '"': inQuote=!inQuote; break; default: a[counter][counter2]=*tmp; counter2++; break; } tmp++; } a[counter][counter2]='\0'; new_Message->type = *a[0]; new_Message->Time = &a[2][11]; new_Message->asset = a[3]; if(*a[4]=='S') new_Message->BS = 0; else new_Message->BS = 1; new_Message->price1=atof(a[5]); new_Message->shares1=atol(a[6]); new_Message->price2=atof(a[7]); new_Message->shares2=atol(a[8]); new_Message->idNum = atoi(a[1]); return(new_Message); } Here there is a serious memory clash, in two variables of different scope. I have investigated using gdb and it seems the address of new_Message->Time is equalling to the address of Check->Time. They both are structures of different types I am trying to resolve this issue, because, when parser changes the value of new_Message->Time it manipulates the contents of Check-Time Please do suggest how to solve this problem. I have lost(spent) around 10 hours and counting to resolve this issue, and tons of hair. Soham

    Read the article

  • Problem passing variables in php form.

    - by Joshxtothe4
    I have the following php form. I am trying to make it so that when the form is loaded, the values will be assigned the appropriate check- variable. This variable will contain either "checked or "". If it contains checked, the way it is displayed with the html should cause the relevant checkbox to be checked. As it is, the variables do not seem to be being passed. When I echo out $deleted or $notice from within the submitinfo branch, they are blank. Furthermore, nothing is being inserted into the database, and I am not getting any database error. How can I check this? <?php if (isset($_GET["cmd"])) $cmd = $_GET["cmd"]; else if (isset($_POST["cmd"])) $cmd = $_POST["cmd"]; else die("Invalid URL"); if (isset($_GET["pk"])) { $pk = $_GET["pk"]; } if (isset($_POST["deleted"])) { $deleted = $_POST["deleted"]; } if (isset($_POST["notice"])) { $notice = $_POST["notice"]; } $con = mysqli_connect("localhost","user","password", "db"); if (!$con) { echo "Can't connect to MySQL Server. Errorcode: %s\n". mysqli_connect_error(); exit; } $con->set_charset("utf8"); $getformdata = $con->query("select * from STATUS where ARTICLE_NO = '$pk'"); $checkDeleted = ""; $checkNotice = ""; while ($row = mysqli_fetch_assoc($getformdata)) { $checkDeleted = $row['deleted']; $checkNotice = $row['notice']; } if($cmd=="submitinfo") { $statusQuery = "INSERT INTO STATUS VALUES (?, ?)"; if ($statusInfo = $con->prepare($statusQuery)) { $statusInfo->bind_param("ss", $deleted, $notice); $statusInfo->execute(); $statusInfo->close(); echo "true"; } else { echo "false"; } print_r($con->error); } if($cmd=="EditStatusData") { echo "<form name=\"statusForm\" action=\"test.php\" method=\"post\" enctype=\"multipart/form-data\"> <h1>Editing information for auction: ".$pk."</h1> Löschung Ebay: <input type=\"checkbox\" name=\"deleted\" value=\"checked\" ".$checkDeleted." /> <br /> Abmahnung: <input type=\"checkbox\" name=\"notice\" value=\"checked\" ".$checkNotice." /> <br /> <input type=\"hidden\" name=\"cmd\" value=\"submitinfo\" /> <input name=\"Submit\" type=\"submit\" value=\"submit\" /> </form>"; } else { print_r($con->error); }

    Read the article

< Previous Page | 92 93 94 95 96 97 98 99 100 101 102 103  | Next Page >