Search Results

Search found 50462 results on 2019 pages for 'list view'.

Page 14/2019 | < Previous Page | 10 11 12 13 14 15 16 17 18 19 20 21  | Next Page >

  • Problem with implementing removeAll for List of custom object

    - by Jay
    Hello everyone, I have a scenario in my code where I need to compare two Lists and remove from the first list, objects which are present in the second list. Akin to how the "removeAll" object works for List. Since my List is created on a custom object, the removeAll method won't work for me. I have tried various methods to make this work: - implemented equals() and hashCode for the custom object comprising the list - implemented the Comparable Interface for the custom object - implemented the Comparator Interface for the custom object I've even tried using the Apache Common's CollectionUtils and ListUtils methods (subtract, intersect, removeAll). None seem to work. I understand I will perhaps need to write some custom removal code. But not sure how to go about doing that. Any pointers helping me move in the right direction will be really appreciated. Thanks, Jay

    Read the article

  • Link between CCK field and view

    - by JTB
    I want to use a view to select nodes in a content type field. This view must receive an argument that is another field of the content type. Can someone explain me how to pass the argument from the field to the view? Excuse my poor english

    Read the article

  • Convert a List of Options to an Option of List using Scalaz

    - by Rafael de F. Ferreira
    The following function transforms a list of Option[T] into a list of Some[T], in the case where all members are Some's, or None, in the case where there is at least one None member. I guess the code is clearer that this explanation: def lo2ol[T](lo: List[Option[T]]): Option[List[T]] = { lo.foldRight[Option[List[T]]](Some(Nil)){(o, ol) => (o, ol) match { case (Some(x), Some(xs)) => Some(x :: xs); case _ => None : Option[List[T]]; }}} I remember seeing somewhere a similar example, but using Scalaz to simplify the code. How would it look like?

    Read the article

  • converting a matrix to a list

    - by andrewj
    Suppose I have a matrix foo as follows: foo <- cbind(c(1,2,3), c(15,16,17)) > foo [,1] [,2] [1,] 1 15 [2,] 2 16 [3,] 3 17 I'd like to turn it into a list that looks like [[1]] [1] 1 15 [[2]] [1] 2 16 [[3]] [1] 3 17 You can do it as follows: lapply(apply(foo, 1, function(x) list(c(x[1], x[2]))), function(y) unlist(y)) I'm interested in an alternative method that isn't as complicated. Note, if you just do apply(foo, 1, function(x) list(c(x[1], x[2]))), it returns a list within a list, which I'm hoping to avoid.

    Read the article

  • sharepoint list relationship question

    - by Korey
    I have two custom lists in sharepoint with a one to many relationship on a column in both lists. So list A has text column 1 and list B has a lookup column 1' on list A's column 1. I want to display the rows in list A, where column 1 has a match on column 1' and a 2nd column in list B with a specific text string. I have Sharepoint Designer and am fumbling along with linked sources described here http://office.microsoft.com/en-us/sharepointdesigner/HA100991441033.aspx, but can't get exactly what I'm looking for.

    Read the article

  • Sql server indexed view

    - by Jose
    OK, I'm confused about sql server indexed views(using 2008) I've got an indexed view called AssignmentDetail when I look at the execution plan for select * from AssignmentDetail it shows the execution plan of all the underlying indexes of all the other tables that the indexed view is supposed to abstract away. I would think that the execution plan woul simply be an clustered index scan of PK_AssignmentDetail(the name of the clustered index for my view) but it doesn't. There seems to be no performance gain with this indexed view what am I supposed to do? Should I also create a non-clustered index with all of the columns so that it doesn't have to hit all the other indexes? Any insight would be greatly appreciated

    Read the article

  • Upgrading a SharePoint list instance that was deployed via feature

    - by Goldmember
    I'm curious how others address this issue. Using VSEWSS 1.3, I have created a site content type, a list definition (w event receivers), and a list instance. All of them are in the same WSP solution and each is activated individually via features. Now let's assume that all the features have been activated for some time, and the list instance contains a number of items (that can't be deleted). Now suppose I need to make a change to the schema.xml (inject some javascript, modify views, whatever) of the list. Is it even possible to "upgrade" the schema of the existing list instance? Otherwise I would think I'm stuck creating a new instance and copying items over.

    Read the article

  • Fill a array with List data with one more element

    - by marionmaiden
    Hello, By a question that I made, I figured out that tho copy elements from one list to an array I just need to use the method toArray() for this. But let's suppose I have a List with n objects. I want to copy then into a array sized n+1 and add into the first position another object and in the other n positions the n data of the list. This is the way I'm doing it for now, but I'm just wondering if there is a better way for do that: Object array[] = new Object[list.size() + 1]; Object chk = new Object(); array[0] = chk; for(int i = 1; i < array.length; i++){ array[i] = list.get(i); }

    Read the article

  • SQL Server indexed view matching of views with joins not working

    - by usr
    Does anyone have experience of when SQL Servr 2008 R2 is able to automatically match indexed view (also known as materialized views) that contain joins to a query? for example the view select dbo.Orders.Date, dbo.OrderDetails.ProductID from dbo.OrderDetails join dbo.Orders on dbo.OrderDetails.OrderID = dbo.Orders.ID cannot be automatically matched to the same exact query. When I select directly from this view ith (noexpand) I actually get a much faster query plan that does a scan on the clustered index of the indexed view. Can I get SQL Server to do this matching automatically? I have quite a few queries and views... I am on enterprise edition of SQL Server 2008 R2.

    Read the article

  • just-in-time list

    - by intuited
    I'd like to know if there is a class available, either in the standard library or in pypi, that fits this description. The constructor would take an iterator. It would implement the container protocol (ie _getitem_, _len_, etc), so that slices, length, etc., would work. In doing so, it would iterate and retain just enough values from its constructor argument to provide whatever information was requested. So if jitlist[6] was requested, it would call self.source.next() 7 times, save those elements in its list, and return the last one. This would allow downstream code to use it as a list, but avoid unnecessarily instantiating a list for cases where list functionality was not needed, and avoid allocating memory for the entire list if only a few members ended up being requested. It seems like a pretty easy one to write, but it also seems useful enough that it's likely that someone would have already made it available in a module.

    Read the article

  • How to stop Zend Framework from appending '/scripts/' to the View Base Path

    - by Hannes
    Thats basically my code (simplified): class IndexController extends Zend_Controller_Action { public function indexAction(){ $this->view->setBasePath(APPLICATION_PATH . '/views/partner/xyz/'); $this->view->render('node.phtml'); } } Now what I (obvoiusly) want is to use the view script APPLICATION_PATH . '/views/partner/xyz/node.phtml' but ZF always tries to load APPLICATION_PATH . '/views/partner/xyz/scripts/node.phtml' is there any Way around that Behviour?

    Read the article

  • Python: Repeat elements in a list comprehension?

    - by User
    I have the following list comprehension which returns a list of coordinate objects for each location. coordinate_list = [Coordinates(location.latitude, location.longitude) for location in locations] This works. Now suppose the location object has a number_of_times member. I want a list comprehension to generate n Coordinate objects where n is the number_of_times for the particular location. So if a location has number_of_times = 5 then the coordinates for that location will be repeated 5 times in the list. (Maybe this is a case for a for-loop but I'm curious if it can be done via list comprehensions)

    Read the article

  • Display/Hide part of a list

    - by superexsl
    Hi I have an (unordered)list (generated by a repeater) of items. However, I'd like to show the first three items, and have the rest hidden by the main content div. When a button is pressed, I would like the list's div to expand, pushing the main content div down and showing the rest of the list. I was thinking of using slideDown(), but that closes the entire div ( and I would like to show the first 3 items of the list). What would be the best way to achieve an effect like this? Is there a plugin that can easily show X items of a list and the display the rest upon request? Thanks

    Read the article

  • python conditional list creation from 2D lists

    - by dls
    Say I've got a list of lists. Say the inner list of three elements in size and looks like this: ['apple', 'fruit', 1.23] The outer list looks like this data = [['apple', 'fruit', 1.23], ['pear', 'fruit', 2.34], ['lettuce', 'vegetable', 3.45]] I want to iterate through the outer list and cull data for a temporary list only in the case that element 1 matches some keyword (aka: 'fruit'). So, if I'm matching fruit, I would end up with this: tempList = [('apple', 1.23), ('pear', 2.34)] This is one way to accomplish this: tempList = [] for i in data: if i[1] == 'fruit': tempList.append(i[0], i[2]) is there some 'Pythonic' way to do this in fewer lines?

    Read the article

  • Fastest way to check a List<T> for a date

    - by fishhead
    I have a list of dates that a machine has worked on, but it doesn't include a date that machine was down. I need to create a list of days worked and not worked. I am not sure of the best way to do this. I have started by incrementing through all the days of a range and checking to see if the date is in the list by iterating through the entire list each time. I am looking for a more efficient means of finding the dates. class machineday { datetime WorkingDay; } class machinedaycollection : List<machineday> { }

    Read the article

  • Manually changing keyboard orientation for a view that's on top of a camera view

    - by XKR
    I'm basically trying to reproduce the core functionality of the "At Once" app. I have a camera view and another view with a text view on it. I add both views to the window. All is well so far. [window addSubview:imagePicker.view]; [window addSubview:textViewController.view]; I understand that the UIImagePickerController does not support autorotation, so I handle it manually by watching UIDeviceOrientationDidChangeNotifications and applying the necessary transforms to the textViewController.view. Now, the problem here is the keyboard. If I do nothing, it just stays in portrait mode. I can get it to rotate by adding the following code to the notification handler. [[UIApplication sharedApplication] setStatusBarOrientation:interfaceOrientation]; [textView resignFirstResponder]; [textView becomeFirstResponder]; However, the following simple test produces weird behavior. Start the app in portrait mode. Rotate the device 90 degrees clockwise. Rotate the device 90 degrees counterclockwise (back to the initial position). Rotate the device 90 degrees clockwise. After step 4, instead of the landscape-mode keyboard, the portrait-style keyboard is shown, skewed to fit in the landscape keyboard frame. Perhaps my approach is wrong from the start. I was wondering if anyone has been able to reliably make the keyboard change its orientation in response to setStatusBarOrientation.

    Read the article

  • Best way to implement a List(Of) with a maximum number of items

    - by Ben
    I'm trying to figure out a good way of implementing a List(Of) that holds a maximum number of records. e.g. I have a List(Of Int32) - it's being populated every 2 seconds with a new Int32 item. I want to store only the most current 2000 items. How can I make the list hold a maximum of 2000 items, then when the 2001'th item is attempted to be added, the List drops the 2000'th item (resulting in the current total being 1999). Thing is, I need to make sure I'm dropping only the oldest item and adding a new item into the List. Ben

    Read the article

  • Add a background image to tables in a navigation view in a tabbed application

    - by padatronic
    Hi people, I have a tabbed application which then has a navigation controller. In each the navigation controller I an a table View Controller which obviously contains a table. I push a new table view controller from this one. I want to put a background to the table but can only add an image infront of the table. I think this may be because I am adding the sub view in the table view controller, but I don't seem to be able to add it anywhere else. Please could you help me, thanks.

    Read the article

  • ORDER BY in a Sql Server 2008 view

    - by eidylon
    Hi all... we have a view in our database which has an ORDER BY in it. Now, I realize views generally don't order, because different people may use it for different things, and want it differently ordered. This view however is used for a VERY SPECIFIC use-case which demands a certain order. (It is team standings for a soccer league.) The database is Sql Server 2008 Express, v.10.0.1763.0 on a Windows Server 2003 R2 box. The view is defined as such: CREATE VIEW season.CurrentStandingsOrdered AS SELECT TOP 100 PERCENT *, season.GetRanking(TEAMID) RANKING FROM season.CurrentStandings ORDER BY GENDER, TEAMYEAR, CODE, POINTS DESC, FORFEITS, GOALS_AGAINST, GOALS_FOR DESC, DIFFERENTIAL, RANKING It returns: GENDER, TEAMYEAR, CODE, TEAMID, CLUB, NAME, WINS, LOSSES, TIES, GOALS_FOR, GOALS_AGAINST, DIFFERENTIAL, POINTS, FORFEITS, RANKING Now, when I run a SELECT against the view, it orders the results by GENDER, TEAMYEAR, CODE, TEAMID. Notice that it is ordering by TEAMID instead of POINTS as the order by clause specifies. However, if I copy the SQL statement and run it exactly as is in a new query window, it orders correctly as specified by the ORDER BY clause.

    Read the article

  • [ZF] set/add view from controller action

    - by user359650
    Hi all, I'm trying to set a view script to be executed in addition to the currently requested action view script. I want to do this from the controller action itself in a way that this new view script output will be available from the layout $this-layout()-content helper. I found the setView() method but don't know how to use it from the controller. Thanks a lot.

    Read the article

  • set/add view from controller action

    - by user359650
    Hi all, I'm trying to set a view script to be executed in addition to the currently requested action view script. I want to do this from the controller action itself in a way that this new view script output will be available from the layout $this-layout()-content helper. I found the setView() method but don't know how to use it from the controller. Thanks a lot.

    Read the article

  • asp.net mvc 2 - return JavaScript with View

    - by Tomaszewski
    Hi, using ASP.NET MVC 2 I have a navigation menu inside my Master Page. In the navigation menu, I am trying add a class to the that the current page relates to (i.e., home page will add class="active" to the Home button). I'm trying to consider scalability and the fact that I don't want to change individual pages if the navigation changes later. The only way I can think of doing this is: Add JavaScript to each individual View that will add the class when the DOM is ready Return JavaScript when return View() occurs on point (2), I am unsure how to do. Thusfar I have been doing the following in my controller: public ActionResult Index() { ViewData["messege"] = JavaScript("<script type='text/javascript' language='javascript'> $(document).ready(function () { console.log('hi hi hi'); }); </script>"); return View(); } but in my view, when I call: <%: ViewData["messege"] %> I get: System.Web.Mvc.JavaScriptResult as the result Would you guys have any ideas on How to solve the navigation menu probelem, other than the solutions I've listed return JavaScript along with your view from the Controller Thanks, in advanced!

    Read the article

  • JSP + View bean complete example

    - by jihedamine
    I found this interesting tutorial that explains the concept of view bean with some code snippets http://www.ibm.com/developerworks/ibm/library/i-extreme5/, but I'd like to view a complete (simple) web application in a real world scenario using plain JSP and view beans (not using struts, spring or jsf framework). Thanks for pointing me to such a resource.

    Read the article

< Previous Page | 10 11 12 13 14 15 16 17 18 19 20 21  | Next Page >