Document moved to: https://github.com/servo/servo/blob/master/HACKING_QUICKSTART.md
var vsixPackage = O2_FluentSharp_VSIXPackage.vsixPackage; // this is a reference to an Package object | |
var ivsSolution = (IVsSolution)Package.GetGlobalService(typeof(IVsSolution)); | |
var dte = (EnvDTE80.DTE2)Package.GetGlobalService(typeof(EnvDTE.DTE)); | |
var errorListProvider = new ErrorListProvider(vsixPackage); | |
var errorText = "this is a test item"; | |
var errorCategory = TaskErrorCategory.Error; | |
//Get first project details | |
var proj = dte.Solution.Projects.Item(1); |
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.
# Source | |
#include <stdio.h> | |
#include <stdlib.h> | |
struct node { | |
int something; | |
struct node *next; | |
}; |
$ uname -r
.globl bar | |
.p2align 4, 0x90 | |
.type bar,@function | |
bar: | |
.cfi_startproc | |
cvttss2si %xmm0, %eax | |
cmpl $1, %eax | |
jo 0f | |
retq | |
0: |
template <class _Ty> | |
_NODISCARD /* constexpr */ _Ty _Common_lerp(const _Ty _ArgA, const _Ty _ArgB, const _Ty _ArgT) noexcept { | |
// on a line intersecting {(0.0, _ArgA), (1.0, _ArgB)}, return the Y value for X == _ArgT | |
const int _Finite_mask = (int{isfinite(_ArgA)} << 2) | (int{isfinite(_ArgB)} << 1) | int{isfinite(_ArgT)}; | |
if (_Finite_mask == 0b111) { | |
// 99% case, put it first; this block comes from P0811R3 | |
if ((_ArgA <= 0 && _ArgB >= 0) || (_ArgA >= 0 && _ArgB <= 0)) { | |
// exact, monotonic, bounded, determinate, and (for _ArgA == _ArgB == 0) consistent: | |
return _ArgT * _ArgB + (1 - _ArgT) * _ArgA; |
Apologies for the snarky title, but there has been a huge amount of discussion around so called "Prompt Engineering" these past few months on all kinds of platforms. Much of it is coming from individuals who are peddling around an awful lot of "Prompting" and very little "Engineering".
Most of these discussions are little more than users finding that writing more creative and complicated prompts can help them solve a task that a more simple prompt was unable to help with. I claim this is not Prompt Engineering. This is not to say that crafting good prompts is not a difficult task, but it does not involve doing any kind of sophisticated modifications to general "template" of a prompt.
Others, who I think do deserve to call themselves "Prompt Engineers" (and an awful lot more than that), have been writing about and utilizing the rich new eco-system
import json | |
import os | |
import sys | |
from collections import defaultdict | |
from tqdm import tqdm | |
import argparse | |
import torch | |
from safetensors.torch import load_file, save_file |