Posts

Showing posts from November, 2014

Bootstrap Shown.bs.tab Event Not Working

Answer : Bootstrap tab events are based off the .nav-tabs elements, not the .tab-content elements. So in order to tap into the show event, you need the element with an href that is pointed towards #tab1 , not the #tab1 content element itself. So instead of this: $('#tab1').on('shown.bs.tab', function (e) { console.log("tab1"); }); Do this instead: $('[href=#tab1]').on('shown.bs.tab', function (e) { console.log("tab1"); }); Or, to capture all of them, just do this: $('a[data-toggle="tab"]').on('shown.bs.tab', function (e) { console.log(e.target.href); }) Demo in Stack Snippets $('a[data-toggle="tab"]').on('shown.bs.tab', function (e) { console.log(e.target.href); }) <link href="//cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/3.3.2/css/bootstrap.css" rel="stylesheet"/> <script src="//cdnjs.cloudflare.com/ajax/li

Android Studio Emulator And AMD CPU

Image
Answer : If you have an AMD processor, you can download an ARM image, but it is super slow on x86 platforms. The x86 image does not work with AMD CPUs, because the x86 image needs HAXM installed which needs VT-X support, and only Intel CPUs support it. So you can download the Genymotion emulator, which supports both VT-X & AMD-V technology. Genymotion is super fast. Other than hooking your physical device up to test, it's the next best thing. Android Studio emulator is not efficient for testing. I am using the personal version of Genymotion. With the latest API 30, even x86 emulators are very fast in AMD processors. For this in Windows, you follow this below. You absolutely don't need Intel HAXM (Hardware Accelerated Execution Mode) in AMD processors, because they are AMD processors. Just enable (check) Windows Hypervisor Platform in Windows features as shown below. Now, you can start emulators. No need of Intel HAXM. Here is official link: https://android-deve

Android Change Include Layout Programmatically Code Example

Example 1: code to include layout from java in android < ViewStub android : id = "@+id/layout_stub" android : inflatedId = "@+id/message_layout" android : layout_width = "match_parent" android : layout_height = "match_parent" android : layout_weight = "0.75" / > Example 2: code to include layout from java in android ViewStub stub = ( ViewStub ) findViewById ( R . id . layout_stub ) ; stub . setLayoutResource ( R . layout . whatever_layout_you_want ) ; View inflated = stub . inflate ( ) ;

A Href Button Html Code Example

Example 1: href on a button < button onclick = " window.location.href= ' /page2 ' " > Continue </ button > Example 2: buton html href <!-- if you are on Window : --> < button onclick = " window.location.href= ' page2.html ' " > Button </ button > <!-- if you are on linux or macOS : --> < button onclick = " location.href= ' page2.html ' " > Button </ button > Example 3: html button click url # Wrap whole button in a 'a' tag. < a href = " https://google.com " class = " button " > < button class = " pixel " > Button text </ button > </ a >

Centos Add User Docker Group Code Example

Example 1: add user to docker group sudo usermod -aG docker $USER #$USER is your username Example 2: add user to docker group sudo gpasswd -a $USER docker

Change Templates In Xcode

Answer : You wouldn't change the existing templates. In other words, don't modify anything under the /Developer hierarchy (or wherever you installed your developer tools). Instead, clone the templates you want to have customized variants of. Then change their names and the information in them. Finally, put them in the appropriate location in your account's Library/Application Support folder, specifically: File templates: ~/Library/Application Support/Developer/Shared/Xcode/File Templates/ Target templates: ~/Library/Application Support/Developer/Shared/Xcode/Target Templates/ Project templates: ~/Library/Application Support/Developer/Shared/Xcode/Project Templates/ That way they won't be overwritten when you install new developer tools, and you can tweak them to your heart's content. Update For newer versions of Xcode the updated path will be: ~/Library/Developer/Xcode/Templates/File Templates/Source This may be useful for somebody: As for X
Answer : Set yourself as the ARSession.delegate . Than you can implement session(_:didUpdate:) which will give you an ARFrame for every frame processed in your session. The frame has an camera property that holds information on the cameras transform, rotation and position. func session(_ session: ARSession, didUpdate frame: ARFrame) { // Do something with the new transform let currentTransform = frame.camera.transform doSomething(with: currentTransform) } As rickster pointed out you always can get the current ARFrame and the camera position through it by calling session.currentFrame . This is useful if you need the position just once, eg to move a node where the camera has been but you should use the delegate method if you want to get updates on the camera's position. I know it had been solved but i have a little neat solution for it .. I would prefere adding a renderer delegate method.. it's a method in ARSCNViewDelegate func renderer(_ renderer:

Change Python Version In Conda Environment Code Example

Example 1: change python version in conda environment conda install python = 3.7 Example 2: anaconda create environment python version conda create -n myenv python = 3.6 Example 3: conda set python version conda search python conda install python = 3.6 .2 Example 4: how to downgrade python to 3.7 4 anaconda conda install python = 3.5 .0 # or maybe conda install python = 2.7 .8 # or whatever you want....

Angular 9 Introduced A Global '$localize()' Function That Needs To Be Loaded

Answer : You need to make sure you have the @angular/localize package first: npm install @angular/localize --save Then, import '@angular/localize/init' in your polyfills.ts file just like the error says The best way if you are using Angular CLI is to run ng add @angular/localize It will take care of it automatically Or else import '@angular/localize/init'; to your polyfills.ts Tested with Angular 9 If you have many angular projects in same workspace, running ng add @angular/localize will add import statement import '@angular/localize/init' to polyfills.ts in default Project only,i think this will be fixed in later updates. so you need to add import '@angular/localize/init' manually to polyfills.ts in other projects.

Add Icon To Submit Button In Twitter Bootstrap 2

Answer : You can use a button tag instead of input <button type="submit" class="btn btn-primary"> <i class="icon-user icon-white"></i> Sign in </button> I think you can use label tags for this purpose. Here is a sample of the twitter bootstrap HTML navbar: <form class="navbar-search"> <input type="text" class="search-query" placeholder="Search here" /> <label for="mySubmit" class="btn"><i class="icon-search icon-white"></i> Search me</label> <input id="mySubmit" type="submit" value="Go" class="hidden" /> </form> Basically you get a label element for the input (type=submit) and then you hide the actual input submit. Users can click on the label element and still get through with the form submission. I think you should try this FontAwesome designe

Anime Take Code Example

Example 1: anime Ah, I see you are a man of culture as well Example 2: anime print('Watch love is war, its lit')

Bootstrap 4 Css Cdn. Code Example

Example 1: bootstrap 4 cdn < link rel = " stylesheet " href = " https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/css/bootstrap.min.css " > Example 2: bootstrap 4 cdn <!-- Boostrap 4 CSS --> < link rel = " stylesheet " href = " https://stackpath.bootstrapcdn.com/bootstrap/4.4.1/css/bootstrap.min.css " integrity = " sha384-Vkoo8x4CGsO3+Hhxv8T/Q5PaXtkKtu6ug5TOeNV6gBiFeWPGFN9MuhOf23Q9Ifjh " crossorigin = " anonymous " > < script src = " https://stackpath.bootstrapcdn.com/bootstrap/4.4.1/js/bootstrap.min.js " integrity = " sha384-wfSDF2E50Y2D1uUdj0O3uMBJnjuUD4Ih7YwaYd1iqfktj0Uod8GCExl3Og8ifwB6 " crossorigin = " anonymous " > </ script > <!-- Boostrap JS --> < script src = " https://code.jquery.com/jquery-3.4.1.slim.min.js " integrity = " sha384-J6qa4849blE2+poT4WnyKhv5vZF5SrPo0iEjwBvKU7imGFAV0wwj1yYfoRSJoZ+n " crossorig

AngularJS: How To Clear Query Parameters In The URL?

Answer : I use $location.search('key', null) As this not only deletes my key but removes it from the visibility on the URL. I ended up getting the answer from AngularJS forum. See this thread for details The link is to a Google Groups thread, which is difficult to read and doesn't provide a clear answer. To remove URL parameters use $location.url($location.path()); To remove ALL query parameters, do: $location.search({}); To remove ONE particular query parameter, do: $location.search('myQueryParam', null);