THẢO LUẬN

thg 10 15, 2017 9:08 SA

Cho mình hỏi <label for="body">Body:</label> vs {!! Form::label('body', 'Body:') !!} Hai cái này có khác gì nhau không vậy ạ

0
Avatar
đã bình luận cho bài viết
thg 10 15, 2017 4:00 SA

(y)

0
thg 10 14, 2017 4:39 SA

ở nút gọi popup nếu chuyển sang popup trang khác thì gọi như thế nào

0
thg 10 13, 2017 11:36 SA

Mình rất ưng cai bụng.

0

Hi All, Hiện tại mình đang chạy ngrok trên 1 PC chạy mạng LAN, nhưng khi thực hiện ngrok http 3000 thì connecting fail. Mình đã bypass proxy rồi, có thể truy cập được mạng. Nhưng không hiểu sao nó lại fail nữa. Bạn có thể giải thích và cho mình solution được không vậy. Mong ad có thể trả lời sớm. Thanks

0

Nếu không lấy hết dữ liệu về client mà nhiều user cùng request liên tục lên server có thể sẽ bị chết.

0

Mai mốt ad đừng dùng google translate dịch cả bài. Chịu khó dịch từng câu cho nó đúng nha 😊

+1

Interesting question. Waiting for the answer 😄

0

@chuongpdh

  • Đối với dữ liệu động thì mình nghĩ cách đó là hợp lý. Còn chết hay không thì phụ thuộc mình tối ưu query, cache, scale như thế nào.
  • Còn với dữ liệu tĩnh hoặc rất ít khi thay đổi (categories, locations) thì mình có lưu data ở dưới client cũng là 1 giải pháp để giảm tải cho server 😃
0

@KmasterYC Nếu như có hàng trăm hoặc hàng ngàn cùng input như vậy có phải chết server ko. Cách này không ổn.

0

Cảm ơn bạn. Mình thử làm cách của bạn và đã được rồi.

0

Bài viết rất hay. Cảm ơn chủ thớt nhiều!

0
thg 10 13, 2017 5:00 SA

ồ dạ vâng em cảm ơn ạ 😄 .

0
thg 10 13, 2017 3:26 SA

mình thấy defer = true | false thì nó đều chạy hàm register à bạn

Tại sao bạn lại thấy như vậy 🤔 Cụ thể bạn đã làm những gì để ra kết quả đó?

Mà trong bài viết mình đề cập việc set $defertrue thì service sẽ được load khi nó lần đầu tiên được gọi đến, và lúc này hàm register sẽ được chạy mà, chứ ý mình không phải là set $defer = true thì hàm register sẽ mãi mãi không được chạy.

Bạn có thể tìm hiểu thêm về Deferred Providers trên Document của Laravel, trên đó có nói rõ:

If your provider is only registering bindings in the service container, you may choose to defer its registration until one of the registered bindings is actually needed. Deferring the loading of such a provider will improve the performance of your application, since it is not loaded from the filesystem on every request. Laravel compiles and stores a list of all of the services supplied by deferred service providers, along with the name of its service provider class. Then, only when you attempt to resolve one of these services does Laravel load the service provider. To defer the loading of a provider, set the defer property to true and define a provides method. The provides method should return the service container bindings registered by the provider

Ngoài ra, bạn cũng có thể xem thêm về code của Framework để kiểm tra cách nó load deferred providers, cụ thể là ở file laravel/framework/src/Illuminate/Foundation/Application.php.

0
thg 10 13, 2017 3:22 SA

các biến đó thì mình phải tạo thôi, trên tutorial có phần Get the Code https://developers.google.com/maps/documentation/android-api/current-place-tutorial#get-the-code do hơi dài nên Google đã cho Hide đi, bạn ấn Show là sẽ thây đầy đủ code hoặc clone từ repo google-map-sample của Google https://github.com/googlemaps/android-samples

0
thg 10 13, 2017 2:53 SA

Dữ liệu luôn là vô giá, không nên xóa cứng với bất kỳ lý do gì, nhất là trên prod

0
thg 10 13, 2017 2:18 SA

do mới tìm hiểu cả android nữa nên hơi khó hiểu á thầy thế cá biến "mLocationPermissionGranted" "mDefaultLocation","mLastKnownLocation","mLastKnownLocation" lấy ở đâu ra ạ, em có hơi chậm hiểu phầm đọc tài liệu á thầy 😦 https://developers.google.com/maps/documentation/android-api/current-place-tutorial

private void getDeviceLocation() { /* * Get the best and most recent location of the device, which may be null in rare * cases when a location is not available. */ try { if (mLocationPermissionGranted) { Task locationResult = mFusedLocationProviderClient.getLastLocation(); locationResult.addOnCompleteListener(this, new OnCompleteListener() { @Override public void onComplete(@NonNull Task task) { if (task.isSuccessful()) { // Set the map's camera position to the current location of the device. mLastKnownLocation = task.getResult(); mMap.moveCamera(CameraUpdateFactory.newLatLngZoom( new LatLng(mLastKnownLocation.getLatitude(), mLastKnownLocation.getLongitude()), DEFAULT_ZOOM)); } else { Log.d(TAG, "Current location is null. Using defaults."); Log.e(TAG, "Exception: %s", task.getException()); mMap.moveCamera(CameraUpdateFactory.newLatLngZoom(mDefaultLocation, DEFAULT_ZOOM)); mMap.getUiSettings().setMyLocationButtonEnabled(false); } } }); } } catch(SecurityException e) { Log.e("Exception: %s", e.getMessage()); } }

0
thg 10 13, 2017 1:08 SA

Trước hết mình cần làm rõ vấn đề như sau trích từ https://developers.google.com/maps/documentation/android-api/location?hl=vi#working_with_location_data

  • The My Location layer provides a simple way to display a device's location on the map. It does not provide data. (My Location layer cung cấp một cách đơn giản để hiển thị vị trí của thiết bị trên map, chứ nó không cung cấp dữ liệu location)
  • The Google Play services Location API is recommended for all programmatic requests for location data. (The Google Play services Location API được khuyến nghị cho mọi yêu cầu về dữ liệu location).

Bài viết Android location API using Google Play services của mình là nói về ý thứ 2 nên không liên quan gì tới map cả. Còn câu hỏi của bạn theo như mình hiểu thì là làm sao hiển thị nút vị trí hiện tại trên map? Với câu hỏi này thì bạn có thể tham khảo bài viết sau về google map https://viblo.asia/p/bat-dau-voi-google-maps-api-cho-android-DzVkpoZPenW. Sau khi hiển thị được map thì bạn chỉ cần thêm dòng mGoogleMap.setMyLocationEnabled(true); vào trong hàm onMapReady là có thể hiển thị button my location.

Nếu có vấn đề gì thì bạn cứ lên đây trao đổi tiếp nhé 😃.

0
thg 10 13, 2017 12:09 SA

Nếu $defer là true thì không chạy hàm register. mình thấy $defer = true | false thì nó đều chạy hàm register à bạn

0
Viblo
Hãy đăng ký một tài khoản Viblo để nhận được nhiều bài viết thú vị hơn.
Đăng kí