file-organization

User-files organization in a Web server

感情迁移 提交于 2020-01-24 22:44:27
问题 I'm developing a Web application where users can upload files. Suppose to have different file categories, e.g. audio and docs . I guess I can put all the files that belongs from a category in a unique folder, e.g.: audio_dir -file_from_user1.mp3 -another_file_from_user1.mp3 -file_from_user2.mp3 -file_from_user4.mp3 docs_dir -file_from_user1.doc -file_from_user5.pdf The other solution I'm evaluating uses a third level, where files are grouped by users. audio_dir user1_dir -file_from_user1.mp3

On XP, best way to synchronize files and folders [closed]

前提是你 提交于 2019-12-20 09:45:33
问题 Closed. This question is off-topic. It is not currently accepting answers. Want to improve this question? Update the question so it's on-topic for Stack Overflow. Closed 2 years ago . I'm using SyncToy 1.4 and it would be fine for what I need except that: It can't handle the assigned drive letter changing between systems (e.g. syncing a USB drive), it leaves its own (hidden) files in the folders being synched (is this a limitation of the OS/FS?), it recreates empty folders for ones that have

Should I put many functions into one file? Or, more or less, one function per file?

半城伤御伤魂 提交于 2019-12-18 15:17:37
问题 I love to organize my code, so ideally I want one class per file or, when I have non-member functions, one function per file. The reasons are: When I read the code I will always know in what file I should find a certain function or class. If it's one class or one non-member function per header file, then I won't include a whole mess when I include a header file. If I make a small change in a function then only that function will have to be recompiled. However, splitting everything up into

How to split an ansible role's `defaults/main.yml` file into multiple files?

给你一囗甜甜゛ 提交于 2019-12-04 02:59:20
In some ansible roles (e.g. roles/my-role/ ) I've got quite some big default variables files ( defaults/main.yml ). I'd like to split the main.yml into several smaller files. Is it possible to do that? I've tried creating the files defaults/1.yml and defaults/2.yml , but they aren't loaded by ansible. The feature I'm describing below has been available since Ansible 2.6, but got a bugfix in v2.6.2 and another (minor) one in v2.7. To see a solution for older versions, see Paul's answer. defaults/main/ Instead of creating defaults/main.yml , create a directory — defaults/main/ — and place all

On XP, best way to synchronize files and folders [closed]

女生的网名这么多〃 提交于 2019-12-02 19:48:55
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. I'm using SyncToy 1.4 and it would be fine for what I need except that: It can't handle the assigned drive letter changing between systems (e.g. syncing a USB drive), it leaves its own (hidden) files in the folders being synched (is this a limitation of the OS/FS?), it recreates empty folders for ones that have been deleted, it syncs new sub folders in folders that have been unselected from syncing and sometimes finds

Should I put many functions into one file? Or, more or less, one function per file?

点点圈 提交于 2019-11-30 12:39:19
I love to organize my code, so ideally I want one class per file or, when I have non-member functions, one function per file. The reasons are: When I read the code I will always know in what file I should find a certain function or class. If it's one class or one non-member function per header file, then I won't include a whole mess when I include a header file. If I make a small change in a function then only that function will have to be recompiled. However, splitting everything up into many header and many implementation files can considerately slow down compilation. In my project, most

How to split an ansible role's `defaults/main.yml` file into multiple files?

允我心安 提交于 2019-11-30 02:45:59
问题 In some ansible roles (e.g. roles/my-role/ ) I've got quite some big default variables files ( defaults/main.yml ). I'd like to split the main.yml into several smaller files. Is it possible to do that? I've tried creating the files defaults/1.yml and defaults/2.yml , but they aren't loaded by ansible. 回答1: The feature I'm describing below has been available since Ansible 2.6, but got a bugfix in v2.6.2 and another (minor) one in v2.7. To see a solution for older versions, see Paul's answer.

Organization of C files

末鹿安然 提交于 2019-11-28 17:52:15
I'm used to doing all my coding in one C file. However, I'm working on a project large enough that it becomes impractical to do so. I've been #including them together but I've run into cases where I'm #including some files multiple times, etc. I've heard of .h files, but I'm not sure what their function is (or why having 2 files is better than 1). What strategies should I use for organizing my code? Is it possible to separate "public" functions from "private" ones for a particular file? This question precipitated my inquiry. The tea.h file makes no reference to the tea.c file. Does the

Workflow to create Xcode groups as file system folders

吃可爱长大的小学妹 提交于 2019-11-28 14:35:08
问题 I like organizing my classes into groups, in the Xcode 4 project navigator pane. I also use GIT versioning via the terminal, which works better for me than the Xcode 4 integration. To me it makes the most sense when the groups I create in Xcode correspond to real folders on my file system. However, Xcode seems to not care about where a file (e.g. Objective-C .h/.m file) is on the filesystem, and every time you add a group ( Option+Command+N ) it's purely cosmetic, for any files you put in

Multiple classes in a header file vs. a single header file per class

核能气质少年 提交于 2019-11-27 17:26:01
For whatever reason, our company has a coding guideline that states: Each class shall have it's own header and implementation file. So if we wrote a class called MyString we would need an associated MyStringh.h and MyString.cxx . Does anyone else do this? Has anyone seen any compiling performance repercussions as a result? Does 5000 classes in 10000 files compile just as quickly as 5000 classes in 2500 files? If not, is the difference noticeable? [We code C++ and use GCC 3.4.4 as our everyday compiler] The term here is translation unit and you really want to (if possible) have one class per