Posts

Showing posts from October, 2021

Adding Asterisk To Required Fields In Bootstrap 3

Answer : Use .form-group.required without the space. .form-group.required .control-label:after { content:"*"; color:red; } Edit: For the checkbox you can use the pseudo class :not(). You add the required * after each label unless it is a checkbox .form-group.required:not(.checkbox) .control-label:after, .form-group.required .text:after { /* change .text in whatever class of the text after the checkbox has */ content:"*"; color:red; } Note: not tested You should use the .text class or target it otherwise probably, try this html: <div class="form-group required"> <label class="col-md-2 control-label">&#160;</label> <div class="col-md-4"> <div class="checkbox"> <label class='text'> <!-- use this class --> <input class="" id="id_tos" name="tos" required="required" type="

Add To Queue Java Code Example

Example: java queue import java . util . * ; Queue < Integer > queue = new LinkedList < Integer > ( ) ; // use non-primative types when constructing // to add a value to the back of queue: queue . add ( 7 ) ; // to remove and return front value: int next = queue . remove ( ) ; // to just return front value without removing: int peek = queue . peek ( ) ;

150 Pound In Kg Code Example

Example: 150 pound in kg let pound = 1; let kilogram = 0.453592;

Aoe 2 Hd Cheat Code Code Example

Example: aoe 2 hd cheat codes robin hood. 1,000 Gold (10,000 in Age of Empires 2: HD Edition) cheese steak jimmy's. 1,000 Food (10,000 in Age of Empires 2: HD Edition) lumberjack. 1,000 Wood (10,000 in Age of Empires 2: HD Edition) rock on. 1,000 Stone (10,000 in Age of Empires 2: HD Edition) ninjaconnor ninjalui rowshep. 100,000 of each resource (each code has same effect) aegis. Immediate building, resource gathering, research etc. (toggle on/off) i r winner. Win campaign resign. Lose campaign torpedo#. Kill opponent # (replace # with 1-8) black death. Destroy all other players, including allies wimpywimpywimpy. Destroy yourself

Are USB 3.0 Ports Yellow?

Answer : A yellow USB port usually denotes an "always on" port. It supplies power to the device plugged into it even when the laptop is off. If it's a Lenovo ThinkPad chances are it's the "always on USB", which is a special port that remains powered when the computer is asleep, or when the computer is fully powered off and the AC adapter plugged. This allows you to, for example, keep charging your phone or wireless gamepad without having to keep your computer running. http://www.asprangers.com/post/2012/10/02/What%E2%80%99s-in-color-Yellow-Blue-Gray-color-USB-Ports-on-Lenovo.aspx It can be whatever colour that your manufacturer wants it to be - I do not think there is a standard. That being said, every product I have seen that supports USB 3 seems to have a blue socket, so there may be one! If it is yellow, my guess is that it may be a way to indicate enhanced/increased/special power output. What model do you have? If you write the model number,

Clear Selected Option In Ui-select Angular

Answer : If you are using the select2 theme there is an allow-clear option on the ui-select-match directive that does this for you. You will have the x on the right and you can clear it by clicking it. https://github.com/angular-ui/ui-select/wiki/ui-select-match Quick example: <ui-select-match allow-clear="true" placeholder="Select or search a country in the list..."> <span>{{$select.selected.name}}</span> </ui-select-match> Working example: http://plnkr.co/edit/DbbUE68QlNLjx97pBZ56?p=preview This does not currently work using either the bootstrap or selectize theme. You could add a small X button when you display the selection. <ui-select-match placeholder="Select or search a country in the list..."> <span>{{$select.selected.name}}</span> <button class="clear" ng-click="clear($event)">X</button> </ui-select-match> Then you stop the click event from bubb

Codeigniter - Date Format - Form Validation

Answer : You can take use of CodeIgniters callback functions by creating a callback_date_valid() function that check if the date is valid. And to check if it is valid, you could use PHP's checkdate function array( 'field' => 'reg[dob]', 'label' => 'DOB', 'rules' => 'required|date_valid' ) function callback_date_valid($date){ $day = (int) substr($date, 0, 2); $month = (int) substr($date, 3, 2); $year = (int) substr($date, 6, 4); return checkdate($month, $day, $year); } I have a pretty clean solution for this. You can extend codeigniters form validation library. Do this by putting a MY_Form_validation.php file in your application/libraries folder. This file should look like this: class MY_Form_validation extends CI_Form_validation { public function __construct($rules = array()) { parent::__construct($rules); } public function valid_date($date) { $d = DateTime:

6ft To Inches Code Example

Example: foot to inch 1 foot = 12 inches

Std String Find Character C++ Code Example

Example 1: c++ string contains if ( string1 . find ( string2 ) != std :: string :: npos ) { std :: cout << "found!" << '\n' ; } Example 2: std string find character c++ // string::find # include <iostream> // std::cout # include <string> // std::string int main ( ) { std :: string str ( "There are two needles in this haystack with needles." ) ; std :: string str2 ( "needle" ) ; // different member versions of find in the same order as above: std :: size_t found = str . find ( str2 ) ; if ( found != std :: string :: npos ) std :: cout << "first 'needle' found at: " << found << '\n' ; found = str . find ( "needles are small" , found + 1 , 6 ) ; if ( found != std :: string :: npos ) std :: cout << "second 'needle' found at: " << found << '\n'

.append VS .html VS .innerHTML Performance

Image
Answer : All three are slow to me. Modifying the dom on each iteration is slow. http://jsperf.com/jquery-append-vs-html-list-performance/24 I just added a new test in there: var html = []; for (var i = 0; i < len; i++) { html.push('<div>Test ' + i + '</div>'); } document.getElementById('list').innerHTML = html.join(''); This is much faster again. :) My method in Firefox does 26k Ops/sec vs 1,000, 10,000, and 13 That benchmark is worthless. innerHTML is always faster than DOM manipulation. jQuery seems faster because it prepares a string with all the HTML first while the others do one operation each iteration. Also note that jQuery.html() uses innerHTML whenever it can. jQuery from benchmark var html = ''; for (var i = 0; i < len; i++) { html += '<div>Test ' + i + '</div>'; } $('#list').html(html); innerHTML from benchmark var list = document.getElementById('l

Antd Form Grid Code Example

Example 1: responsive grid using antd import 'antd/dist/antd.css'; import { Row, Col } from 'antd'; < Row > < Col xs = {24} xl = {8} > One of three columns </ Col > < Col xs = {24} xl = {8} > One of three columns </ Col > < Col xs = {24} xl = {8} > One of three columns </ Col > </ Row > Example 2: const layout xs sm xl ant design { xs: '480px', sm: '768px', md: '992px', lg: '1200px', xl: '1600px', } Example 3: responsive grid using antd < div className = " ant-row " > < div className = " ant-col ant-col-xs-24 ant-col-xl-8 " > One of three columns </ div > < div className = " ant-col ant-col-xs-24 ant-col-xl-8 " > One of three columns </ div > < div className = " ant-col ant-col-xs-24 ant-col-xl-8 &qu

Row Padding Flutter Code Example

Example 1: flutter how to space buttons evenly in a row //Use mainAxisAligment: MainAxisAlignment.spaceEvenly, //After initializing the row new Container ( alignment : FractionalOffset . center , child : new Row ( mainAxisAlignment : MainAxisAlignment . spaceEvenly , children : < Widget > [ new FlatButton ( child : new Text ( 'Don\'t have an account?' , style : new TextStyle ( color : Color ( 0xFF2E3233 ) ) ) , ) , new FlatButton ( child : new Text ( 'Register.' , style : new TextStyle ( color : Color ( 0xFF84A2AF ) , fontWeight : FontWeight . bold ) , ) , onPressed : moveToRegister , ) ] , ) , ) , Example 2: column each child padding Wrap ( spacing : 20 , // to apply margin in the main axis of the wrap runSpacing : 20 , // to app

Clear All Matlab Except One Code Example

Example 1: clear all but matlab clearvars -except NAME Example 2: matlab clear all clear % Clears all variable data clc % Clears the command line window