Tutorial by Examples: c

THREE.CylinderGeometry build cylinders. Cylinder Continuing from the previous example, the code to create the box could be replaced with the below. //Makes a new cylinder with // - a circle of radius 5 on top (1st parameter) // - a circle of radius 5 on the bottom (2nd parameter) // - a height...
extension String { func matchesPattern(pattern: String) -> Bool { do { let regex = try NSRegularExpression(pattern: pattern, options: NSRegularExpressionOptions(rawValue: 0)) let range: NSRange = NSMakeRange(...
public interface ILogger { void Log(string message); } [Export(typeof(ILogger))] [ExportMetadata("Name", "Console")] public class ConsoleLogger:ILogger { public void Log(string message) { Console.WriteLine(message); } } [Export(typeof(IL...
You may need to render some content in view, which is specific to some environment only. To achieve this goal you can use Environment tag helper: <environment names="Development"> <h1>This is heading for development environment</h1> </environment> <envi...
Often one want to show the result of a command executed by root to other users. The tee command allows easily to write a file with user perms from a command running as root: su -c ifconfig | tee ~/results-of-ifconfig.txt Only ifconfig runs as root.
For null check in method Object nullableObject = methodReturnObject(); if (Objects.isNull(nullableObject)) { return; } For not null check in method Object nullableObject = methodReturnObject(); if (Objects.nonNull(nullableObject)) { return; }
In the old fashion way for collection null check List<Object> someObjects = methodGetList(); for (Object obj : someObjects) { if (obj == null) { continue; } doSomething(obj); } With the Objects.nonNull method and Java8 Stream API, we can do the above in this way: ...
Consider this example: public class ThreadTest implements Runnable { private boolean stop = false; public void run() { long counter = 0; while (!stop) { counter = counter + 1; } System.out.println("Counted " + counter);...
An observable is created from the TextChanged event of the TextBox. Also any input is only selected if it's different from the last input and if there was no input within 0.5 seconds. The output in this example is sent to the console. Observable .FromEventPattern(textBoxInput, "TextChan...
What are local and global scope? All Python variabes which are accessible at some point in code are either in local scope or in global scope. The explanation is that local scope includes all variables defined in the current function and global scope includes variabled defined outside of the curren...
A transaction is a sequential group of SQL statements such as select,insert,update or delete, which is performed as one single work unit. In other words, a transaction will never be complete unless each individual operation within the group is successful. If any operation within the transaction fai...
AUTOCOMMIT MySQL automatically commits statements that are not part of a transaction. The results of any UPDATE,DELETE or INSERT statement not preceded with a BEGIN or START TRANSACTION will immediately be visible to all connections. The AUTOCOMMIT variable is set true by default. This can be chan...
You can close a notification by using the .close() method. let notification = new Notification(title, options); // do some work, then close the notification notification.close() You can utilize the setTimeout function to auto-close the notification sometime in the future. let notification = n...
The Notification API specifications support 2 events that can be fired by a Notification. The click event. This event will run when you click on the notification body (excluding the closing X and the Notifications configuration button). Example: notification.onclick = function(event) { ...
import java.awt.EventQueue; import java.awt.GridLayout; import java.awt.event.WindowAdapter; import java.awt.event.WindowEvent; import java.awt.event.WindowListener; import java.util.ArrayList; import java.util.List; import javax.swing.JFrame; import javax.swing.JTextArea; import javax.sw...
Create a font extension using the IDE. See the iReport or Jaspersoft Studio documentation for details. The font extension can also be created manually. What are font extensions? Using a textElement you can specify a font (if not specified default font SansSerif is used) <textElement> &...
If you want to have a table organized in column-store format instead of row store, add INDEX cci CLUSTERED COLUMNSTORE in definition of table: DROP TABLE IF EXISTS Product GO CREATE TABLE Product ( ProductID int, Name nvarchar(50) NOT NULL, Color nvarchar(15), Size nvarchar(5)...
CREATE CLUSTERED COLUMNSTORE INDEX enables you to organize a table in column format: DROP TABLE IF EXISTS Product GO CREATE TABLE Product ( Name nvarchar(50) NOT NULL, Color nvarchar(15), Size nvarchar(5) NULL, Price money NOT NULL, Quantity int ) GO CREATE CLUSTERED C...
The NotifyPropertyChangedBaseclass below defines a generic Set method that can be called from any derived type. public class NotifyPropertyChangedBase : INotifyPropertyChanged { protected void RaisePropertyChanged([CallerMemberName] string propertyName = null) => PropertyChanged?.Invo...
Consider the following partial example: import com.example.somelib.*; import com.acme.otherlib.*; public class Test { private Context x = new Context(); // from com.example.somelib ... } Suppose that when when you first developed the code against version 1.0 of somelib and versi...

Page 496 of 826