Posts

Showing posts from June, 2020

Bootstrap Css Col Code Example

Example 1: bootstrap grid class col-12 col-sm-4 col-md-3 col-lg-12 col-xl-12 Example 2: bootstrap change column width .col-sm-3half , .col-sm-8half { position : relative ; min-height : 1 px ; padding-right : 15 px ; padding-left : 15 px ; } @media ( min-width : 768 px ) { .col-sm-3half , .col-sm-8half { float : left ; } .col-sm-3half { width : 29.16666667 % ; } .col-sm-8half { width : 70.83333333 % ; } }

Append Div In Div Jquery Code Example

Example 1: jquery add div element $ ( '#someParent' ) . append ( '<div>I am new here</div>' ) ; Example 2: append div to another div jquery < h2 > Greetings < / h2 > < div class = "container" > < div class = "inner" > Hello < / div > < div class = "inner" > Goodbye < / div > < / div >

Bootstrap 4 Article W3schools Code Example

Example: bootstrap gem install bootstrap -v 4.4.1

Codeleet Code Example

Example: leetcode helpful tool in practicing for programming interviews

Change Xticklabels Fontsize Of Seaborn Heatmap

Image
Answer : Consider calling sns.set(font_scale=1.4) before plotting your data. This will scale all fonts in your legend and on the axes. My plot went from this, To this, Of course, adjust the scaling to whatever you feel is a good setting. Code: sns.set(font_scale=1.4) cmap = sns.diverging_palette(h_neg=210, h_pos=350, s=90, l=30, as_cmap=True) sns.clustermap(data=corr, annot=True, fmt='d', cmap="Blues", annot_kws={"size": 16}) Or just use the set_xticklabels: g = sns.clustermap(data=corr_s, annot=True, fmt='d',cmap = "Blues") g.ax_heatmap.set_xticklabels(g.ax_heatmap.get_xmajorticklabels(), fontsize = 16) To get different colors for the ticklabels: import matplotlib.cm as cm colors = cm.rainbow(np.linspace(0, 1, corr_s.shape[0])) for i, ticklabel in enumerate(g.ax_heatmap.xaxis.get_majorticklabels()): ticklabel.set_color(colors[i])

3 Foot In Cm Code Example

Example: foot to cm 1 foot = 30.48 cm

Android Studio Database Inspector Does Not Show Any Databases

Answer : In my case, it showed me the same process a lot of times. And none of them worked. The solution was Invalidating the Cache: File -> Invalidate Caches/Restart -> Invalidate and restart After that everything started working again. I face 2 cases: First time connect to my device and database does not show, then i do an action to modify database -> database will show. After I use ADB Idea to clean app data or uninstall (or go to settings and clear cache or uninstall app) -> database does not show -> restart device -> database will show Looks like its problem with device . If you have some custom rom installed then you might run into this issue . Link to the issue tracker https://issuetracker.google.com/issues/159432618

Cannot Connect To The Docker Daemon At Tcp://localhost:2375. Is The Docker Daemon Running? Wsl Code Example

Example: WSL connect docker daemon to docker for windows echo "export DOCKER_HOST=tcp://localhost:2375" >> ~/.bashrc && source ~/.bashrc

Code Space Html Code Example

Example 1: html space <!-- Create space in HTMl --> &nbsp; <!-- Example: --> < p > Hello &nbsp; World! </ p > Example 2: html space tag non-breaking space = &nbsp; < less than = &lt; > greater than = &gt; & ampersand = &amp;

Airflow Apache Tutorial Code Example

Example: apache airflow pip install apache-airflow [ postgres,google ] == 2.0 .2 --constraint "https://raw.githubusercontent.com/apache/airflow/constraints-2.0.2/constraints-3.7.txt"

How To Create Whatsapp Link Code Example

Example: link whatsapp to website < ! -- link the following URL to the desired icon or button in your code : https : //wa.me/PhoneNumber (see the example below) remember to include the country code -- > < a href = 'https://wa.me/27722840005' target = '_blank' > < i class = "fa fa-whatsapp" > < / i > < / a >

Arduino Mills Code Example

Example 1: arduino millis() /*Description Returns the number of milliseconds passed since the Arduino board began running the current program. This number will overflow (go back to zero), after approximately 50 days. Syntax */ time = millis ( ) ; Example 2: arduino millis /*Description Returns the number of milliseconds passed since the Arduino board began running the current program. This number will overflow (go back to zero), after approximately 50 days. Syntax */ time = millis ( ) /* Returns Number of milliseconds passed since the program started. Return Data type: unsigned long. */

AWS CLI - All Commands Return Unknown Output Type: [None]

Answer : $aws configure press Enters see the "Default output format [None]:" input one of "json, text or table "(all in lower case) after that rerun your command. My ~/.aws/config was somehow in a bad state, there were multiple declarations for the same setting under a single role header. Editing the file manually fixed my issue. The info under Configuration Settings and Precedence https://docs.aws.amazon.com/cli/latest/userguide/cli-chap-getting-started.html led me to the right place.

Circular List Iterator In Python

Answer : Use itertools.cycle , that's its exact purpose: from itertools import cycle lst = ['a', 'b', 'c'] pool = cycle(lst) for item in pool: print item, Output: a b c a b c ... (Loops forever, obviously) In order to manually advance the iterator and pull values from it one by one, simply call next(pool) : >>> next(pool) 'a' >>> next(pool) 'b' The correct answer is to use itertools.cycle. But, let's assume that library function doesn't exist. How would you implement it? Use a generator: def circular(): while True: for connection in ['a', 'b', 'c']: yield connection Then, you can either use a for statement to iterate infinitely, or you can call next() to get the single next value from the generator iterator: connections = circular() next(connections) # 'a' next(connections) # 'b' next(connections) # 'c' next(con

Rick Roll Lyrics Copy Code Example

Example: never gonna give you up lyrics /* We're no strangers to love You know the rules and so do I A full commitment's what I'm thinking of You wouldn't get this from any other guy I just wanna tell you how I'm feeling Gotta make you understand Never gonna give you up Never gonna let you down Never gonna run around and desert you Never gonna make you cry Never gonna say goodbye Never gonna tell a lie and hurt you We've known each other for so long Your heart's been aching but you're too shy to say it Inside we both know what's been going on We know the game and we're gonna play it And if you ask me how I'm feeling Don't tell me you're too blind to see Never gonna give you up Never gonna let you down Never gonna run around and desert you Never gonna make you cry Never gonna say goodbye Never gonna tell a lie and hurt you Never gonna give you up Never gonna let you down Never gonna run around and

List Commands Python Code Example

Example 1: list methods python list . append ( x ) # append x to end of list list . extend ( iterable ) # append all elements of iterable to list list . insert ( i , x ) # insert x at index i list . remove ( x ) # remove first occurance of x from list list . pop ( [ i ] ) # pop element at index i ( defaults to end of list ) list . clear ( ) # delete all elements from the list list . index ( x [ , start [ , end ] ] ) # return index of element x list . count ( x ) # return number of occurances of x in list list . reverse ( ) # reverse elements of list in - place ( no return ) list . sort ( key = None , reverse = False ) # sort list in - place list . copy ( ) # return a shallow copy of the list Example 2: python commands simple python commands print ( "your text here" ) -- -- -- -- -- -- -- -- -- -- -- -- -- -- - name = input ( "what is your name" ) print ( "nice to meet you " + name ) -- -- -- -- -- -- -- -- -- -- -- -

Bootstrap 3.3 Table Responsive Code Example

Example 1: bootstrap table dense <!-- BOOTSTRAP V3 --> <table class= "table table-condensed" > ... </table> <!-- BOOTSTRAP v4 --> <table class= "table table-sm" > ... </table> Example 2: bootstrap 3 table Bootstrap Basic Table A basic Bootstrap table has a light padding and only horizontal dividers. The .table class adds basic styling to a table ------------------------------------------------------------ Striped Rows The .table-striped class adds zebra-stripes to a table Bordered Table The .table-bordered class adds borders on all sides of the table and cells ------------------------------------------------------------ Hover Rows The .table-hover class adds a hover effect ( grey background color ) on table rows ------------------------------------------------------------ Condensed Table The .table-condensed class makes a table more compact by cutting cell padding in half ------------------------------------------

CIDR Address Is Not Within CIDR Address From VPC

Answer : An IPv4 address consists of 32 bits. 1) /32 in CIDR x.x.x.x/32 means use all 32 bits to form a range of addresses. In this case just one IP address is possible. 2) /24 in CIDR x.x.x.0/24 means fix the first 24 bits and use last 8 bits to form a range of addresses. In this case, there can be 2^8 IP addresses i.e. from x.x.x.0 to x.x.x.255. 3) /16 in CIDR x.x.0.0/16 means fix the first 16 bits and use the last 16 bits to form a range of addresses. In this case, there can be 2^16 IP addresses i.e. from x.x.0.0 to x.x.255.255. 4) /8 in CIDR x.0.0.0/8 means fix the first 8 bits and use the last 24 bits to form a range of addresses. In this case, there can be 2^24 IP addresses i.e. from x.0.0.0 to x.255.255.255. 5) /0 in CIDR 0.0.0.0/0 means fix the first 0 bits and use the last 32 bits to form a range of addresses. In this case, all the possible IP addresses are included in the range. Hope it helps you in understanding your problem that first 16 bits needs to be

Cannot Successfully Source .bashrc From A Shell Script

Answer : A shell script is run in its own shell instance. All the variable settings, function definitions and such only affect this instance (and maybe its children) but not the calling shell so they are gone after the script finished. By contrast the source command doesn't start a new shell instance but uses the current shell so the changes remain. If you want a shortcut to read your .bashrc use a shell function or an alias instead of a shell script, like alias brc='source ~/.bashrc' I want to complement ravi's answer: This behavior is specific to Ubuntu (and probably most derived distros), since your default ~/.bashrc file starts with a short-circuit, Ubuntu 18.04, for example: # If not running interactively, don't do anything case $- in *i*) ;; *) return;; esac That will stop the evaluation of the file if it is running in a non-interactive shell, which is the case of your script since all scripts are run in a non-interactive shell, and

Class And Static Variables In Python Code Example

Example 1: python static variable in function #You can make static variables inside a function in many ways. #____________________________________________________________# """1/You can add attributes to a function, and use it as a static variable.""" def foo ( ) : foo . counter += 1 print ( "Counter is %d" % foo . counter ) foo . counter = 0 #____________________________________________________________# """2/If you want the counter initialization code at the top instead of the bottom, you can create a decorator:""" def static_vars ( ** kwargs ) : def decorate ( func ) : for k in kwargs : setattr ( func , k , kwargs [ k ] ) return func return decorate #Then use the code like this: @static_vars ( counter = 0 ) def foo ( ) : foo . counter += 1 print ( "Counter is %d" % foo . counter ) #___________________________

Can't Add Perf Probe For C++ Methods

Answer : As a workaround you can get the method address with objdump and perf probe will accept it. $ perf probe -x /path/file '0x643f30' Added new event: probe_libfile:abs_643f30 (on 0x643f30 in /path/file) You can now use it in all perf tools, such as: perf record -e probe_libfile:abs_643f30 -aR sleep 1 Do note that perf probe expects an offset from the file, and objdump and readelf return the address after adjusting for the loading address. For -pie executable, where the loading address is 0, the addresses will be the same. For non -pie executables you can get the loading address by looking at the output of readelf -l /path/file and searching for the offset 0x000000 and looking at what VirtAddr it points to, then subtract that number from the symbol address that you get from objdump --syms or readelf --syms . It will usually be 0x400000

Codeigniter Left Join Query With Where Clause Code Example

Example: left join in codeigniter query builder $this->db->select('p.id, p.photo, p.desc, info.desc'); $this->db->from('products as p'); $this->db->join('lang_info as info', 'info.id=p.id and info.lang='.$this->lang, 'left'); $this->db->where('p.id', $this->product_id); $this->db->where_in('info.name', ['good', 'bad']);