Programming

리눅스에서 Xcode를 실행할 수 있습니까?SQL Server 문자열을 날짜로 변환

procodes 2020. 5. 25. 22:26
반응형

리눅스에서 Xcode를 실행할 수 있습니까?


Linux에서 Xcode를 실행할 수 있습니까? Mac OS X은 BSD Unix를 기반으로 했으므로 가능합니까?

내가 들었던 것으로부터, iPhone 시뮬레이터가있는 MonoDevelop 플러그인이 있습니다.


Xcode (gcc 컴파일러 제품군, gdb 디버거 등)의 저수준 툴체인은 모두 공개 소스이며 Unix 및 Linux 플랫폼에 공통입니다. 그러나 편집기, 프로젝트 관리, 인덱싱, 탐색, 빌드 시스템, 그래픽 디버거, 비주얼 데이터 모델링, SCM 시스템, 리팩토링, 프로젝트 스냅 샷 등의 IDE는 Mac OS X Cocoa 응용 프로그램이며 이식성이 없습니다.


아무도 아직 방랑자를 제안 하지 않았으므로 여기 에 OSX 용 방랑 상자가 있습니다.

vagrant init https://vagrant-osx.nyc3.digitaloceanspaces.com/osx-sierra-0.3.1.box
vagrant up

MACOS 가상 머신이 있습니다. 그러나 Apple의 EULA에 따르면 여전히 MacOS 하드웨어에서 실행해야합니다 : D 그러나 어디서나 MacOS를 휘두르고 우분투를 설치 한 괴짜 여러분 모두 : D

불행히도 SSH X-forwarding옵션을 사용하여 내부에서 편집기를 실행할 수 없습니다 .


나는 대답하지 않고 의견을 말하고 싶었습니다. 그러나 정확하게 말하자면 OSX는 BSD를 기반으로하지 않으며 NeXTStep의 진화입니다. NeXTStep OS는 CMU에서 개발 한 Mach 커널을 사용합니다. 원래 MicroKernel로 설계되었지만 성능 제약으로 인해 결국 API의 Unix 부분을 커널 자체에 포함하고 BSD 호환 "서버"(원래 BSD 호환 요청 처리) 커널 메시지)가 커널로 옮겨져 모 놀리 식 커널이되었습니다. 프로그래밍 API에서 BSD 호환 가능하지만 BSD가 아닙니다.

OS의 나머지 부분은 ObjectiveC (Stepstone과 GNU / GCC의 Richard Stallman 사이의 계약하에)와 관련하여 "Display Postscript"라는 기술을 기반으로하는 GUI (X 서버와 유사하지만 포스트 스크립트 명령 포함)를 사용했습니다. OS X은 Display Postscript를 PDF 표시로 변경하고 일반 하드웨어 요구 사항을 1000 배 증가 시켰습니다 (NeXT는 8-16MB로 실행할 수 있으며 이제 GB가 필요합니다).

GCC와 Objective C 및 NeXT의 긴밀한 결혼으로 인해 Linux에서 기본적으로 XCode를 실행하는 가장 좋은 방법은 GNUStep 라이브러리를 사용하여 포트를 만드는 것입니다. 원래 NextStep을 위해 설계된 다음 OpenStep 호환성을 위해 코코아와 호환된다는 이야기를 들었지만 거의 20 년 동안 그 어떤 것도 연주하지 않았습니다. 물론 Swift가 아닌 ObjC까지만 가능하며 Apple이 OpenSource로 갈지 모르겠습니다.


VMware Player 또는 Workstation (또는 VirtualBox)을 실행하는 경우 Mac OS X를 지원하는지 확실하지 않지만 Mac OS X Server (클라이언트를 합법적으로 가상화 할 수 없음)인지 확실하지 않습니다. 물론이 경우 OS X에서 XCode를 실행하고 있지만 호스트 시스템은 Linux 일 수 있습니다.


괜찮은 Mac을 위해 수천 달러를 지불 할 수 없다면 클라우드에서 OSX 및 XCode를 실행하는 옵션이 있습니다.

http://www.macincloud.com/


해당 플러그인에 MonoTouch (무료 아님) 가 필요하다고 생각합니다 .

그리고 Linux에서 Xcode를 실행할 수있는 방법이 없습니다.

모든 나쁜 소식에 대해 죄송합니다. :)


아니요, iPhone 개발을위한 .NET / mono 환경 MonoTouch에 대해 들어 보았습니다 . 그러나 여전히 Mac과 공식 iPhone SDK가 필요합니다. 그리고 에뮬레이터는 공식적인 애플입니다. 이것은 별도의 IDE 역할을하며 Objective C로 코딩 할 필요가 없으며 C #으로 코딩 할 수 있습니다

가장 적게 말하는 것은 흥미로운 프로젝트입니다 ....

편집 : 분명히, 당신은 지금 앱 스토어에 배포 할 수 있습니다.


OSX는 Linux가 아닌 BSD를 기반으로 합니다. Linux 시스템에서는 Xcode를 실행할 수 없습니다.


다른 OS에서 XCode를 원한다면 클라우드 컴퓨팅을 제안합니다. 그렇게하면 앱이 Mac에서 개발되고 App Store에 제출 될 수 있습니다.

참고 URL : https://stackoverflow.com/questions/2406151/can-you-run-xcode-in-linux

SQL Server 문자열을 날짜로 변환


다음과 같이 문자열을 변환하고 싶습니다.

'10/15/2008 10:06:32 PM'

SQL Server에서 동등한 DATETIME 값으로

오라클에서는 다음과 같이 말합니다.

TO_DATE('10/15/2008 10:06:32 PM','MM/DD/YYYY HH:MI:SS AM')

이 질문 은 문자열을 표준 형식 중 하나로 구문 분석 한 다음 해당 코드 중 하나를 사용하여 변환 해야 함을 의미합니다 . 그런 평범한 작업에는 우스운 것 같습니다. 더 쉬운 방법이 있습니까?


SQL Server (2005, 2000, 7.0)에는 임의로 구성된 날짜 시간을 문자열 형식으로 가져 와서 날짜 / 시간 데이터 유형으로 변환하는 융통성 또는 융통성이없는 방법이 없습니다.

"임의로"는 "어떻게 든 당신이나 나 또는 지구 반대편에있는 누군가는 아니지만 그것을 쓴 사람이 직관적이고 완전히 명백한 것으로 생각하는 형태"를 의미합니다. 솔직히, 나는 그런 알고리즘이 있는지 확실하지 않습니다.


이 시도

Cast('7/7/2011' as datetime)

Convert(varchar(30),'7/7/2011',102)

자세한 내용은 CAST 및 CONVERT (Transact-SQL) 를 참조하십시오.


쿼리 프로세서를 통해이를 실행하십시오. 그것은 날짜 및 / 또는 시간과 같은 형식을 지정 하며이 중 하나는 당신이 찾고있는 것을 줄 것입니다. 적응하기가 어렵지 않습니다.

Declare @d datetime
select @d = getdate()

select @d as OriginalDate,
convert(varchar,@d,100) as ConvertedDate,
100 as FormatValue,
'mon dd yyyy hh:miAM (or PM)' as OutputFormat
union all
select @d,convert(varchar,@d,101),101,'mm/dd/yy'
union all
select @d,convert(varchar,@d,102),102,'yy.mm.dd'
union all
select @d,convert(varchar,@d,103),103,'dd/mm/yy'
union all
select @d,convert(varchar,@d,104),104,'dd.mm.yy'
union all
select @d,convert(varchar,@d,105),105,'dd-mm-yy'
union all
select @d,convert(varchar,@d,106),106,'dd mon yy'
union all
select @d,convert(varchar,@d,107),107,'Mon dd, yy'
union all
select @d,convert(varchar,@d,108),108,'hh:mm:ss'
union all
select @d,convert(varchar,@d,109),109,'mon dd yyyy hh:mi:ss:mmmAM (or PM)'
union all
select @d,convert(varchar,@d,110),110,'mm-dd-yy'
union all
select @d,convert(varchar,@d,111),111,'yy/mm/dd'
union all
select @d,convert(varchar,@d,12),12,'yymmdd'
union all
select @d,convert(varchar,@d,112),112,'yyyymmdd'
union all
select @d,convert(varchar,@d,113),113,'dd mon yyyy hh:mm:ss:mmm(24h)'
union all
select @d,convert(varchar,@d,114),114,'hh:mi:ss:mmm(24h)'
union all
select @d,convert(varchar,@d,120),120,'yyyy-mm-dd hh:mi:ss(24h)'
union all
select @d,convert(varchar,@d,121),121,'yyyy-mm-dd hh:mi:ss.mmm(24h)'
union all
select @d,convert(varchar,@d,126),126,'yyyy-mm-dd Thh:mm:ss:mmm(no spaces)'

SQL Server Denali에서는 원하는 대상에 접근 할 수있는 작업을 수행 할 수 있습니다. 그러나 여전히 임의로 정의 된 엉뚱한 날짜 문자열을 전달할 수 없으며 SQL Server가 수용 할 것으로 기대합니다. 다음은 자신의 답변에 게시 한 내용을 사용한 예입니다. FORMAT () 함수는 로케일을 선택적 인수로 받아 들일 수도 있습니다. .Net 형식을 기반으로하므로 대부분의 토큰 형식이 없을 수도 있습니다.

DECLARE @d DATETIME = '2008-10-13 18:45:19';

-- returns Oct-13/2008 18:45:19:
SELECT FORMAT(@d, N'MMM-dd/yyyy HH:mm:ss');

-- returns NULL if the conversion fails:
SELECT TRY_PARSE(FORMAT(@d, N'MMM-dd/yyyy HH:mm:ss') AS DATETIME);

-- returns an error if the conversion fails:
SELECT PARSE(FORMAT(@d, N'MMM-dd/yyyy HH:mm:ss') AS DATETIME);

I strongly encourage you to take more control and sanitize your date inputs. The days of letting people type dates using whatever format they want into a freetext form field should be way behind us by now. If someone enters 8/9/2011 is that August 9th or September 8th? If you make them pick a date on a calendar control, then the app can control the format. No matter how much you try to predict your users' behavior, they'll always figure out a dumber way to enter a date that you didn't plan for.

Until Denali, though, I think that @Ovidiu has the best advice so far... this can be made fairly trivial by implementing your own CLR function. Then you can write a case/switch for as many wacky non-standard formats as you want.


UPDATE for @dhergert:

SELECT TRY_PARSE('10/15/2008 10:06:32 PM' AS DATETIME USING 'en-us');
SELECT TRY_PARSE('15/10/2008 10:06:32 PM' AS DATETIME USING 'en-gb');

Results:

2008-10-15 22:06:32.000
2008-10-15 22:06:32.000

You still need to have that other crucial piece of information first. You can't use native T-SQL to determine whether 6/9/2012 is June 9th or September 6th.


For this problem the best solution I use is to have a CLR function in Sql Server 2005 that uses one of DateTime.Parse or ParseExact function to return the DateTime value with a specified format.


why not try

select convert(date,'10/15/2011 00:00:00',104) as [MM/dd/YYYY]

date formats can be found at SQL Server Helper > SQL Server Date Formats


Use this:

SELECT convert(datetime, '2018-10-25 20:44:11.500', 121) -- yyyy-mm-dd hh:mm:ss.mmm

And refer to the table in the official documentation for the conversion codes.


This page has some references for all of the specified datetime conversions available to the CONVERT function. If your values don't fall into one of the acceptable patterns, then I think the best thing is to go the ParseExact route.


Personally if your dealing with arbitrary or totally off the wall formats, provided you know what they are ahead of time or are going to be then simply use regexp to pull the sections of the date you want and form a valid date/datetime component.


If you want SQL Server to try and figure it out, just use CAST CAST('whatever' AS datetime) However that is a bad idea in general. There are issues with international dates that would come up. So as you've found, to avoid those issues, you want to use the ODBC canonical format of the date. That is format number 120, 20 is the format for just two digit years. I don't think SQL Server has a built-in function that allows you to provide a user given format. You can write your own and might even find one if you search online.


Took me a minute to figure this out so here it is in case it might help someone:

In SQL Server 2012 and better you can use this function:

SELECT DATEFROMPARTS(2013, 8, 19);

Here's how I ended up extracting the parts of the date to put into this function:

select
DATEFROMPARTS(right(cms.projectedInstallDate,4),left(cms.ProjectedInstallDate,2),right( left(cms.ProjectedInstallDate,5),2)) as 'dateFromParts'
from MyTable

참고URL : https://stackoverflow.com/questions/207190/sql-server-string-to-date-conversion

반응형