What's the best database pagination technique - Offset or Cursor? medium.com/@matejbaco2000…
πŸ‘︎ 7
πŸ’¬︎
πŸ‘€︎ u/thecouchdev
πŸ“…︎ Jan 19 2022
🚨︎ report
What's the best database pagination technique - Offset or Cursor? medium.com/@matejbaco2000…
πŸ‘︎ 8
πŸ’¬︎
πŸ‘€︎ u/thecouchdev
πŸ“…︎ Jan 19 2022
🚨︎ report
Is there a practical use case for database cursors in MySQL?

I can see you can fetch multiple cols in MySQL using cursors but I also can see there are a lot steps to making and using cursors (explicit) so I am wondering what are the real scenarios where cursors are used?

πŸ‘︎ 2
πŸ’¬︎
πŸ‘€︎ u/hyperactiveowl
πŸ“…︎ Jan 21 2021
🚨︎ report
Like many, I have having karma issues, also my age keeps shifting from 9 years to 1. However, I have a video! I think you have a cursor error in your database. v.redd.it/jg9qz39lo6t61
πŸ‘︎ 5
πŸ’¬︎
πŸ‘€︎ u/TychaBrahe
πŸ“…︎ Apr 14 2021
🚨︎ report
I click an item in a database and bring up the item's "page" in a modal. The cursor is immediately in the title field blinking. Is there a way to not have it do that?

If I click an item in a database, I just want to view the modal at first, not immediately jump into editing the title or another field.

πŸ‘︎ 2
πŸ’¬︎
πŸ‘€︎ u/DevBot9
πŸ“…︎ Sep 07 2020
🚨︎ report
Retrieve and match highlighted text with a database via cursor highlighting, in any window, then show matched output

I'm looking to code something where I wanna be able to hightlight some text in any window (or basically anywhere on my PC), retrieve it into a database, where I match it with another value and ultimately give an output of the matched value in the database.

For example I highlight the number 1 in a text, it goes into the database, finds the value 1, matches it with the value I decided, and creates an output of that value in a similar style to that. I've looked a bit into C# but I'm kind of a real noobie, so any advice on where to start and which language to use is greatly appreciated. Thanks!

πŸ‘︎ 2
πŸ’¬︎
πŸ‘€︎ u/captainbastion
πŸ“…︎ Jul 06 2020
🚨︎ report
Is a cursor used from Python Packages like psychopg2 and pyodbc completely different than a database cursor?

Disclaimer: I posted this to StackOverflow last week and didn't receive any responses and to the cs50 subreddit and haven't received any responses. Googled all over and couldn't find an answer. Hoping someone here can concretely say "these are two different things that are just named the same"

When you query a database from Python using a library like psycopg2 and pyodbc you create a connection and then open a cursor with that connection.

pyodbc example

import pyodbc   
myconnection = pyodbc.connect(<my connection info>)   
mycursor = myconnection.cursor()   
mycursor.execute('Select * From Sometable') 

So in this case is the cursor just what is used to communicate with the database?

From the psycopg2 documentation

" class cursor

Allows Python code to execute PostgreSQL command in a database session. "

To me this is totally different than a cursor used in SQL Server Management Studio or PgAdmin4 which works on one row at a time. Can someone confirm that these are two completely different things that are just unfortunately named the same thing?

πŸ‘︎ 2
πŸ’¬︎
πŸ‘€︎ u/Scalar_Mikeman
πŸ“…︎ Dec 05 2019
🚨︎ report
YSK: To move your cursor to a specific position on your phone, you can (for Android) swipe on your spacebar or (for iOS) long-press the spacebar and move without lifting your thumb.

Why YSK: It gets annoying when you need to edit a typo and have to erase the whole word just to correct it. With this feature, you can precisely move the cursor around your typed content without having to gnash.

Edit: Bonus YSK:

β€’ On Android, you can tap and swipe left from your backspace icon to delete whole words or sentences.

β€’ You can tap and hold the caps lock icon and drag your thumb to any letter to quickly get an uppercase letter.

πŸ‘︎ 6k
πŸ’¬︎
πŸ‘€︎ u/abhijeet_bohra
πŸ“…︎ Jan 21 2022
🚨︎ report
Implementing cursor-based pagination at the API gateway level

Scenario: My team is using GraphQL (apollo server without federation) as an API gateway. We started with a simple offset-based paging model I’m interested in proposing that we adopt (or at least consider adopting) the Relay Cursor Connections Specification for maximum flexibility on the frontend.

Did some digging and sifting through the Apollo docs, Relay docs, as well as some other generic resources. By all accounts, due to infrequent changes and lack of need for infinite scroll, we’ve decided that a simple β€œpage” (or offset/limit) is straightforward enough.

However, for specification reasons, could it be worthwhile to expose the cursor spec at the API gateway layer, even if the cursor value only contains the next page (instead of an id/timestamp). Seems like a bit more effort but might pay off if it lets us change the underlying pagination scheme without breaking any frontend code

πŸ‘︎ 6
πŸ’¬︎
πŸ‘€︎ u/YungSparkNote
πŸ“…︎ Dec 02 2021
🚨︎ report
[MS SQL] - Useful Cursor Scenario for Blog Database

I created this blog database for my final project. I've completed every requirement for the project except one: creating a cursor.

I know how to write cursors, I know they are next to useless, and I can BS an impractical, unnecessary cursor in a heartbeat to get my points.

I'd much rather demonstrate a useful cursor example (in context to my blog structure) and actually learn something about practical cursor useage.

Can anyone think of a practical scenario?

Keep in mind: This database isn't bound to an application and I have to be able to execute it to prove it works.


Edit: I created a cursor using the advice of u/narayanis. I'd like to share it in case someone in a similar predicament stumbles into this post:

CREATE PROCEDURE MergeCategories
(
	@OldCatOne as int,
	@OldCatTwo as int,
	@NewCatName as varchar(50),
	@NewCatCleanName as varchar(50)
)
AS

DECLARE @NewCatID as int
SET @NewCatID = coalesce((select max(CATEGORY_ID) + 1 FROM CATEGORY), 1)

DECLARE @CatID as int
DECLARE @PostID as int

DECLARE merge_categories CURSOR FOR
	SELECT CATEGORY_ID, POST_ID
	FROM POST_CATEGORY
	WHERE CATEGORY_ID = @OldCatOne
	OR CATEGORY_ID = @OldCatTwo

OPEN merge_categories;

FETCH NEXT FROM merge_categories INTO @CatID, @PostID;

WHILE @@FETCH_STATUS=0
BEGIN
	DELETE FROM POST_CATEGORY WHERE CATEGORY_ID = @CatID AND POST_ID = @PostID

	INSERT INTO CATEGORY (CATEGORY_ID, CATEGORY, CATEGORY_CLEAN)
	VALUES (@NewCatID, @NewCatName, @NewCatCleanName)

	INSERT INTO POST_CATEGORY (CATEGORY_ID, POST_ID)
	VALUES (10, @PostID)
FETCH NEXT FROM merge_categories INTO @CatID, @PostID;
END
CLOSE merge_categories
DEALLOCATE merge_categories
πŸ‘︎ 3
πŸ’¬︎
πŸ‘€︎ u/TheTacoWhisperer
πŸ“…︎ May 14 2017
🚨︎ report
If I append results to a list from an sqlite3 cursor.execute, can I access those results even if the connection to the database is closed?

Say I do this:

import sqlite3
species = 'dog'
conn = sqlite3.connect('database.db')
cursor = conn.execute('SELECT * FROM cards where species like ?, (species, ))

k9s = []
for result in (cursor.fetchall()):
      k9.append(result)

 conn.close()

Can I then do something like this:

#Connection is still closed
print(k9s[3])

Thanks for reading.

πŸ‘︎ 5
πŸ’¬︎
πŸ‘€︎ u/AlexAndThunder
πŸ“…︎ Jan 20 2018
🚨︎ report
Blinking cursor at shutdown - how to troubleshoot?

As per title, my TW installation is doing this more and more as of late.

I would shutdown from my KDE session, and a blank screen with a blinking cursor would appear.

If I leave it alone for a while (a long while, like a few minutes!) it evenually shows the OEM screen with the tumbleweed logo underneath, and a few secs later it finally shuts down.

If I arrow up while the cursor is blinking, I get a tty for login.

Could someone kindly advise some troubleshooting steps?

journalctl -br -1 seems to stop at the session logout, and logout seems to happen in a snappy fashion (18:34:02 Activating service name='org.kde.LogoutPrompt' until 18:34:05 Reached target Exit the Session), so I suspect the hang is happening after, but I dunno which logs to check for that.

-- Journal begins at Fri 2021-12-10 13:44:40 CET, ends at Tue 2022-01-04 08:46:43 CET. --
gen 03 18:34:05 inspiron systemd[1771]: Reached target Exit the Session.
gen 03 18:34:05 inspiron systemd[1771]: Finished Exit the Session.
gen 03 18:34:05 inspiron systemd[1771]: Reached target Shutdown.
gen 03 18:34:05 inspiron systemd[1771]: app.slice: Consumed 11min 40.266s CPU time.
gen 03 18:34:05 inspiron systemd[1771]: Removed slice User Application Slice.
gen 03 18:34:05 inspiron systemd[1771]: Stopped Create User's Volatile Files and Directories.
gen 03 18:34:05 inspiron systemd[1771]: Closed PipeWire Multimedia System Socket.
gen 03 18:34:05 inspiron systemd[1771]: Closed PipeWire PulseAudio.
gen 03 18:34:05 inspiron systemd[1771]: Closed D-Bus User Message Bus Socket.
gen 03 18:34:05 inspiron systemd[1771]: Stopped Daily Cleanup of User's Temporary Directories.
gen 03 18:34:05 inspiron systemd[1771]: Stopped target Timers.
gen 03 18:34:05 inspiron systemd[1771]: Stopped target Sockets.
gen 03 18:34:05 inspiron systemd[1771]: Stopped target Paths.
gen 03 18:34:05 inspiron systemd[1771]: Stopped target Basic System.
gen 03 18:34:05 inspiron systemd[1771]: session.slice: Consumed 3min 10.982s CPU time.
gen 03 18:34:05 inspiron systemd[1771]: Removed slice User Core Session Slice.
gen 03 18:34:05 inspiron systemd[1771]: pipewire.service: Consumed 1min 9.002s CPU time.
gen 03 18:34:05 inspiron systemd[1771]: Stopped PipeWire Multimedia Service.
gen 03 18:34:05 inspiron systemd[1771]: Stopping PipeWire Multimedia Service...
gen 03 18:34:05 inspiron systemd[1771]: wireplumber.service: Consumed 2.670s CPU time.
gen 03 1
... keep reading on reddit ➑

πŸ‘︎ 5
πŸ’¬︎
πŸ‘€︎ u/andreaippo
πŸ“…︎ Jan 04 2022
🚨︎ report
Cursors and loops in Databases, Adding Exception Logging, the "require `requires requires`" syntax mailchi.mp/humanreadablem…
πŸ‘︎ 3
πŸ’¬︎
πŸ‘€︎ u/pekalicious
πŸ“…︎ Jan 29 2019
🚨︎ report
There’s already a cursor in the ad please someone just add β€œsave as.” It’s right outside Richmond station.
πŸ‘︎ 372
πŸ’¬︎
πŸ‘€︎ u/AnotherNetAlias
πŸ“…︎ Jan 26 2022
🚨︎ report
[OC] Phinger Cursors - your new cursor theme
πŸ‘︎ 2k
πŸ’¬︎
πŸ‘€︎ u/phisch90
πŸ“…︎ Jan 26 2022
🚨︎ report
Database connections and cursors... when should I create new cursors And what about SA sessions?

When using a DBAPI2 conformant library, you first have to connect to the database, then get a cursor for that connection. I understand the very basics of cursors. But what I am unsure about is when to create a new cursor. Should I make a new cursor for each query, make one per logical transaction or just simply have one cursor per application instance?

My gut tells me it's one of the first two...

Then there are SQLAlchemy sessions. Using SA, you get a "sessionmaker" which is basically a factory for sessions. This, to me, is a hint that you may want more than one session. But why? Should I go on the same feeling as I have for cursors/connections?

This is especially important to me for web-applications. I come from a PHP background, where essentially each requests "re-runs" the whole application. But a WSGI based app usually keeps running on the server. And if you have to deal with concurrent access, optimistic locking and all the related headaches, the questions about cursors and sessions becomes especially important.

Let's take Flask as an example. You can use before_request and teardown_request to create/close a session/cursor. But is this the correct way to do it? What if the user starts an operation which spans multiple HTTP requests and you want to do it in one transaction? What then?

πŸ‘︎ 8
πŸ’¬︎
πŸ‘€︎ u/exhuma
πŸ“…︎ Nov 20 2012
🚨︎ report
[DEV][SALE] Quick Cursor: One-Handed mode for big phones. PRO is on sale 0.99$ and 100 free promo codes

Edit: No more promo codes available


About Quick Cursor app

It is a free app with no ads that makes it easier to use large smartphones with one hand by using a cursor controlled with one finger by swiping from edge of the screen.

It also has a PRO (2.49$ -> 0.99$ on sale) in-app purchase that offers more customizations and some extra features:

  • more gestures: long click, swipe, scroll, drag and drop, etc
  • floating tracker mode (like a floating bubble on the edge)
  • edge actions triggered by the cursor
  • blacklist/whitelist
  • and others

Play Store link: https://play.google.com/store/apps/details?id=com.quickcursor


History

The app was launched here on Reddit, and this is the third post about the app, so if you want to read more info about the journey, you can check this topics:

Thanks to everyone that helped me improve this app in the last two years with almost 100 updates, from first early access version 22 to current version 115.

You can check the changelog: image, XML, Text


If you want to help

  • Leave a rate or a review on Play Store
  • help with translations here: Quick Cursor project on OneSkyApp (the translation app works better on desktop)
  • feedback: bugs and improvement ideas
  • buy the PRO version to support my work
  • share the app to anyone that might be interested

Sale and promo codes

The sale for PRO version (0.99$) will be available for 2 weeks starting from today: 17 - 31 January

The 100 free promo codes will be given here: 1 per account, just comment or send me a private message (not fake Reddit accounts without history or created in the last days). I will respond in chronological order, as fast as possible.

Please don't forget to Rate the app on Play Store.

... keep reading on reddit ➑

πŸ‘︎ 115
πŸ’¬︎
πŸ‘€︎ u/micku7zu
πŸ“…︎ Jan 17 2022
🚨︎ report
One sneeze and that cursor is gone forever
πŸ‘︎ 13k
πŸ’¬︎
πŸ‘€︎ u/rameneater23
πŸ“…︎ Dec 18 2021
🚨︎ report
cursor debate
πŸ‘︎ 2k
πŸ’¬︎
πŸ‘€︎ u/Asrikuuu
πŸ“…︎ Jan 05 2022
🚨︎ report
Question about database cursors and memory

I have several databases I've been asked to write some python programs for that have rather large datasets. One of the requests is the ability to dump a table into a CSV file. I can do this at a basic level but my understanding is that the cursor.execute() method is going to pull the entire resultset over into memory at once. I've seen the SScursor that MySQLdb supports but some of the libraries I'm having to use do not support that method or at least not obviously (using cx_oracle and JayDeBeAPI). Any ideas on how not to gobble up all my memory? Some of these tables are > 100 gb in size.

πŸ‘︎ 2
πŸ’¬︎
πŸ‘€︎ u/dasnoob
πŸ“…︎ Feb 26 2016
🚨︎ report
[OC] Phinger Cursors - your new cursor theme
πŸ‘︎ 350
πŸ’¬︎
πŸ‘€︎ u/phisch90
πŸ“…︎ Jan 26 2022
🚨︎ report
can we get a scale setting to increase speed of the Destiny Cursor on Console?

You know? The round circle in which you use to click on things in the menus. I only ask because it's definitely too slow and M&K can just zip across screens. I know it's easy for M&K because it ain't an analog stick and it's way easier to have such a flexible speed but I know I can handle a higher speed than what we have.

Edit: And Deadzone

Edit 2: Hot damn thanks for the rewards fellas.

πŸ‘︎ 727
πŸ’¬︎
πŸ‘€︎ u/Experiment_Magnus
πŸ“…︎ Jan 07 2022
🚨︎ report
How can I retrieve multiple elements by random in a database using sqlstatement with sqlite?

I'm trying to create a quiz app with a database with two tables one for topics and one for the questions. The topicsID is a Foreign key in my questions table. I want to retrieve 2 random questions from each topicID there is 7 topics, so far I have only tried retrieving one topic but Idk how to retrieve the rest in the same function. I want to retrieve 2 random questions for each topic and put that in an array. IΒ΄m writing in Kotlin using sqlite.

val qList = ArrayList<MathQuestions>()

val db: SQLiteDatabase = this.readableDatabase

var sqlStatement = "SELECT * FROM $QuestionTableName WHERE $QTopicColumn_ID = '1' ORDER BY RAND() LIMIT 2"

val cursor: Cursor = db.rawQuery(sqlStatement, null)

πŸ‘︎ 6
πŸ’¬︎
πŸ‘€︎ u/SirenOcean
πŸ“…︎ Jan 19 2022
🚨︎ report
I ordered a mouse from wish, but my cursor didn't move, any solutions?
πŸ‘︎ 6k
πŸ’¬︎
πŸ‘€︎ u/CG-ZenDex
πŸ“…︎ Nov 30 2021
🚨︎ report
GW2 shutdown post debunked (presumably), there's no cursor on console
πŸ‘︎ 279
πŸ’¬︎
πŸ‘€︎ u/Leonid56
πŸ“…︎ Jan 04 2022
🚨︎ report
So I was gonna Ashe Ult the Cait but my cursor went on the minimap and shot the opposite direction v.redd.it/va0e2bxknix71
πŸ‘︎ 10k
πŸ’¬︎
πŸ‘€︎ u/jonahamundsen
πŸ“…︎ Nov 04 2021
🚨︎ report
I noticed Chubby was tracking the cursor as I used the computer and got curious what he would do if I played a vid of bugs crawling across the screen v.redd.it/qst4hmvw3l981
πŸ‘︎ 669
πŸ’¬︎
πŸ‘€︎ u/tastemebakes
πŸ“…︎ Jan 04 2022
🚨︎ report
Mahmood | Royal Blood - Loose Change [$] + HDDT (7.88*) 99.20% FC #10 646pp | 84.11 cv.UR | done with frogy cursor
πŸ‘︎ 171
πŸ’¬︎
πŸ‘€︎ u/-P4905-
πŸ“…︎ Jan 23 2022
🚨︎ report
You can cursor carry an item into new games, has this always been a thing? v.redd.it/v0q0vnt1qqa81
πŸ‘︎ 88
πŸ’¬︎
πŸ‘€︎ u/StrifeFanfare
πŸ“…︎ Jan 09 2022
🚨︎ report
Ever notice the Mac cursor on the console in VOY Ep: Good Shepherd v.redd.it/jhg5ag6yul981
πŸ‘︎ 230
πŸ’¬︎
πŸ‘€︎ u/try315
πŸ“…︎ Jan 04 2022
🚨︎ report
The Blue Thingy That Happens When You Click And Hold The Mouse Then Move The Cursor Made An "L" Rule
πŸ‘︎ 403
πŸ’¬︎
πŸ“…︎ Jan 12 2022
🚨︎ report
I made my custom texture-pack just like in minecraft includes (oof sound, moon and star, menu, cursor) it's still in progress reddit.com/gallery/rbrteb
πŸ‘︎ 1k
πŸ’¬︎
πŸ‘€︎ u/NOTmigjaypogi324
πŸ“…︎ Dec 08 2021
🚨︎ report
Whenever I move my mouse, it moves my cursor. v.redd.it/4j96d67lsl881
πŸ‘︎ 626
πŸ’¬︎
πŸ‘€︎ u/kshark12
πŸ“…︎ Dec 30 2021
🚨︎ report
Sanity Check. Cursor used from Python Packages like psychopg2 and pyodbc are completely different than a database cursor....Correct?

When you query a database from Python using a library like psycopg2 and pyodbc you create a connection and then open a cursor with that connection.

pyodbc example

import pyodbc  
myconnection = pyodbc.connect(&lt;my connection info&gt;)  
mycursor = myconnection.cursor()  
mycursor.execute('Select * From Sometable')

So in this case is the cursor just what is used to communicate with the database?

From the psycopg2 documentation

" class cursor

Allows Python code to execute PostgreSQL command in a database session. "

To me this is totally different than a cursor used in SQL Server Management Studio which works on one row at a time. Can someone confirm that these are two completely different things that are just unfortunately named the same thing?

πŸ‘︎ 2
πŸ’¬︎
πŸ‘€︎ u/Scalar_Mikeman
πŸ“…︎ Dec 05 2019
🚨︎ report

Please note that this site uses cookies to personalise content and adverts, to provide social media features, and to analyse web traffic. Click here for more information.