Search Results

Search found 1872 results on 75 pages for 'tom genoni'.

Page 58/75 | < Previous Page | 54 55 56 57 58 59 60 61 62 63 64 65  | Next Page >

  • Any way to anticipate session timeout ?

    - by Tom
    Hi, Is there a way to "catch" the session timeout event, so as to retrieve data from HttpSession before its invalidated ? We're implementing the Filter Interface, and in the doFilter method, the user we stored in the session object at login is null when session times out. Thanks in advance.

    Read the article

  • Writing a batch script to perform differently on different days?

    - by Tom
    I am in the process of setting up a batch script to do a specified action if the script was run on a weekday, and an alternate action if run on the weekend. I am almost completely unfamiliar with writing batch scripts, but I know how to write my entire script except the logic I describe above. Can someone please answer both if it is possible, and if it is at least a framework of how to implement it. Thanks in advance.

    Read the article

  • Wordpress media uploaded theme options

    - by Tom J Nowell
    I have a word press theme with a theme options dialog I'd like to add a feature to upload a logo via the theme options page and then display it on the front end in the header as the logo. How would I do this. I would like to use the wordpress media uploaded, but if this is not possible or an alternative is available Id appreciate that also

    Read the article

  • Default tablespace for indexes in postgres

    - by tom
    Just wondering if its possible to set a default tablespace in postgres to keep indexes. Would like the databases to live on the default tablespace for postgres, however, would like to get the indexes on a different set of disks just to keep the i/o traffic separated. It does not appear to me that it can be done without going in and doing an ALTER index TABLESPACE command, and then the index is moved and will stay there, but the databases and indexes are part of a django app, so non-django intervention can cause some problems.

    Read the article

  • Django Admin Running Same Query Thousands of Times for Model

    - by Tom
    Running into an odd . . . loop when trying to view a model in the Django admin. I have three related models (code trimmed for brevity, hopefully I didn't trim something I shouldn't have): class Association(models.Model): somecompany_entity_id = models.CharField(max_length=10, db_index=True) name = models.CharField(max_length=200) def __unicode__(self): return self.name class ResidentialUnit(models.Model): building = models.CharField(max_length=10) app_number = models.CharField(max_length=10) unit_number = models.CharField(max_length=10) unit_description = models.CharField(max_length=100, blank=True) association = models.ForeignKey(Association) created = models.DateTimeField(auto_now_add=True) updated = models.DateTimeField(auto_now=True) def __unicode__(self): return '%s: %s, Unit %s' % (self.association, self.building, self.unit_number) class Resident(models.Model): unit = models.ForeignKey(ResidentialUnit) type = models.CharField(max_length=20, blank=True, default='') lookup_key = models.CharField(max_length=200) jenark_id = models.CharField(max_length=20, blank=True) user = models.ForeignKey(User) is_association_admin = models.BooleanField(default=False, db_index=True) show_in_contact_list = models.BooleanField(default=False, db_index=True) created = models.DateTimeField(auto_now_add=True) updated = models.DateTimeField(auto_now=True) _phones = {} home_phone = None work_phone = None cell_phone = None app_number = None account_cache_key = None def __unicode__(self): return '%s' % self.user.get_full_name() It's the last model that's causing the problem. Trying to look at a Resident in the admin takes 10-20 seconds. If I take 'self.association' out of the __unicode__ method for ResidentialUnit, a resident page renders pretty quickly. Looking at it in the debug toolbar, without the association name in ResidentialUnit (which is a foreign key on Resident), the page runs 14 queries. With the association name put back in, it runs a far more impressive 4,872 queries. The strangest part is the extra queries all seem to be looking up the association name. They all come from the same line, the __unicode__ method for ResidentialUnit. Each one is the exact same thing, e.g., SELECT `residents_association`.`id`, `residents_association`.`jenark_entity_id`, `residents_association`.`name` FROM `residents_association` WHERE `residents_association`.`id` = 1096 ORDER BY `residents_association`.`name` ASC I assume I've managed to create a circular reference, but if it were truly circular, it would just die, not run 4000x and then return. Having trouble finding a good Google or StackOverflow result for this.

    Read the article

  • Ordering z-indexes in an array

    - by Tom Gullen
    I have an array which looks something along the lines of resourceData[0][0] = "pic1.jpg"; resourceData[0][1] = 5; resourceData[1][0] = "pic2.jpg"; resourceData[1][1] = 2; resourceData[2][0] = "pic3.jpg"; resourceData[2][1] = 900; resourceData[3][0] = "pic4.jpg"; resourceData[3][1] = 1; The numeric represents the z-index of the image. Minimum z-index value is 1. Maximum (not really important) is 2000. I have all the rendering and setting z-indexes done fine. My question is, I want to have four functions: // Brings image to z front function bringToFront(resourceIndex) { // Set z-index to max + 1 resourceData[resourceIndex][1] = getBiggestZindex() + 1; // Change CSS property of image to bring to front $('#imgD' + resourceIndex).css("z-index", resourceData[resourceIndex][1]); } function bringUpOne(resourceIndex) { } function bringDownOne(resourceIndex) { } // Send to back z function sendToBack(resourceIndex) { } So given then index [3] (900 z): If we send it to the back, it will take the value 1, and [3] will have to go to 2, but that conflicts with [1] who has a 2 z-index so they need to go to three etc. Is there an easy programatical way of doing this because as soon as I start doing this it's going to get messy. It's important that the indexes of the array don't change. We can't sort the array unfortunately due to design. Update Thanks for answers, I'll post the functions here once they are written incase anyone comes across this in the future (note this code has zindex listed in [6]) // Send to back z function sendToBack(resourceIndex) { resourceData[resourceIndex][6] = 1; $('#imgD' + resourceIndex).css("z-index", 1); for (i = 0; i < resourceData.length; i++) { if (i != resourceIndex) { resourceData[i][6]++; $('#imgD' + i).css("z-index", resourceData[i][6]); } } }

    Read the article

  • VB6: Slow Binary Write?

    - by Tom the Junglist
    Wondering why a particular binary write operation in VB is so slow. The function reads a Byte array from memory and dumps it into a file like this: Open Destination For Binary Access Write As #1 Dim startP, endP As Long startP = BinaryStart endP = UBound(ReadBuf) - 1 Dim i as Integer For i = startP To endP DoEvents Put #1, (i - BinaryStart) + 1, ReadBuf(i) Next Close #1 For two megabytes on a slower system, this can take up to a minute. Can anyone tell me why this is so slow?

    Read the article

  • Want to check fields for data fast.

    - by Tom
    We have a database setup that consists of two parts: a static structure, and dynamic additions. For each database, the dynamic can be different, and sometimes we don't have data for all the dynamic fields. Rigt now, we check for empties by looking at the total count of records in the entire table, but we want to move to a more refined method of checking for empties if possible. Is it possible to quickly check through several hundred fields and see which ones are empty and which ones are populated?

    Read the article

  • What naming conventions exist for the primary Node.js file?

    - by Tom Dworzanski
    This question has been completely edited in hopes that it will be reopened. The naming of the main Node.js file is something left to the user and and does not seem to be defined by any well established convention. In hopes of finding a good name, I am curious if there are naming conventions in other parts of the Node.js ecosystem that might suggest a name to use. Some names I have seen are: app.js, index.js, main.js, server.js, etc. Please provide only well documented standards in answers.

    Read the article

  • Android - Opening phone deletes app state

    - by Tom G
    Hey everyone, I'm writing an android application that maintains a lot of "state" data...some of it I can save in the form of onSaveInstanceState but some of it is just to complex to save in memory. My problem is that sliding the phone open destroys/recreates the app, and I lose all my application state in the process. The same thing happens with the "back" button, but I overloaded that function on my way. Is there any way to overload the phone opening to prevent it from happening? Thanks in advance.

    Read the article

  • Static member variable containing object instances

    - by tom
    I have the following: function Preferences() { } Preferences.players = { 'player1': new Player() } players is a static member variable of Preferences and I'm trying to make it an object containing an instance of a Player. However, it doesn't appear to let me do this. It seems like it will allow me to define players if I make it a non-static member variable however. Like so: function Preferences() { var players = { 'player1' : new Player() } } Is it possible to create a static member variable containing instances of an object in JS?

    Read the article

  • Why the generated key size is not constant?

    - by Tom Brito
    The following code prints randomly 634, 635, 636, each time I run it. Why its not constant? public static void main(String[] args) throws Exception { KeyPairGenerator keyPairGen = KeyPairGenerator.getInstance("RSA", "BC"); keyPairGen.initialize(1024); RsaKeyPair keyPair = new RsaKeyPair(keyPairGen.generateKeyPair()); System.out.println(keyPair.getPrivate().getEncoded().length); }

    Read the article

  • Android/ iOS how to determine small changes in distance using sensors?

    - by Tom
    I have been doing a bit of research, but I cannot seem to find a way to determine small distances (centimeters and meters) using the sensors in Android or iOS devices. Bluetooth appears too inaccurate and require more than one device, GPS only works over larger variations in distance, and small variations in rotation seem to make using the accelerometer nearly impossible. Is there a method that I am unaware of that would allow me to do such a thing? I am familiar with Calculus, so using Integrals to determine distance based on changes in time and velocity/ acceleration is not a problem for me, I just do not know how to determine those things. Thank you.

    Read the article

  • A data structure based on the R-Tree: creating new child nodes when a node is full, but what if I ha

    - by Tom
    I realize my title is not very clear, but I am having trouble thinking of a better one. If anyone wants to correct it, please do. I'm developing a data structure for my 2 dimensional game with an infinite universe. The data structure is based on a simple (!) node/leaf system, like the R-Tree. This is the basic concept: you set howmany childs you want a node (a container) to have maximum. If you want to add a leaf, but the node the leaf should be in is full, then it will create a new set of nodes within this node and move all current leafs to their new (more exact) node. This way, very populated areas will have a lot more subdivisions than a very big but rarely visited area. This works for normal objects. The only problem arises when I have more than maxChildsPerNode objects with the exact same X,Y location: because the node is full, it will create more exact subnodes, but the old leafs will all be put in the exact same node again because they have the exact same position -- resulting in an infinite loop of creating more nodes and more nodes. So, what should I do when I want to add more leafs than maxChildsPerNode with the exact same position to my tree? PS. if I failed to explain my problem, please tell me, so I can try to improve the explanation.

    Read the article

  • PHP include(): File size & performance

    - by Tom
    An inexperienced PHP question: I've got a PHP script file that I need to include on different pages lots of times in lots of places. I have the option of either breaking the included file down into several smaller files and include these on a as-needed basis... OR ... I could just keep it all together in a single PHP file. I'm wondering if there's any performance impact of using a larger vs. smaller file for include() in this context? For example, is there any performance difference between a 200KB file and a 20KB file? Thank you.

    Read the article

  • How to set Main Inerface in xCode programatically

    - by Tom Tallak Solbu
    I am using Apples MultipleDetailViews http://developer.apple.com/library/ios/#samplecode/MultipleDetailViews/Introduction/Intro.html for template as a source for my iPad app. The template is using a splitviewController in the interface builder (MainWindow). In the iPhone/iPad Deployment info of the target, MainWindow is set as the "Main Interface". I want my app to also run on iPhone. This means I need to load a different xib when the app is run on an iPhone. I must then remove "MainWindow" from "Main Interface" because the app will crash when I load on an iPhone due to the splitViewController. The AppDeleagte of the template look like this: - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { self.window = [[[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]]; self.window.rootViewController = self.splitViewController; [self.window makeKeyAndVisible]; } If I remove "Main Window" from "Main Interface", how do I then need to change the APpDelegate, or maybe I need to change the MainWindow.xib to also work for iPhone?

    Read the article

  • Asp.net mvc html melper

    - by tom
    Hi there Ive got this function as a html helper which should write a javascript function onto the page, I then call this in the masterpage like this <%Html.RenderBaseUrlScript(); % My problem is that the script never seems to be written to the page, I search in the source and cannot see it anywhere, I have tried moving this around from the head to the body of the html masterpage, Im really confused as to why this is not workung, please help public static string RenderBaseUrlScript(this HtmlHelper helper) { return string.Format("<script type='text/javascript'> $.url=function(url){{return '{0}'+url;}}", GetBaseUri()); }

    Read the article

  • Eclipse Type Hierarchy Question

    - by Tom Tresansky
    In Eclipse, the Java Method Override Indicator is the little upwards arrow next to a method in the Type Hierarchy view. A solid arrow means a method overrides an existing method lower in the hierarchy. What does the hollow arrow mean? Do annotations effect either arrow?

    Read the article

  • How do I change the name of an application tab?

    - by Tom Rom
    I'm working on a facebook page for a client and with the new profiles pages starting to roll out I've come across an issue with the name of the app I created. The original profiles which most of you will see here - http://www.facebook.com/DrMartyBecker says "Welcome" as the tab name. On the new profile pages the tab says 'drMARTY', I can't find the place where I can modify the name. So i was wondering if there was a way to change this and where. Thanks for the help!

    Read the article

  • How to embed a google map with a changeable area?

    - by Tom
    I haven't worded this very well But basically, I'd like to embed a map on my site - but the area it shows will change. I've tried doing this, but it never seems to work as it will focus on the wrong area - the old area, rather than the new area. Basically, I'd like a google map code that uses $place as a location. Thanks.

    Read the article

  • How to get the parameter names of an object's constructors (reflection)?

    - by Tom
    Say I somehow got an object reference from an other class: Object myObj = anObject; Now I can get the class of this object: Class objClass = myObj.getClass(); Now, I can get all constructors of this class: Constructor[] constructors = objClass.getConstructors(); Now, I can loop every constructor: if (constructors.length > 0) { for (int i = 0; i < constructors.length; i++) { System.out.println(constructors[i]); } } This is already giving me a good summary of the constructor, for example a constructor public Test(String paramName) is shown as public Test(java.lang.String) Instead of giving me the class type however, I want to get the name of the parameter.. in this case "paramName". How would I do that? I tried the following without success: if (constructors.length > 0) { for (int iCon = 0; iCon < constructors.length; iCon++) { Class[] params = constructors[iCon].getParameterTypes(); if (params.length > 0) { for (int iPar = 0; iPar < params.length; iPar++) { Field fields[] = params[iPar].getDeclaredFields(); for (int iFields = 0; iFields < fields.length; iFields++) { String fieldName = fields[i].getName(); System.out.println(fieldName); } } } } } Unfortunately, this is not giving me the expected result. Could anyone tell me how I should do this or what I am doing wrong? Thanks!

    Read the article

  • Zend_Soap with attachments (server)

    - by Tom
    i'm trying to build a SOAP service with Zend_Soap. Everything is working great but the client needs the ability to send attachments to the service (not base64 encoded strings, as this service will be called multiple times a day with various file sizes so processing all that in memory is not possible. So I'd like to handle a normal SOAP attachment (DIME/MIME) with the SOAP server in Zend Framework however I'm unable to find documentation about it. Can I access it with $_FILES[] or any other way? Is it even possible in Zend_Soap (as there's not that much info available). SOAP is a must - so thanks for the advice but it has to be SOAP, not REST.

    Read the article

< Previous Page | 54 55 56 57 58 59 60 61 62 63 64 65  | Next Page >