Programming Question

87 views
Skip to first unread message

James Carl Necio

unread,
Jan 15, 2014, 6:15:29 AM1/15/14
to clean-code...@googlegroups.com
Hi Everyone,

I'm a newbie in software engineering, and I think that my question is not valid for a clean code discussion but I will ask anyways since it is still related to programming.
I have a directory with over 900,000 files and folders in all, now the question is how will I show all of the files and folders inside a JTable.
Yes I'm using java and not only I need to show this in a table but the table should also have the size, name and directory of that file/folder and an indication if the file is a file or a directory.

Any answers will be really appreciated :)
and will be posting my inquiries on clean code after this directory dilemma.

Sebastian Gozin

unread,
Jan 16, 2014, 11:37:15 AM1/16/14
to clean-code...@googlegroups.com
This is indeed a bit of a tricky question as I don't wish to tell you of. But at the same time I don't want to write the application for you.
Perhaps there is something else we could try...

Which things do you know how to do already that could bring you closer to a solution?
Perhaps we could suggest some next steps you might look at while you explore a way to a solution.

For example:
- do you know how to list the files in a directory?
- do you know how to populate a JTable with a bunch of labels?

Cheers,
- Sebastian

James Green

unread,
Jan 16, 2014, 11:40:31 AM1/16/14
to clean-code...@googlegroups.com
Anyone with 900,000 data entities needs to work out how it is categorised. From that a search interface can be designed to meet the needs of the user rather than the needs of the software.


--
The only way to go fast is to go well.
---
You received this message because you are subscribed to the Google Groups "Clean Code Discussion" group.
To unsubscribe from this group and stop receiving emails from it, send an email to clean-code-discu...@googlegroups.com.
To post to this group, send email to clean-code...@googlegroups.com.
Visit this group at http://groups.google.com/group/clean-code-discussion.

Sebastian Gozin

unread,
Jan 16, 2014, 12:24:11 PM1/16/14
to clean-code...@googlegroups.com
James,

While you are certainly correct don't you think it's a bit too soon to jump to abstract concepts such as search interfaces and categories?
I mean the OP didn't provide us with any context of what he tried or knows how to do. Which lead me to ignore the actual number of files he needs to deal with as I'm not sure their sheer number is the problem.


On Thursday, January 16, 2014 5:40:31 PM UTC+1, James Green wrote:
Anyone with 900,000 data entities needs to work out how it is categorised. From that a search interface can be designed to meet the needs of the user rather than the needs of the software.
On 15 January 2014 11:15, James Carl Necio <jcne...@gmail.com> wrote:
Hi Everyone,

I'm a newbie in software engineering, and I think that my question is not valid for a clean code discussion but I will ask anyways since it is still related to programming.
I have a directory with over 900,000 files and folders in all, now the question is how will I show all of the files and folders inside a JTable.
Yes I'm using java and not only I need to show this in a table but the table should also have the size, name and directory of that file/folder and an indication if the file is a file or a directory.

Any answers will be really appreciated :)
and will be posting my inquiries on clean code after this directory dilemma.

--
The only way to go fast is to go well.
---
You received this message because you are subscribed to the Google Groups "Clean Code Discussion" group.
To unsubscribe from this group and stop receiving emails from it, send an email to clean-code-discussion+unsub...@googlegroups.com.

James Green

unread,
Jan 16, 2014, 12:28:50 PM1/16/14
to clean-code...@googlegroups.com
He asked how to how 900,000 entries in a JTable. I sent him back to ask the business how they'd like the interface to look. Guiding him into a discussion may well lead to a completely new product which these days is search powered. No need to take my advice though.


To unsubscribe from this group and stop receiving emails from it, send an email to clean-code-discu...@googlegroups.com.

Sebastian Gozin

unread,
Jan 16, 2014, 12:42:41 PM1/16/14
to clean-code...@googlegroups.com
I agree it's probably useful to figure out why that number is so large. I guess that's a good third question.


On Thursday, January 16, 2014 6:28:50 PM UTC+1, James Green wrote:
He asked how to how 900,000 entries in a JTable. I sent him back to ask the business how they'd like the interface to look. Guiding him into a discussion may well lead to a completely new product which these days is search powered. No need to take my advice though.
On 16 January 2014 17:24, Sebastian Gozin <s...@thinkerit.be> wrote:
James,

While you are certainly correct don't you think it's a bit too soon to jump to abstract concepts such as search interfaces and categories?
I mean the OP didn't provide us with any context of what he tried or knows how to do. Which lead me to ignore the actual number of files he needs to deal with as I'm not sure their sheer number is the problem.


On Thursday, January 16, 2014 5:40:31 PM UTC+1, James Green wrote:
Anyone with 900,000 data entities needs to work out how it is categorised. From that a search interface can be designed to meet the needs of the user rather than the needs of the software.
On 15 January 2014 11:15, James Carl Necio <jcne...@gmail.com> wrote:
Hi Everyone,

I'm a newbie in software engineering, and I think that my question is not valid for a clean code discussion but I will ask anyways since it is still related to programming.
I have a directory with over 900,000 files and folders in all, now the question is how will I show all of the files and folders inside a JTable.
Yes I'm using java and not only I need to show this in a table but the table should also have the size, name and directory of that file/folder and an indication if the file is a file or a directory.

Any answers will be really appreciated :)
and will be posting my inquiries on clean code after this directory dilemma.

--
The only way to go fast is to go well.
---
You received this message because you are subscribed to the Google Groups "Clean Code Discussion" group.
To unsubscribe from this group and stop receiving emails from it, send an email to clean-code-discussion+unsubscri...@googlegroups.com.
To post to this group, send email to clean-code...@googlegroups.com.

James Carl Necio

unread,
Jan 16, 2014, 9:20:37 PM1/16/14
to clean-code...@googlegroups.com
Hi! Thanks for the replies!

Why do I have 900k files: because in the current system they create a few log files per hour and that is the product of many months of log creation.
What I have done so far: I have created a tree model that shows only the tree nodes of the root directory then loads the sub-directories when the children of that node needs to be shown.
What the problem is: It provides a seemingly fast way to show the next level of nodes to the tree, but it instances like if the directory to be loaded contains many sub-directories again, the problem still occurs and it would take a very long time to show them and sometimes crashes the whole system because of loading such many directories.

Sorry for not clearing things out in my OP this is my first time to join a discussion group. And I am not asking any code to be written. I just want to learn the flow so that I can implement it based on my understanding. Sorry I just graduated last year and these things are never taught during college.

Roberto Guerra

unread,
Jan 17, 2014, 12:25:22 AM1/17/14
to clean-code...@googlegroups.com
I think you are focusing too much on the 'HOW'. You have a solution in mind but it might not really match what the business need is. This is what I kind of deciphered from your posts:

You want a way to view the logs outputted by something, and these logs can grow in size considerably.

As an aside, keeping logs for that long is not such a good idea, IMO. If something bad happened a month ago that was not caught because the logs were not being processed properly, then there is something wrong in their process, and a software 'solution' won't solve their bigger problem.

Also there are some neat tools already out there to deal with processing logs. Have a look at Kibana http://rashidkpc.github.io/Kibana/ .
Reply all
Reply to author
Forward
0 new messages