Tutorial by Examples: er

overflow-wrap tells a browser that it can break a line of text inside a targeted element onto multiple lines in an otherwise unbreakable place. Helpful in preventing an long string of text causing layout problems due to overflowing it's container. CSS div { width:100px; outline: 1px dash...
If static_cast is used to convert a pointer (resp. reference) to base class to a pointer (resp. reference) to derived class, but the operand does not point (resp. refer) to an object of the derived class type, the behavior is undefined. See Base to derived conversion.
c++11 The alignment requirement of a type can be queried using the alignof keyword as a unary operator. The result is a constant expression of type std::size_t, i.e., it can be evaluated at compile time. #include <iostream> int main() { std::cout << "The alignment requiremen...
Search for :h UserGettingBored *UserGettingBored* UserGettingBored When the user presses the same key 42 times. Just kidding! :-)
if ([[dataObject objectForKey:@"yourVariable"] isEqualToString:"Hello World"]) { return YES; } else { return NO; } You can query values stored using KVC quickly and easily, without needing to retrieve or cast these as local variables.
C++14 C++14 allows to use auto in lambda argument auto print = [](const auto& arg) { std::cout << arg << std::endl; }; print(42); print("hello world"); That lambda is mostly equivalent to struct lambda { template <typename T> auto operator ()(const...
HTML <div> Even if this div is too small to display its contents, the content is not clipped. </div> CSS div { width:50px; height:50px; overflow:visible; } Result Content is not clipped and will be rendered outside the content box if it exceeds its co...
using (SQLiteConnection conn = new SQLiteConnection(@"Data Source=data.db;Pooling=true;FailIfMissing=false")) { conn.Open(); using (SQLiteCommand cmd = new SQLiteCommand(conn)) { cmd.CommandText = "query"; using (SqlDataReader dr = cmd.ExecuteReade...
The two mapAccum functions combine the operations of folding and mapping. -- A Traversable structure -- | -- A seed value | ...
Although GameplayKit (which is introduced with iOS 9 SDK) is about implementing game logic, it could also be used to generate random numbers, which is very useful in apps and games. Beside the GKRandomSource.sharedRandom which is used in the following chapters there are three additional types of GK...
For complete control over a new Chart and Series object (especially for a dynamic Series name), you must resort to modifying the SERIES formula directly. The process to set up the Range objects is straightforward and the main hurdle is simply the string building for the SERIES formula. The SERIES ...
If a type t is Traversable then values of t a can be split into two pieces: their "shape" and their "contents": data Traversed t a = Traversed { shape :: t (), contents :: [a] } where the "contents" are the same as what you'd "visit" using a Foldable insta...
pyquery is a jquery-like library for python. It has very well support for css selectors. from pyquery import PyQuery html = """ <h1>Sales</h1> <table id="table"> <tr> <td>Lorem</td> <td>46</td> </tr> &l...
Suppose you have a Post model with a hasMany relationship with Comment. You may insert a Comment object related to a post by doing the following: $post = Post::find(1); $commentToAdd = new Comment(['message' => 'This is a comment.']); $post->comments()->save($commentToAdd); You ca...
However, x in the generator expression is not just variable, but can be any pattern. In cases of pattern mismatch the generated element is skipped over, and processing of the list continues with the next element, thus acting like a filter: [x | Just x <- [Just 1, Nothing, Just 3]] -- [1, 3] ...
List comprehensions can also draw elements from multiple lists, in which case the result will be the list of every possible combination of the two elements, as if the two lists were processed in the nested fashion. For example, [ (a,b) | a <- [1,2,3], b <- ['a','b'] ] -- [(1,'a'), (1,'b'),...
We consume rest API as a JSON format and then unmarshal it to a POJO. Jackson’s org.codehaus.jackson.map.ObjectMapper “just works” out of the box and we really don’t do anything in most cases. But sometimes we need custom deserializer to fulfill our custom needs and this tutorial will guide you thro...
If you want to show active network interfaces, type: ifconfig If you want to show also network interfaces that are down, type: ifconfig -a
You could use ethtool, but they are not going to be reboot persistent. If you want to achieve this, edit the following file: sudo vim /etc/network/interfaces And edit the file with needed informations: auto <interface_name> iface <interface_name> inet static address <ip_addres...
Using the class below, we can connect to Exchange and then set a specific user's out of office settings with UpdateUserOof: using System; using System.Web.Configuration; using Microsoft.Exchange.WebServices.Data; class ExchangeManager { private ExchangeService Service; public Exch...

Page 216 of 417