Partial evaluation means to fix some variables in the given code before execution. With a traditional implementation of a compiler or an interpreter, all variables are replaced with its value on each evaluation of that variable. This is because a variable can change at any timing. This is, however, not always true in actual applications. Almost all of large applications has setting variables and data
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| pm list packages -f |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| qApp->setStyle(QStyleFactory::create("Fusion")); | |
| QPalette darkPalette; | |
| darkPalette.setColor(QPalette::Window, QColor(53,53,53)); | |
| darkPalette.setColor(QPalette::WindowText, Qt::white); | |
| darkPalette.setColor(QPalette::Base, QColor(25,25,25)); | |
| darkPalette.setColor(QPalette::AlternateBase, QColor(53,53,53)); | |
| darkPalette.setColor(QPalette::ToolTipBase, Qt::white); | |
| darkPalette.setColor(QPalette::ToolTipText, Qt::white); | |
| darkPalette.setColor(QPalette::Text, Qt::white); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| -- cd to the current finder window folder in iTerm. Or drag a folder onto this script to cd to that folder in iTerm. | |
| -- found this script in the comments of this article: http://www.macosxhints.com/article.php?story=20050924210643297 | |
| -- Instructions for use: | |
| -- paste this script into Script Editor and save as an application to ~/Library/Scripts/Applications/Finder/cd to in iTerm | |
| -- run via the AppleScript Menu item (http://www.apple.com/applescript/scriptmenu/) | |
| -- Or better yet, Control-click and drag it to the top of a finder window so it appears in every finder window. | |
| -- Activate it by clicking on it or dragging a folder onto it. | |
| -- Another nice touch is to give the saved script the same icon as iTerm. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| include(CMakeParseArguments) | |
| # Function to wrap a given string into multiple lines at the given column position. | |
| # Parameters: | |
| # VARIABLE - The name of the CMake variable holding the string. | |
| # AT_COLUMN - The column position at which string will be wrapped. | |
| function(WRAP_STRING) | |
| set(oneValueArgs VARIABLE AT_COLUMN) | |
| cmake_parse_arguments(WRAP_STRING "${options}" "${oneValueArgs}" "" ${ARGN}) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #include <GL/glew.h> | |
| #include <GLFW/glfw3.h> | |
| #include <iostream> | |
| #include <string> | |
| void PrintOpenGLErrors(char const * const Function, char const * const File, int const Line) | |
| { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #requires -version 2 | |
| <# | |
| .SYNOPSIS | |
| Time-base One-Time Password Algorithm (RFC 6238) | |
| .DESCRIPTION | |
| This is an implementation of the RFC 6238 Time-Based One-Time Password Algorithm draft based upon the HMAC-based One-Time Password (HOTP) algorithm (RFC 4226). This is a time based variant of the HOTP algorithm providing short-lived OTP values. | |
| .NOTES | |
| Version: 1.0 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # Boolean | |
| op.add_column('projects', sa.Column('is_closed', sa.Boolean(), server_default=sa.schema.DefaultClause("0"), nullable=False)) | |
| # DateTime | |
| op.add_column('projects_users', sa.Column('created_at', sa.DateTime(), server_default=sa.func.current_timestamp(), nullable=False)) |
There is sometimes a situation in which one needs to get the relative offset of a structure field, common examples of this include serialization frameworks which aid to serialize objects, vertex attributes for rendering (D3D, GL.), etc.
The most common technique for getting this information is through the offsetof
macro defined in stddef.h. Unfortunately using the macro in C++ comes with a
new set of restrictions that prevent some (subjectively valid) uses of it.
OlderNewer