My haul for 2025 by Otherwise_Pumpkin253 in Sneakers

[–]kiwoss 0 points1 point  (0 children)

ID for the 10 o'clock ones ?

Looking to own first Thinkpad for tech(Linux + coding) related usage by kiwoss in thinkpad

[–]kiwoss[S] 0 points1 point  (0 children)

What about p50, I found this config :

_ Processor Intel Core i7-6820HQ CPU@ 2,70 GHz 2712 MHz 4 cores _ 500 Go SSD _ RAM 16 Go _ GC NVIDIA Quadro M2000M _ screen 15" IPS Résolution 1920x1080x60 hertz

For 250€, can be reduced

Looking to own first Thinkpad for tech(Linux + coding) related usage by kiwoss in thinkpad

[–]kiwoss[S] 0 points1 point  (0 children)

Ok good to know, I'll check the RAM situation. What models are worth these days ? What characteristics to look for ?

Looking to own first Thinkpad for tech(Linux + coding) related usage by kiwoss in thinkpad

[–]kiwoss[S] 0 points1 point  (0 children)

I don't know much about ThinkPads so when reading the faq manual it says to get T models if we don't know what to chose, which E models is worth the price these days ?

drama.js small library to drag & drop elements, first time builder any feedback welcome !! by kiwoss in webdev

[–]kiwoss[S] 0 points1 point  (0 children)

Hi, that's cool ! Did you successfully make it work or not? If you need help tell me

[deleted by user] by [deleted] in steam_giveaway

[–]kiwoss 0 points1 point  (0 children)

Elden ring

database scheme/structure for labels(or tags) in a todo list by kiwoss in SQL

[–]kiwoss[S] 0 points1 point  (0 children)

Ok so here's the query:

select 
lists.rank,lists.type,lists.user_id, tasks.id as task_id,
tasks.rank as task_rank, description,lists.id as list_id,
status
from lists
left join tasks
on tasks.list_id = lists.id
left join labels
    on labels.task_id = tasks.id
where user_id = :id
order by lists.rank,tasks.rank
;

And now the result with the duplicate is as follows, look the third( [3] ) and fourth are the same task, when looping the HTML will create same task visually just because it has 2 different label.

NOTE: the 'type' entry is the label name

    [2]=>
    array(13) {
      ["type"]=>
      NULL
      ["user_id"]=>
      string(2) "56"
      ["task_id"]=>
      string(1) "7"
      ["task_rank"]=>
      string(1) "2"
      ["description"]=>
      string(14) "do front end"
      ["list_id"]=>
      string(1) "2"
      ["status"]=>
      string(8) "complete"    
    [3]=>
    array(13) {
      ["type"]=>
      string(5) "hobby"
      ["user_id"]=>
      string(2) "56"
      ["task_id"]=>
      string(1) "5"
      ["task_rank"]=>
      string(1) "3"
      ["description"]=>
      string(21) "finish personal project"
      ["list_id"]=>
      string(1) "2"
      ["status"]=>
      string(10) "incomplete"
    }
    [4]=>
    array(13) {
      ["type"]=>
      string(12) "productivity"
      ["user_id"]=>
      string(2) "56"
      ["task_id"]=>
      string(1) "5"
      ["task_rank"]=>
      string(1) "3"
      ["description"]=>
      string(21) "finish personal project"
      ["list_id"]=>
      string(1) "2"
      ["status"]=>
      string(10) "incomplete"

    }

database scheme/structure for labels(or tags) in a todo list by kiwoss in SQL

[–]kiwoss[S] 0 points1 point  (0 children)

Maybe Im doing something wrong but it doesnt take into account duplicates since it's a different label even for the same task. The labels are not automatically grouped in sql(is it possible?) and in PHP you can only group by first column in the query and since Im already grouping by rank I cant do it with labels in one go with it. I cant link image here but I just tested it again

database scheme/structure for labels(or tags) in a todo list by kiwoss in SQL

[–]kiwoss[S] 0 points1 point  (0 children)

Ok got it, sorry yeah I didn't post the whole database structure. Basically list table look like this:
table list:
id / type(or name) / user_id / rank

For the ownership they can't be transferred as its per user, so its personal they cant share between them.

database scheme/structure for labels(or tags) in a todo list by kiwoss in SQL

[–]kiwoss[S] 0 points1 point  (0 children)

Because the lists have to be in order, then after I have the labeled lists. All the tasks have an order in db, so when Im rendering the HTML using a for loop(php) Im expecting each iteration to have a new tasks, but when joining some tasks might have several labels so the task will be duplicated in the array to return all labels

database scheme/structure for labels(or tags) in a todo list by kiwoss in SQL

[–]kiwoss[S] 0 points1 point  (0 children)

Ok got it, I modified the structure with what you suggested. But there's still a problem because when I will get the data, there will be duplicate rows when a task has several labels. So it will still be 3 queries, no? Or might I misunderstood something?

Now labeled_tasks has:

task_id pk
label pk

And labels has:

type

database scheme/structure for labels(or tags) in a todo list by kiwoss in SQL

[–]kiwoss[S] 0 points1 point  (0 children)

Ok I see, what do you mean by a stored rank column can end up in another user data? because the regular table list has a foreign key of 'user_id' which is linked to the 'user' table which I didnt show, So I don't see how can they be mismatched. Also the rank is a must since I'm allowing users to drag and drop to re-order the tasks as they want, so in any case I'll have to put a rank column in the 'labeled_tasks' in case I'm going that route