directory-structure

c# Build a directory tree

▼魔方 西西 提交于 2019-12-24 08:25:49
问题 I am trying to build a directory tree in my application. I am using this Example from Ext.NET . How I can search a given path for directories and sub-directories in order to build this tree? Here is the code given in the example to build the tree from nodes: protected void NodeLoad(object sender, NodeLoadEventArgs e) { if (!string.IsNullOrEmpty(e.NodeID)) { for (int i = 1; i < 6; i++) { AsyncTreeNode asyncNode = new AsyncTreeNode(); asyncNode.Text = e.NodeID + i; asyncNode.NodeID = e.NodeID +

How to reference a JavaScript file in Lib from an HTML file in Data?

混江龙づ霸主 提交于 2019-12-24 04:35:38
问题 I decided to give Mozilla's Add-on Builder a try. My directory structure looks something like this: The problem is that the file popup.html needs to reference stackapi.js . But I have absolutely no clue how to do that. Looking through the Mozilla docs, there seems to be a way to do the opposite: var data = require("self").data; var url_of_popup = data.url("popup.html"); This allows scripts in Lib to access data files in Data. But I need to do the opposite. 回答1: In add-ons built with the Add

PHPStorm and module references

给你一囗甜甜゛ 提交于 2019-12-23 12:25:42
问题 I have the following files at my PHP project: index.php private/module1.php private/module2.php The index.php references module1.php this way: require_once('private/module1.php'); By its turn, module1.php requires module2.php , so it has the following line: require_once('private/module2.php'); I need to inform the relative path from root for it to work. I guess that's because require_once command expects a path from the current document, which happens to be index.php. The problem is that PHP

Is there an inbuilt way in PHP to parse a string like this: '/path/to/../../up/something.txt'

痴心易碎 提交于 2019-12-22 10:34:27
问题 So say I have a string like so of a path $path = '/path/to/../../up/something.txt'; Is there a way built into PHP to parse it and come up with a URL without the directory ups (../) ? E.g. $path = parsePath('/path/to/../../up/something.txt'); // /up/something.txt 回答1: realpath($path); Docs 回答2: PHP's realpath() is cool, but what if you want to figure it out without accessing the filesystem? I've written this function that can return a path with ../ and the like calculated to a real path. It

How to create directories and sub directories efficiently and elegantly in Python 2.7?

此生再无相见时 提交于 2019-12-22 10:20:00
问题 I am trying to create a bunch of directories and sub directories at a specific location in my PC. My process is something like this: Check if there's any directory with the same directory name. Skip if so. If not, create the directory and the pre-defined sub directories under that directory. This is the code I came up with using os module: def Test(): main_dir = ["FolderA", "FolderB"] common_dir = ["SubFolder1", "SubFolder2", "SubFolder3"] for dir1 in main_dir: if not os.path.isdir(dir1): for

Mifare Application Directory Management?

半城伤御伤魂 提交于 2019-12-22 00:16:05
问题 [ Please only consider 1k classic cards in your answers. ] I am hoping to gain a bit of industry knowledge in the realm of RFID. Specifically, with the MIFARE MAD (Mifare application directory). I understand its architecture from reviewing the MIFARE MAD documentation published by NXP located here: http://www.nxp.com/documents/application_note/AN10787.pdf However, from this document a few questions arise. Who manages the initial MAD directory on a given card? I know that manufactures may

Docker: Using COPY when the Dockerfile is located in a subdirectory

二次信任 提交于 2019-12-21 12:45:11
问题 I'm building an app using multiple dockerfiles (one for each service). My app's directory structure is as follows: app ├── dockerfiles │ ├── webserver │ │ └── Dockerfile │ └── database │ └── Dockerfile ├── public └── <frontend> ├── db └── <data> [...] ├── LICENSE ├── README.md └── docker-compose.yml In my webserver's Dockerfile , I want to copy in my existing code using the COPY command: # Dockerfile COPY ./public /var/www/html And I want to deploy the app using my docker-compose.yml file: #

Measuring “closeness” in large source trees

前提是你 提交于 2019-12-21 11:35:13
问题 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

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

♀尐吖头ヾ 提交于 2019-12-21 11:30:16
问题 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

C++ project source code layout

柔情痞子 提交于 2019-12-21 09:36:57
问题 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