Tutorial by Examples: st

<?php set_query_var( 'passed_var', $my_var ); get_template_part( 'foo', 'bar' ); ?> Access it in foo-bar.php <?php echo $passed_var; ?>
Filetype plugins for foo filetype are sourced in that order: 1. $HOME/.vim/ftplugin/foo.vim. Be careful with what you put in that file as it may be overridden by $VIMRUNTIME/ftplugin/foo.vim -- under windows, it'll be instead $HOME/vimfiles/ftplugin/foo.vim 2. $VIMRUNTIME/ftplugin/foo.vim. Like ev...
For anything below 1.9 SpawnEgg egg = new SpawnEgg(EntityType.CREEPER); ItemStack creeperEgg = egg.toItemStack(5); For 1.9 and above In versions 1.9 and higher, Spigot does not have an implementation for creating spawn eggs without using NMS. To accomplish this, you can use a small custom cl...
Detailed instructions on getting travis-ci set up or installed.
Introduction System Workbench for STM32 is a free IDE on Windows, Linux and OS X. Description from ST Microelectronics: The System Workbench toolchain, called SW4STM32, is a free multi-OS software development environment based on Eclipse, which supports the full range of STM32 microcontrollers...
Introduction C/C++ IDE for ARM development. Atollic TrueSTUDIO® is tested and verified on the following Operating Systems: Microsoft® Windows ®Vista (32-bit version) Microsoft® Windows® Vista (64-bit version) Microsoft® Windows® 7 (32-bit version) Microsoft® Windows® 7 (64-bit version) Micr...
int storeId = 1; DataSource dataSource = ... // JdbcTemplate jdbcTemplate = new JdbcTemplate(dataSource); String sql = "SELECT * FROM customer WHERE store_id = ?"; List<Map<String, Object>> mapList = jdbcTemplate.queryForList(sql, storeId); for(Map<String, Object> ...
WPF does not support displaying anything other than an image as a splash screen out-of-the-box, so we'll need to create a Window which will serve as a splash screen. We're assuming that we've already created a project containing MainWindow class, which is to be the application main window. First of...
As an example you want to disable pagination in your default index action and get all results in index. How can you do that? It's simple. You should override the index action in your controller like this: public function actions() { $actions = parent::actions(); unset($actions['index'])...
Each React Native component can take a style prop. You can pass it a JavaScript object with CSS-style style properties: <Text style={{color:'red'}}>Red text</Text> This can be inefficient as it has to recreate the object each time the component is rendered. Using a stylesheet is pref...
import React, { Component } from 'react'; import { View, Text, StyleSheet } from 'react-native'; const styles = StyleSheet.create({ red: { color: 'red' }, big: { fontSize: 30 } }); class Example extends Component { render() { return ( ...
You can pass an array to the style prop to apply multiple styles. When there is a conflict, the last one in the list takes precedence. import React, { Component } from 'react'; import { View, Text, StyleSheet } from 'react-native'; const styles = StyleSheet.create({ red: { color: ...
Use dynamic_cast<>() as a function, which helps you to cast down through an inheritance hierarchy (main description). If you must do some non-polymorphic work on some derived classes B and C, but received the base class A, then write like this: class A { public: virtual ~A(){} }; class B...
Objects like numbers, lists, dictionaries,nested structures and class instance objects live in your computer’s memory and are lost as soon as the script ends. pickle stores data persistently in separate file. pickled representation of an object is always a bytes object in all cases so one must ope...
Unity is an xUnit-style test framework for unit testing C. It is written completely in C and is portable, quick, simple, expressive and extensible. It is designed to especially be also useful for unit testing for embedded systems. A simple test case that checks the return value of a function, might...
Example Controller action use Symfony\Component\HttpFoundation\Request; public function exampleAction(Request $request) { /* * First you need object ready for validation. * You can create new object or load it from database. * You need to add some constraints for this obj...
The syntactic sugar Most of the getting started examples of ExpressJs include this piece of code var express = require('express'); var app = express(); ... app.listen(1337); Well, app.listen is just a shortcut for: var express = require('express'); var app = express(); var http = require(...
A basic middleware is a function that takes 3 arguments request, response and next. Then by app.use, a middleware is mounted to the Express App Middlewares Stack. Request and response are manipulated in each middleware then piped to the next one through the call of next(). For example, the below c...
import pandas as pd df = pd.DataFrame([{'var1': 'a,b,c', 'var2': 1, 'var3': 'XX'}, {'var1': 'd,e,f,x,y', 'var2': 2, 'var3': 'ZZ'}]) print(df) reshaped = \ (df.set_index(df.columns.drop('var1',1).tolist()) .var1.str.split(',', expand=True) .stack() .reset_ind...
Liferay exposes many default and custom services available to other systems via JSON. To explore services on a particular liferay instance, use a given URL - A local instance in this case: http://localhost:8080/api/jsonws/ Select the required service, consume the service with the given syntax ...

Page 279 of 369