Posts

Showing posts from November, 2008

Android Studio 3.0 Unsigned Apk Not Installing

Image
Answer : Looks like we can not directly use the apk after running on the device from the build->output->apk folder. After upgrading to android studio 3.0 you need to go to Build -> Build Apk(s) then copy the apk from build -> output -> apk -> debug Like this - Fist Click On Build Icon on android studio after that click Build APK(s) then Generate APK the copy Apk. It is working perfact.

Checkbox Disabled Attribute In ASP.NET MVC

Answer : It is not easy to achieve this with an if condition inside the helper method because all the below markups will render a disabled chechbox. <input type="checkbox" disabled> <input type="checkbox" disabled="disabled"> <input type="checkbox" disabled="false"> <input type="checkbox" disabled="no"> <input type="checkbox" disabled="enabled"> This should work in the razor. Simple If condition and rendering what you want. @if(item.Selected) { @Html.CheckBoxFor(modelItem => item.Selected) } else { @Html.CheckBoxFor(modelItem => item.Selected, new { @disabled = "disabled"}) } You may consider writing a custom html helper which renders the proper markup for this. This won't work because <input disabled="anything" /> will result in a disabled control. You need to only have a @disabled property when it should be d

Installing Ansible Example

This page describes how to install Ansible on different platforms. Ansible is an agentless automation tool that by default manages machines over the SSH protocol. Once installed, Ansible does not add a database, and there will be no daemons to start or keep running. You only need to install it on one machine (which could easily be a laptop) and it can manage an entire fleet of remote machines from that central point. When Ansible manages remote machines, it does not leave software installed or running on them, so there’s no real question about how to upgrade Ansible when moving to a new version. Prerequisites Control node requirements Managed node requirements Selecting an Ansible version to install Installing Ansible on RHEL, CentOS, or Fedora Installing Ansible on Ubuntu Installing Ansible on Debian Installing Ansible on Gentoo with portage Installing Ansible on FreeBSD Installing Ansible on macOS Installing Ansible on Solaris Installing Ansible on Arch Linux In

6 Factorial Is Code Example

Example 1: factorial of 8 function getFactorial($int) { $factorial = 1; for ($i = $int; $i > 1; $i--) { $factorial *= $i; } echo "The factorial of " . $int . " is " . $factorial . ' < br > '; } Example 2: Factorial Number // METHOD ONE const factorialNumber = num => { let factorials = [] for(let i = 1; i <= num; i++) factorials.push(i) return factorials.reduce((acc , curr) => acc * curr, 1) } // METHOD TWO const factorialNumber = num => { let factorial = 1, i = 1 while(i <= num){ factorial *= i; i++ } return factorial } // METHOD THREE function factorialNumber(num) { if(num < 1) return 1 else return factorialNumber(num - 1) * num }

Bootstrap Disclaimer Template Code Example

Example 1: bootstrap errors This is a primary alert—check it out! This is a secondary alert—check it out! This is a success alert—check it out! This is a danger alert—check it out! This is a warning alert—check it out! This is a info alert—check it out! This is a light alert—check it out! This is a dark alert—check it out! Example 2: bootstrap Alerts Alerts are available for any length of text, as well as an optional dismiss button. For proper styling, use one of the eight required contextual classes (e.g., .alert-success). For inline dismissal, use the alerts jQuery plugin. A simple primary alert—check it out! A simple secondary alert—check it out! A simple success alert—check it out! A simple danger alert—check it out! A simple warning alert—check it out! A simple info alert—check it out! A simple light alert—check it out! A simple dark alert—check it out! A simple primary alert with an example link. Give it a

Asar Namaz Time Islamabad Code Example

Example: islamabad prayer timings Islamabad Prayer Times
Note This module is part of ansible-base and included in all Ansible installations. In most cases, you can use the short module name apt_key even without specifying the collections: keyword. Despite that, we recommend you use the FQCN for easy linking to the module documentation and to avoid conflicting with other collections that may have the same module name. New in version 1.0: of ansible.builtin Synopsis Requirements Parameters Notes Examples Return Values Synopsis Add or remove an apt key, optionally downloading it. Requirements The below requirements are needed on the host that executes this module. gpg Parameters Parameter Choices/Defaults Comments data string The keyfile contents to add to the keyring. file path The path to a keyfile on the remote server to add to the keyring. id string The identifier of the key. Including this allows check mode to correctly report the changed state. If specifying a sub

Angular2 Watch For Route Change

Answer : In the final version of Angular (e.g. Angular 2/4), you can do this this.router.events.subscribe((event) => { if(event.url) { console.log(event.url); } }); Every time the route changes, events Observable has the info. Click here for docs . If you are using "@angular/router": "3.0.0-alpha.7", "@angular/router-deprecated": "2.0.0-rc.2", then this.router.events.subscribe((event) => { console.log('route changed'); }); Here's what I use in my app. You can subscribe to a Route instance to track changes. class MyClass { constructor(private router: Router) { router.subscribe((val) => /*detect changes*/) } }

Boostrap Cdn Code Example

Example 1: bootstrap cdn < link rel = " stylesheet " href = " https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/css/bootstrap.min.css " > Example 2: bootstrap cdn CSS < link rel = " stylesheet " href = " https://maxcdn.bootstrapcdn.com/bootstrap/3.4.1/css/bootstrap.min.css " > JS < script src = " https://maxcdn.bootstrapcdn.com/bootstrap/3.4.1/js/bootstrap.min.js " > </ script > JQuery < script src = " https://ajax.googleapis.com/ajax/libs/jquery/3.4.1/jquery.min.js " > </ script > Example 3: mdbootstrap cdn <!-- Font Awesome --> < link rel = " stylesheet " href = " https://use.fontawesome.com/releases/v5.8.2/css/all.css " > <!-- Google Fonts --> < link rel = " stylesheet " href = " https://fonts.googleapis.com/css?family=Roboto:300,400,500,700&display=swap " > <!-- Bootstrap core CSS --> &l

Bootstrap Select Multiple Dropdown Custom Style Code Example

Example: multiple select dropdown in bootstrap $('select').selectpicker();

Arial Font Google Cdn Link Code Example

Example 1: add google font CSS @import url ( https://fonts.googleapis.com/css?family=Roboto ) ; HTML <link rel="stylesheet" href="https://fonts .googleapis .com /css?family=Roboto"/ > body { font-family : "Roboto" ; } Example 2: google font library <link href= "https://fonts.googleapis.com/css?family=Lobster" rel= "stylesheet" type= "text/css"

Change Color Linear Progress Indicator Flutter Code Example

Example 1: how to change color of circular progress indicator in flutter valueColor: new AlwaysStoppedAnimation (Colors.blue), Example 2: flutter change color of circular progress indicator valueColor: new AlwaysStoppedAnimation (Colors.blue),

Android: Permission Denial: Starting Intent With Revoked Permission Android.permission.CAMERA

Answer : Remove this permission <uses-permission android:name="android.permission.CAMERA"/> I faced this error executing my app in android 7. After tests I noticed user permission wasn't in project A but it was in project B, that I only tested in android 5 devices. So I remove that permission in project B in order to run it on other device that targets android 7 and it finally could open. In adittion I added the fileprovider code that Android suggests here https://developer.android.com/training/camera/photobasics.html Hope this helps. hi you can use these permission in your manifest file with other permission, <uses-feature android:name="android.hardware.camera.any" android:required="true" /> <uses-feature android:name="android.hardware.camera.autofocus" android:required="false" /> If still it not working then may be you are using android M,SO you need to programmatically add permissio

Map Arduino Tutorial Code Example

Example: map arduino Syntax map ( value , fromLow , fromHigh , toLow , toHigh ) Parameters value : the number to map . fromLow : the lower bound of the value’s current range . fromHigh : the upper bound of the value’s current range . toLow : the lower bound of the value’s target range . toHigh : the upper bound of the value’s target range . Example : map ( val , 0 , 255 , 0 , 1023 ) ;

Bootstrap Cards Side By Side Code Example

Example 1: boostrap card < div class = " card " style = " width : 18 rem ; " > < div class = " card-body " > < h5 class = " card-title " > Card title </ h5 > < h6 class = " card-subtitle mb-2 text-muted " > Card subtitle </ h6 > < p class = " card-text " > Some quick example text to build on the card title and make up the bulk of the card's content. </ p > < a href = " # " class = " card-link " > Card link </ a > < a href = " # " class = " card-link " > Another link </ a > </ div > </ div > Example 2: bootstrap card change image .card-img-top { width: 100%; height: 15vw; object-fit: cover; } Example 3: .card class < style > .card { border : 1 px solid #ccc ; background-color : #f4f4f4 ; padding : 20 px