You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: content/articles/R/plotting-graphs/index.md
+2-3Lines changed: 2 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -13,9 +13,8 @@ I recently stumbled over [R](http://www.r-project.org/), a programming language
13
13
14
14
This post is about how to display (draw) a mathematical function with R.
15
15
16
-
```tip
17
-
There's a very nice and interactive [tutorial for R](http:*www.codeschool.com/courses/try-r) available over at [codeschool.com](http:*www.codeschool.com/). It's free and takes about 3 - 4 hours to complete.
18
-
```
16
+
> [!TIP]
17
+
> There's a very nice and interactive [tutorial for R](http:*www.codeschool.com/courses/try-r) available over at [codeschool.com](http:*www.codeschool.com/). It's free and takes about 3 - 4 hours to complete.
Copy file name to clipboardExpand all lines: content/articles/algorithms/easy-compare-function.md
+2-3Lines changed: 2 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -44,6 +44,5 @@ int Compare(int a, int b) {
44
44
45
45
That's it.
46
46
47
-
```note
48
-
Care should be taken if `a` and/or `b` can come close to `int.MaxValue` or `int.MinValue`. In this case the results may not be what one wants (like if `a = int.MinValue` and `b = 1` then the result will be `int.MaxValue` which is wrong).
49
-
```
47
+
> [!NOTE]
48
+
> Care should be taken if `a` and/or `b` can come close to `int.MaxValue` or `int.MinValue`. In this case the results may not be what one wants (like if `a = int.MinValue` and `b = 1` then the result will be `int.MaxValue` which is wrong).
Copy file name to clipboardExpand all lines: content/articles/algorithms/visitor-pattern.md
+4-6Lines changed: 4 additions & 6 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -291,9 +291,8 @@ public class Document {
291
291
}
292
292
```
293
293
294
-
```note
295
-
The implementations of `Accept()` seem to be identical for all child classes of `DocumentPart`. However, we can't move the code into the base class because `IVisitor` doesn't have an method `Visit(DocumentPart)` but only for the concrete implementations. (We could solve this through reflection, though, but would lose compile-time checking.)
296
-
```
294
+
> [!NOTE]
295
+
> The implementations of `Accept()` seem to be identical for all child classes of `DocumentPart`. However, we can't move the code into the base class because `IVisitor` doesn't have an method `Visit(DocumentPart)` but only for the concrete implementations. (We could solve this through reflection, though, but would lose compile-time checking.)
This will print "ApolloSpacecraft". The actual method implementation to be called is chosen **at runtime** based solely on the actual type of `ship`. So, only the type of a *single* object is used to select the method, hence the name *single* dispatch.
368
367
369
-
```note
370
-
"Single dispatch" is one form of "dynamic dispatch", i.e. the method is chosen at runtime. If the method is chosen at compile time (true for all non-virtual methods), it's called "static dispatch".
371
-
```
368
+
> [!NOTE]
369
+
> "Single dispatch" is one form of "dynamic dispatch", i.e. the method is chosen at runtime. If the method is chosen at compile time (true for all non-virtual methods), it's called "static dispatch".
Copy file name to clipboardExpand all lines: content/articles/cpp-cli/cheat-sheet.md
+10-15Lines changed: 10 additions & 15 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -12,9 +12,8 @@ aliases:
12
12
13
13
This article provides a quick comparison between C++/CLI and C#. It's meant for those who know C# (and possibly C++) and will explain which C++/CLI language construct correspond with which in C#. (I don't know Visual Basic so I can't add infos about this here.)
14
14
15
-
```note
16
-
This is not a complete reference but rather quick reference for those features that are (in my opinion) the most unclear.
17
-
```
15
+
> [!NOTE]
16
+
> This is not a complete reference but rather quick reference for those features that are (in my opinion) the most unclear.
18
17
19
18
<!--more-->
20
19
@@ -24,9 +23,8 @@ C++/CLI is - as the name suggest - an extension of C++ to allow it to use Micros
24
23
25
24
C++/CLI is the successor of "Managed C++", which felt unnatural to many developers. However, both "languages" have the same goal: combine native code with managed code.
26
25
27
-
```note
28
-
C++/CLI is currently only available on Windows. At the time of writing (mid 2010) there are no plans in the Mono project to support C++/CLI. Such support would be necessary as a C++/CLI compiler creates mixed code that contains native and managed code. While the managed code could be executed by the Mono runtime the native can't. Therefore a C++/CLI library can't be used on Linux or MacOSX (or any other Mono supported OS).
29
-
```
26
+
> [!NOTE]
27
+
> C++/CLI is currently only available on Windows. At the time of writing (mid 2010) there are no plans in the Mono project to support C++/CLI. Such support would be necessary as a C++/CLI compiler creates mixed code that contains native and managed code. While the managed code could be executed by the Mono runtime the native can't. Therefore a C++/CLI library can't be used on Linux or MacOSX (or any other Mono supported OS).
30
28
31
29
See also:
32
30
@@ -458,9 +456,8 @@ protected:
458
456
459
457
You only need destructor *and* finalizer when the class hosts some unmanaged data (e.g. a pointer to a C++ class). If you don't have unmanaged data in your class, you neither need destructor nor finalizer (unless you have some members implementing `IDisposable`).
460
458
461
-
```warn
462
-
The destructor (`Dispose()`) will **not** be called automatically from the finalizer.
463
-
```
459
+
> [!WARNING]
460
+
> The destructor (`Dispose()`) will **not** be called automatically from the finalizer.
464
461
465
462
Since freeing unmanaged resources should occur in the finalizer (see [](idisposable-and-finalizers.md)), the default implementation pattern for finalizer and destructor looks like this:
466
463
@@ -574,9 +571,8 @@ Calling an event is identical to calling a delegate:
574
571
this->MyCustomEvent(this, EventArgs::Empty);
575
572
```
576
573
577
-
```note
578
-
Checking the event against `nullptr` isn't required in C++/CLI (unlike C#). That's because the event's `raise()` method automatically checks whether there are actually any event handlers ([source](http://stackoverflow.com/a/2014752/614177)).
579
-
```
574
+
> [!NOTE]
575
+
> Checking the event against `nullptr` isn't required in C++/CLI (unlike C#). That's because the event's `raise()` method automatically checks whether there are actually any event handlers ([source](http://stackoverflow.com/a/2014752/614177)).
580
576
581
577
## Templates and Generics
582
578
@@ -630,9 +626,8 @@ T MyClass::ReturnNull() {
630
626
}
631
627
```
632
628
633
-
```note
634
-
The syntax of `T()` may be misleading. It does **not** create an instance of `T` on the stack and call `T`'s default constructor (as the syntax would suggest). It indeed results in `nullptr`.
635
-
```
629
+
> [!NOTE]
630
+
> The syntax of `T()` may be misleading. It does **not** create an instance of `T` on the stack and call `T`'s default constructor (as the syntax would suggest). It indeed results in `nullptr`.
636
631
637
632
## Referencing managed type from other file (in the same project)
Of course, this also allows you to actually do something (e.g. call methods) with the `nativeClass` pointer.
250
250
251
-
```tip
252
-
If you only want to store a pointer to a native class (i.e. don't do anything with it), you don't need to link against the native type's `.lib` file.
253
-
```
251
+
> [!TIP]
252
+
> If you only want to store a pointer to a native class (i.e. don't do anything with it), you don't need to link against the native type's `.lib` file.
The keyword `__declspec(...)` is a Microsoft specific extension to C++ (see [here](http:*msdn.microsoft.com/en-us/library/3y1sfaz2.aspx)). So it only works in Visual C++. There is an alternative (more portable?) way to specify which classes/functions are to be exported. For this, a "Module-Definition File" (`.def`) needs to be created. However, creating such a file is more tedious than specifying the export statement directly in the code. For more information, see [this article](http:*www.codeguru.com/cpp/cpp/cpp_mfc/tutorials/article.php/c9855).
132
-
```
130
+
> [!NOTE]
131
+
> The keyword `__declspec(...)` is a Microsoft specific extension to C++ (see [here](http:*msdn.microsoft.com/en-us/library/3y1sfaz2.aspx)). So it only works in Visual C++. There is an alternative (more portable?) way to specify which classes/functions are to be exported. For this, a "Module-Definition File" (`.def`) needs to be created. However, creating such a file is more tedious than specifying the export statement directly in the code. For more information, see [this article](http:*www.codeguru.com/cpp/cpp/cpp_mfc/tutorials/article.php/c9855).
133
132
134
133
Now, when you compile the library project, an additional `.lib` file will be created. This file is used to import the exported classes/functions in another project. (If you don't export anything, the file won't be created.) How to do this, is explained in [part two of this mini series](part-2--project-dependencies.md).
Copy file name to clipboardExpand all lines: content/articles/cpp/project-tutorial/part-2--project-dependencies/index.md
+7-8Lines changed: 7 additions & 8 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -134,14 +134,13 @@ And that's it. Your project should now compile.
134
134
135
135
Besides being easier to use, the new way has also another advantage: The information about project dependencies are now stored in the project file instead of the solution file (which is the case with the way described in [](#specify_build_order)). This way you can use a library project that has some dependencies itself in several different solutions and always have the dependencies already set up correctly. (With the old way you had to recreate the dependencies for each solution manually.)
136
136
137
-
```note
138
-
There are two options - available in the project settings - that influence how these references work. Both can be found under "Linker" --> "General":
139
-
140
-
* *Ignore Import Library:* This is specified in the library project. When this is set, the `.lib` file generated by the project won't be used automatically by projects that depend on it. (Default: No)
141
-
* *Link Library Dependencies:* This is the opposite of the other option. It's specified on the project that uses other projects. If set to "No", dependencies won't be linked automatically. (Default: Yes)
142
-
143
-

144
-
```
137
+
> [!NOTE]
138
+
> There are two options - available in the project settings - that influence how these references work. Both can be found under "Linker" --> "General":
139
+
>
140
+
> * *Ignore Import Library:* This is specified in the library project. When this is set, the `.lib` file generated by the project won't be used automatically by projects that depend on it. (Default: No)
141
+
> * *Link Library Dependencies:* This is the opposite of the other option. It's specified on the project that uses other projects. If set to "No", dependencies won't be linked automatically. (Default: Yes)
Copy file name to clipboardExpand all lines: content/articles/cpp/property-sheets/index.md
+17-26Lines changed: 17 additions & 26 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -12,23 +12,20 @@ aliases:
12
12
13
13
Everyone who has ever created and managed a C++ project in Visual Studio knows that there are hundreds of compiler switches and options to choose from. While setting the desired values for one project may be ok, it's quite time-consuming and error-prone to do this for multiple projects. I'm currently working with a solution containing about 30 or so projects that share most of their project settings. I always wished there was a way to sync or share these common settings among the projects in the solution. Fortunately, there is: *property sheets*. They're a bit hidden though, so I'll explain how to use them in this article.
14
14
15
-
```note
16
-
This only applies to C++ and C++/CLI projects. .NET projects (C# and Visual Basic) don't have that many options to be tweaked and (therefore?) can't have shared settings.
17
-
```
15
+
> [!NOTE]
16
+
> This only applies to C++ and C++/CLI projects. .NET projects (C# and Visual Basic) don't have that many options to be tweaked and (therefore?) can't have shared settings.
18
17
19
-
```note
20
-
This article describes property sheets as they appear in Visual Studio 2010. They may work slightly different in other versions of Visual Studio.
21
-
```
18
+
> [!NOTE]
19
+
> This article describes property sheets as they appear in Visual Studio 2010. They may work slightly different in other versions of Visual Studio.
22
20
23
21
<!--more-->
24
22
25
23
## The Property Manager
26
24
27
25
While property sheets (file extension: `.props`) are simply XML files and therefore could be edited with a simple text editor, Visual Studio also provides an editor for property sheets. This editor is available through the so called Property Manager. To display the Property Manager pane, in the menu go to `View` --> `Other Windows` --> `Property Manager`.
28
26
29
-
```note
27
+
> [!NOTE]
30
28
Property sheet files share the same XML syntax as `.vcxproj` files.
31
-
```
32
29
33
30

34
31
@@ -48,17 +45,15 @@ Let's examine the property sheets a bit closer:
48
45
* Property sheets have an order in which they're evaluated. This is important, if two property sheets define a value for the same setting. The order can be seen in the Property Manager and is bottom up. So in the image above, for the "Debug" configuration first `Core Windows Libraries` is evaluated, then `Unicode Support` and so forth. We'll examine the effects of this order a little later.
49
46
* Property sheets belong to a certain configuration (such as "Debug|Win32"). The stack of property sheets defines the value that can be inherited for this specific configuration (i.e. that's what you get when you choose `<inherit from parent or project defaults>` for a value in the project settings).
50
47
51
-
```note
52
-
The property sheet `Microsoft.Cpp.Win32.user` is located somewhere in the current user's application settings. It's contents therefore will be different for each user. By keeping it *the top item* in every configuration you allow the user to override any option, if necessary, without needing to change the project file.
53
-
```
48
+
> [!NOTE]
49
+
> The property sheet `Microsoft.Cpp.Win32.user` is located somewhere in the current user's application settings. It's contents therefore will be different for each user. By keeping it *the top item* in every configuration you allow the user to override any option, if necessary, without needing to change the project file.
54
50
55
51
## Creating a shared property sheet
56
52
57
53
The first step is to create a new property sheet file. To do this, right-click on the project and choose `Add New Project Property Sheet`. This will add a new property sheet to all configurations of the project. In this article, we'll called the file `commons.props` and place it in a directory called `shared-properties` directly in the solution directory.
58
54
59
-
```note
60
-
You can also right-click on a configuration and choose the same menu item. In this case the new property sheet will only be added to the selected configuration. You can, of course, add this property sheet later to the other configurations as well.
61
-
```
55
+
> [!NOTE]
56
+
> You can also right-click on a configuration and choose the same menu item. In this case the new property sheet will only be added to the selected configuration. You can, of course, add this property sheet later to the other configurations as well.
62
57
63
58
As mentioned before, we want to keep the property sheet `Microsoft.Cpp.Win32.user` the top item in every configuration. So, select an instance of the new property sheets and click on the down arrow in the Property Manager's toolbar. Repeat this also for the property sheet(s) in the other configuration(s).
64
59
@@ -72,9 +67,8 @@ The result then should look like this:
72
67
73
68
To edit a property sheet (file), simply double-click on it in the Property Manager.
74
69
75
-
```note
76
-
The same property sheet file can be listed multiple times in the Property Manager. Editing one "instance" of this file will, of course, update all other "instances" as well (since all "instances" share the same file).
77
-
```
70
+
> [!NOTE]
71
+
> The same property sheet file can be listed multiple times in the Property Manager. Editing one "instance" of this file will, of course, update all other "instances" as well (since all "instances" share the same file).
78
72
79
73
This will pop up a dialog that's very similar to the "Project Settings" dialog of a C++ project. Note that since the property sheet file itself isn't bound to any specified project kind or configuration, the dialog may display more options than are actually available to the project the property sheet is currently associated with.
80
74
@@ -90,19 +84,17 @@ After clicking on `Apply`, the result should look like this:
90
84
91
85
Now, again, open the property sheet editor for the `common` property sheet we created earlier. There, set the `Warning Level` to `Level3 (/W3)`. Then click `OK`.
92
86
93
-
```note
94
-
You may need to save the property sheet manually. For this, use the `Save` button in the Property Manager's toolbar.
95
-
```
87
+
> [!NOTE]
88
+
> You may need to save the property sheet manually. For this, use the `Save` button in the Property Manager's toolbar.
96
89
97
90
When you now open the project's settings again, you should see that the inherited value (not in bold) of `Warning Level`*changed* from level 1 to level 3.
98
91
99
92

100
93
101
94
That's the effect of the property sheet. You can define as many settings in a single property sheet file as you want. Then you can add the same property sheet file to multiple project thereby sharing this set of common project settings among all projects.
102
95
103
-
```note
104
-
A value of a setting specified in a property sheet is only used in a project, when there isn't a custom value (printed in bold) assigned to this setting in the project settings. To take the value of the property sheet (instead of defining a value in the project file), select `<inherit from parent or project defaults>` from the drop-down menu of this setting.
105
-
```
96
+
> [!NOTE]
97
+
> A value of a setting specified in a property sheet is only used in a project, when there isn't a custom value (printed in bold) assigned to this setting in the project settings. To take the value of the property sheet (instead of defining a value in the project file), select `<inherit from parent or project defaults>` from the drop-down menu of this setting.
106
98
107
99
## Property Sheet Order
108
100
@@ -141,9 +133,8 @@ The XML code for inheritance is:
141
133
142
134
Property sheets can also contain *conditional property values*. This means that the value of a property depends on some other value. Usually, this is used to place values for debug and release builds in the same property sheet file. Unfortunately, you can edit these conditions in Visual Studio's property editor. You need to use a text editor.
143
135
144
-
```note
145
-
When you've modified a property sheet outside of Visual Studio, you need to close the solution(s) it belongs to and reopen them afterwards. Otherwise Visual Studio won't detect the changes to the property sheet.
146
-
```
136
+
> [!NOTE]
137
+
> When you've modified a property sheet outside of Visual Studio, you need to close the solution(s) it belongs to and reopen them afterwards. Otherwise Visual Studio won't detect the changes to the property sheet.
147
138
148
139
First, you can define conditions on single properties by using the `Condition` attribute:
0 commit comments