Posts

Showing posts from March, 2009

Bootstrap 3 Cdn Link 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 3 cdn <!-- Latest compiled and minified CSS --> < link rel = " stylesheet " href = " https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css " integrity = " sha384-BVYiiSIFeK1dGmJRAkycuHAHRg32OmUcww7on3RYdg4Va+PmSTsz/K68vbdEjh4u " crossorigin = " anonymous " > <!-- Optional theme --> < link rel = " stylesheet " href = " https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap-theme.min.css " integrity = " sha384-rHyoN1iRsVXV4nD0JutlnGaslCJuC7uwjduW9SVrLvRYooPp2bWYgmgJQIXwl/Sp " crossorigin = " anonymous " > <!-- Latest compiled and minified JavaScript --> < script src = " https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js "

Bootstrap Navbar Float Right Code Example

Example 1: bootstrap navbar right <! DOCTYPE html > < html lang = " en " > < head > < title > Bootstrap Example </ title > < meta charset = " utf-8 " > < meta name = " viewport " content = " width=device-width, initial-scale=1 " > < link rel = " stylesheet " href = " https://maxcdn.bootstrapcdn.com/bootstrap/3.4.1/css/bootstrap.min.css " > < script src = " https://ajax.googleapis.com/ajax/libs/jquery/3.4.1/jquery.min.js " > </ script > < script src = " https://maxcdn.bootstrapcdn.com/bootstrap/3.4.1/js/bootstrap.min.js " > </ script > </ head > < body > < nav class = " navbar navbar-inverse " > < div class = " container-fluid " > < div class = " navbar-header " > < a class = " navbar-brand " href = " # &

Cannot Ignore .idea/workspace.xml - Keeps Popping Up

Answer : I was facing the same issue, and it drove me up the wall. The issue ended up to be that the .idea folder was ALREADY commited into the repo previously, and so they were being tracked by git regardless of whether you ignored them or not. I would recommend the following, after closing RubyMine/IntelliJ or whatever IDE you are using: mv .idea ../.idea_backup rm .idea # in case you forgot to close your IDE git rm -r .idea git commit -m "Remove .idea from repo" mv ../.idea_backup .idea After than make sure to ignore .idea in your .gitignore Although it is sufficient to ignore it in the repository's .gitignore, I would suggest that you ignore your IDE's dotfiles globally. Otherwise you will have to add it to every .gitgnore for every project you work on. Also, if you collaborate with other people, then its best practice not to pollute the project's .gitignore with private configuation that are not specific to the source-code of the project. I had t

Bootstrap Radio Button "checked" Flag

Answer : Assuming you want a default button checked. <div class="row"> <h1>Radio Group #2</h1> <label for="year" class="control-label input-group">Year</label> <div class="btn-group" data-toggle="buttons"> <label class="btn btn-default"> <input type="radio" name="year" value="2011">2011 </label> <label class="btn btn-default"> <input type="radio" name="year" value="2012">2012 </label> <label class="btn btn-default active"> <input type="radio" name="year" value="2013" checked="">2013 </label> </div> </div> Add the active class to the button ( label tag) you want defaulted and checked="" to

CodeIgniter: How To Do A Select (Distinct Fieldname) MySQL Query

Answer : $record = '123'; $this->db->distinct(); $this->db->select('accessid'); $this->db->where('record', $record); $query = $this->db->get('accesslog'); then $query->num_rows(); should go a long way towards it. You can also run ->select('DISTINCT `field`', FALSE) and the second parameter tells CI not to escape the first argument. With the second parameter as false , the output would be SELECT DISTINCT `field` instead of without the second parameter, SELECT `DISTINCT` `field` try it out with the following code function fun1() { $this->db->select('count(DISTINCT(accessid))'); $this->db->from('accesslog'); $this->db->where('record =','123'); $query=$this->db->get(); return $query->num_rows(); }

Can I Split A Large HAProxy Config File Into Multiple Smaller Files?

Answer : Configuration files can't be linked together from a configuration directive. However HAProxy can load multiple configuration files from its command line, using the -f switch multiple times: haproxy -f conf/http-defaults -f conf/http-listeners -f conf/tcp-defaults -f conf/tcp-listeners If you want to be flexible with the amount of config files you can even specify a directory like this: -f /etc/haproxy . The files will then be used in their lexical order, newer files overriding older files. See the mailing list for an example, if provides links to the documentation. This information can be found in the management guide, not the regular docs. Stumbled on this answer where the author created scripts to imitate nginx disable enable sites functionality. In the haproxy init.d startup he uses script loop to build the haproxy -f commands concatenation. /etc/init.d/haproxy: EXTRAOPTS=`for FILE in \`find /etc/haproxy/sites-enabled -type l | sort -n\`; do CONFIGS=&quo

Bootstrap Responsive Table Content Wrapping

Answer : just simply use as below and it will word wrap any long text within a table . No need to anything else <td style="word-wrap: break-word;min-width: 160px;max-width: 160px;">long long comments</td> So you can use the following : td { white-space: normal !important; // To consider whitespace. } If this doesn't work: td { white-space: normal !important; word-wrap: break-word; } table { table-layout: fixed; } I ran across the same issue you did but the above answers did not solve my issue. The only way I was able to resolve it - was to make a class and use specific widths to trigger the wrapping for my specific use case. As an example, I provided a snippet below - but I found you will need to adjust it for the table in question - since I typically use multiple colspans depending on the layout. The reasoning I believe Bootstrap is failing - is because it removes the wrapping constraints to get a full table for the scrollbars. THe

Bootstrap Modal Js Cdn Code Example

Example 1: open bootstrap modal using javascript $("#myModal").modal(); //open modal $('#myModal').modal('toggle'); //open modal $('#myModal').modal('show'); //open modal $('#myModal').modal('hide'); //hide modal //@sujay Example 2: open bootstrap modal with javascript $("#myModal").modal()

AngularJs And AddThis Social Plugin

Answer : I have created the simple AngularJS directive to refresh AddThis toolbox defined inside the dynamically included partial angular.module('Directive.AddThis', []) /** * AddThis widget directive * * Usage: * 1. include `addthis_widget.js` in header with async=1 parameter * <script src="//s7.addthis.com/js/300/addthis_widget.js#pubid=<pubid>&async=1"></script> * http://support.addthis.com/customer/portal/articles/381263-addthis-client-api#configuration-url * 2. add "addthis-toolbox" directive to a widget's toolbox div * <div addthis-toolbox class="addthis_toolbox addthis_default_style addthis_32x32_style"> * ... ^ * </div> */ .directive('addthisToolbox', function() { return { restrict: 'A', transclude: true, replace: true, template: '<div ng-transclude></div>', link: function ($scope, elem

Shorthand If Statement Python Code Example

Example 1: python if else short version x = 10 if a > b else 11 Example 2: short if python a = '123' if b else '456' Example 3: shorthand python if # Traditional Ternary Operatorcan_vote = ( age >= 18 ) true : false ; # Python Ternary Operatorcan_vote = True if age >= 18 else False

Can You Play Gta 5 Cross Platform Code Example

Example: Is GTA V Online Cross Platform #include < stdio.h > int main() { int a,b; for(a=1;a<=5;a++) { for(b=1;b<=5;b++) { if(b-1==a) printf("*"); else printf(" "); } printf("\n"); } }

Int To Cstring Code Example

Example 1: c++ convert int to cstring # include <isotream> # include <string> using namespace std ; string str = to_string ( int ) ; char cstr [ size ] = "" ; strcat_s ( cstr , str . c_str ( ) ) ; Example 2: c++ convert int to cstring # include <isotream> # include <string> string str = to_string ( int ) ; char cstr [ size ] = "" ; strcat_s ( cstr , str . c_str ( ) ) ;

Acid Properties In Dbms Studytonight Code Example

Example 1: acid properties in dbms Atomicity The entire transaction take place at once or doesn't happen at all. Consistency Database must be consistent before and after the transaction. Isolation Multiple transactions occur independently without interference. Durability The changes of the successful transaction occurs even if the system failure occur. Example 2: acid property db A - Atomicity transactions either take place or they dont. ('all or nothing' property) C - Consistency Db must be consistent before and after a transaction. I - Isolation multiple transaction don't interfere with each other. D - Durability changes survive eventual failures of the system.

Audio Tag With Html Code Example

Example 1: how do you play audio files on html < audio src = " sound.mp3 " autoplay > </ audio > Example 2: audio html tag MIME Types for Audio Formats Format MIME-type MP3 audio/mpeg OGG audio/ogg WAV audio/wav If simply audio ' < audio > ' tag is written then audio controls will not appear on the web page. and for showing audio controller we need to write controls attribute in audion tag ' < audio controls > '. Example < audio controls > < source src = " horse.mp3 " type = " audio/mpeg " > </ audio >

C++ Gcc Online Compiler Code Example

Example 1: cpp online compiler Best Site With auto compile : https : //godbolt.org/z/nEo4j7 Example 2: online compiler cpp Good cpp compilers : -- -- -- -- -- -- -- -- -- -- - repl . it / languages / cpp www . w3schools . com / cpp / trycpp . asp ? filename = demo_helloworld onlinegdb . com / online_c ++ _compiler programiz . com / cpp - programming / online - complier cpp . sh

Android Button Border Radius Code Example

Example 1: rounded corners button in android <?xml version="1.0" encoding="utf-8"?> < shape xmlns: android = " http://schemas.android.com/apk/res/android " > < corners android: radius = " 24dp " /> < solid android: color = " #F00 " /> </ shape > Example 2: how to add corner radius in android button < shape xmlns: android = " http://schemas.android.com/apk/res/android " android: shape = " rectangle " > < solid android: color = " @color/primary " /> < corners android: radius = " 5dp " /> </ shape >

Capturing STDERR And STDOUT To File Using Tee

Answer : The latter; it makes sure STDOUT and STDERR of the original command go to the same fd, then feeds them jointly into tee. In the former case, it's the STDERR of the tee command that you'd be joining with its STDOUT.

3x3 Matrix Multiplication Java Code Example

Example 1: matrix multiplication in java public class MatrixMultiplicationExample{ public static void main(String args[]){ //creating two matrices int a[][]={{1,1,1},{2,2,2},{3,3,3}}; int b[][]={{1,1,1},{2,2,2},{3,3,3}}; //creating another matrix to store the multiplication of two matrices int c[][]=new int[3][3]; //3 rows and 3 columns //multiplying and printing multiplication of 2 matrices for(int i=0;i<3;i++){ for(int j=0;j<3;j++){ c[i][j]=0; for(int k=0;k<3;k++) { c[i][j]+=a[i][k]*b[k][j]; }//end of k loop System.out.print(c[i][j]+" "); //printing matrix element }//end of j loop System.out.println();//new line } }} Example 2: 3x3 matrix multiplication java 1 2 3 456789 87623 253673 3464 23643 322 2 1 2