프로그램 작성

전문가 및 열성적 프로그래머를위한 Q & A


24
navigator.geolocation.getCurrentPosition이 때때로 작동하지 않는 경우가 있습니다
그래서 navigator.geolocation.getCurrentPosition jammy를 사용하는 아주 간단한 JS가 있습니다. $(document).ready(function(){ $("#business-locate, #people-locate").click(function() { navigator.geolocation.getCurrentPosition(foundLocation, noLocation); }); navigator.geolocation.getCurrentPosition(foundLocation, noLocation); function foundLocation(position) { var lat = position.coords.latitude; var lon = position.coords.longitude; var userLocation = lat + ', ' + lon; $("#business-current-location, #people-current-location").remove(); $("#Near-Me") .watermark("Current Location") .after("<input type='hidden' name='business-current-location' id='business-current-location' value='"+userLocation+"' />"); $("#people-Near-Me") .watermark("Current …


4
클래스의 JavaScript 클릭 이벤트 리스너
현재 클릭 한 클래스의 속성을 얻기 위해 JavaScript를 작성하려고합니다. 올바른 방법으로 이벤트 리스너를 사용해야한다는 것을 알고 있습니다. 내 코드는 다음과 같습니다. var classname = document.getElementsByClassName("classname"); var myFunction = function() { var attribute = this.getAttribute("data-myattribute"); alert(attribute); }; classname.addEventListener('click', myFunction(), false); 클래스 중 하나를 클릭 할 때마다 속성을 알려주는 경고 상자가 표시 …

6
Java에서 final로 선언 된 ==와 문자열 비교
Java의 문자열에 대한 간단한 질문이 있습니다. 다음 간단한 코드 세그먼트는 두 문자열을 연결 한 다음와 비교합니다 ==. String str1="str"; String str2="ing"; String concat=str1+str2; System.out.println(concat=="string"); 비교 표현 concat=="string"반환 false명백한로 (I 사이의 차이 이해 equals()와 ==). 이 두 문자열이 final이렇게 선언 되면 final String str1="str"; final String str2="ing"; String concat=str1+str2; System.out.println(concat=="string"); concat=="string"이 …
220 java  string  final 

2
“업그레이드 비보안 요청”HTTP 헤더 란 무엇입니까?
HTTP (비 HTTPS) 사이트에 POST 요청을하고 Chrome 개발자 도구에서 요청을 검사 한 후 서버에 보내기 전에 자체 헤더를 추가 한 것을 발견했습니다. Upgrade-Insecure-Requests: 1 에서 검색을 수행 한 후 Upgrade-Insecure-Requests, 나는 오직 찾을 수있는 정보를 전송하는 서버에 대한 이 헤더를 : Content-Security-Policy: upgrade-insecure-requests 이것은 관련이 있지만 내 경우 CLIENT가 Request …

30
MSSQL 오류 '기본 공급자가 Open에서 실패했습니다'
나는 사용하던 .mdfA를 연결하는database 하고 entityClient. 이제 .mdf파일 이 없도록 연결 문자열을 변경하고 싶습니다 . 다음이 connectionString맞습니까? <connectionStrings> <!--<add name="conString" connectionString="metadata=res://*/conString.csdl|res://*/conString.ssdl|res://*/conString.msl;provider=System.Data.SqlClient;provider connection string="Data Source=.\SQL2008;AttachDbFilename=|DataDirectory|\NData.mdf;Integrated Security=True;Connect Timeout=30;User Instance=True;MultipleActiveResultSets=True"" providerName="System.Data.EntityClient" />--> <add name="conString" connectionString="metadata=res://*/conString.csdl|res://*/conString.ssdl|res://*/conString.msl;provider=System.Data.SqlClient;provider connection string="Data Source=.\SQL2008;Initial Catalog=NData;Integrated Security=True;Connect Timeout=30;User Instance=True;MultipleActiveResultSets=True"" providerName="System.Data.EntityClient" /> 항상 오류가 발생하기 때문에 : 기본 공급자가 Open에서 실패했습니다

7
다른 운영 체제 간 git core.autocrlf에서 행 끝 변환이 작동하는 방식
core.autocrlf 설정 작동 방식 에 대한 자식 문서 뿐만 아니라 스택 오버플로에 대한 다양한 질문과 답변을 읽었습니다 . 이것은 내가 읽은 내용을 이해 한 것입니다. Unix 및 Mac OSX (OSX 이전 버전에서는 CR 사용) 클라이언트는 LF 줄 끝을 사용합니다. Windows 클라이언트는 CRLF 줄 끝을 사용합니다. 클라이언트에서 core.autocrlf가 true로 설정되면 git …

8
Bash에서 두 변수 빼기
두 디렉토리 사이의 파일 수를 빼기 위해 아래 스크립트가 있지만 COUNT=표현식이 작동하지 않습니다. 올바른 구문은 무엇입니까? #!/usr/bin/env bash FIRSTV=`ls -1 | wc -l` cd .. SECONDV=`ls -1 | wc -l` COUNT=expr $FIRSTV-$SECONDV ## -> gives 'command not found' error echo $COUNT
220 bash  shell  unix 

10
부동 소수점을 n 소수점 이하 자릿수로 포맷
부동 소수점을 "n"소수점으로 형식화해야합니다. BigDecimal을 시도했지만 리턴 값이 올바르지 않습니다 ... public static float Redondear(float pNumero, int pCantidadDecimales) { // the function is call with the values Redondear(625.3f, 2) BigDecimal value = new BigDecimal(pNumero); value = value.setScale(pCantidadDecimales, RoundingMode.HALF_EVEN); // here the value is correct (625.30) return value.floatValue(); // but here …

16
커밋하기 전에 자식이 후행 공백을 자동으로 제거하도록하십시오.
팀과 함께 git을 사용하고 있으며 diff, log, merge 등에서 공백 변경 사항을 제거하고 싶습니다.이 작업을 수행하는 가장 쉬운 방법은 git이 후행 공백 (및 기타 공백 오류)을 자동으로 제거하는 것이라고 가정합니다 ) 적용되는 모든 커밋에서. ~/.gitconfig파일로 다음을 추가하려고했지만 커밋 할 때 아무것도하지 않습니다. 어쩌면 다른 무언가를 위해 설계되었을 수도 있습니다. 해결책은 …
220 git  whitespace  githooks 



14
다음 항목 중 하나가 목록에 있는지 확인하는 방법은 무엇입니까?
다음 항목 중 하나라도 목록에 있는지 확인할 수있는 간단한 방법을 찾으려고하지만 첫 번째 시도가 작동하지 않습니다. 이를 수행하는 함수를 작성하는 것 외에도 여러 항목 중 하나가 목록에 있는지 확인하는 짧은 방법입니다. >>> a = [2,3,4] >>> print (1 or 2) in a False >>> print (2 or 1) in a …
220 python 


당사 사이트를 사용함과 동시에 당사의 쿠키 정책개인정보 보호정책을 읽고 이해하였음을 인정하는 것으로 간주합니다.
Licensed under cc by-sa 3.0 with attribution required.