directory-structure

Data structure used for directory structure?

醉酒当歌 提交于 2019-12-04 07:56:03
问题 I'm making a program which the user build directories (not in windows, in my app) and in these folders there are subfolders and so on; every folder must contain either folders or documents. What is the best data structure to use? Notice that the user may select a subfolder and search for documents in it and in its subfolders. And I don't want to limit the folders or the subfolders levels. 回答1: This is what I do: Every record in the database has two fields: ID and ParentID. IDs are 4-5

How to organize code so that we can move and update it without having to edit the location of the configuration file?

拈花ヽ惹草 提交于 2019-12-04 05:45:15
问题 The issue that I consider is how to write code that can easily know the location of a required config file and yet is portable, without any edit, from an environment to another. We don't want to edit the location of the configuration file to adapt the code to each new environment, say each time we move the code from a development environment to production. The method should not rely on resources that are not universally available, such as an access to user-defined environment variables or an

Measuring “closeness” in large source trees

♀尐吖头ヾ 提交于 2019-12-04 05:26:41
As part of a question I posed earlier about finding the best match between two sources , where one has an active git repo and the other has no git history, I wrote a perl script to find the closest git commit . I'm in the process of rewriting the script so that you don't have to guess at which branch to use, but it will run through and find the closest match in all branches, then tell you the best commit with the best branch. Unfortunately, I'm finding that the measurement I'm using may not be the best judge of "closeness." Currently, I use diff -burN -x.git my_git_subtree my_src_subtree | wc

What should the view file/directory structure be in ASP.NET MVC?

烂漫一生 提交于 2019-12-04 04:44:48
I'm confused with how views are organized, and it is important to understand this as ASP.NET MVC uses conventions to get everything working right. Under the views directory, there are subdirectories. Inside these subdirectories are views. I'm assuming that the subdirectories map to controllers, and the controllers act on the views contained within their subdirectories. Is there an emerging expectation of what types of views are contained within these directories? For instance, should the default page for each directory be index.aspx? Should the pages follow a naming convention such as Create

C++ project source code layout

别说谁变了你拦得住时间么 提交于 2019-12-04 03:51:09
One of the popular way to organize project directory is more or less like this: MyLib +--mylib_class_a.h mylib_class_a.cpp mylib_library_private_helpers.h mylib_library_private_helpers.cpp MyApp +--other_class.h other_class.cpp app.cpp app.cpp : #include "other_class.h" #include <mylib_class_a.h> // using library MyLib All .h and .cpp files for the same library are in the same directory. To avoid name collision, file names are often prefix with company name and/or library name. MyLib will be in MyApp's header search path, etc. I'm not a fan of prefixing filenames, but I like the idea of

Elegant way to take basename of directory in Python?

混江龙づ霸主 提交于 2019-12-04 02:13:15
I have several scripts that take as input a directory name, and my program creates files in those directories. Sometimes I want to take the basename of a directory given to the program and use it to make various files in the directory. For example, # directory name given by user via command-line output_dir = "..." # obtained by OptParser, for example my_filename = output_dir + '/' + os.path.basename(output_dir) + '.my_program_output' # write stuff to my_filename The problem is that if the user gives a directory name with a trailing slash, then os.path.basename will return the empty string,

Why place headers in a separate directory? [duplicate]

两盒软妹~` 提交于 2019-12-03 22:35:09
This question already has an answer here: Separate “include” and “src” folders for application-level code? [closed] 10 answers I know that it is common in C/C++ projects to place header files in a directory such as include and implementation in a separate directory such as src . I have been toying with different project structures and am wondering whether there any objective reasons for this or is it simply convention? Convention is one of the reasons - most of the time, with effective abstraction, you only care about the interface and want to have it easy just looking at the headers. It's not

Directory Structure for Cucumber + Maven + POM project under SRC & TEST folder

喜夏-厌秋 提交于 2019-12-03 20:37:03
I am looking for effective project Structure to manage it with POM, Cucumber(Feature and Step definition Files) under Maven's Src & test folders. What should be correct way to manage? Where to use Maven's src and test folder. Please Share. Thanks in Advance. Project Structure for a Maven project with Cucumber + POM base package contains Page object initialization class where it can be extended to all the page classes browser package contains the browser factory class which contains the methods to invoke Chrome, Firefox, IE etc., custom Exception package used to throw the custom messages

Git sparse checkout without leading directories [duplicate]

生来就可爱ヽ(ⅴ<●) 提交于 2019-12-03 14:35:26
This question already has an answer here: Checkout subdirectories in Git? 8 answers I understand how to configure a sparse checkout in Git, but I was wondering if it's possible to eliminate the leading directories. For example, say I have a Git repository with a folder structure like so: folder1/foo folder2/foo/bar/stuff folder3/another/foo/bar/stuff2 And I only want the contents inside stuff2 . For sparse checkout of those directories, the .git/info/spare-checkout file would look like this: folder3/another/foo/bar/stuff2/ My problem is after I'm finished with the sparse checkout, I don't see

C - Starting a big project. File/Directory structure and names. Good example required [closed]

丶灬走出姿态 提交于 2019-12-03 13:14:45
Closed. This question is off-topic. It is not currently accepting answers. Learn more . Want to improve this question? Update the question so it's on-topic for Stack Overflow. Starting a new big C multiplatform project, what rules should one follow to avoid difficulties later? For example, as a new developer, I can have difficulties to navigate myself around Linux Kernel source code - which is a good example of highly evolvable but hard-to-step-in software structure with incosistent directory structure (e.g. sound directory and arch in the same directory level). As a project-architect, what