Lập trình

Q & A cho các lập trình viên chuyên nghiệp và đam mê

16
Ví dụ về gotos tốt trong C hoặc C ++ [đóng]
Đã đóng cửa . Câu hỏi này cần được tập trung hơn . Nó hiện không chấp nhận câu trả lời. Đã đóng cửa 6 năm trước . Đã khóa . Câu hỏi này và các câu trả lời của nó bị khóa vì câu hỏi lạc đề nhưng có …
79 c++  c  goto 

10
Không thể gọi getSupportFragmentManager () từ hoạt động
Tôi có một hoạt động có một phần nhỏ. XML: <fragment android:name="com.example.androidcalculator.ResultFragment" android:id="@+id/result_fragment" android:layout_weight="1" android:layout_width="match_parent" android:layout_height="wrap_content" /> Và tôi muốn gọi một phương thức từ ResultFragment từ một phương thức trong Activity, nhưng getSupportFragmentManager "không tồn tại": FragmentManager fragMan = getSupportFragmentManager(); Làm cách nào để giải quyết vấn đề này?

5
Nút Bootstrap 3.0 trong Navbar
Tôi đã nâng cấp bootstrap 3.0 ngay bây giờ. Và thẻ "a" trông giống như btn (bởi sự trợ giúp của lớp .btn) bị hủy trên thanh điều hướng. <li> <a href="<?php echo BASE_PATH; ?>register.php" class="btn btn-primary btn-sm"> <?php echo "<strong>" . _('Bayilik Başvurusu') . "</strong>"; ?> </a> </li> Nhưng …


6
Cách lấy văn bản được chọn của hộp Javascript
Điều này hoạt động hoàn hảo <select name="selectbox" onchange="alert(this.value)"> Nhưng tôi muốn chọn văn bản. Tôi đã thử theo cách này <select name="selectbox" onchange="alert(this.text)"> Nó hiển thị không xác định. Tôi đã tìm thấy cách sử dụng DOM để lấy văn bản. Nhưng tôi muốn làm điều này theo cách …



9
Mất dòng mã khi Notepad ++ gặp sự cố
Tôi đang làm việc trên tệp .js sáng nay trên Notepad ++, như thường lệ, khi chương trình vừa gặp sự cố. Vì vậy, tôi đã kết thúc nó và mở lại nó để thấy rằng tất cả các dòng mã của tôi trong tệp .js của tôi, đã biến …
79 file  notepad++  lines  loss 

4
Tại sao không có khoảng trống giữa các CardView trên Lollipop?
Tôi cố gắng sử dụng CardViewvà nó hoạt động tốt dưới 5.0, nhưng trông lạ trên Lollipop. <?xml version="1.0" encoding="utf-8"?> <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent" android:layout_height="match_parent" android:orientation="vertical" android:paddingBottom="@dimen/activity_vertical_margin" android:paddingLeft="@dimen/activity_horizontal_margin" android:paddingRight="@dimen/activity_horizontal_margin" android:paddingTop="@dimen/activity_vertical_margin"> <android.support.v7.widget.CardView android:layout_width="match_parent" android:layout_height="200dp"> <TextView android:id="@+id/textView" android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="card1" android:textAppearance="?android:attr/textAppearanceLarge" /> </android.support.v7.widget.CardView> <android.support.v7.widget.CardView android:layout_width="match_parent" android:layout_height="200dp"> <TextView android:id="@+id/textView2" android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="card2" android:textAppearance="?android:attr/textAppearanceLarge" /> …

25
Cá thể ResourceConfig không chứa bất kỳ lớp tài nguyên gốc nào
Có gì sai ở đây? The ResourceConfig instance does not contain any root resource classes. Dec 10, 2010 10:21:24 AM com.sun.jersey.spi.spring.container.servlet.SpringServlet initiate SEVERE: Exception occurred when intialization com.sun.jersey.api.container.ContainerException: The ResourceConfig instance does not contain any root resource classes. at com.sun.jersey.server.impl.application.RootResourceUriRules.<init>(RootResourceUriRules.java:103) at com.sun.jersey.server.impl.application.WebApplicationImpl._initiate(WebApplicationImpl.java:1182) at com.sun.jersey.server.impl.application.WebApplicationImpl.access$600(WebApplicationImpl.java:161) at com.sun.jersey.server.impl.application.WebApplicationImpl$12.f(WebApplicationImpl.java:698) at com.sun.jersey.server.impl.application.WebApplicationImpl$12.f(WebApplicationImpl.java:695) at com.sun.jersey.spi.inject.Errors.processWithErrors(Errors.java:197) …
79 jersey 

7
Cách sử dụng XMLReader trong PHP?
Tôi có tệp XML sau, tệp này khá lớn và tôi không thể lấy simplexml để mở và đọc tệp, vì vậy tôi đang thử XMLReader nhưng không thành công trong php <?xml version="1.0" encoding="ISO-8859-1"?> <products> <last_updated>2009-11-30 13:52:40</last_updated> <product> <element_1>foo</element_1> <element_2>foo</element_2> <element_3>foo</element_3> <element_4>foo</element_4> </product> <product> <element_1>bar</element_1> <element_2>bar</element_2> <element_3>bar</element_3> <element_4>bar</element_4> </product> …

7
vim: xóa 2 khoảng trắng đầu tiên cho nhiều dòng
Cách dễ nhất để xóa 2 khoảng trắng đầu tiên cho mỗi dòng bằng VIM là gì? Về cơ bản, nó lặp lại "2x" cho mỗi dòng. Làm rõ: ở đây giả định là 2 ký tự đầu tiên là khoảng trắng. Vì vậy, câu hỏi là về việc thực …
79 vim 

6
Liên kết phần tử thiếu thuộc tính thuộc tính bắt buộc
<!DOCTYPE html> ... <link rel='stylesheet' id='basecss-css' href='http://www.someurl.com/modules/14ce1e21/peadig-eucookie.css' type='text/css' media='all' /> Tại sao trình xác thực ( http://validator.w3.org/ ) lại từ chối điều này? Thuộc tính nào là "bắt buộc" mà tôi không biết? Lỗi: Dòng Lỗi 408, Cột 142: Liên kết phần tử thiếu thuộc tính thuộc tính bắt buộc. …
79 html 



Khi sử dụng trang web của chúng tôi, bạn xác nhận rằng bạn đã đọc và hiểu Chính sách cookie và Chính sách bảo mật của chúng tôi.
Licensed under cc by-sa 3.0 with attribution required.