프로그램 작성

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


21
값으로 목록 요소를 삭제하는 간단한 방법이 있습니까?
a = [1, 2, 3, 4] b = a.index(6) del a[b] print(a) 위의 오류는 다음과 같습니다. Traceback (most recent call last): File "D:\zjm_code\a.py", line 6, in <module> b = a.index(6) ValueError: list.index(x): x not in list 그래서 나는 이것을해야합니다 : a = [1, 2, 3, 4] try: b = a.index(6) …
942 python  list 

11
INNER JOIN ON vs WHERE 절
간단하게하기 위해 모든 관련 필드가이라고 가정합니다 NOT NULL. 넌 할 수있어: SELECT table1.this, table2.that, table2.somethingelse FROM table1, table2 WHERE table1.foreignkey = table2.primarykey AND (some other conditions) 그렇지 않으면: SELECT table1.this, table2.that, table2.somethingelse FROM table1 INNER JOIN table2 ON table1.foreignkey = table2.primarykey WHERE (some other conditions) 이 두 가지가 같은 방식으로 …
941 sql  mysql  join  inner-join 



27
Android "뷰 계층 구조를 만든 원래 스레드 만 해당 뷰를 만질 수 있습니다."
Android에서 간단한 뮤직 플레이어를 만들었습니다. 각 노래의보기에는 다음과 같이 구현 된 SeekBar가 포함됩니다. public class Song extends Activity implements OnClickListener,Runnable { private SeekBar progress; private MediaPlayer mp; // ... private ServiceConnection onService = new ServiceConnection() { public void onServiceConnected(ComponentName className, IBinder rawBinder) { appService = ((MPService.LocalBinder)rawBinder).getService(); // service that handles …




20
jQuery AJAX 제출 양식
이름 orderproductForm과 정의되지 않은 수의 입력 양식 이 있습니다. 어떤 종류의 jQuery.get 또는 ajax 또는 Ajax를 통해 페이지를 호출하고 양식의 모든 입력을 전송하는 것과 같은 것을하고 싶습니다 orderproductForm. 한 가지 방법은 다음과 같은 것을하는 것이라고 생각합니다. jQuery.get("myurl", {action : document.orderproductForm.action.value, cartproductid : document.orderproductForm.cartproductid.value, productid : document.orderproductForm.productid.value, ... 그러나 모든 양식 …

30
RecyclerView에서 항목 사이에 칸막이와 공백을 추가하는 방법은 무엇입니까?
다음은 divider 및 dividerHeight 매개 변수를 ListView사용하여 클래스 에서 이전에 수행 한 방법의 예입니다 . <ListView android:id="@+id/activity_home_list_view" android:layout_width="match_parent" android:layout_height="match_parent" android:divider="@android:color/transparent" android:dividerHeight="8dp"/> 그러나 나는 RecyclerView수업 에서 그러한 가능성을 보지 못합니다 . <android.support.v7.widget.RecyclerView android:id="@+id/activity_home_recycler_view" android:layout_width="match_parent" android:layout_height="match_parent" android:scrollbars="vertical"/> 이 경우 여백을 정의하거나 사용자 정의 구분선보기를 목록 항목의 레이아웃에 직접 추가하거나 내 목표를 달성하는 …

30
foreach 루프의 현재 반복 색인을 어떻게 얻습니까?
foreach 루프의 현재 반복을 나타내는 값을 얻기 위해 C #에서 내가 경험하지 않은 희귀 언어 구조 (최근에 배운 소수, 스택 오버플로에 대한 일부)가 있습니까? 예를 들어, 현재 상황에 따라 이와 같은 작업을 수행합니다. int i = 0; foreach (Object o in collection) { // ... i++; }
938 c#  foreach 

10
Mockito로 void 메소드를 조롱하는 방법
void 리턴 타입으로 메소드를 조롱하는 방법? 관찰자 패턴을 구현했지만 방법을 모르기 때문에 Mockito로 조롱 할 수 없습니다. 그리고 인터넷에서 예를 찾으려고했지만 성공하지 못했습니다. 내 수업은 다음과 같습니다. public class World { List<Listener> listeners; void addListener(Listener item) { listeners.add(item); } void doAction(Action goal,Object obj) { setState("i received"); goal.doAction(obj); setState("i finished"); } …

9
AddTransient, AddScoped 및 AddSingleton Services의 차이점
ASP.NET Core에서 DI ( 종속성 주입) 를 구현하고 싶습니다 . 따라서이 코드를 ConfigureServices메소드에 추가하면 두 가지 방식으로 작동합니다. ASP.NET Core에서 services.AddTransient와 service.AddScoped방법 의 차이점은 무엇입니까 ? public void ConfigureServices(IServiceCollection services) { // Add framework services. // Add application services. services.AddTransient<IEmailSender, AuthMessageSender>(); services.AddScoped<IEmailSender, AuthMessageSender>(); }

5
Trello는 사용자의 클립 보드에 어떻게 액세스합니까?
Trello 에서 카드 위로 마우스를 가져 가고 Ctrl+를 누르면 C이 카드의 URL이 클립 보드에 복사됩니다. 그들은 이것을 어떻게합니까? 내가 알 수있는 한, Flash 무비는 없습니다. 내가있어 Flashblock을이 설치하고, 파이어 폭스 네트워크 탭 쇼에는 플래시 동영상이로드되지 않습니다. (예를 들어 ZeroClipboard와 같은 일반적인 방법입니다.) 그들은이 마법을 어떻게 달성합니까? (이 시점에서 나는 주현절이 …

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