structure

ZendFramework - Where to place additional classes in modular directory structure?

我只是一个虾纸丫 提交于 2019-12-05 08:05:24
问题 I'm currently working on some kind of web application based on ZendFramework. In one of the modules there's a need of calculating item price. When buying, by providing some promotional code client can get access to one or more discounts. I thought of making it as decorators (pattern). Base class calculating price (method "getPrice") can be modified by one of more decorator classes. Each of them can substract some value. So, each promotion has its own class implementing some interface (e.g.

How do I structure my PHP project?

僤鯓⒐⒋嵵緔 提交于 2019-12-05 07:54:55
I am about to embark upon yet another large PHP project. This time, I intend to have the project folder be tidy! So I have a few questions concerning keeping my project clean and DRY: How do I differentiate between PHP source files and PHP files that should be accessed by the browser? In other words, how do I make it clear which PHP files gives output and which gives function or class definitions? I am planning on separating my PHP functions into static classes, separated by subject, for instance database::create() or editor::write(). What are your thoughts on this? I am planning on creating a

How to resolve two structures with the same name?

◇◆丶佛笑我妖孽 提交于 2019-12-05 06:09:35
In my code base I find that two modules have structures with the same name. It is giving a name conflict error. Is there a way to resolve it without changing the code? This is a terrible hack, but it would be possible to use a macro to redefine the name of the struct, like so // a.h struct collide { int a; }; // b.h struct collide { float b; }; // test.c #define collide a_collide #include "a.h" #undef collide #include "b.h" int main(){ struct a_collide a; struct collide b; return 0; } You'd probably want to rename the struct for both headers to give errors when someone inevitably uses the

How to set up Umbraco to default in a subpage?

二次信任 提交于 2019-12-05 05:36:38
I have this question about umbraco structuring and I can't find the answer anywhere. Typically in Umbraco it will default the root site to the first node of the tree. so if we have Home page 1 page 2 the default page will be home (so www.mysite.com will point to home). How do I change this however so that www.mysite.com will point to page1 or page2? What if I have this structure? wrapper index page 1 page 2 and I want www.mysite.com to go straight to www.mysite.com/index.aspx I couldn't find a rule that does that. Tried inserting a rewrite/redirect rule and it didn't change anything. Please

How to get table structure in CodeIgniter

让人想犯罪 __ 提交于 2019-12-05 04:31:40
I want to know the structure of a table. How I can do it in CodeIgniter. Using database class I got 'Invalid SQL Statement' error when I ran $this->db->query('desc mytable'); Try: $fields = $this->db->list_fields('table_name'); foreach ($fields as $field) { echo $field; } From manual Omar Alvarado For more descriptive information, you should use $fields = $this->db->field_data('table_name'); You're going to get something like this foreach field in fields as stdClass name = "id" type = "int" max_length = 11 default = null primary_key = 1 Harun Or Rashid For Get Table Schema in CodeIgniter query

Properties in Structures: “Expression is a value and therefore cannot be the target of an assignment.”

五迷三道 提交于 2019-12-05 03:57:52
I have the following 2 structures, and I don't really understand why the second one does not work: Module Module1 Sub Main() Dim myHuman As HumanStruct myHuman.Left.Length = 70 myHuman.Right.Length = 70 Dim myHuman1 As HumanStruct1 myHuman1.Left.Length = 70 myHuman1.Right.Length = 70 End Sub Structure HandStruct Dim Length As Integer End Structure Structure HumanStruct Dim Left As HandStruct Dim Right As HandStruct End Structure Structure HumanStruct1 Dim Left As HandStruct Private _Right As HandStruct Public Property Right As HandStruct Get Return _Right End Get Set(value As HandStruct)

Tesseract OCR: is it possible to force a specific pattern?

落花浮王杯 提交于 2019-12-05 03:16:46
问题 I'm using Tesseract and I want to develop an app that is able to recognize a sequence of characters. I had good results but not exellent. The characters sequence I want to read has always a specific pattern, let's say: number number number char char - (e.g.: 123AB) Is there a way to "tell" the ocr engine that the structure is always fixed, in order to improve the results of the recognition? Thank you in advance. 回答1: Try bazaar matching pattern in Tesseract: \d\d\d\c\c 回答2: You can use the

java library to maintain database structure

爱⌒轻易说出口 提交于 2019-12-05 02:40:53
My application is always developing, so occasionally - when the version upgrades - some tables need to be created/altered/deleted, some data modified, etc. Generally some sql code needs to be executed. Is there a Java library that can be used to keep my database structure up to date (by analyzing something like " db structure version " information and executing custom sql to code to update from one version to another)? Also it would be great to have some basic actions (like add/remove column) ready to use with minimal configuration, ie name/type and no sql code. Try DBDeploy . Although I haven

array of pointers to structures

試著忘記壹切 提交于 2019-12-05 00:54:06
问题 I'm trying to understand if my code is correct. I need to declare an array of pointers to structs, create a new struct and assign the values and print them. It seems to me that I'm not declaring array of pointers correctly. I need to know what I'm doing wrong. Thank you I'm getting this compile error: error: 'people' undeclared (first use in this function) And I've tried to insert struct data *list; into main but it wouldnt work char *book[] = { "x", "y", "z",}; int number[] = { 1, 2, 3};

How to create structure with null value support?

被刻印的时光 ゝ 提交于 2019-12-05 00:34:21
I'm new in C#. In c# I can't set value of a structure to null how can I create a structure with null value support? MrWednesday Structs and value types can be made nullable by using the Generic Nullable<> class to wrap it. For instance: Nullable<int> num1 = null; C# provides a language feature for this by adding a question mark after the type: int? num1 = null; Same should work for any value type including structs. MSDN Explanation: Nullable Types (c#) You can use Nullable<T> which has an alias in C#. Keep in mind that the struct itself is not really null (The compiler treats the null