Trying to reverse a string using recursion
Is Java "pass-by-reference" or "pass-by-value"?
Bootstrap CSS Active Navigation ERD for a web development company I am working on an ERD which represents the relationships between entities in a Web development company behavioral model. There I have entities like:   Customer Service ----------- (like: web development, web design, web consultation, ...) Order-item ------- (like: web development, web design, web consultation, ...) Order Invoice Project Project-phase Task --------------- (like: web development task3, web design task7) Developer Delivery ----------- (like: the developed web app, web consultation session, ...)   I have this diagram so far, though I know it still has major problems, and it is just for a start point:    Main concept   Customer makes order-items on services, combined to form an order which relates to an invoice. Each project has multiple project-phases with each project-phase related to an order. Each project-phase has multiple tasks, each of which is assigned to a developer. Each project-phase has a delivery, which will be delivered upon payment of the related orders invoice.   Questions   Are has and contains completely the same? If not, how to choose between them for relationships?! what is the measure?! Are there any rational problems with the Main concept section? Any helpful ideas or suggestions to improve this model?   Any help with this, would be really appreciated.  Update 1  Refined version of the diagram     Update 2  Considering an analogy of a Fast food restaurant would be helpful:   Customer ---------- A hungry person Service ------------- Making a burger, Home delivery, Mobile delivery, ... Order-item --------- A burger, ... Order ---------------- A home-delivered burger Invoice -------------- The printed invoice Project -------------- Serving the customer for a complete year (like a contract) Project-phase ----- Serving the customer for a single day Task ----------------- Preparing the kitchen, process the meat, ... Developer ---------- The cookie Delivery ------------- A burger in wrapped in wax papaer and a drink with the tray   Update 3  ()     Project seems to be unrelated to Customer in your diagram. Is this what you intended?   I think Order is and Project should not be related, as I think it is something off-the-counter and customer has nothing to do with it. she/he is only after the delivery and is concerned about time and money, nothing else. Please tell if I am wrong.     Are all Orders part of a Project or can you have orders that aren't in a project at all?   All Orders are part of a project, except those new ones which are waiting in the process queue.     Similarly, you relate order item directly to customer, but also to order. Are orders split between customers?   Please think of Order-Item as these:   web design web design consultancy domain name consultancy ...   So, customer choose some of these items, collected as an Order which has an invoice and could be paid. Order-Items are directly related to offered Services. I don't understand what do you mean by Are orders split between customers?.     If not you don't need a ternary relationship between customer, order item and service. Rather, an order item is an intersection between order and service. Order items belong to customers by inheritance from order (or even project?)   This is somehow true: Order items belong to customers by inheritance from order, but I think it is more rational to say it like this:     Order-Items, inherited from Service, belong to Order which itself belongs to Customer. I'm looking at creating a basic ORM (purely for fun), and was wondering, is there a way to return the list of tables in a database and also the fields for every table?  Using this, I want to be able to loop through the result set (in C#) and then say for each table in the result set, do this (e.g. use reflection to make a class that will do or contain xyz).  Further to this, what are some good online blogs for SQL Server? I know this question is really about using system SPs and databases in Sql Server, and I am ok with general queries, so I'm interested in some blogs which cover this sort of functionality.  Thanks Preview of CAD files in format .dwg I'm looking for a utility or a program for Ubuntu, and possibly even for Windows that is able to convert a CAD file format .DWG to PDF.   My need is to provide a preview of CAD files, and I thought that the easiest way is to convert them into PDF format, but I'm open to suggestions, even if there is only the possibility to convert them to JPG image file type or PNG would be fine.  What interests me is only to find some solution, no matter if it is commercial or free I was trying to install Lightworks 11.5.1 (amd64) on Ubuntu 14.04(amd64) but there's a notice: Dependency is not satisfiable: libtiff4. Is there anyway to solve this dependency issue?  Thanks in advance. How do I convert a hex string to an int in Python?   I may have it as "0xffff" or just "ffff". Why jquery validation is not working on appended elements? Proof that there must exist infinitely many solutions to a homogeneous system of equations when more unknowns than equations Calling Python in PHP I have a Python script I recently wrote that I call using the command line with some options. I now want a very thin web interface to call this script locally on my Mac.  I don't want to go through the minor trouble of installing mod_python or mod_wsgi on my Mac, so I was just going to do a system() or popen() from PHP to call the Python script.  Any better ideas? Thanks in advance! Can Compound Topographic Index (CTI) / Topographic Wetness Index (TWI) produce negative values? I am calculating Topographic Wetness Index for a study area using SRTM DEM (90 and 30m).   I've seen several versions of TWI (CTI).  I have been using: TWI = ln(As +1 / tanB)       where As = catchment area, B = slope (degrees/radians??)  When I run this function, the output contains negative values (using slope in degrees and radians).  Are negative values acceptable? Or does this indicate an error in the analysis??  I understand the output should be scaled to 1-10, but negative values seems counter intuitive. Could someone explain what negative values could mean (due to flat areas, no data values?)  On a side not, the calculations are being run on on a very large area, which overaps several watersheds. Is it appropriate to run TWI over such a large extent? Python setup, install one module as a sub module of another module? Need rtl8814au driver for kernel 5.3 on Ubuntu 19.10 Real Analysis Riemann Integration - Strict Monotonicity for Integrals If $f,g$ are Riemann integrable on $[a,b]$, and $f(x) &lt; g(x)$ for all $x \in [a,b]$, prove that $$ \int_a^b f(x) \,dx &lt; \int_a^b g(x) \,dx$$  This is a strict inequality. I know how to prove the monotonicity of integrals with the non strict inequality, but I am not sure how to do this. Are the tags shown in a particular order? I noticed that, sometimes, the tags I add to a question are not shown in the same order I wrote them, when the question is saved. Are they shown in a particular order? If they are, in which order they are shown? Is $R^2$ useful or dangerous? I was skimming through  by Cosma Shalizi (in particular, section 2.1.1 of the ), and was reminded that you can get very low $R^2$ even when you have a completely linear model.  To paraphrase Shalizi's example: suppose you have a model $Y = aX + \epsilon$, where $a$ is known. Then $\newcommand{\Var}{\mathrm{Var}}\Var[Y] = a^2 \Var[x] + \Var[\epsilon]$ and the amount of explained variance is $a^2 \Var[X]$, so $R^2 = \frac{a^2 \Var[x]}{a^2 \Var[X] + \Var[\epsilon]}$. This goes to 0 as $\Var[X] \rightarrow 0$ and to 1 as $\Var[X] \rightarrow \infty$.  Conversely, you can get high $R^2$ even when your model is noticeably non-linear. (Anyone have a good example offhand?)  So when is $R^2$ a useful statistic, and when should it be ignored? What causes Nova's Triple Tap to go on a short cooldown? This isn't about the level 20 ultimate talent.  There is a brief "arming phase" where Nova locks onto her target before shooting three bullets.  When something happens to her target during that phase (allied Devouring Maw, Divine Shield, etc.), sometimes Triple Tap is placed on the full 100 second cooldown, other times it is placed on a much shorter 10 second cooldown.  What triggers this 10 second cooldown?   Is this a timing issue?  I believe if she is interrupted after the shots start going out, Triple Tap is always put on the full cooldown.  Maybe I'm just seeing the ability get blocked right as the first shot goes out? Is this ability-specific?  Does stunning Nova have a different effect than a Devouring Maw or Void Prison on her target?  And is that different from a Divine Shield/Sanctification on the target? Is this determined by whether the line to the target was interrupted by an ally or an enemy hero?  For example, is there a difference between an allied Void Prison and an enemy Void Prison on the target? PDF Editing in PHP? Does anyone know of a good method for editing PDFs in PHP? Preferably open-source/zero-license cost methods. :)  I am thinking along the lines of opening a PDF file, replacing text in the PDF and then writing out the modified version of the PDF?  I have programmatically created PDF files in the past using FPDF, but found it a little unwieldy at times. I have this table but check constraint is throwing me an error:     Column CHECK constraint for column 'MedicamentRegulated' references another column, table 'Medicaments'.   I've seen this as allowed in SQL Server but I don't know why it doesn't work :/  CREATE TABLE Medicaments ( MedicamentID INT NOT NULL IDENTITY(1,1) PRIMARY KEY, Name VARCHAR(50), DateValidity DATE, MedicamentRegulated BIT CHECK((MedicamentRegulated = 1 AND DateValidity IS NOT NULL)    OR MedicamentRegulated = 0) ) How to align a  to the middle (horizontally/width) of the page $\gcd(b^x - 1, b^y - 1, b^ z- 1,\dots) = b^{\gcd(x, y, z,\dots)} -1$ Possible Duplicate:        $b$, $x$, $y$, $z$, $\ldots$ are integers greater than 1. How can we prove that  $$ \gcd (b ^ x - 1, b ^ y - 1, b ^ z - 1 ,\dots)= b ^ {\gcd (x, y, z, \dots)} - 1\ ? $$