Search Results

Search found 15376 results on 616 pages for 'once'.

Page 9/616 | < Previous Page | 5 6 7 8 9 10 11 12 13 14 15 16  | Next Page >

  • How to include javascript/css once with Struts 1.x

    - by Felix
    If this is the wrong approach, please suggest something better, but my current efforts have been trying to find something that exists for a single page load, such that I can cache which javascript/css files have been included so as to only include them once. I thought in a TagSupport subclass I could use (HttpServletRequest)pageContext.getRequest().getParameterMap().put(srcKey,true) but the request is per jsp, not per page load so it was a failure. I could set up a filter in web.xml, but it seems I would have to search the response for duplicates and rewrite the response...pain. I could try to store things in the session, but there are headaches with clearing values... Any help would be appreciated.

    Read the article

  • Execute an autocommand only once

    - by Andrej M.
    I have an issue with using GVim on Windows. I have set up the following in my .vimrc: if has("gui_running") autocmd VIMEnter * :source C:/session.vim endif Unfortunately this creates a problem. If I'm a the top of the file and try to move up a line (k), the screen flashes. If I hold the key for just a second it will flash a few dozen times, it is really nasty too look at. I've tried using GUIEnter instead but I got the same results. The docs mention that I can fire an autocommand only once, but I couldn't figure out the exact syntax. Care to help?

    Read the article

  • importing same module more than once

    - by wallacoloo
    So after a few hours, I discovered the cause of a bug in my application. My app's source is structure like: main/ __init__.py folderA/ __init__.py fileA.py fileB.py Really, there are about 50 more files. But that's not the point. In main/__init__.py, I have this code: from folderA.fileA import * in folderA/__init__.py I have this code: sys.path.append(pathToFolderA) in folderA/fileB.py I have this code: from fileA import * The problem is that fileA gets imported twice. However, I only want to import it once. The obvious way to fix this (to me atleast) is to change certain paths from path to folderA.path But I feel like Python should not even have this error in the first place. What other workarounds are there that don't require each file to know it's absolute location?

    Read the article

  • WSSQL query for multiple computers at once

    - by Josh
    I can run normal searches just fine. Windows 7 won't let me add a network share to my local index, but I can query the remote index just fine. The problem is that I can't find a way to query two indexes at once. I was hoping that something like this would work: SELECT System.ItemName FROM compA.SystemIndex, compB.SystemIndex WHERE SCOPE='file://compA/pathA' OR SCOPE='file://compB/pathB' but it doesn't. For simple queries, I can query compA and compB separately and then merge the results myself, but I'm hoping for a better way. Anybody here have some experience with this?

    Read the article

  • Test if single linked list is circular by traversing it only once

    - by user1589754
    I am a fresher and I was asked this question in a recent interview I gave. The question was --- By traversing each element of linked list just once find if the single linked list is circular at any point. To this I answered that we will store reference of each node while traversing the list in another linked list and for every node in the list being tested we will find if the reference exists in the list I am storing the references. The interviewer said that he needs a more optimized way to solve this problem. Can anyone please tell me what would be a more optimized method to solve this problem.

    Read the article

  • how to check an ANTLR token is only used once or less in the parser

    - by Simon Kenyon Shepard
    In Antlr, if I have a rule for example: someRule : TOKENA TOKENB; it would accept : "tokena tokenb" if I would like TOKENA to be optional, I can say, someRule : TOKENA* TOKENB; then I can have : "tokena tokenb" or "tokenb" or "tokena tokena tokenb" but this also means it can be repeated more that once. Is there anyway I can say this token can be there 1 or less times but not more than one? so it would accept: "tokena tokenb" or "tokenb" BUT NOT "tokena tokena tokenb"? Many thanks

    Read the article

  • Using Jquery, call function on selection just once

    - by maxp
    Say i have a selection of textboxes like this; var arrayoftextboxes = $('.textbox1, .textbox2, .textbox3'); Is there a way I can call a function on each one in a simpler way than this? It only needs to be called once. arrayoftextboxes.each(function(i){foo(arrayoftextboxes[i]);}); I tried arrayoftextboxes.load(function(){foo(this)}); and arrayoftextboxes.bind(function(){foo(this)}); but the functions dont seem to be called.

    Read the article

  • Outlook 2007 VSTO Add-in deployed by click-once doesn't detect published updates

    - by Matt
    I have created an outlook 2007 add-in project in vs2008, targeting .net 3.5, then migrated the project to vs2010. I have then published the project from vs2010 to a web site, and installed the add-in using click-once to a virtual machine running xp, .net 3.5 sp1, and outlook 2007. This all works great and I can see my add-in within outlook. Publish update settings are set to update the add-in at startup rather than every 7 days. However when I then make a simple change to the add-in, update the AssemblyVersion and AssemblyFileVersion of the add-in project, and then publish the updates, when I run outlook it doesn't detect that there is a new version, and just runs the current one that is installed. I can see that the publish has generated a new setup.exe and added a new folder to the 'Application Files' folder with the current (autogenerated) publish version. Can anyone suggest anything how I can get the update to be deployed to the client?

    Read the article

  • PHP & Regular expression: keyword just occurs once

    - by lauthiamkok
    Hi, how can I make sure a certain keyword just occurs once in the input with regular expression? I think there is some mistakes in the expression below as I can repeat the same keywords, if (!preg_match('/\b(.php?){1}\b/', $cfg_path)) { $error = true; echo '<error elementid="cfg_path" message="PATH - make sure you have a \'.php?\' in the path."/>'; } I just want this to be true, form.php?category=something or form.php? but not this, form.php?.php?category=something or form.php?.php? please let me know how to fix it. thanks.

    Read the article

  • iPhone App : Storing / Saving personal preferences once per App

    - by sg
    Hi, I want to store / save personal preference settings like Email, Phone number for an App. I have few forms which send info by Email to my ID. I want to know the Email & Phone number of user so I can contact this person if need be. I don't want users to keep entering their Email ID & Phone No. everytime in each form. It's wise to take these inputs (Email & Phone) just once per device / per App installed on the device. I am trying to use .plist for this purpose. I have no success. How do I do it? Any example code (or) links? Thanks. I would appreciate any help.

    Read the article

  • Prepared statement initialized tiwice and closed once

    - by sonam
    Hi, I want to know that if a PreparedStatement object is initialized twice the way shown in code snippet below and closed only once in finally block, will it fail to close? I am not getting any error in this code but will it be a better idea to use 2 different preparedStatements instead of one. I think it fails to close the preparedStatement at #1. Connection conn = null; PreparedStatement ps = null; try { conn = getConnection(); ps = conn.prepareStatement(QueryUtil.UPDATE_POLICY_DETAILS); // #1 ps.setInt(1, iCancellationPolicyId); ps.executeUpdate(); //some code here ps = conn.prepareStatement(QueryUtil.UPDATE_POLICY_CHARGES); // #2 ps.setInt(1, iCancellationPolicyId); ps.executeUpdate(); //some code here } catch (SQLException sqlExp) { sqlExp.printStackTrace(); LOG.fatal(sqlExp); } finally { conn.close(); ps.close(); }

    Read the article

  • one document.createElement, append it twice, only shows once

    - by Sirber
    I have a button I want to use in the beginning and the end of the page: var button_save = document.createElement('button'); $("#compteurs").append(button_save); [...] $("#compteurs").append(button_save); but it only appear at the end of the page. If I remove it from the bottom of the page, it appear at the begining of page. It's a kind of pointer. Is there a way to create the button only once and use it twice? Thanks!

    Read the article

  • Click-Once deployment is leaving multiple versions (yes, more than 2)

    - by Clyde
    I've got a click once application that is leaving all old versions on my disk. It's an internal corporate application that gets frequent updates, so this is a disaster for rapidly inflating our backup size. According to the docs and other SO questions, it is supposed to only leave the current and previous versions on disk. However, each time I deploy the project and upgrade a client, I get another copy of all exe/dll/data files. I'm making no changes whatsoever to the application, just pushing deploy again in Visual Studio. Any ideas? Updates: The problem seems to happen on both Windows 7 and XP. 64 bit windows and 32. I've done a diff of the folders where the version is installed and the following files are different: MyApp.exe.manifest MyApp.exe.cdf-ms MyDll1.cdf-ms MyDll2.cdf-ms No actual executable files are different, nor the MyApp.manifest, MyDll1.manifest, etc.

    Read the article

  • Multiple things at once (Threads?)

    - by Jonathan
    All, What is a really simple way of having a program do more than one thing at once, even if the computer does not necessarily have multiple 'cores'. Can I do this by creating more than one Thread? My goal is to be able to have two computers networked (through Sockets) to respond to each-other's requests, while my program will at the same time be able to be managing a UI. I want the server to potentially handle more than one client at the same time as well. My understanding is that the communication is done with BufferedReader.readLine() and PrintWriter.println(). My problem is that I want the server to be waiting on multiple readLine() requests, and also be doing other things. How do I handle this? Many thanks, Jonathan

    Read the article

  • SQL query showing element more than once.

    - by Sorin Cioban
    Hi guys, I have the following SQL query but it doesn't entirely work because it shows each element more than once. select c.name, c.director, c.title, count(c.title) as numfilms from casting c join casting c1 on c1.name = c.name Group by c.name, c.director, c.title Having count (c.title) > 1 order by numfilms So what it does it shows which actors have made more than 1 film. But unfortunately, this query shows each actor as many times as the number of movies he made. Using distinct doesn't work as actor may have been in different movie with same title and different director.

    Read the article

  • WPF UserControl event called only once?

    - by 742
    Hi Everyone, I need to bind two-way a property of a user control to a property of a containing user control. I also need to set a default value to the property from code in the child (cannot be done easily from XAML tags). If I call my code from the child constructor, the value is set in the parent but the change callback routine is not triggered (my understanding is that the parent doesn't yet exist at the time the child is created). My current workaround is to catch the Loaded event of the child and to call the code from the handler. Howver as Loaded is called more than once, I need to set a flag to set the property only the first time. I don't like this way, but I don't know if there is a single shot event that could be used, or if this can be done otherwise. Any feedback based on your experience?

    Read the article

  • make Ruby script run once a second

    - by Matt Hintzke
    I have a ruby script that needs to run about 1 time a second. What I am doing is using a ruby script to keep track of modifications of files in a directory. I want the script to run once a second so that the modifications are updated in "live" time. Basically, I want my script to do the same kind of thing as running "top" on a unix shell. Where the screen is updated every second or so. Is there an equivalent to setInterval in ruby like there is in javascript? Thanks

    Read the article

  • returning values from function or method multiple times by only calling the class once

    - by Sokhrat Sikar
    I have a members.php file that shows my websites members. I echo members name by using foreach method. A method of Members class returns an array, then I use foreach loop in the members.php file to echo the members. I am trying to aovid writing php code in my members.php file. Is there a way to avoid using foreach inside members.php file? For example, is it possible to return value from a method couple of times? (by only calling the object once). Just like how we normally call the functions? This question doesn't make sense, but I am just trying to see if there is a away around this issue?

    Read the article

  • jquery .load() function only gets called once

    - by user1288099
    the html <div class="stackwrapper" id="user1"></div> <div class="stackwrapper" id="user2"></div> <div class="userdrawings"></div> the javascript $('.stackwrapper').click(function(e){ var id=$(this).attr('id'); $('.userdrawings').load('loadSession.php?user='+id).fadeIn("slow"); }); Somehow it only works at once, only at the first click on stackwrapper, when I click on the second one, the function is not triggered again.

    Read the article

  • Help moving multiple images at once with touches

    - by daveMac
    Here is my problem: I am trying to move a puzzle piece around the screen and then connect to the other piece if they are in close proximity. I have achieved this, though it is perhaps a little odd the way I did. My problem though is that once they have connected, I can't figure out how to move them as one image, instead of two separate entities. I would really appreciate any help or suggestions. Here is a sample of what I have been doing: (void)touchesMovedNSSet *)touches withEventUIEvent *)event{ UITouch *touch = [touches anyObject]; [self dispatchTouchEvent:[touch view] toPosition:[touch locationInView:self.view]]; } -(void)dispatchTouchEventUIView *)theView toPositionCGPoint)position{ if ((CGRectContainsPoint([picture frame], position))) { picture.center = position; } if (CGRectContainsPoint([picture2 frame], position)) { picture2.center = position; } }

    Read the article

  • Can a thread call wait() on two locks at once in Java (6)

    - by Dr. Monkey
    I've just been messing around with threads in Java to get my head around them (it seems like the best way to do so) and now understand what's going on with synchronize, wait() and notify(). I'm curious about whether there's a way to wait() on two resources at once. I think the following won't quite do what I'm thinking of: synchronized(token1) { synchronized(token2) { token1.wait(); token2.wait(); //won't run until token1 is returned System.out.println("I got both tokens back"); } } In this (very contrived) case token2 will be held until token1 is returned, then token1 will be held until token2 is returned. The goal is to release both token1 and token2, then resume when both are available (note that moving the token1.wait() outside the inner synchronized loop is not what I'm getting at). A loop checking whether both are available might be more appropriate to achieve this behaviour (would this be getting near the idea of double-check locking?), but would use up extra resources - I'm not after a definitive solution since this is just to satisfy my curiosity.

    Read the article

  • Simple nested setTimeout() only runs once (JavaScript)

    - by danielfaraday
    For some reason my galleryScroll() function only runs once, even though the function calls itself using setTimeout(). I'm thinking the issue may be related to scope, but I'm not sure: http://jsfiddle.net/CYEBC/2/ $(document).ready(function() { var x = $('#box').offset().left; var y = $('#box').offset().top; galleryScroll(); function galleryScroll() { x = x + 1; y = y + 1; $('#box').offset({ left: x, top: y }); setTimeout('galleryScroll()', 100); } });? The HTML: <html> <head> </head> <body> <div id="box"> </div> </body> </html>

    Read the article

  • Targeting an iFrame once with jQuery

    - by user275074
    Hi, I have a series of frames (4) which are used in a page to create loading of dynamic content through Ajax calls. In each of these frames I target parent level elements and update them with there respective content e.g. $("#loadingGrid1",top.document).show(); $("#frameSkills",top.document).hide(); In jQuery is there a way to instead of targeting specific elements on the parent page multiple times, simply target the page once into a variable e.g. var parentPage=$('#frameSkills',top.document); And then use this variable to apply content like $(parentPage #loadingGrid1).hide() Hope I've explained what I'm after enough. Basically, I'm having to call "top.document" in every jQuery selector I make and it seems like a waste of energy.

    Read the article

  • Oracle Sql: how to substract rows from one table from another only once

    - by slyder07
    I'm working for a university project, and I have the following question: I have 2 tables in a Oracle DB... I need to select those rows from table1, which are not included in table2... But the main problem is that I need to exclude that rows from table2 wich was selected once... For example: Table1 Table2 ResultTable id | Number | Letter id | Number | Letter id | Number | Letter _____________________ _____________________ _____________________ 1 4 S 1 6 G 2 2 P 2 2 P 2 8 B 3 5 B 3 5 B 3 4 S 4 4 S 4 4 S 4 1 A 6 2 P 5 1 A 5 1 H 6 2 P 6 2 X So, how you see it, if one row from Table1 has a "twin" in Table2, they both are excluded. Hope I was explicit enough. Sorry for my bad English. Thanks.

    Read the article

  • JavaScript - Settting property on Object in Image load function, property not set once outside funct

    - by Sunday Ironfoot
    Sometimes JavaScript doesn't make sense to me, consider the following code that generates a photo mosaic based on x/y tiles. I'm trying to set a .Done property to true once each Mosaic image has been downloaded, but it's always false for some reason, what am I doing wrong? var tileData = []; function generate() { var image = new Image(); image.onload = function() { // Build up the 'tileData' array with tile objects from this Image for (var i = 0; i < tileData.length; i++) { var tile = tileData[i]; var tileImage = new Image(); tileImage.onload = function() { // Do something with this tile Image tile.Done = true; }; tileImage.src = tile.ImageUrl; } }; image.src = 'Penguins.jpg'; tryDisplayMosaic(); } function tryDisplayMosaic() { setTimeout(function() { for (var i = 0; i < tileData.length; i++) { var tile = tileData[i]; if (!tile.Done) { tryDisplayMosaic(); return; } } // If we get here then all the tiles have been downloaded alert('All images downloaded'); }, 2000); } Now for some reason the .Done property on the tile object is always false, even though it is explicitly being set to true inside tileImage.onload = function(). And I can ensure you that this function DOES get called because I've placed an alert() call inside it. Right now it's just stuck inside an infinite loop calling tryDisplayMosaic() constantly. Also if I place a loop just before tryDisplayMosaic() is called, and in that loop I set .Done = true, then .Done property is true and alert('All images downloaded'); will get called.

    Read the article

< Previous Page | 5 6 7 8 9 10 11 12 13 14 15 16  | Next Page >