Tutorial by Examples: f

You can provide help for OpenFileDialog, SaveFileDialog and ColorDialog. To do so set ShowHelp property of dialog to true and handle HelpRequest event for dialog: void openFileDialog1_HelpRequest(object sender, EventArgs e) { //Perform custom action Help.ShowHelp(this, "Http://examp...
When a user press F1 on a control or click on Help button of form (?) and then clicks on a control the HelpRequested event will be raised. You can handle this event to provide custom action when user requests help for controls or form. The HelpRequested supports bubble up mechanism. It fires for y...
You can show a Help Button at title-bar of a Form. To do so, you should: Set HelpButton property of form to true. Set MinimizeBox and MaximizeBox to false. Then a help button will appear on title-bar of Form: Also when you click on Help button, the cursor will be changed to a ? cursor: ...
If you have a Form with MinimizeBox and MaximizeBox set to true, then you can not show Help button on title-bar of Form and will lose the feature of click on help button to convert it to help cursor to be able to click on controls to show help. You can make a menu item on MenuStrip act like standar...
You can detect when a user Clicked on a HelpButton on title-bar of form by handling HelpButtonClicked. You can let the event continue or cancel it by setting Cancel property of its event args to true. private void Form1_HelpButtonClicked(object sender, CancelEventArgs e) { e.Cancel = true; ...
SELECT product, SUM(quantity) AS "Total quantity" FROM order_details GROUP BY product;
Assume a table of employees in which each row is an employee who has a name, a department, and a salary. SELECT department, MIN(salary) AS "Lowest salary" FROM employees GROUP BY department; This would tell you which department contains the employee with the lowest salary, and what t...
SELECT * FROM Cars WHERE status IN ( 'Waiting', 'Working' ) This is semantically equivalent to SELECT * FROM Cars WHERE ( status = 'Waiting' OR status = 'Working' ) i.e. value IN ( <value list> ) is a shorthand for disjunction (logical OR).
Default behavior when cloning an object is to perform a shallow copy of the object's fields. In that case, both the original object and the cloned object, hold references to the same objects. This example shows that behavior. import java.util.List; public class Sheep implements Cloneable { ...
To copy nested objects, a deep copy must be performed, as shown in this example. import java.util.ArrayList; import java.util.List; public class Sheep implements Cloneable { private String name; private int weight; private List<Sheep> children; public Sheep(Str...
Custom Fonts for UI components from storyboard can be easily achieved with User Defined Runtime Attributes in storyboard and Categories. The advantages are like, No need to define outlets for the ui element No need to set font for elements programatically. Steps to follow Font File: A...
Warning: The functions atoi, atol, atoll and atof are inherently unsafe, because: If the value of the result cannot be represented, the behavior is undefined. (7.20.1p1) #include <stdio.h> #include <stdlib.h> int main(int argc, char** argv) { int val; if (argc < 2) ...
$ jekyll build # The current site folder will be built into the ./_site directory $ jekyll build --destination /var/www/ # The current site folder will be generated into /var/www/ $ jekyll build --watch # The current site folder will be built into the ./_site directory and will be kept up t...
VBA is compiled in run-time, which has a huge negative impact on it's performance, everything built-in will be faster, try to use them. As an example I'm comparing SUM and COUNTIF functions, but you can use if for anything you can solve with WorkSheetFunctions. A first attempt for those would be t...
This example shows how to mock out a function call that is irrelevant to our unit test, and then use the defer statement to re-assign the mocked function call back to its original function. var validate = validateDTD // ParseXML parses b for XML elements and values, and returns them as a map of ...
Although available, defining a class from scratch is not recommended in modern Perl. Use one of helper OO systems which provide more features and convenience. Among these systems are: Moose - inspired by Perl 6 OO design Class::Accessor - a lightweight alternative to Moose Class::Tiny...
Subroutine arguments in Perl are passed by reference, unless they are in the signature. This means that the members of the @_ array inside the sub are just aliases to the actual arguments. In the following example, $text in the main program is left modified after the subroutine call because $_[0] in...
NHibernate uses classes to map into tables or views. Creating a Plain Old CLR Object (POCOs, sometimes called Plain Ordinary CLR Objects) is a good practice for persistent classes. A POCO has its data accessible through the standard .NET property mechanisms, shielding the internal representation fro...
The Fluent NHibernate is a library to help you to map the entities using C# code instead of xml mappings. Fluent NHibernate uses the fluent pattern and it is based on conventions to create the mappings and it gives you the power of the visual studio tools (such as intellisense) to improve the way yo...
In the logging configuration file of your choice set the logging of the following packages to the levels shown.: # log the sql statement org.hibernate.SQL=DEBUG # log the parameters org.hibernate.type=TRACE There will probably be some logger specific prefixes that are required. Log4j config:...

Page 152 of 457