Search Results

Search found 21331 results on 854 pages for 'require once'.

Page 21/854 | < Previous Page | 17 18 19 20 21 22 23 24 25 26 27 28  | Next Page >

  • Event handler triggered twice instead of once

    - by kwokwai
    Hi all, I am sorry that I have asked two questions in a few minutes. In a html file, I got three child DIV tags in a parent DIV tag: <div id="container"> <div id="frag-123">123</div> <div id="frag-124">124</div> <div id="frag-125">125</div> </div> Now when I click either the three child DIV tags, I will see two alert boxes pop up instead of one: The first alert box will show something like this: frag-123, and the second alert box will show something like this: container I dont know why. I just want to get the ID value of a child DIV, not the one from the parent DIV. <script> $(function() { $("div").click(function() { var imgID = this.id; alert(imgID); }); }); </script> Please help.

    Read the article

  • Saving several Monticello packages at once

    - by Juan Barreda
    I am working with Pharo Smalltalk. Suppose you want to save your own group of packages into a local repository, you know that your packages are prefixed with "MyPrefix". What's the right message to do it? In code: | myPkgs | myPkgs := MCPackage allInstances select: [: mcPkg | mcPkg name beginsWith: 'MyPrefix' ]. myPkgs do: [ : myPkg | myPkg ??? ]. It would be too difficult to script that one for a web based repository?

    Read the article

  • sort arrow is always showing up once sorting is used

    - by kksachin
    we have several pages as tabs where datatable is used in most of the pages.when we sort on a particular coulmn and exit the page and re enter this page the arrow appears(up /down based on how we left) Although the data is not sorted in the direction the arrow shows.i have set preserveSort and preserveDataMode to false. The arrow is set to true in the column's t:commandSortHeader tag in all the pages. is this a bug or am i missing any setting?I have tried to set forceId to false in t:commandSortHeader but of now use.

    Read the article

  • Marker on Google Map added only once.

    - by Vafello
    I have the following code: function clicked(overlay, latlng) { var icon3 = new GIcon(); icon3.image = "marker.png"; icon3.iconAnchor = new GPoint(15, 40); var marker2 = new GMarker(latlng, { icon: icon3, draggable: true, title: 'Drag me' }); map.addOverlay(marker2); } Each time I click on the map a new marker is placed on the map. The problem is that I need only one marker and if I click several times, each time a new marker is added. How to change the code so only one marker is placed and when the map is clicked again it just changes its location?

    Read the article

  • Forbid GridView to load all views at once

    - by efpies
    I have about 700 items to display in the grid view. On a Samsung Galaxy Tab 10.1 this is not a problem: it has enough memory. On a HTC Explorer the heap is overflown. So I want to load data dynamically regarding current scroll position (N rows for screen + 5 rows as a tail). And I want to show a scrollbar which represents the position in total rows. But I don't want to draw items that I don't see. In other words, I want to create something similar to UITableView in iOS. How can I do this?

    Read the article

  • changing the saved contents of the model , edit model fileds once saved

    - by imran-glt
    hi I have extended the user model and added extra fields to it i.e "latitude" "longitude" and status and than save it. up to here it works fine. but i want to allow the user to change his/her "latitude" "longitude" whenever he/she needs like the hotmail and yahoo allows change account feature. in my case the user only wants to chage the latitude and longitude i tried it in this way but it didnt work. is this the right way to do it ...... or is there any other way to change the saved contents view.py def status_change(request): print "status_change function called" if request.method == "POST": rform = registerForm(data = request.POST) uform = UserForm(data = request.POST) if rform.is_valid(): user = uform.save() register = rform.save() register.user = user register.save() return render_to_response('home.html') else: rform = registerForm() return render_to_response('status_change.html',{'rform':rform})

    Read the article

  • TeamCity Multi-Part Build - How to checkout the code just once

    - by Jeff D
    I am trying to create 1 package with multiple build configurations. The first will checkout the code, build it (Solution File configuration), and run nunit tests. If that succeeds, another will then build in release mode. If that succeeds, a final script witll package up the output, and mark it as an artifact. The problem I'm having is that I don't know how to tell TeamCity not to create new directories for each step, and as a result, the steps are failing. Is there a setting for this? It seems like the dependencies tab would be an appropriate place to look, but I don't seem to understand the instructions, and my tinkering so far has been fruitless.

    Read the article

  • Confirmation box pops up more than once using ajax

    - by peter burg
    I'm using Ajax to delete records and display an animated message (function display_message) when this record is deleted, but I noticed that the confirmation box pops up depending on the number of records. for example if I have 2 records in my list and I want to delete on of them.The confirmation box pops up twice before deleting and the same thing happen with the message, It appears twice(I'm using a message that fade in and out), and so on(3 records - 3 pops up, etc). I tried a lot to resolve it but I haven't succeed . Here is my function that delete the records: $(function() { $(".delete_class").click(function() { var id = $(this).attr("id"); var dataString = 'id='+ id ; var parent = $(this).parent().parent(); if(confirm("are you sure?")) { $.ajax({ type: "POST", url: "delete.php", data: dataString, cache: false, success: function() { parent.hide(); } }); } display_message("user deleted!") }); }); Please help.

    Read the article

  • How to Select Multiple Records from Multiple Tables at Once - SQL Server/C#/.NET/T-SQL

    - by peace
    I have two tables Customer and CustomerPhone. Customer usually has multiple phone numbers, so when i run select statement on customer 101, i will get multiple records due to the multiple phone numbers. As you see below all the "Phone" and "Fax" field belongs to CustomerPhone table. These are considered as two records in the CustomerPhone table whereas the rest of fields relate to Customer table which is a single record. What should i do to fill Phone and Fax field in this case? Should i run select statement on CustomerPhone first and then run select statement on Customer?

    Read the article

  • See if item exists once in Enumerable (Linq)

    - by Stacey
    Given a list... class Item { public Name { get; set; } } List<Item> items = new List<Item> { new Item() { Name = "Item 1" }, new Item() { Name = "Item 1" }, new Item() { Name = "Item 2" }, new Item() { Name = "Item 3" } } List<Item> listing = new List<Item> { new Item() { Name = "Item 1" }, new Item() { Name = "Item 2" }, new Item() { Name = "Item 3" } new Item() { Name = "Item 4" } } etc. I need to create a third array that will cancel out double instances between the two; however items with "Name 1" are both the same, but different 'instances'. So the third List should have 1 instance of Item 1, since 'items' had 2 instances. Any ideas of how this can be done through Linq?

    Read the article

  • Silverlight/WPF: Retreiving the size of a `UIElement` once it has been rendered on screen

    - by ondesertverge
    I have the following simple piece of code: var canvas = new Canvas(); foreach (var ztring in strings) { var textblock = new TextBlock(); textblock.Text = ztring; panel.Children.Add(textblock); textblock.Measure(infiniteSize); } At this point I would expect any of the size properties (Height/Width, ActualHeight/ActualWidth, DesiredSize, RenderSize) to give me the size of the textblock. None of them do. ActualHeight always gives 16.0 no matter what size font. ActualWidth changes according to the text length but not the font size. I change the font size on the parent container and not the TextBlock itself. I feel like I am missing some basic element of understanding the manipulation of silverlight elements from within the codebehind. The question is: how do I get the real actual pixel size of my TextBlock?

    Read the article

  • Does a SELECT happen all at once, or progressively

    - by AmbroseChapel
    I have a process which finds a list of files to be deleted using a SELECT wheredelete= 'Y'. I set this process running the other day but it takes a while because it actually does the file deletions too. And in the middle of its long operation, I was using the application and deleted one more file. At this point I realised I didn't know if that file would be deleted, because I didn't know if the SELECT would have found all the files at the start, or if it was finding them progressively and would get to my newly-deleted file eventually.

    Read the article

  • Rails editing multiple records at once

    - by Joseph Silvashy
    I feel like this might be really simple but I'm just not getting it right, so I have like a settings page in my app and I want each setting to be like a key value store, for example: +-------------------+--------------------------------+ | setting | value | +-------------------+--------------------------------+ | twitter_username | something | +-------------------+--------------------------------+ | facebook_url | http://facebook.com/someguy | +-------------------+--------------------------------+ My form looks something like this: <% form_tag set_admin_settings_path, :method => :put do %> <ol> <% for setting in @settings %> <li class="field"> <label><%= setting.setting_name.humanize %></label> <%= text_field_tag "[setting_value][]", setting.setting_value %> </li> <% end %> <li class="submit"> <%= submit_tag "Update settings" %> </li> </ol> <% end %> Everything renders fine but when I try to save the form, nothing is saved :(

    Read the article

  • Excel - check if row contains ANY value *more than once*

    - by user2536778
    I am doing data analysis and sometimes I need to check and to make sure each row in excel does not have any repeated value. I hope that there is a formula where each time if there's a repeated value in the same row, the value will be highlighted and it doesn't matter what value it is, as long as it's repeated in the same row. I try to search it everywhere but the closest I can find is below question & answer ( which couldn't apply to me as I need a formula that can highlight any value that's repeated and not only zero): I have rows which contain grades for students (numerical values), where the number 0 means they missed a class. I want the row to be highlighted in one color if they have "0" 3 or 4 times, and in another color if they have "0" 5 times or more. =COUNTIF(1:1,0)=5 Anyone can help me? Thanks in advance!

    Read the article

  • localize many images in Xcode at once?

    - by Sebastian
    I have this project that i need to add a translation to. I already know how to add localisation to single image files, but there are 200+ images with text on it in that project. Do i really have to click one file at a time, "get info", click "add localisation" enter the Language and click OK for every file? When i select multiple images the languages and do those steps the new language is not added :-/ Please someone have a way to save me from insanity ;-) Thanks! S

    Read the article

  • Entity Framework LINQ Query using Custom C# Class Method - Once yes, once no - because executing on the client or in SQL?

    - by BrooklynDev
    I have two Entity Framework 4 Linq queries I wrote that make use of a custom class method, one works and one does not: The custom method is: public static DateTime GetLastReadToDate(string fbaUsername, Discussion discussion) { return (discussion.DiscussionUserReads.Where(dur => dur.User.aspnet_User.UserName == fbaUsername).FirstOrDefault() ?? new DiscussionUserRead { ReadToDate = DateTime.Now.AddYears(-99) }).ReadToDate; } The linq query that works calls a from after a from, the equivalent of SelectMany(): from g in oc.Users.Where(u => u.aspnet_User.UserName == fbaUsername).First().Groups from d in g.Discussions select new { UnReadPostCount = d.Posts.Where(p => p.CreatedDate > DiscussionRepository.GetLastReadToDate(fbaUsername, p.Discussion)).Count() }; The query that does not work is more like a regular select: from d in oc.Discussions where d.Group.Name == "Student" select new { UnReadPostCount = d.Posts.Where(p => p.CreatedDate > DiscussionRepository.GetLastReadToDate(fbaUsername, p.Discussion)).Count(), }; The error I get is: LINQ to Entities does not recognize the method 'System.DateTime GetLastReadToDate(System.String, Discussion)' method, and this method cannot be translated into a store expression. My question is, why am I able to use my custom GetLastReadToDate() method in the first query and not the second? I suppose this has something to do with what gets executed on the db server and what gets executed on the client? These queries seem to use the GetLastReadToDate() method so similarly though, I'm wondering why would work for the first and not the second, and most importantly if there's a way to factor common query syntax like what's in the GetLastReadToDate() method into a separate location to be reused in several different places LINQ queries. Please note all these queries are sharing the same object context.

    Read the article

  • Fresh XP +click once +cannot connect

    - by niao
    Greetings, we have to following problem. Our application is deployed using ClickOnce. Everything is running fine and application is able to connect to the wcf service. The problem occurs when application is installed on FRESH XP machine without .net Framework and Windows Installater (that were selected in ClickOnce prerequities). Application downloads .NET Framework 3.5SP1 and windows installer but then it cannot connect the the server. Reboot after install does not help. The strange is that this application has been installed on 10 xp machines and 4 of them can connect to the service without a problem

    Read the article

  • get data from online once and then viewable offline

    - by user313100
    Okay, I want to have an app that takes phone numbers from an online database and displays them in a table view. When the user is not online, I want them to still be able to see the numbers they already got from the database in the table view. If the user manages to go back online, the database updates the view. My question is, is this possible to do and if so, what's the best way to approach it? (bit of a newbie, please help me out)

    Read the article

  • objective c import once

    - by joels
    I have a header file with a bunch on statics like static NSString * SOME_NAME = @"someMeaning"; What is the best way to import this? Should I define them some other way? I tried just using the #import statement but any file that imports it gives me a warning saying SOME_NAME defined but not used...

    Read the article

  • javascript window.close, once again

    - by John Kjøller
    Im sorry if I havent done my research properly, - but couldnt find the answer I needed, so here goes: From my main page I open a new window using mainPlayer = window.open(); This window stays open until user clicks on a mainPlayer.close(); event. (or simply x closes the window) However, the idea is to make it possible to let the player keep playing, while browsing around the rest of the pages. But as soon as the user leaves the page that opened the mainPlayer window, the reference to the mainPlayer window seem to be lost. How do I, from the site's other pages, check if the mainPlayer window is open and close it on a click event? Thx John

    Read the article

  • C++ Serial Port Only Responding Once Using Write()

    - by Pfeffer
    All the code below works. My device responds, C,7 is a reset. When I run this the second time it doesn't respond. If I manually turn my device off and on, then run this script again it works. But not if I press the button to run the script the second time. RS232: 57600,8,N,1 Any ideas?? Is there any more information needed to solve this? *Also when I get this working I'm going to have to use the read() function to get the devices responses. Does anyone know the correct format I need to use, based on the below code? Sorry I'm new to C++...I'm more of a PHP guy. *I also don't know if 1024 is right, but it seems to work so eh... Thanks so much! #include <termios.h> int fd; struct termios options; fd=open("/dev/tty.KeySerial1", O_RDWR | O_NOCTTY | O_NDELAY); fcntl(fd, F_SETFL, 0); tcgetattr(fd,&options); options.c_ispeed=57600; options.c_ospeed=57600; options.c_cflag |= (CLOCAL | CREAD); options.c_lflag &= ~(ICANON | ECHO | ECHOE | ISIG); options.c_cflag &= ~CSTOPB; options.c_lflag &= ~ECHO; options.c_oflag &= ~ECHO; options.c_oflag &= ~OPOST; options.c_cflag |= CS8; options.c_cflag |= CRTSCTS; options.c_cc[VMIN] = 0; options.c_cc[VTIME] =10; tcflush(fd, TCIFLUSH); tcsetattr(fd,TCSANOW,&options); write(fd, "C,7\r\n", 1024); close(fd);

    Read the article

< Previous Page | 17 18 19 20 21 22 23 24 25 26 27 28  | Next Page >