paging

ROW_NUMBER() and nhibernate - finding an item's page

醉酒当歌 提交于 2019-11-29 15:25:45
问题 given a query in the form of an ICriteria object, I would like to use NHibernate (by means of a projection?) to find an element's order, in a manner equivalent to using SELECT ROW_NUMBER() OVER (...) to find a specific item's index in the query. (I need this for a "jump to page" functionality in paging) any suggestions? NOTE: I don't want to go to a page given it's number yet - I know how to do that - I want to get the item's INDEX so I can divide it by page size and get the page index. 回答1:

Kendo scheduler resources paging

做~自己de王妃 提交于 2019-11-29 13:03:14
in kendo scheduler control am using group header template and would like to make a paging in my resources view http://dojo.telerik.com/IMUjA this example has 2 only resources if I would like to add 2 another resources I want to show only 2 resources per page and would like to have next/prev buttons to change resources viewed as paging in scheduler displaying I want something such as the example I made in this link: dojo.telerik.com/uBigO/4 I would like to control my resources to view configured number of the resources cause the pagination method is not supported in Kendo scheduler as a feature

Is this how you paginate, or is there a better algorithm?

丶灬走出姿态 提交于 2019-11-29 12:32:28
问题 I want to be able to take a sequence like: my_sequence = ['foo', 'bar', 'baz', 'spam', 'eggs', 'cheese', 'yogurt'] Use a function like: my_paginated_sequence = get_rows(my_sequence, 3) To get: [['foo', 'bar', 'baz'], ['spam', 'eggs', 'cheese'], ['yogurt']] This is what I came up with by just thinking through it: def get_rows(sequence, num): count = 1 rows = list() cols = list() for item in sequence: if count == num: cols.append(item) rows.append(cols) cols = list() count = 1 else: cols.append

selenium get current url after loading a page

百般思念 提交于 2019-11-29 01:53:10
问题 I'm using Selenium Webdriver in Java. I want to get the current url after clicking the "next" button to move from page 1 to page 2. Here's the code I have: WebDriver driver = new FirefoxDriver(); String startURL = //a starting url; String currentURL = null; WebDriverWait wait = new WebDriverWait(driver, 10); foo(driver,startURL); /* go to next page */ if(driver.findElement(By.xpath("//*[@id='someID']")).isDisplayed()){ driver.findElement(By.xpath("//*[@id='someID']")).click(); driver.manage()

NHibernate paging with SQL Server

耗尽温柔 提交于 2019-11-29 01:35:39
When using SetFirstResult(start) and SetMaxResults(count) methods to implement paging I've noticed that the generated query only does a select top count * from some_table and it does not take the start parameter into account or at least not at the database level. It seems that if I instruct NHibernate to execute the following query: var users = session.CreateCriteria<User>() .SetFirstResult(100) .SetMaxResults(5) .List<User>(); 105 records will transit between the database server and the application which will take care to strip the first 100 records. With tables containing many rows this

Paging UIScrollView with different page widths

。_饼干妹妹 提交于 2019-11-28 19:33:32
I would like to have a horizontal scrolling UIScrollView with paging enabled. The pages in this scrollview have different widths, so the scrolling distance differs from page to page. The goal is to make a picker for different points in time, e.g.: | Now | Yesterday evening | Last Week | Last Month | ^ ^ ^ ^ <- stopps here Here | Now | has a smaller width than | Yesterday evening | . When paging through this values, the scrollview should stop at the center of the according value. Is that possible? it's surely possible, but not so automatically... i guess you should implement the

Range based paging mongodb

假装没事ソ 提交于 2019-11-28 18:27:22
on the mongodb docs it says: (source) Unfortunately skip can be (very) costly and requires the server to walk from the beginning of the collection, or index, to get to the offset/skip position before it can start returning the page of data (limit). As the page number increases skip will become slower and more cpu intensive, and possibly IO bound, with larger collections. Range based paging provides better use of indexes but does not allow you to easily jump to a specific page. What is range based paging and where is the documentation for it? The basic idea is to write the paging into the query

Differences or similarities between Segmented paging and Paged segmentation?

六月ゝ 毕业季﹏ 提交于 2019-11-28 17:16:21
I was studying combined paging/segmentation systems and in my book there were two approaches to this : 1.paged segmentation 2.segmented paging I could not make out the difference between the two. I think in paged segmentation the segment is divided into pages and in segmented paging the pages are divided into segments, though I don't know if I am right or wrong. Meanwhile on the internet the combined paging/segmentation is described using one scheme only. I can't figure out why in my coursebook there are two schemes for this. Any help would be deeply appreciated. So,after vigorously searching

Difference Swapping and Paging

只谈情不闲聊 提交于 2019-11-28 17:10:28
问题 What are the differences between Swapping and Paging with reference to Process Memory Management ? Also guide me to the tutorials if any where I could get more information. 回答1: Swapping refers to copying the entire process address space, or at any rate, the non-shareable-text data segment, out to the swap device, or back, in one go (typically disk). Whereas paging refers to copying in/out one or more pages of the address space. In particular, this is at a much finer grain. For example, there

What causes page faults?

我们两清 提交于 2019-11-28 16:52:46
According to Wikipedia : A page fault is a trap to the software raised by the hardware when a program accesses a page that is mapped in the virtual address space, but not loaded in physical memory . (emphasis mine) Okay, that makes sense. But if that's the case, why is it that whenever the process information in Process Hacker is refreshed, I see about 15 page faults? Or in other words, why is any memory getting paged out? (I have no idea if it's user or kernel memory.) I have no page file, and the RAM usage is about 1.2 GB out of 4 GB, which is after a clean reboot. There's no shortage of any