P
P
Philip2013-07-11 15:28:23
C++ / C#
Philip, 2013-07-11 15:28:23

Difficulties with Xcode

There is a project like this:
Project
{
Class1.cpp
Class2.cpp

Core
{
Class1.cpp
Framework
{
Class2.cpp
}
}
}
But I still haven't figured out how to connect it to Xcode. And I also didn’t understand the tricks with folders and subfolders, how are they created? I think there are experienced Xcode users here, I hope for you. Thank you.
Xcode 4.6.3

Answer the question

In order to leave comments, you need to log in

4 answer(s)
N
nochkin, 2013-07-11
@RussDragon

If the project is not from Xcode, then it is enough to create an empty project and add all these files (File - Add Files).
If the project is from Xcode, then there is a file with the extension .xcodeproj, which must be opened in Xcode.

A
Andrey Ezhgurov, 2014-09-29
@FMars

IMHO, @alexclear has overcomplicated it . It can be easier:

SELECT a.* FROM Apartment a
  LEFT JOIN Apartment_Dates ad
    ON ad.apartment_id=a.id AND ? BETWEEN ad.arrival_time AND ad.departure_time
  WHERE ad.id IS NULL

Regarding @Serhioromano 's solution , MySQL has this nasty feature: the IN (SELECT ...) construct is evaluated for each row of the selected table. Those. if the Apartment table has 1000 records, then (SELECT FROM Apartment_Dates) will be evaluated 1000 times when the query is executed. It is clear that this works much slower than JOIN and exists ().

A
Alex Chistyakov, 2014-09-29
@alexclear

select a.id, a.location from apartments a
   where not exists (select d.apartment_id
            from apartment_dates d 
                    where d.apartment_id = a.id
                          and d.arrival_time<=? and d.departure_time>=?)

where ? - specified date.

S
Sergey Romanov, 2014-09-29
@Serhioromano

You need to use the Apartment_Dates table as an index. And in my experience < and > are faster than BETWEEN.
It is better to use reverse logic than direct. Since when the intervals are free are in different rows of records.

SELECT a.* 
  FROM Apartment AS a
 WHERE a.id NOT IN(SELECT apartment_id 
    FROM Apartment_Dates 
   WHERE  ? <= departure_time AND ? >= arrival_time)

Where ? this is your date.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question