Posts

Showing posts from August, 2019

Change Point Size And Color On Hover In Chartjs

Answer : To change the data point­ 's color and size on hover, you'll need to set pointHoverBackgroundColor and pointHoverRadius property (as needed) respectively for the dataset, like so ... datasets: [{ ... pointHoverRadius: 5, pointHoverBackgroundColor: 'red' }] ᴅᴇᴍᴏ var ctx = $('#chart'); var myLineChart = new Chart(ctx, { type: 'line', data: { labels: [1, 2, 3, 4, 5], datasets: [{ label: '# of votes', data: [1, 2, 3, 4, 5], fill: false, pointHoverRadius: 5, pointHoverBackgroundColor: 'red' }] } }); <script src="https://cdnjs.cloudflare.com/ajax/libs/Chart.js/2.5.0/Chart.min.js"></script> <script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script> <canvas id="chart"></canvas> Answering an old thread as accepted answer didn't work for me f

Admob Vs AdSense

Answer : AdMob is used for native applications, so you should use AdMob in this case. AdSense is used for mobile web applications. The amount of revenue in an ad-based model really depends on the amount of users and ad requests. Ads can be a good stream of revenue but you do need the user base for it to take off. According to your last question: Users click ads in mobile apps much more than on websites and it is much easier to make money on mobile platforms. It is quite harder than 1-2 years ago, but you can still get through. If you want to make money on apps Android is a very good choice, but if you would prefer to sell your apps choose iPhone. Simple answer: Adsense : For websites. If you login in adsense website you'll read "Show ads on your own website". Admob : For natives or hybrids apps ("mob" comes from mobile). This would be your case. If you login in Admob's website you'll read "Earn more from your apps the smart way". If

Can I Use TensorBoard With Google Colab?

Answer : EDIT: You probably want to give the official %tensorboard magic a go, available from TensorFlow 1.13 onward. Prior to the existence of the %tensorboard magic, the standard way to achieve this was to proxy network traffic to the Colab VM using ngrok. A Colab example can be found here. These are the steps (the code snippets represent cells of type "code" in colab): Get TensorBoard running in the background. Inspired by this answer. LOG_DIR = '/tmp/log' get_ipython().system_raw( 'tensorboard --logdir {} --host 0.0.0.0 --port 6006 &' .format(LOG_DIR) ) Download and unzip ngrok. Replace the link passed to wget with the correct download link for your OS. ! wget https://bin.equinox.io/c/4VmDzA7iaHb/ngrok-stable-linux-amd64.zip ! unzip ngrok-stable-linux-amd64.zip Launch ngrok background process... get_ipython().system_raw('./ngrok http 6006 &') ...and retrieve public url. Source ! curl -s http://localho

Change Directory In Node.js Command Prompt

Image
Answer : That isn't the Node.js command prompt window. That is a language shell to run JavaScript commands, also known as a REPL. In Windows, there should be a Node.js command prompt in your Start menu or start screen: Which will open a command prompt window that looks like this: From there you can switch directories using the cd command. To switch to the another directory process.chdir("../"); If you mean to change default directory for "Node.js command prompt", when you launch it, then (Windows case) go the directory where NodeJS was installed find file nodevars.bat open it with editor as administrator change the default path in the row which looks like if "%CD%\"=="%~dp0" cd /d "%HOMEDRIVE%%HOMEPATH%" with your path. It could be for example if "%CD%\"=="%~dp0" cd /d "c://MyDirectory/" if you mean to change directory once when you launched "Node.js command prom

Apply Transparent Background In GIMP

Image
Answer : Select Layer → Transparency → Add Alpha Channel Select the background using the Fuzzy Selection Tool (Magic Wand) and press the Del key. GIF will allow you single-color transparency, while PNG has full alpha channel support. Open the image and choose Select > By Color from the menu. Click on the color you'd like to remove. Select Colors > Color to Alpha from the menu and click OK. This will result in the transparent, checkered background that you're looking for. If the background is made up of multiple colors, just repeat these three steps as necessary.

ASUS BIOS Keeps Resetting Boot Priority To Windows Boot Manager Before UEFI

Image
Answer : After more digging found one answer here that is working. http://www.tomsguide.com/answers/id-1973164/change-asus-boot-order.html I just completed a CHAT session with ASUS. It worked!! Here is what they told me: Enter the BIOS setup menu by pressing and holding F2 key when powering on. Switch to “Boot” and set “Launch CSM” to Enabled. Switch to “Security” and set “Secure Boot Control” to Disabled. Press F10 to save and exit. Press and hold ESC key to launch boot menu when the Unit restarts. We now get the following (happy!) screen: And we can get to the Ubuntu Boot Disk: (* 20 mins pass *) And now I am logged in and editing this question from the (successfully) installed ubuntu 15.10 woot! Just solved this problem by DISABLEing the FAST BOOT option in te BOOT tab. And then all the disks are selectable further on that TAB

Bootstrap Buttons With Icons Code Example

Example 1: bootstrap 4 button with icon <!-- Add icon library --> < link rel = " stylesheet " href = " https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css " > < button class = " btn " > < i class = " fa fa-home " > </ i > </ button > Example 2: how to icon button in html <! DOCTYPE html > < html > < head > < meta name = " viewport " content = " width=device-width, initial-scale=1 " > <!-- Add icon library --> < link rel = " stylesheet " href = " https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css " > < style > .btn { background-color : DodgerBlue ; border : none ; color : white ; padding : 12 px 16 px ; font-size : 16 px ; cursor : pointer ; } /* Darker background on mouse-over */ .btn :hover { background-color

Bullets Numbered Latex Code Example

Example 1: latex bullet points \begin{itemize} \item One entry in the list \item Another entry in the list \end{itemize} Example 2: list overleaf \begin{enumerate} \item The labels consists of sequential numbers. \begin{itemize} \item The individual entries are indicated with a black dot, a so-called bullet. \item The text in the entries may be of any length. \end{itemize} \item The numbers starts at 1 with every call to the enumerate environment. \end{enumerate}

Tar Czf Code Example

Example: tar cmd # tar cvzf MyImages - 14 - 09 - 12. tar . gz / home / MyImages OR # tar cvzf MyImages - 14 - 09 - 12. tgz / home / MyImages

Centralizar Div No Meio Da Tela Code Example

Example 1: centralizar div no meio da tela .center-box { display : flex ; align-items : center ; justify-content : center ; } Example 2: posicionar div centro da tela .flex-box { display : flex ; align-items : center ; justify-content : center ; }
Note This plugin is part of the hetzner.hcloud collection (version 1.2.1). To install it use: ansible-galaxy collection install hetzner.hcloud . To use it in a playbook, specify: hetzner.hcloud.hcloud_floating_ip_info . Synopsis Requirements Parameters See Also Examples Return Values Synopsis Gather facts about your Hetzner Cloud Floating IPs. This module was called hcloud_floating_ip_facts before Ansible 2.9, returning ansible_facts and hcloud_floating_ip_facts . Note that the hetzner.hcloud.hcloud_floating_ip_info module no longer returns ansible_facts and the value was renamed to hcloud_floating_ip_info ! Requirements The below requirements are needed on the host that executes this module. hcloud-python >= 1.0.0 Parameters Parameter Choices/Defaults Comments api_token string / required This is the API Token for the Hetzner Cloud. endpoint string Default: "https://api.hetzner.cloud/v1" This is the API Endpoi

Angular NgIf

directive A structural directive that conditionally includes a template based on the value of an expression coerced to Boolean. When the expression evaluates to true, Angular renders the template provided in a then clause, and when false or null, Angular renders the template provided in an optional else clause. The default template for the else clause is blank. See more... Exported from CommonModule Selectors [ ngIf] Properties Property Description @ Input() ngIf : T Write-Only The Boolean expression to evaluate as the condition for showing a template. @ Input() ngIfThen : TemplateRef< NgIfContext<T>> Write-Only A template to show if the condition expression evaluates to true. @ Input() ngIfElse : TemplateRef< NgIfContext<T>> Write-Only A template to show if the condition expression evaluates to false. Description A shorthand form of the directive, * ngIf="condition" , is generally used, p

Alarm 1 Hour Code Example

Example: timer 1hr from time import sleep sleep(3600)

Angularjs Versions Code Example

Example 1: anjular js < script src = "https://ajax.googleapis.com/ajax/libs/angularjs/1.7.9/angular.min.js" > < /script > Example 2: angularjs < script src = "https://ajax.googleapis.com/ajax/libs/angularjs/1.7.9/angular.min.js" > < /script >

Can Magnitude Be Negative?

Answer : Scalar quantities can be negative. Instead of saying "scalar quantities have only magnitudes," a better description might be that a scalar quantity can be described using only one number per point in space. That number may be positive or negative. In contrast, a vector quantity cannot be described using only one number per point in space. In 3-d space, we need 3 numbers per point in space to describe a vector quantity. The word "magnitude," whether applied to a scalar or a vector or anything else, normally refers to a non-negative number. It is sometimes used to refer to the absolute value of a scalar, and sometimes used to refer to the norm (e.g., length) of a vector. In summary, this is how the words are typically used: Scalar typically refers to a single element of a number field (or a single element per point in space), such as a real number (which can be positive or negative) or even a complex number (this is common in the context of q

Asus ATK Driver For Windows 10

Image
Answer : ASUS support site is not very user friendly . I made a post with all the ASUS drivers for Windows 10 , including ATK Package. Here you can find ATK Package 1.0.0061 , for 64-bit and 32-bit versions. Asus released an official ATK driver for Windows 10 64 bit and you can reach at this link (pointing to Asus official download support site): http://dlcdnet.asus.com/pub/ASUS/nb/Apps_for_Win10/ATKPackage/ATKPackage_Win10_64_VER100039.zip Asus has a hard to find downloads section where you can grab latest versions of some apps and drivers. Follow this link and click Change Your Model , a window will appear. Select Notebook in the left column and then don't select your laptop model . Between laptop models in the center column there are some interesting items: Apps Apps for Win8 Apps for Win8.1 Apps for Win10 Drivers Drivers for Win8 Drivers for Win8.1 Drivers for Win10 Select one of these, then choose the app/driver you want from the right column. In thi

AngularJS : Ng-model Binding Not Updating When Changed With JQuery

Answer : Angular doesn't know about that change. For this you should call $scope.$digest() or make the change inside of $scope.$apply() : $scope.$apply(function() { // every changes goes here $('#selectedDueDate').val(dateText); }); See this to better understand dirty-checking UPDATE : Here is an example Just use; $('#selectedDueDate').val(dateText).trigger('input'); I have found that if you don't put the variable directly against the scope it updates more reliably. Try using some "dateObj.selectedDate" and in the controller add the selectedDate to a dateObj object as so: $scope.dateObj = {selectedDate: new Date()} This worked for me.

Android - How To Get Plain HTML Using EvaluateJavascript From Webview? JSOUP Not Able To Parse The Result HTML

Answer : You should use JsonReader to parse the value: webView.evaluateJavascript("(function() {return document.getElementsByTagName('html')[0].outerHTML;})();", new ValueCallback<String>() { @Override public void onReceiveValue(final String value) { JsonReader reader = new JsonReader(new StringReader(value)); reader.setLenient(true); try { if(reader.peek() == JsonToken.STRING) { String domStr = reader.nextString(); if(domStr != null) { handleResponseSuccessByBody(domStr); } } } catch (IOException e) { // handle exception } finally { IoUtil.close(reader); } } }); for remove the UTFCharacthers use this function: public static StringBuffer removeUTFCharacters(String data) { Pattern p = Pattern.compile("\\\\u(\\p{XDigit}{4})"); Matcher m = p.matcher(data);

Can I Include An MSI File Inside A Chocolatey Package?

Answer : Yes, this is definitely possible. This is actually exactly what the ChocolateyGUI package does. You can see its .nuspec file here: https://github.com/chocolatey/ChocolateyGUI/blob/develop/nuspec/chocolatey/ChocolateyGUI.nuspec <?xml version="1.0"?> <package> <metadata> <id>chocolateygui</id> <version>$version$</version> <title>Chocolatey GUI</title> <authors>Chocolatey</authors> <owners>Chocolatey</owners> <projectUrl>https://github.com/chocolatey/ChocolateyGUI</projectUrl> <projectSourceUrl>https://github.com/chocolatey/ChocolateyGUI</projectSourceUrl> <packageSourceUrl>https://github.com/chocolatey/ChocolateyGUI/tree/develop/nuspec/chocolatey</packageSourceUrl> <iconUrl>https://raw.githubusercontent.com/chocolatey/choco/master/docs/logo/chocolateyicon.gif</iconUrl> <licenseUrl>https://ra

Access Logs From Console.log() In Node.js Vm Module

Answer : You can just wrap console.log directly: function hook_consolelog(callback) { var old_log = console.log; console.log = (function(write) { return function() { write.apply(console, arguments) callback.apply(null, arguments); } })(console.log) return function() { console.log = old_log; } } var result; var unhook = hook_consolelog(function(v) { result = v; }); console.log('hello'); unhook(); console.log('goodbye'); console.log('the result is ', result);​ Since console.log simply calls process.stdout , another approach would be to capture the stdout events using a bit of wrapper magic like this: var util = require('util') function hook_stdout(callback) { var old_write = process.stdout.write process.stdout.write = (function(write) { return function(string, encoding, fd) { write.apply(process.stdout, arguments) callback(string,

Bash Compare Variable To Number Code Example

Example 1: number compare in bash #!/bin/bash # Script to do numeric comparisons var1 = 10 var2 = 20 if [ $var2 -gt $var1 ] then echo " $var2 is greater than $var1 " fi # Second comparison If [ $var1 -gt 30 ] then echo " $var is greater than 30" else echo " $var1 is less than 30" fi Example 2: bash compare numbers bash if greater thanShell/Bash By Me ( Armandres ) on Feb 18 2021 DonateDeleteEdit if (( a > b )) ; then .. . fi #Use above example or below one: if [ " $a " -gt " $b " ] ; then .. . fi

What Does Scp Stand For Code Example

Example 1: using scp scp remote_username@ 10.10 .0 .2 : / remote / file . txt / local / directory Example 2: scp examples # With ssh key , verbose , and - r for whole directories . scp - v - i [ your private key path ] - r / my_dir [ server_user ] @ [ serverIP ] : / where / to / copy

Animating AddClass/removeClass With JQuery

Answer : Since you are not worried about IE, why not just use css transitions to provide the animation and jQuery to change the classes. Live example: http://jsfiddle.net/tw16/JfK6N/ #someDiv{ -webkit-transition: all 0.5s ease; -moz-transition: all 0.5s ease; -o-transition: all 0.5s ease; transition: all 0.5s ease; } Another solution (but it requires jQueryUI as pointed out by Richard Neil Ilagan in comments) :- addClass, removeClass and toggleClass also accepts a second argument; the time duration to go from one state to the other. $(this).addClass('abc',1000); See jsfiddle:- http://jsfiddle.net/6hvZT/1/ You could use jquery ui's switchClass , Heres an example: $( "selector" ).switchClass( "oldClass", "newClass", 1000, "easeInOutQuad" ); Or see this jsfiddle.

Catch Multiple Exceptions In One Line (except Block)

Answer : From Python Documentation: An except clause may name multiple exceptions as a parenthesized tuple, for example except (IDontLikeYouException, YouAreBeingMeanException) as e: pass Or, for Python 2 only: except (IDontLikeYouException, YouAreBeingMeanException), e: pass Separating the exception from the variable with a comma will still work in Python 2.6 and 2.7, but is now deprecated and does not work in Python 3; now you should be using as . How do I catch multiple exceptions in one line (except block) Do this: try: may_raise_specific_errors(): except (SpecificErrorOne, SpecificErrorTwo) as error: handle(error) # might log or have some other default behavior... The parentheses are required due to older syntax that used the commas to assign the error object to a name. The as keyword is used for the assignment. You can use any name for the error object, I prefer error personally. Best Practice To do this in a manner currently and