organization

What's a good way to organize a large collection of personal scripts using git?

China☆狼群 提交于 2019-11-29 03:50:59
问题 I have a large collection of my personal scripts that I would like to start versioning using Git. I've previously organized my code as follows: ~/code/python/projects/ (for large stuff, each project contained in an individual folder) ~/code/python/scripts/ (single file scripts all contained in this directory) ~/code/python/sandbox/ (my testing area) ~/code/python/docs/ (downloaded documentation) ~/code/java/... (as above) Now i'm going to start versioning my code using git, so that I can have

Organizing Strings.xml

為{幸葍}努か 提交于 2019-11-28 22:52:41
I'm making an android app and since I've just started I want to try get the most organised code/resources. In my strings.xml file so far I have this: <?xml version="1.0" encoding="utf-8"?> <resources> <string name="app_name">GameController</string> <string name="stop">Stop</string> <string name="start">Start</string> <string name="preferences">Preferences</string> <string name="back">Back</string> </resources> All of the strings except app_name are used in an options menu. But since I will be adding much more strings I was thinking that it might be better to do something like this: <?xml

How do I import a third party lib into git?

て烟熏妆下的殇ゞ 提交于 2019-11-28 20:47:44
I'm looking at how to import some third part code into a git repository. The third party code is the "stm32f10x_stdperiph_lib" that is provided by ST. The lib is actually a bunch of normal c-files (and header-files) that you just include and build with when you do a STM32 project. The problem is that they only provide it as a zip-file and they do release new versions, so I would like to add more control. So my plan is to write a little script that does this: unzip grab some of the files (I don't need all the files in the zip) import the selected files into a git repository My problems start at

guidelines for where to put classes in Rails apps that don't fit anywhere

筅森魡賤 提交于 2019-11-28 18:29:29
问题 I'm wondering if there are any best practices about where to put non-standard Ruby files in Rails apps, those that don't fit in any of the default directories ( controllers / models etc.). I'm talking about classes that are used by controllers/models etc., but are not subclasses of any of the Rails base classes. Classes that include functionality extracted from models to make them less fat. Some of them kind of look like models but aren't AR models, some of them look more like "services",

Alphabetizing methods in Visual Studio

邮差的信 提交于 2019-11-28 08:51:41
Is there any sort of plug-in or tool available for Visual Studio 2008 to alphabetize methods? Ideally I'd like a tool that will alphabetize a selection, or specified type (i.e. only methods, not member variables), either automatically or on-demand. DavidN Resharper has a Type Members Layout, which can order members by type, accessibility and alphabetically as well. You can also take a look into Ora , which presents a pane in visual studio that is ordered (even though your source may not be). Link's dead. The following answer goes much further than the OP asks, because I believe, that sorting

How do I import a third party lib into git?

故事扮演 提交于 2019-11-27 20:46:54
问题 I'm looking at how to import some third part code into a git repository. The third party code is the "stm32f10x_stdperiph_lib" that is provided by ST. The lib is actually a bunch of normal c-files (and header-files) that you just include and build with when you do a STM32 project. The problem is that they only provide it as a zip-file and they do release new versions, so I would like to add more control. So my plan is to write a little script that does this: unzip grab some of the files (I

Convert delimited string into hierarchical JSON with JQuery

独自空忆成欢 提交于 2019-11-27 19:08:35
I have an array of strings that describe the parent/child relationship by being delimited with dashes. So, if Bob's boss was Jim and Jim's boss was Fred, Bob's entry in the array would be "Fred-Jim-Bob" and Jim's entry would be "Fred-Jim." I don't have the ability to change the way the data is coming in so I was looking for help as far as the best way of turning these values into JSON similar to this: { "name": "Fred", "children": { "name": "Jim", "children": { "name": "Bob" } } } Any help would be greatly appreciated. Thanks. var input = ["Fred-Jim-Bob", "Fred-Jim", "Fred-Thomas-Rob", "Fred"]

Organizing Strings.xml

南笙酒味 提交于 2019-11-27 14:29:39
问题 I'm making an android app and since I've just started I want to try get the most organised code/resources. In my strings.xml file so far I have this: <?xml version="1.0" encoding="utf-8"?> <resources> <string name="app_name">GameController</string> <string name="stop">Stop</string> <string name="start">Start</string> <string name="preferences">Preferences</string> <string name="back">Back</string> </resources> All of the strings except app_name are used in an options menu. But since I will be

C++ class header files organization

本小妞迷上赌 提交于 2019-11-27 02:50:39
What are the C++ coding and file organization guidelines you suggest for people who have to deal with lots of interdependent classes spread over several source and header files? I have this situation in my project and solving class definition related errors crossing over several header files has become quite a headache. Some general guidelines: Pair up your interfaces with implementations. If you have foo.cxx , everything defined in there had better be declared in foo.h . Ensure that every header file #includes all other necessary headers or forward-declarations necessary for independent

Convert delimited string into hierarchical JSON with JQuery

自古美人都是妖i 提交于 2019-11-26 22:46:22
问题 I have an array of strings that describe the parent/child relationship by being delimited with dashes. So, if Bob's boss was Jim and Jim's boss was Fred, Bob's entry in the array would be "Fred-Jim-Bob" and Jim's entry would be "Fred-Jim." I don't have the ability to change the way the data is coming in so I was looking for help as far as the best way of turning these values into JSON similar to this: { "name": "Fred", "children": { "name": "Jim", "children": { "name": "Bob" } } } Any help