Joomla Limit Custom Pagination - joomla

In Joomla 2.5 for paging we have getPagesLinks() function.
If i have more than 100 records then it gives Start Prev 1 2 3 4 5 6 7 8 9 10 Next End.
I want like Start Prev 1 2 Next End.
How can i do that?

You can override the output in the template: http://docs.joomla.org/Understanding_Output_Overrides#Pagination_Links_Overrides
The pagination object also has some properties which are of interest:
pagesCurrent
pagesStart
pagesStop
pagesTotal
That should allow you to create what you want. By setting Start and Stop depending on Current and Total.

Related

Spring application using Pageable always returns the same result from page 2

I'm using spring to develop an application using sqlite as a database, but I'm having a problem implementing pagination in the repository's findAll(Pageable pageable) method.
For this implementation I'm using Pageable, and the problem is that, from the second page onwards, the result is always the same.
After some debugging I noticed that in the sql output the LIMIT and OFFSET clauses are switched. That is, imagining that I want 1 result per page, the LIMIT and OFFSET values are like this:
Page 1:
page=0 | size=1 -> LIMIT 1 OFFSET 0
Page 2:
page=0 | size=1 -> LIMIT 1 OFFSET 1
Page 3
page=0 | size=1 -> LIMIT 2 OFFSET 1
That is, the values of LIMIT and OFFSET are switched, as for the case of page 3 it should be: LIMIT 1 OFFSET 2
Does anyone know why this happens, and any possible solutions?
I already managed to solve the problem.
The problem was in the use of a custom sql dialect that had a problem. I changed the implementation to use a maven dependency that handles sql dialect and it solved the problem.
Thank you

Duration Based Apache JMeter Scenario

am running test in duration based scenario with jmeter 5.4.1, at the end of the script, test is getting stop prematurely without executing some of the calls in the last iteration, please help me to make sure all the calls executed in the last iteration, i have tried loop,duration controller nothing seems. to be prominent
Example: i have home, login, search,select item & logout, duration of 5 min with 1 user
Test execution : Home 10 login 10 search 9 select item 9 logout 9
Test execution : Home 10
login 10
search 9
select item 9
logout 9
If you set duration in the Thread Group or in Runtime Controller it doesn't guarantee that all Sampler will be executed equal number of times, when the duration is reached or exceeded JMeter will start shutting down the threads (virtual users) and the total number of sample results will mainly depend on the application response time.
So if you want to execute everything 10 times only - set number of loops in the Thread Group to 10 and either increase or remove the duration.
Alternatively you can use Concurrency Thread Group configured like:
this way 1 user will execute samplers for 5 minutes as fast as it can but not more than 10 times.

How to implement queue management system in Redis

Im trying to implement queuing system using redis. So lets say we have this list:
> LPUSH listTickets 1 2 3 4 5 6 7 8 9
and as mobile app user someone was assigned number 4, and another user number 6. Now I want to display to them how many tickets are in front of them ( also to calculate the waiting estimated time). Now this may seem easy,
> LPOP listTicket
"4"
then we broadcast the result (the current ticket number to be called), then on mobile app everyone will subtract it from their own ticket number. for example my current ticket is 6 so 6-4=2 That way every user know how many tickets are ahead
However once you want to add feature to let the user delete their ticket or pushing it to the end of the queue, things get complicated. After deleting for example
> LRANGE listTicket 0 -1
1) "2"
2) "4"
3) "6"
4) "7"
5) "8"
when we LPOP listTicket we will get number 2 and the mobile app with ticket 6 will calculate 6-2 and get 4 which is the wrong calculation.
Do you have any algorithm in mind? Is getting the index of every ticket in the list every time someone delete their ticket an expensive process to calculate? Should I just send all tickets in the queue and let the users calculate their own position?
I want the system to be scale-able. So can the redis-node server handle total of 50 thousands (over different queues or lists) connected mobile apps getting their ranking in the queue they subscribed their ticket to.
I thought about using ZRANK but how will this load the server?

Spring batch - multi threaded environment

I want to write a spring boot batch application where I have a database table full of events. What I want to do is have a multi threaded spring boot batch application which will work in this way:
I want to have 5 threads running each thread will keep an offset to track what event it has read so that no other thread reads the same event again. How am I thinking to do it:
Thread 1 will pick up the event if eventId % 5 == 1
Thread 2 will pick up the event if eventId % 5 == 2
Thread 2 will pick up the event if eventId % 5 == 3
Thread 2 will pick up the event if eventId % 5 == 4
Thread 2 will pick up the event if eventId % 5 == 0
so I want to be able to keep offset in a database table for each thread. Is there a way to make Spring boot environment to work in this way?
You can partition your table according to what you described (I guess you will have 5 partitions) and use a partitioned step configured with a TaskExecutorPartitionHandler of 5 threads. With this setup you will achieve what you are looking for.
Hope this helps.

JMeter - How to implement "N users fire up N different queries simultaneously" scenario

I have trouble implementing the following scenario and Google did't help - may be I am missing something obvious?
Scenario is :
Step 1. 9 sesssions simultaneously running 3 different JDBC queries, i.e
3*Q1,3*Q2,3*Q3 all starting and running at the same time
Clarification: In the beginning of step 1, the following queries will start in 9 different sessions - Q1,Q1,Q1,Q2,Q2,Q2,Q3,Q3,Q3
Step 2. 27 sessions like
above (9 times each query)
Step 3. 54 sessions (18 times each query)
Steps must run sequentially.
To do so:
Step 1)
3 thread groups, each one with 3 threads, each thread group calling a different Qi
Step2)
3 thread groups, each one with 9 threads, each thread group calling a different Qi with scheduler delayed so that it starts after step1 has finished
Step3)
Same as step2 with 18 threads and delayed so that it starts after step 2
But I must say I don't understand why you need such behaviour

Resources