Tutorial by Examples: current

To change password of current user just type: sudo passwd It will ask you to enter your current password: [sudo] password for <user>: And then you will be asked to enter new password: Enter new UNIX password: And finally you will be asked to re-enter your password: Retype new UNIX...
// Get the battery API navigator.getBattery().then(function(battery) { // Battery level is between 0 and 1, so we multiply it by 100 to get in percents console.log("Battery level: " + battery.level * 100 + "%"); });
// Add active class to active navigation link $(document).ready(function () { $('ul.nav.navbar-nav').find('a[href="' + location.pathname + '"]') .closest('li').addClass('active'); });
For one-time, non-constant requests for a user's physical activity, use the Snapshot API: // Remember to initialize your client as described in the Remarks section Awareness.SnapshotApi.getDetectedActivity(client) .setResultCallback(new ResultCallback<DetectedActivityResult>() { ...
// Remember to intialize your client as described in the Remarks section Awareness.SnapshotApi.getLocation(client) .setResultCallback(new ResultCallback<LocationResult>() { @Override public void onResult(@NonNull LocationResult locationResult) { Location lo...
// Remember to initialize your client as described in the Remarks section Awareness.SnapshotApi.getWeather(client) .setResultCallback(new ResultCallback<WeatherResult>() { @Override public void onResult(@NonNull WeatherResult weatherResult) { Weather weathe...
Often you will get into a state where you have a partially typed command sequence in progress, but you want to abort it. You can abort it with either of the following keybindings: C-g EscEscEsc
You can reload the current state using the $state.reload method from your controller $state.reload() This is a shorthand for (code taken from the official docs) $state.transitionTo($state.current, $stateParams, { reload: true, inherit: false, notify: false }); Running a reload on your ...
The following uses a variable with a for loop to rename a group of files. SetLocal EnableDelayedExpansion for %%j in (*.*) do ( set filename=%%~nj set filename=!filename:old=new! set filename=Prefix !filename! set filename=!filename! Suffix ren "%%j" "!filename!%%~x...
The table shows a list of currently supported release showing both original distribution releases (e.g. Ubuntu 14.04) and point releases (e.g. 14.04.3). The Ubuntu versions which are still supported will be delivered security updates. Point releases include support for new hardware as well as rolli...
Mage::helper('core/url')->getCurrentUrl();
There are a few ways to determine the current shell echo $0 ps -p $$ echo $SHELL
public class InsertIntoConcurrentHashMap { public static void main(String[] args) { ConcurrentHashMap<Integer, SomeObject> concurrentHashMap = new ConcurrentHashMap<>(); SomeObject value = new SomeObject(); Integer key = 1; SomeObject ...
You can get the current location and local places of user by using the Google Places API. Ar first, you should call the PlaceDetectionApi.getCurrentPlace() method in order to retrieve local business or other places. This method returns a PlaceLikelihoodBuffer object which contains a list of PlaceLi...
Use the os.getcwd() function: print(os.getcwd())
FNR contains the number of the input file row being processed. In this example you will see awk starting on 1 again when starting to process the second file. Example with one file $ cat file1 AAAA BBBB CCCC $ awk '{ print FNR }' file1 1 2 3 Example with two files $ cat file1 AAAA BBBB...
The built-in functions GETDATE and GETUTCDATE each return the current date and time without a time zone offset. The return value of both functions is based on the operating system of the computer on which the instance of SQL Server is running. The return value of GETDATE represents the current tim...
To get the current date you use the DateTime.Today property. This returns a DateTime object with today's date. When this is then converted .ToString() it is done so in your system's locality by default. For example: Console.WriteLine(DateTime.Today); Writes today's date, in your local format to...
Imagine that we have a separate Google spreadsheet, and we need to get the B2 cell value to cell D5 on your current sheet. function copyValueandPaste() { var source = SpreadsheetApp.openById('spread sheet id is here'); //Separate spreadsheet book var sourcesheet = source.getSheetByName...
This exception occurs when a collection is modified while iterating over it using methods other than those provided by the iterator object. For example, we have a list of hats and we want to remove all those that have ear flaps: List<IHat> hats = new ArrayList<>(); hats.add(new Ushanka...

Page 3 of 7