find the same files

  • 1 Replies
  • 2223 Views
*

f.atyeh

  • Roomba
  • *
  • 1
find the same files
« on: February 08, 2015, 12:13:47 pm »
I have some files and I want to group them. these files include the name of images. I count the same images and sort them descending and chose 10 images with highest rate . so final files include 10 images and their rates. For example :
file f1: image a1 wirh rate m1
image a2 with rate m2 , ...
file f2 : image a2 with rate n1
image a3 with rate n2 , ...
and other files ...
Kind of images are unlimited.
The rate and kind of images both are important for me. now I want to find same files based on these 2 items.
These files may have overlap too .for example f1 , f2 , f9 are in the same group, f2 , f4 , f5 are in the same. f2 has overlap.
How can I group them in your idea.
Thanks,

*

8pla.net

  • Trusty Member
  • ***********
  • Eve
  • *
  • 1307
  • TV News. Pub. UAL (PhD). Robitron Mod. LPC Judge.
    • 8pla.net
Re: find the same files
« Reply #1 on: February 08, 2015, 04:32:30 pm »
Worth consideration may be multidimensional arrays which contain one or more arrays. 

Pseudocode version 0.1:
Code
$image=array (
  0 => 'a1',
  1 => 'a2',
  2 => 'a3',
  3 => 'a4',
);

$rate=array (
  0 => 'm1',
  1 => 'm2',
  2 => 'n1',
  3 => 'n2',
);

$file=array (
  0 =>
  array (
    0 => 'a1',
    1 => 'm1',
  ),
  1 =>
  array (
    0 => 'a2',
    1 => 'm2',
  ),
  2 =>
  array (
    0 => 'a3',
    1 => 'n1',
  ),
  3 =>
  array (
    0 => 'a4',
    1 => 'n2',
  ),
);

This may be one of the simplest approaches to consider.  And it can be further customized to the exact requirement.  But I think is should be part of the discussion.   Then we have consideration of the more advanced  possibilities to discuss, which of course becomes more exciting.
My Very Enormous Monster Just Stopped Using Nine

 


LLaMA2 Meta's chatbot released
by spydaz (AI News )
August 24, 2024, 02:58:36 pm
ollama and llama3
by spydaz (AI News )
August 24, 2024, 02:55:13 pm
AI controlled F-16, for real!
by frankinstien (AI News )
June 15, 2024, 05:40:28 am
Open AI GPT-4o - audio, vision, text combined reasoning
by MikeB (AI News )
May 14, 2024, 05:46:48 am
OpenAI Speech-to-Speech Reasoning Demo
by MikeB (AI News )
March 31, 2024, 01:00:53 pm
Say good-bye to GPUs...
by MikeB (AI News )
March 23, 2024, 09:23:52 am
Google Bard report
by ivan.moony (AI News )
February 14, 2024, 04:42:23 pm
Elon Musk's xAI Grok Chatbot
by MikeB (AI News )
December 11, 2023, 06:26:33 am

Users Online

346 Guests, 0 Users

Most Online Today: 365. Most Online Ever: 2369 (November 21, 2020, 04:08:13 pm)

Articles