Search Results

Search found 15137 results on 606 pages for 'global state'.

Page 38/606 | < Previous Page | 34 35 36 37 38 39 40 41 42 43 44 45  | Next Page >

  • django admin app error (Model with property field): global name 'full_name' is not defined

    - by rxin
    This is my model: class Author(models.Model): first_name = models.CharField(max_length=200) last_name = models.CharField(max_length=200) middle_name = models.CharField(max_length=200, blank=True) def __unicode__(self): return full_name def _get_full_name(self): "Returns the person's full name." if self.middle_name == '': return "%s %s" % (self.first_name, self.last_name) else: return "%s %s %s" % (self.first_name, self.middle_name, self.last_name) full_name = property(_get_full_name) Everything is fine except when I go into admin interface, I see TemplateSyntaxError at /bibbase2/admin/bibbase2/author/ Caught an exception while rendering: global name 'full_name' is not defined It seems like the built-in admin app doesn't work with a property field. Is there something wrong with my code?

    Read the article

  • Global find object references in NHibernate

    - by Miral
    Is it possible to perform a global reversed-find on NHibernate-managed objects? Specifically, I have a persistent class called "Io". There are a huge number of fields across multiple tables which can potentially contain an object of that type. Is there a way (given a specific instance of an Io object), to retrieve a list of objects (of any type) that actually do reference that specific object? (Bonus points if it can identify which specific fields actually contain the reference, but that's not critical.) Since the NHibernate mappings define all the links (and the underlying database has corresponding foreign key links), there ought to be some way to do it.

    Read the article

  • SQL ConnectionString in global.asax overridden by web.config

    - by rlb.usa
    This is going to sound very odd, but I have a web.config like this: <connectionStrings> <remove name="LocalSqlServer"/> <add name="LocalSqlServer" connectionString="Data Source=BACKUPDB;..." providerName="System.Data.SqlClient"/> </connectionStrings> And a global.asax like this: void Session_Start(object sender, EventArgs e) { // Code that runs when a new session is started if (Application["con"] == null || Application["con"] == "") { Application["con"] = "Data Source=PRODUCTIONDB;..."; } } And EVERYWHERE in my code, I reference my ConnectionStrings like this: SqlConnection con = new SqlConnection(Convert.ToString(HttpContext.Current.Application["con"])); However, I see that everything I do inside this application goes to BACKUP db instead of PRODUCTIONDB. What is going on, how could this happen, and why? It doesn't make any sense to me, and it got me into a lot of trouble. We use LocalSqlServer string for FormsAuthentication.

    Read the article

  • SQL ConnectionString in web.config and global.asax implications

    - by rlb.usa
    This is going to sound very odd, but I have a web.config like this: <connectionStrings> <remove name="LocalSqlServer"/> <add name="LocalSqlServer" connectionString="Data Source=BACKUPDB;..." providerName="System.Data.SqlClient"/> </connectionStrings> And a global.asax like this: void Session_Start(object sender, EventArgs e) { // Code that runs when a new session is started if (Application["con"] == null || Application["con"] == "") { Application["con"] = "Data Source=PRODUCTIONDB;..."; } } And EVERYWHERE in my code, I reference my ConnectionStrings like this: SqlConnection con = new SqlConnection(Convert.ToString(HttpContext.Current.Application["con"])); However, I see that everything I do inside this application goes to BACKUP db instead of PRODUCTIONDB. What is going on, how could this happen, and why? It doesn't make any sense to me, and it got me into a lot of trouble. We use LocalSqlServer string for FormsAuthentication.

    Read the article

  • Searching Outlook Global Adress List

    - by MoominTroll
    I'm pulling up the Global Address List from Outlook like so... Microsoft.Office.Interop.Outlook.Application oApp = new Microsoft.Office.Interop.Outlook.Application(); AddressList gal = oApp.Session.GetGlobalAddressList(); ...with the aim of eventually being able to search through this in my own application to retrieve contact information which I can then supply to a method that squirrels off an email. Unfortunately given that my own GAL has about 20K entries in (the customers much more) using a foreach or something simply doesn't work in an acceptable timeframe. I want to pass a string like "Tom" to a method and have it return a list of possible contacts. Is this possible outside of actually opening up Outlook and creating the mail there? Note: There are a couple of other questions similar to this but most seem to have no good answer. I'm hoping I have more luck.

    Read the article

  • How to call angular javascript directive methods from the global scope

    - by user1659278
    I have a directive like the one of the examples from AngularJS, shown below. How can I call the toggle method from the global scope? I want to be able to toggle the zippy from some legacy code. myApp.directive('zippy', function(){ return { restrict: 'E', replace: true, transclude: true, scope: { title:'bind' }, template: '<div class="zippy">' + '<div class="title">{{title}}</div>' + '<div class="body" ng-transclude></div>' + '</div>', link: function(scope, element, attrs) { var title = angular.element(element.children()[0]), opened = true; title.bind('click', toggle); function toggle() { opened = !opened; element.removeClass(opened ? 'closed' : 'opened'); element.addClass(opened ? 'opened' : 'closed'); } toggle(); } } });

    Read the article

  • how to check session upon start in masterpage or in global.asax

    - by user572276
    i am new in asp.net form authentication and sessions i would like to know how to save session in masterpage or in global.asax and how to clear session how to better handle session timeout by redirecting to a page this is my web.config session settings <sessionState mode="InProc" cookieless="false" timeout="1"></sessionState> code in my masterpage if (Request.Url.AbsolutePath.EndsWith("SessionExpired.aspx", StringComparison.InvariantCultureIgnoreCase)) { HtmlMeta meta = new HtmlMeta(); meta.HttpEquiv = "Refresh"; meta.Content = "7; URL=./Login.aspx"; Page.Header.Controls.Add(meta); } else HttpContext.Current.Response.AppendHeader("Refresh", Convert.ToString((Session.Timeout * 60)) + "; Url=./Public/SessionExpired.aspx");

    Read the article

  • getting global name not defined error

    - by nashr rafeeg
    i have the following class class notify(): def __init__(self,server="localhost", port=23053): self.host = server self.port = port register = gntp.GNTPRegister() register.add_header('Application-Name',"SVN Monitor") register.add_notification("svnupdate",True) growl(register) def svn_update(self, author="Unknown", files=0): notice = gntp.GNTPNotice() notice.add_header('Application-Name',"SVN Monitor") notice.add_header('Notification-Name', "svnupdate") notice.add_header('Notification-Title',"SVN Commit") # notice.add_header('Notification-Icon',"") notice.add_header('Notification-Text',Msg) growl(notice) def growl(data): s = socket.socket(socket.AF_INET, socket.SOCK_STREAM) s.connect((self.host,self.port)) s.send(data) response = gntp.parse_gntp(s.recv(1024)) print response s.close() but when ever i try to use this class via the follwoing code i get 'NameError: global name 'growl' is not defined' from growlnotify import * n = notify() n.svn_update() any one has an idea what is going on here ? cheers nash

    Read the article

  • PHP access class inside another class

    - by arxanas
    So I have two classes like this: class foo { /* code here */ } $foo = new foo(); class bar { global $foo; public function bar () { echo $foo->something(); } } I want to access the methods of foo inside all methods bar, without declaring it in each method inside bar, like this: class bar { public function bar () { global $foo; echo $foo->something(); } public function barMethod () { global $foo; echo $foo->somethingElse(); } /* etc */ } I don't want to extend it, either. I tried using the var keyword, but it didn't seem to work. What do I do in order to access the other class "foo" inside all methods of bar?

    Read the article

  • C# Using singleton instead of a global static instance

    - by Farstucker
    I ran into a problem today and a friend recommended I use a global static instance or more elegantly a singleton pattern. I spent a few hours reading about singletons but a few things still escape me. Background: What Im trying to accomplish is creating an instance of an API and use this one instance in all my classes (as opposed to making a new connection, etc). There seems to be about 100 ways of creating a singleton but with some help from yoda I found some thread safe examples. ..so given the following code: public sealed class Singleton { public static Singleton Instance { get; private set; } static Singleton() { Instance = new Singleton(); } } How/Where would you instantiate the this new class and how should it be called from a separate class? Thanks for your help.

    Read the article

  • GlassFish JDO and global object

    - by bach
    Hi, I'm thinking about the GlassFish platform for my new app. My app env. doesn't have a big volume of data to handle, but a lot of users writing/reading the same data A very volotile portion of the data updates every 200milsec by diff users. Therefore I'd like that type of data to be in memory only and accessible to the whole app My questions: How do I use a global object in memory with GF? a. use a static variable object - for that I guess I need to make sure GF is running on only 1 JVM -- how to I configure GF to run on 1 jvm? b. use HttpContext - same as a. How do I persist to the DB? a. can I use JDO interface? How do I Schedule tasks to be performed in the future (something like the task queue in GAE) thanks, J.S. Bach

    Read the article

  • Actionscript 2.0 Functions problem and somewhat "global" variable

    - by Joshua
    I have two problems. The first problem is with the following functions; when I call the function in (enterFrame), it doesn't work: onClipEvent (load) { function failwhale(levelNum) { _root.gotoAndStop("fail"); failFrom = levelNum; } function guardSightCollision(guardName, guardSightName) { if (_root.guardName.guardSightName.hitTest(_x, _y+radius, true)) { failwhale(1); } if (_root.guardName.guardSightName.hitTest(_x, _y-radius, true)) { failwhale(1); } if (_root.guardName.guardSightName.hitTest(_x-radius, _y, true)) { failwhale(1); } if (_root.guardName.guardSightName.hitTest(_x+radius, _y, true)) { failwhale(1); } } } onClipEvent (enterFrame) { guardSightCollision(guard1, guard1Sight); } Why doesn't it work?... The second problem lies in the failFrom variable: function failwhale(levelNum) { _root.gotoAndStop("fail"); failFrom = levelNum; } How do I make failFrom a "global" variable in that it can be accessed anywhere (from actionscript in frames and even movieclips)...Right now, when I try to trace failFrom in a different frame, it is "undefined".

    Read the article

  • Global javascript variable inside ready

    - by w0rldart
    Which is the right way of declaring a global javascript variable? The way I'm trying it, doesn't work $(document).ready(function() { var intro; if ($('.intro_check').is(':checked')) { intro = true; $('.intro').wrap('<div class="disabled"></div>'); }; $('.intro_check').change(function(){ if(this.checked) { intro = false; $('.enabled').removeClass('enabled').addClass('disabled'); } else { intro = true; if($('.intro').exists()) { $('.disabled').removeClass('disabled').addClass('enabled'); } else { $('.intro').wrap('<div class="disabled"></div>'); } } }); }); console.log(intro);

    Read the article

  • Python __setattr__ and __getattr__ for global scope?

    - by KT
    Suppose I need to create my own small DSL that would use Python to describe a certain data structure. E.g. I'd like to be able to write something like f(x) = some_stuff(a,b,c) and have Python, instead of complaining about undeclared identifiers or attempting to invoke the function some_stuff, convert it to a literal expression for my further convenience. It is possible to get a reasonable approximation to this by creating a class with properly redefined __getattr__ and __setattr__ methods and use it as follows: e = Expression() e.f[e.x] = e.some_stuff(e.a, e.b, e.c) It would be cool though, if it were possible to get rid of the annoying "e." prefixes and maybe even avoid the use of []. So I was wondering, is it possible to somehow temporarily "redefine" global name lookups and assignments? On a related note, maybe there are good packages for easily achieving such "quoting" functionality for Python expressions?

    Read the article

  • global security manager in flex

    - by ron
    hi, I made a swf that interacts with other site on the internet (which has a crossdomainfile for me). in the main.mxml there is a definition of webservice (mx:WebService)(which is not in my domain). Therefore when loading the swf, there is a first call to crossdomainfile.xml. I put this swf on my server so that my clients can get it. When i connect to my server to download the swf, i expect to be asked if i want to allow the swf connect to foreign webservice domain. But i am not being asked. Do i always need to define exception in Global Security Settings panel? I don't want my client do define special things.. Is there a best practice for that? Why when i surfing the net other swf can do this? I read about the FlashPlayerTrust, can i define there a website i trust my swf will connect to? anyone knows?

    Read the article

  • Ideal way to set global uncaught exception Handler in Android

    - by Samuh
    I want to set a global uncaught exception handler for all the threads in my Android application. So, in my Application subclass I set an implementation of Thread.UncaughtExceptionHandler as default handler for uncaught exceptions. Thread.setDefaultUncaughtExceptionHandler( new DefaultExceptionHandler(this)); In my implementation, I am trying to display an AlertDialog displaying appropriate exception message. However, this doesn't seem to work. Whenever, an exception is thrown for any thread which goes un-handled, I get the stock, OS-default dialog (Sorry!-Application-has-stopped-unexpectedly dialog). What is the correct and ideal way to set a default handler for uncaught exceptions? Thanks.

    Read the article

  • Html.EditorFor Global Template?

    - by Grant Trevor
    Is there any way to define a global template for the Html.EditorFor helper? I would like to alter the markup that is output so that for example instead of rendering <div class="editor-label"> <label .../> </div> <div class="editor-field"> <input .../> </div> It would render: <div> <div class="label"><label..../></div> <div class="field"><input..../></div> </div> This is for when I'm using Html.EditorFor with an object instance not just an object property.

    Read the article

  • binding an object to the global scope

    - by elduderino
    I have the following code: var myVar = (function (window) { myobj = {}; myobj.boo = function() { alert('hi'); }; window.myVar = myobj; })(window); myVar.boo(); Why don't I get back the alert when I call myVar.boo() ? I've created an anonymous self-executing function and fed in the window object. Inside that I have another object with a method assigned to it. I then assign the global myVar variable to this obj. This should provide an alias to the my myobj object. However when I call the function I get an Cannot call method 'boo' of undefined error

    Read the article

  • Global Exception Handlers in Java

    - by Samuh
    I am thinking of setting up a global, default Exception handler for my (Android) Mobile application(which uses Java syntax) using Thread.setDefaultUncaughtExceptionHandler(...) call. I am thinking of just displaying an Alert Dialog with appropriate message to the user. Are there any gotchas, caveats and rules that one needs to follow when setting DefaultExceptionHandlers? Any best practices like making sure that the process is killed, full stack trace is written to logs etc. ? Links to documentation, tutorials etc. that can throw some light on this are welcome. Thanks.

    Read the article

  • How to provide global functionality in multi-user database app

    - by Mike B
    I have been building a multi-user database application (in C#/WPF 4.0) that manages tasks for all employees of a company. I now need to add some functionality such as sending an email reminder to someone when a critical task is due. How should this be done? Obviously I don’t want every instance of the program to be performing this function (Heh each user would get 10+ emails). Should I add the capability to the application as a "Mode" and then run a copy on the database server in this mode or would it be better to create a new app altogether to perform "Global" type tasks? Is there a better way?

    Read the article

  • Social Media Aggregator, Global Update via Powershell

    - by deanjmiller
    Does anyone know of a way to interface with a Social Media Aggregator using Powershell. For Instance, I would like to update my global status on digsby using Powershell. Digsby would then fan the message out to Facebook, Myspace, Twitter, Etc.. I am open to using any Social Media Aggregator that can do this.. Digsby, Seesmic, Ping.fm TweetDeek, etc.. If any of these programs have a com interface or something like it I'm sure who ever implements this first will have a large gain in users.

    Read the article

  • global applied stylesheet link on debian box

    - by James
    Hi there, Having some trouble identifying what is wrong with my link to an external CSS stylesheet... I am using a debian box to host some things... including a file i am accessing page.py which is located in /var/www/cgi-bin. I need this page to link to a css file which currently has the pathname /var/www/styles.css. Now I know I could link as: <link rel="stylesheet" href="**../styles.css**" type="text/css"> and the problem is solved but I would rather have a 'global' link, that I can use in other py files elsewhere in my filesystem and they will all point to /var/www/styles.css The information I have searched suggests that <link rel="stylesheet" href="**/var/www/styles.css**" type="text/css"> should work fine... but it doesn't. I have tried multiple combinations of everything I know but it doesn't seem to link as I would expect. Can anyone point me in the right direction?

    Read the article

  • Is there a global inbox for android?

    - by Loony2nz
    I'm a Blackberry fan and I have been aching to get a phone with a better UI (and not the jesusPhone). I was looking at the Android platform and find it quite fun to play with. However, one of the crucial elements of my BB that I love to death is the global inbox of all my email accounts. (not to mention the BB messenger, but I can live without that). Is there an addon or does the android have this feature natively? I played with my friend's Verizon Droid, and she couldn't tell me. Thanks!

    Read the article

  • session variable not available in global before(:each, :type => :controller)

    - by Rob
    Hi, I'm refactoring some specs, in controller specs I have a before(:each) which sets up things required in the session my before filter is... config.before(:each, :type => :controller) do ... session[:current_user] = @user session[:instance] = @instance ... end @user and @instance are also set in the before(:each) i've just hidden them for readability here I get the following error when running the controller tests undefined method `session' for nil:NilClass I would expect the global before callbacks to have the same things as the ones in the individual tests but I guess maybe they are loaded before the rails environment has been initialised? Thanks

    Read the article

  • Is JSONRequest a global Javascript object ?

    - by Anth0
    My goal is to asynchronously call a URL via POST request (REST Webservice) to increment a statistic on one of my object. I am a newby web developper and I discovered JSON yesterday. Since JSON seems a lot popular and handy I went to www.json.org and discovered a JSONRequest object which seems to able one to send POST/GET request asynchronously but I can't get it work. Is it a global Javascript object or do I need to add some files ? I am a little bit confused since I've found a Firefox plugin extension for JSONRequest but I don't understand its purpose.

    Read the article

< Previous Page | 34 35 36 37 38 39 40 41 42 43 44 45  | Next Page >