Posts

Showing posts from April, 2017

Vscode Comment Lines Code Example

Example 1: vscode comment block of code html * * * * * * * * * * For Mac * * * * * * * * * * * * * * -> How to comment a block ? Command + K + C -> How to uncomment a block ? Command + K + U Example 2: toggle line comment vs code Ctrl + / - Toggle line comment ( default ) Example 3: how to comment selection in visual studio In Visual Studio : Ctrl + K + C will comment , Ctrl + K + U Will uncomment Example 4: commenting in vscode //To comment a block of code in one go, try Ctrl + K, and the Ctrl + C to //comment or Ctrl + U to uncomment. //Pro-Tip: You can also do it without unpressing Ctrl.

403 Access Denied On Tomcat 8 Manager App Without Prompting For User/password

Answer : This may be work. Find the CATALINA_HOME/webapps/manager/META-INF/context.xml file and add the comment markers around the Valve. <Context antiResourceLocking="false" privileged="true" > <!-- <Valve className="org.apache.catalina.valves.RemoteAddrValve" allow="127\.\d+\.\d+\.\d+|::1|0:0:0:0:0:0:0:1" /> --> </Context> You can find more details at this page. The solution that worked for me is edit context.xml files in both $CATALINA_HOME/webapps/manager/META-INF and $CATALINA_HOME/webapps/host-manager/META-INF where my ip is 123.123.123.123 . <Context antiResourceLocking="false" privileged="true" > <Valve className="org.apache.catalina.valves.RemoteAddrValve" allow="127\.\d+\.\d+\.\d+|::1|0:0:0:0:0:0:0:1|123.123.123.123" /> </Context> I installed Tomcat 8.5 on Ubuntu and edited $CATALINA_HOME/conf/tomcat-users.xml : <role ro

Alter Sequence Restart With Postgres Code Example

Example: postgresql alter table sequence alter sequence your_sequence restart with 1000 ;

Cast To Int Javascript Code Example

Example 1: how to convert string to int js let string = "1" ; let num = parseInt ( string ) ; //num will equal 1 as a int Example 2: Javascript string to int var myInt = parseInt ( "10.256" ) ; //10 var myFloat = parseFloat ( "10.256" ) ; //10.256 Example 3: string to number javascript // Method - 1 ### parseInt() ### var text = "42px" ; var integer = parseInt ( text , 10 ) ; // returns 42 // Method - 2 ### parseFloat() ### var text = "3.14someRandomStuff" ; var pointNum = parseFloat ( text ) ; // returns 3.14 // Method - 3 ### Number() ### Number ( "123" ) ; // returns 123 Number ( "12.3" ) ; // returns 12.3 Number ( "3.14someRandomStuff" ) ; // returns NaN Number ( "42px" ) ; // returns NaN Example 4: convert string to number javascript var myString = "869.99" var myFloat = parseFloat ( myString ) var myInt = parseInt ( myString

Alternative To Google Finance Api

Answer : Updating answer a bit 1. Try Twelve Data API For beginners try to run the following query with a JSON response: https://api.twelvedata.com/time_series?symbol=AAPL&interval=1min&apikey=demo&source=docs NO more real time Alpha Vantage API For beginners you can try to get a JSON output from query such as https://www.alphavantage.co/query?function=TIME_SERIES_DAILY&symbol=MSFT&apikey=demo DON'T Try Yahoo Finance API (it is DEPRECATED or UNAVAILABLE NOW). Here is a link to previous Yahoo Finance API discussion on StackOverflow. Here's an alternative link to Yahoo Finance API posted on Google Code. For beginners, you can generate a CSV with a simple API call: http://finance.yahoo.com/d/quotes.csv?s=AAPL+GOOG+MSFT&f=sb2b3jk (This will generate and save a CSV for AAPL, GOOG, and MSFT) Note that you must append the format to the query string ( f=.. ). For an overview of all of the formats see this page. For more examples, visit this p

Can I Get A Combined Inbox In Thunderbird?

Answer : I believe the feature you are looking for is called 'Unified Folders' which works on both IMAP and POP3 protocols. The official site location: http://kb.mozillazine.org/Global_Inbox#Unified_Folders Quote from the site: Unified Folders (originally named Smart Folders when it was added in 3.0) is a folder pane view which looks like a global inbox account by merging the contents of all inbox folders (both POP, IMAP and local folders) from all accounts. It also shows the inbox of each account as a child folder of the unified Inbox account. Any messages in an inbox shows up in both the root of the unified Inbox, plus the child folder of the unified Inbox for that account. To use this functionality: View >> Folders >> Unified I have verified that this does work on Thunderbird 12.0.1 using Ubuntu 12.04 . The KB article I found above it a bit old but still holds correct information about the functionality of the 'Unified Folders

Android Push Notification Without Firebase Code Example

Example: firebase push notification ios no sound { "to": "myToken", "notification": { "body": "test", "title": "test", "sound": "default" }, "priority": "high" }

Bracket Latex Code Example

Example: brackets equation latex \documentclass{article} \usepackage{amsmath} \begin{document} \begin{equation} D_{it} = \begin{cases} 1 & \text{if bank $i$ issues ABs at time $t$}\\ 2 & \text{if bank $i$ issues CBs at time $t$}\\ 0 & \text{otherwise} \end{cases} \end{equation} \end{document}

Brother Printer Firmware Update Password Reset

Answer : I spent many hours doing a variety of factory resets and trying the password above, "access". Apparently, Brother pushed out a firmware update recently which changed the default password on many devices to "initpass". So, if you are locked out of the web interface give this a try. help.brother-usa.com It looks like you might be able to reset to factory settings via the control panel on the device as well. From Brother's FAQ: Via the control panel (only for network ready models) Make sure the machine is not operating, then disconnect all the cables from the machine (except power cable). Press the Menu or Menu/Set key on the control panel. Press up or down navigation key to select LAN or Network and press Set, Menu/Set or OK . Press up or down navigation key to select Factory Reset or Network Reset and press Set, Menu/Set or OK . Select Reset . Select Yes . The machine will re-start, re-connect cables once this is complete.

Admob Shows Test Ads But Not Real Ads

Answer : When apps are newly registered with AdMob, it takes some time and a few ads requests to allow inventory to build. Because of this, you may not see live impressions immediately. Once your app starts making more requests, you should see more consistent results. Please note that test ads operate through the same channels as live ads. Being able to return a test ad ensures that your application is communicating properly with our network. Be patience it will work after some days. Remove the line that says .addTestDevice("4CCC00EF4EA205A6FE82E1AEB26B0839") Also, when you use a virtual device, it shows the test ads no matter what. Are you testing it on a real device? You might be using the sample unit id: ca-app-pub-3940256099942544/6300978111 If you use above then you will see test ads. Make sure you change to your own unit id before releasing the app.

Bootstrap Loader Or Boot Loader Code Example

Example 1: bootstrap loader < div class = " spinner-border text-primary " role = " status " > < span class = " sr-only " > Loading... </ span > </ div > < div class = " spinner-border text-secondary " role = " status " > < span class = " sr-only " > Loading... </ span > </ div > < div class = " spinner-border text-success " role = " status " > < span class = " sr-only " > Loading... </ span > </ div > < div class = " spinner-border text-danger " role = " status " > < span class = " sr-only " > Loading... </ span > </ div > < div class = " spinner-border text-warning " role = " status " > < span class = " sr-only " > Loading... </ span > </ div > < div class = " spinner

Bootstrap 4 Modal W3schools Code Example

Example 1: jquery display modal bs4 $('a[href$="#Modal"]').on( "click", function() { $('#Modal').modal('show'); }); Example 2: bootstrap modal popup < button type = " button " class = " btn btn-info btn-lg " data-toggle = " modal " data-target = " #myModal " > Open Modal </ button > <!-- Modal --> < div id = " myModal " class = " modal fade " role = " dialog " > < div class = " modal-dialog " > <!-- Modal content--> < div class = " modal-content " > < div class = " modal-header " > < button type = " button " class = " close " data-dismiss = " modal " > &times; </ button > < h4 class = " modal-title " > Modal Header </ h4 > </ div > < div class

Add Create Prefab At Position Unity Code Example

Example 1: Unity C# instantiate prefab Instantiate ( myPrefab , new Vector3 ( 0 , 0 , 0 ) , Quaternion . identity ) ; Example 2: unity instantiate prefab Instantiate ( cube , Vector3 ( x , y , 0 ) , Quaternion . identity ) ;

Can't Install Xdebug On Mac With Homebrew

Answer : Add this repository: https://github.com/josegonzalez/homebrew-php#readme Then use brew install php54-xdebug for PHP 5.4 Or brew install php53-xdebug for PHP 5.3 Or brew install php55-xdebug for PHP 5.5 // Working as of 2021 As homebrew removed the extra php repository containing a version with xdebug already installed, you have to install it manually. Summary: brew install <php version> for php update your path pecl install xdebug for xdebug Full example: # update homebrew brew update # install a version of php, e.g. 7.0 brew install php@7.0 # now they tell you how to link it, in my case echo 'export PATH="/usr/local/opt/php@7.0/bin:$PATH"' >> ~/.bash_profile echo 'export PATH="/usr/local/opt/php@7.0/sbin:$PATH"' >> ~/.bash_profile # reload the file with the updated path, so we can use pecl source ~/.bash_profile # check that the path is to the correct php executable, # and pecl is available whi

Combobox Bootstrap Code Example

Example 1: bootstrap 4 dropdown < div class = " dropdown " > < button class = " btn btn-secondary dropdown-toggle " type = " button " id = " dropdownMenuButton " data-toggle = " dropdown " aria-haspopup = " true " aria-expanded = " false " > Dropdown button </ button > < div class = " dropdown-menu " aria-labelledby = " dropdownMenuButton " > < a class = " dropdown-item " href = " # " > Action </ a > < a class = " dropdown-item " href = " # " > Another action </ a > < a class = " dropdown-item " href = " # " > Something else here </ a > </ div > </ div > Example 2: dropdown bootstrap < div class = " dropdown show " > < a class = " btn btn-secondary dropdown-toggle " href = " #