w3hello.com logo
Home PHP C# C++ Android Java Javascript Python IOS SQL HTML videos Categories
When to honor keepalive
Most servers specify the connection type even though in HTTP/1.1 "Connection: close" is the default. The connection type is usually specified at the bottom of the header, even though it doesn't need to be. There is no convention for what sort of HTTP codes should alter the connection type. You usually close the connection if it's a 4-- or a 5-- code, since you do not expect the user-agent (browser) to try to interface with the server until the user refreshes the webpage or tries to access another one. Keeping the connection open only makes it slightly faster when the client wants to access another resource on the server. A lot of servers close the connection after every request. Note that if the user-agent specifies "Connection: close" in the header, whatever you may reply, the connectio

Categories : Misc

Do Guice singletons honor thread-confinement?
It's not only that Guice will provide the same singleton across threads for the same injector, but Guice can only provide the same singleton across threads if you use toInstance. Modules are evaluated once per injector, and you gave Guice one instance and no way to produce a second one. Guice isn't magic. When trying to provide an instance of an Object, it either needs (1) a Guice-friendly no-arg or @Inject-annotated constructor; (2) a Provider or @Provides method, letting you create the instance yourself; or (3) an instance that you've already created and bound with toInstance, which Guice reuses because it doesn't know how to create another. Note that option 2, with a Provider, doesn't need to guarantee that it creates a new instance every single time, and we can exploit that to write a

Categories : Java

how to make fmincon honor constraints at each step?
The documentation indeed states that the 'AlwaysHonorConstraints' option applies to the bound constraints only, so lb and ub. In other words, fmincon considers the entire domain [lb ub] as the feasible region and ignores any and all linear and non-linear constraints. Quite some time ago I wrote optimize, which is based on fminsearch and is available on the file exchange. Now, it's a long time ago, so I might misremember, but I remember implementing an option ('superstrict') that avoids any evaluation of the objective function outside the feasible region, including linear and non-linear constraints. You might want to give that a try. But, sticking to fmincon, a possible workaround is to modify unscented_kalman1 such as to include penalties: function unscented_kalman1(x, ...) %/

Categories : Matlab

Chrome does not honor table width setting using javascript
It's all about the box model. add table{ box-sizing: border-box; } The link is a very interesting read but basically you force calculation including borders and padding which is not compatible with w3c spec. updated jsFiddle

Categories : Javascript

GWT DevMode Jetty restart doesn't honor server code changes
I'm pretty sure you just need to re-compile GreetingServiceImpl.java after you've made your changes (you do not mention doing it after making changes). Restarting the server will not re-compile everything magically for you (but usually your IDE will). Notice that hot-deploy is not the same as "hot-compile-deploy".

Categories : Gwt

DTM_SETFORMAT for a Time Picker control doesn't honor format specifier
From the Region and Language control panel dialog, click the "Additional settings" button and then the Time tab. What is set for AM symbol and PM symbol? On my Windows 7 machine, with the Format set to German, these are both empty strings. The datetime control gets the strings to display from the user's current locale, so even if you force it to display AM/PM in the format string it will not actually have anything to display for this part.

Categories : C++

how to honor the parent logging namespace when importing python modules from entry points
How is the plugin supposed to know whether it's part of application foo as opposed to application bar? If you don't want your plugins to be part of the foo namespace, you can just attach your handlers to the root logger and you won't get the message about "no handlers could be found".

Categories : Python

How to update an Android app by only sending the code that changed instead of the whole bundle for each update?
Not through the play store. I doubt it would be possible outside it either- Android apks are signed. I'm not sure if the signature would work after diffing. Really though, why do you care? If its through the play store, 6 MB isn't much to download. It'll just take a few seconds. If you're handing out the apk, then it won't even take that. It seems like it really isn't worth worrying about.

Categories : Android

Can I update my android application using update button?
Try using this instead, I recall from somewhere that setDataAndType needs to be done in one line. Intent promptInstall = new Intent(Intent.ACTION_VIEW); promptInstall.setDataAndType(Uri.parse(filePath), "application/vnd.android.package-archive"); startActivity(promptInstall);

Categories : Android

Application using bluetooth SPP profile not working after update from Android 4.2 to Android 4.3
I found a work around. It is disconnected if there is no streaming activity for a few seconds. I managed to have some output or input streaming several times per second, and it never disconnects now.

Categories : Android

How android sqlite databse will update in android market?
I have a better solution for this problem. It will be better if you host a web service that will serve the update information. You can do it for free. GoogleAppEngine provides this feature. Serve JSON file from web, parse it in you application. Each time your app launches, write code to check for update information. OR check once in week or some other strategy. This might be tougher way of doing but you can provide more efficient and flexibility through this.

Categories : Android

Location Not Update in ANdroid
Try to get latitude and longitude inside the onLocationChnage() public void onLocationChanged(Location loc) { //sets and displays the lat/long when a location is provided String lat = loc.getLatitude(); String longt= loc.getLongitude(); Toast.makeText(getApplicationContext(),"Lat"+ lat+ "Long"+longt, Toast.LENGTH_LONG).show(); } Add the permission in menifest <uses-permission android:name="android.permission.INTERNET" /> <uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" /> <uses-permission android:name="android.permission.ACCESS_MOCK_LOCATION" />

Categories : Java

Android update UI from Handler
I think what you have here is a threading issue... For example, the order of the players are: Robot 1, Robot2, Human, Robot3 You said that Robot2 got skipped. This is because the for loop in your update method does not wait for your handler to finish executing, since they are on separate threads. After Robot2 makes a move, the human turn is next and you call activeSlot = slot; messageHandler.sendEmptyMessage(HUMAN_GUESS); The problem is... You don't know for sure that the handler has already called activeSlot.setSlotGuess(); for the last robot guess.. So when it is the human's turn, the human sets the activeSlot and you do not know if Robot2 ever got the chance to set its guess. It would be better to wait to advance the turn until the handler is done using the activeSlot obje

Categories : Android

Android: Check if update is available
TextView.equals() does not return true when the text values of the two boxes are equal. You will want to compare the text values of the two boxes. For example: if(installedversion.getText().toString().equals(versionupdnew.getText().toString())) Note that the TextView.getText() function does not return a String (the API documentation states that it returns a CharSequence, however if it is set to use Spannable or Editable it can be cast to a different type. using toString() on these types returns the text value of the box as a String and in my experience is the most reliable way to compare the values of two Views)

Categories : Android

Android Services and UI update
From what you've explained I wouldn't personally use a service. The Android docs on services explain more but here is a snippet: http://developer.android.com/guide/components/services.html A Service is an application component that can perform long-running operations in the background and does not provide a user interface. You could perhaps looks at using an AsyncTask, especially given that you only want it to run whilst the app is running: http://developer.android.com/reference/android/os/AsyncTask.html This class allows to perform background operations and publish results on the UI thread without having to manipulate threads and/or handlers. There is a good answer here on how to run an AsyncTask repeatedly at specific time intervals: How to execute Async task repeatedly a

Categories : Android

Can't run app after update Android SDK Tool
Here is a bunch of solutions available in this post. Can no longer launch apps after upgrding to android sdk tools 20/platform sdk tools 12 Unfortunately, the proposed solution is uninstalling and re-install is the best option chosen by the user in order to run your business

Categories : Android

Android app update mechanism
This is handled by the Play Store client. App history is associated with your Google account, that is why you can (automatically) install the same apps when you get a new device. It is kept on the server and cached on the device. Android keeps track of who installed a particular package (Play Store, side-load, etc.), but generally you can update an app as long as the updated is signed with the same certificate. Whether or not you will get notifications about side-loaded apps is entirely app to the Play Store app. Last I checked, it did show notifications, but you cannot rely on this. If you are dealing with side-loaded app, you'd better have your own update check mechanism.

Categories : Android

Android Location update
Even better, I suggest you look at the new Location APIs in Google Play Services. There's a training class for them as well.

Categories : Android

Multrithreading UI Update android
I pretty sure you should use Handler . (http://developer.android.com/reference/android/os/Handler.html)

Categories : Android

Android DB Update registers
You have an error in your query. After you add the saldoString you do not have a space before the WHERE statement. public void UpdateBDPrincipal(double saldo){ String saldoString = String.valueOf(saldo); try{ dataBase.execSQL("UPDATE usuario SET 'saldoBanco'="+ saldoString +" WHERE 'login'= cristiano"); } catch(Exception error) { Alerta("Erro","Erro no UPDATE"); } } P.S. be careful when building SQL strings this way, it can be vulnerable for SQL injection attacks. In this specific case it "works", because saldo is a double. But if it would be a string it's very dangerous to create strings without escaping or putting strings in '' Update: Also please do not suppress your exception output, this makes tracking errors much harder. try { } catch(E

Categories : Android

Update Android Gallery
Trigger the mediascanner to read all the media files again. Use this piece of code : sendBroadcast(new Intent(Intent.ACTION_MEDIA_MOUNTED, Uri.parse("file://" + Environment.getExternalStorageDirectory()))); This is very inefficient though since it'll begin reading the entire SDCard for changes.

Categories : Java

Android Studio cannot update
I guess its too late for you but the problem is you dont run android studio in root. Go to /android-studio/bin in the console and run "sudo sh studio.sh" and you click to update the software.

Categories : Linux

Why android needs the whole package to update?
The installation package, the .apk file, is signed as one entity. Android makes sure that either everything is ok or it will not install it. But, you can split your application into different parts and update them separately since Android offers a way to let applications that share the same certificate interact in more ways than applications that do not share certificate. Read more here about signing your application and your options: http://developer.android.com/tools/publishing/app-signing.html

Categories : Android

Android sqlit update fail
I think you should try with proper syntax of update query , like this db.update(Table,values,COLUMN + "=?",args); Also another suggestion is to check the type of HEX , may be it could be too longer than its column datatype.

Categories : Android

Android - Eclipse broken after SDK and ADT update
I too face the same problem, What i have done is just goto help - > install new software and enter the url as Diljeet stated https://dl-ssl.google.com/android/eclipse/ . Then you get already installed error , just hit finish, Then you get few warning message after that it is just fine started to download and installed. I think eclipse plugins need to be updated after the sdk is updates. I used adk tools from google Hope this helps

Categories : Android

Android animate() doesn't update the UI
Maybe this video can help you http://graphics-geek.blogspot.com/2013/06/devbytes-animating-listview-deletion_21.html

Categories : Android

Android ListView does not update onResume
You haven't set any new data to list view. Thats why your new contact isn't added to the list after notifyDataSetChanged(). You need to add some method into adapter like setData(List<ProfBean> data) { this.currentAdaptersList= data; } and then call notifyDataSetChanged(). So the final onResume will be : public void onResume() { super.onResume(); this.historyProfs = this.db.getHistory(-1); this.listAdapter.setData(this.historyProfs); this.listAdapter.notifyDataSetChanged(); } Enjoy. And using onResume() for this task is bad idea. Is better to use onActivityResult.

Categories : Android

Update information of an contact in android
@Stacks28: This is me - Mr.Pakapun I try to update only the name of the contact by using the code below. BUT, nothing happends! The name of the contact is not been updated. What wrong with the code ? public void editContact(String _id, String name, String phone, String company) { String where = ContactsContract.Data._ID + " = ? AND " + ContactsContract.Data.MIMETYPE + "= ?"; String[] params = new String[] {_id, ContactsContract.CommonDataKinds.StructuredName.CONTENT_ITEM_TYPE }; ContentResolver cr = getContentResolver(); ArrayList<ContentProviderOperation> ops = new ArrayList<ContentProviderOperation>(); ops.add(ContentProviderOperation.newUpdate(Data.CONTENT_URI) .withSelection(where, params) .withValue(Struc

Categories : Android

Android Update Current Location
I don't understand you question, if you run the method updatePlaces() only ones it will getLastKnownLocation only once and updates the user marker only once. could you please be more explanatory on what you are trying to achieve?

Categories : Android

Android: SMS Database Update Receiver?
You need to create a class that extends ContentObserver then register it with your ContentProvider by calling the ContentResolver.registerContentObserver() method. More information can be found in the Android Developer Documentation

Categories : Android

Using a Thread to run Code and update UI Android
This may help u... //on create Thread currentThread = new Thread(this); currentThread.start(); after on create public void run() { try { Thread.sleep(4000); threadHandler.sendEmptyMessage(0); } catch (InterruptedException e) { //don't forget to deal with the Exception !!!!! } } private Handler threadHandler = new Handler() { public void handleMessage(android.os.Message msg) { Intent in = new Intent(getApplicationContext(),****.class); startActivity(in); } };

Categories : Android

Creating New Row Each Update to Parse on Android
The Rest api docs show examples on 'game scores' where they use pointers and relation to link each new reported score back to the user&game. That relates pretty well to your scenario with reported GPS locations.

Categories : Android

I can't add new/update Android SDK Manager stuff
I am also living in China, and I got problems too thanks to the "Great" firewall, like many other websites, sometimes it was working, sometimes not. What I do is using temporary a VPN to update my SDK when needed. I use this one, in case you need it (a free one): http://www.websitevpn.com/.

Categories : Android

Android - update of custom preinstalled app
You need the permission android.permission.INSTALL_PACKAGES (which requires your app to be within /system/app or signed by the manufacturer), then you can have a look at this question about installing apps silently, there are multiple ways how to do that. Probably the most easy way is downloading the apk, and executing pm install /path/to/apk.

Categories : Android

Android-Studio 0.2.2 error update
This is unfortunately a long standing bug with IntelliJ (the basis for AndroidStudio). Have a look at their bugtracker for more informations. I just filed a new bug about this because thus far it is unresolved and the cause is still rather mysterious. If you want to add anything to it or vote for it or simply watch what is happening...

Categories : Android

Android Widget Failing To Update
AppWidgetProvider extends android.content.BroadcastReceiver, so you cannot register new BroadcastReceiver to the your AppWidget's context. In your code, you will not receive battery event from your BroadcastReceiver. Refer these previous questions. :) Android Broadcast Receiver in Widget Register BroadcastReceiver to Widget (Difference of Context object)

Categories : Android

Android SharedPreferences update does not work
I may be wrong but I think the way you are retrieving the Shared Preferences is the problem. Try using SharedPreferences prefs = getSharedPreferences("appPreferenceKey", Context.Mode_Private);

Categories : Android

progress bar only displays and does not update new to android
Remove you while loop. Put the progressBarHandler.post code in the for loop. The way it is now, you never update the progress bar until you exit the for loop, and then, you exit the while loop as well.

Categories : Android

how to update android studio with .jar file?
Note: There is not a patch update available from 0.1.9 to 0.2. To update from Android Studio 0.1.x to 0.2.x, you must install a new Android Studio bundle from this page. The reason for that is that we have made changes to the bundled SDK such that it includes a pre-configured local Maven repository which can serve up the v4 support library and which is required for creating new projects. From http://developer.android.com/sdk/installing/studio.html#Revisions So why not downloading a new version of Android Studio? Update: If you can't update by network. Try this: java -classpath /path/to/AI-130.687321-130.692269-patch-unix.jar com.intellij.updater.Runner install $PWD From https://code.google.com/p/android/issues/detail?id=56068

Categories : Android

How to update android GPS regularly on the screen?
I assume what you want to implement is : 1) User presses Start and the location starts getting updated using the gps. 2) The distance continues to be updated as long as the user doesn't press the Stop 3) On Stop the location and distance is not updated anymore. For 1) : You should register the location listener in the onClick() method of the Start Button. Currently you are registering the location listener in the onCreate(). Thus pressing the Start button will do nothing (except to display the distance in showData textview). For 2) : Let the distance calculation be in the onLocationChanged() method. You should shift your display code, i.e, setting up the distance in showData textview to onLocationChanged() method. Currently your code updates the showData text with the calculated distance

Categories : Android



© Copyright 2017 w3hello.com Publishing Limited. All rights reserved.