Variable declaration
@buttonColor: #FF0000;
/* Now you can use @buttonColor variable with css Functions. */
.product.into.detailed {
additional-attributes{
.lib-table-button(
background-color: @buttonColor;
);
}
}
Here function lib-tabgle-button used v...
winsound
Windows environment
import winsound
winsound.PlaySound("path_to_wav_file.wav", winsound.SND_FILENAME)
wave
Support mono/stereo
Doesn't support compression/decompression
import wave
with wave.open("path_to_wav_file.wav", "rb") as wav_file: #...
Your typical jQuery object will contain references to any number of DOM elements, and that's why jQuery objects are often referred to as collections. If you want to do any manipulating with specific elements (e.g. getting a data attribute, calculating specific positions) then you need to use .each()...
You may want to do this if the remote repository is migrated. The command for changing the remote url is:
git remote set-url
It takes 2 arguments: an existing remote name (origin, upstream) and the url.
Check your current remote url:
git remote -v
origin https://bitbucket.com/develop/myrep...
Let's say we have a problem of size n. Now for each step of our algorithm(which we need write), our original problem becomes half of its previous size(n/2).
So at each step, our problem becomes half.
StepProblem1n/22n/43n/84n/16
When the problem space is reduced(i.e solved completely), it cannot ...
A higher-order function, as opposed to a first-order function, can have one of three forms:
One or more of its parameters is a function, and it returns some value.
It returns a function, but none of its parameters is a function.
Both of the above: One or more of its parameters is a fu...
If we have a c++ project that uses a config.h configuration file with some custom paths or variables, we can generate it using CMake and a generic file config.h.in.
The config.h.in can be part of a git repository, while the generated file config.h will never be added, as it is generated from the cu...
<?php
namespace App;
use Illuminate\Database\Eloquent\Model;
class User extends Model
{
/**
* Get the user's first name.
*
* @param string $value
* @return string
*/
public function getFirstNameAttribute($value)
{
return ucfirst($v...
If you have a cmake module . You can create a folder called in to store all config files.
For example,you have a project called FOO, you can create a FOO_config.h.in file like:
//===================================================================================
// CMake configuration file, base...
Basic foreground images can be inserted into an email document just like they are for web pages:
<img src="http://www.yourserver.com/email/images/logo.png">
And they can be made links by wrapping them in an <a href> tag:
<a href="http://www.yourwebsite.com">...
Comparator cmp = [ compare:{ a, b -> a <=> b } ] as Comparator
def col = [ 'aa', 'aa', 'nn', '00' ]
SortedSet sorted = new TreeSet( cmp )
sorted.addAll col
assert '[00, aa, nn]' == sorted.toString()
Here is a very simple example of a function that "promises to proceed when a given time elapses". It does that by creating a new Deferred object, that is resolved later and returning the Deferred's promise:
function waitPromise(milliseconds){
// Create a new Deferred object using th...
Correlated (also known as Synchronized or Coordinated) Subqueries are nested queries that make references to the current row of their outer query:
SELECT EmployeeId
FROM Employee AS eOuter
WHERE Salary > (
SELECT AVG(Salary)
FROM Employee eInner
WHERE eInner.Dep...
my @letters = ( 'a' .. 'z' ); # English ascii-bet
print $letters[ rand @letters ] for 1 .. 5; # prints 5 letters at random
How it works
rand EXPR expects a scalar value, so @letters is evaluated in scalar context
An array in scalar context returns the number of elements it ...
The series of events here is supposed to work as follows:
Compile code with -pg option
Link code with -pg option
Run program
Program generates gmon.out file
Run gprof program
To add profiling flags, you must add to your CMakeLists.txt:
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -pg"...