Merge branch 'develop'
This commit is contained in:
commit
7a29963cb6
134 changed files with 10 additions and 2259 deletions
|
@ -61,6 +61,10 @@ const accentsProperties: IGenericObject <IAccentCustomProperty> = {
|
|||
'editorWidget.border': {
|
||||
alpha: 100,
|
||||
value: undefined
|
||||
},
|
||||
'settings.modifiedItemForeground': {
|
||||
alpha: 100,
|
||||
value: undefined
|
||||
}
|
||||
};
|
||||
|
||||
|
|
|
@ -35,7 +35,7 @@
|
|||
"_folder_ci_open"
|
||||
],
|
||||
"changelog": {
|
||||
"lastversion": "2.1.0"
|
||||
"lastversion": "2.0.1"
|
||||
},
|
||||
"icons": {
|
||||
"theme": {
|
||||
|
|
|
@ -28,7 +28,7 @@
|
|||
}
|
||||
},
|
||||
"scripts": {
|
||||
"build": "yarn get-remote-icons && yarn build-icons && yarn build-themes && yarn build-icons-accents && yarn build-icons-variants && yarn build-icons-variants-json",
|
||||
"build": "rimraf _tmp-output-remote-icons/ && yarn get-remote-icons && yarn build-icons && yarn build-themes && yarn build-icons-accents && yarn build-icons-variants && yarn build-icons-variants-json",
|
||||
"minimize-icons": "mkdir icons && svgo -f src/icons/svgs -o icons/",
|
||||
"minimize-json": "json-minify themes/.material-theme-icons.tmp > themes/Material-Theme-Icons.json && yarn remove-icons-tmp",
|
||||
"remove-icons": "rimraf icons && rimraf themes/Material-Theme-Icons.json",
|
||||
|
|
|
@ -11,6 +11,7 @@
|
|||
".github": "_folder_github",
|
||||
".vscode": "_folder_vscode",
|
||||
".gulp": "_folder_gulp",
|
||||
"gulp": "_folder_gulp",
|
||||
"build": "_folder_dark_build",
|
||||
"dist": "_folder_dist"
|
||||
},
|
||||
|
|
|
@ -819,6 +819,7 @@
|
|||
"gitDecoration.modifiedResourceForeground": "{{variant.scheme.base.blue}}90",
|
||||
"gitDecoration.untrackedResourceForeground": "{{variant.scheme.base.green}}90",
|
||||
"gitDecoration.ignoredResourceForeground": "{{variant.scheme.sidebarForeground}}90",
|
||||
"peekViewResult.selectionBackground": "{{variant.scheme.sidebarForeground}}70"
|
||||
"peekViewResult.selectionBackground": "{{variant.scheme.sidebarForeground}}70",
|
||||
"settings.modifiedItemForeground": "{{commons.accents.Teal}}"
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,79 +0,0 @@
|
|||
comment — for comments.
|
||||
comment.line — line comments, we specialize further so that the type of comment start character(s) can be extracted from the scope.
|
||||
comment.line.double-slash — // comment
|
||||
comment.line.double-dash — -- comment
|
||||
comment.line.number-sign — # comment
|
||||
comment.line.percentage — % comment
|
||||
comment.line.character — other types of line comments.
|
||||
comment.block — multi-line comments like /* … */ and <!-- … -->.
|
||||
comment.block.documentation — embedded documentation.
|
||||
|
||||
constant — various forms of constants.
|
||||
constant.numeric — those which represent numbers, e.g. 42, 1.3f, 0x4AB1U.
|
||||
constant.character — those which represent characters, e.g. <, \e, \031.
|
||||
constant.escape — escape sequences like \e would be constant.character.escape.
|
||||
constant.language — constants (generally) provided by the language which are “special” like true, false, nil, YES, NO, etc.
|
||||
constant.other — other constants, e.g. colors in CSS.
|
||||
|
||||
entity — an entity refers to a larger part of the document, for example a chapter, class, function, or tag. We do not scope the entire entity as entity.* (we use meta.* for that). But we do use entity.* for the “placeholders” in the larger entity, e.g. if the entity is a chapter, we would use entity.name.section for the chapter title.
|
||||
entity.name — we are naming the larger entity.
|
||||
entity.name.function — the name of a function.
|
||||
entity.name.type — the name of a type declaration or class.
|
||||
entity.name.tag — a tag name.
|
||||
entity.name.section — the name is the name of a section/heading.
|
||||
entity.other — other entities.
|
||||
entity.other.inherited-class — the superclass/baseclass name.
|
||||
entity.other.attribute-name — the name of an attribute (mainly in tags).
|
||||
|
||||
invalid — stuff which is “invalid”.
|
||||
invalid.illegal — illegal, e.g. an ampersand or lower-than character in HTML (which is not part of an entity/tag).
|
||||
invalid.deprecated — for deprecated stuff e.g. using an API function which is deprecated or using styling with strict HTML.
|
||||
|
||||
keyword — keywords (when these do not fall into the other groups).
|
||||
keyword.control — mainly related to flow control like continue, while, return, etc.
|
||||
keyword.operator — operators can either be textual (e.g. or) or be characters.
|
||||
keyword.other — other keywords.
|
||||
|
||||
markup — this is for markup languages and generally applies to larger subsets of the text.
|
||||
markup.underline — underlined text.
|
||||
markup.underline.link — this is for links, as a convenience this is derived from markup.underline so that if there is no theme rule which specifically targets markup.underline.link then it will inherit the underline style.
|
||||
markup.bold — bold text (text which is strong and similar should preferably be derived from this name).
|
||||
markup.heading — a section header. Optionally provide the heading level as the next element, for example markup.heading.2.html for <h2>…</h2> in HTML.
|
||||
markup.italic — italic text (text which is emphasized and similar should preferably be derived from this name).
|
||||
markup.list — list items.
|
||||
markup.list.numbered — numbered list items.
|
||||
markup.list.unnumbered — unnumbered list items.
|
||||
markup.quote — quoted (sometimes block quoted) text.
|
||||
markup.raw — text which is verbatim, e.g. code listings. Normally spell checking is disabled for markup.raw.
|
||||
markup.inline.raw
|
||||
markup.other — other markup constructs.
|
||||
|
||||
meta - the meta scope is generally used to markup larger parts of the document. For example the entire line which declares a function would be meta.function and the subsets would be storage.type, entity.name.function, variable.parameter etc. and only the latter would be styled. Sometimes the meta part of the scope will be used only to limit the more general element that is styled, most of the time meta scopes are however used in scope selectors for activation of bundle items. For example in Objective-C there is a meta scope for the interface declaration of a class and the implementation, allowing the same tab-triggers to expand differently, depending on context.
|
||||
|
||||
storage — things relating to “storage”.
|
||||
storage.type — the type of something, class, function, int, var, etc.
|
||||
storage.modifier — a storage modifier like static, final, abstract, etc.
|
||||
|
||||
string — strings.
|
||||
string.quoted — quoted strings.
|
||||
string.quoted.single — single quoted strings: 'foo'.
|
||||
string.quoted.double — double quoted strings: "foo".
|
||||
string.quoted.triple — triple quoted strings: """Python""".
|
||||
string.quoted.other — other types of quoting: $'shell', %s{...}.
|
||||
string.unquoted — for things like here-docs and here-strings.
|
||||
string.interpolated — strings which are “evaluated”: `date`, $(pwd).
|
||||
string.regexp — regular expressions: /(\w+)/.
|
||||
string.other — other types of strings (should rarely be used).
|
||||
|
||||
support — things provided by a framework or library should be below support.
|
||||
support.function — functions provided by the framework/library. For example NSLog in Objective-C is support.function.
|
||||
support.class — when the framework/library provides classes.
|
||||
support.type — types provided by the framework/library, this is probably only used for languages derived from C, which has typedef (and struct). Most other languages would introduce new types as classes.
|
||||
support.constant — constants (magic values) provided by the framework/library.
|
||||
support.variable — variables provided by the framework/library. For example NSApp in AppKit.
|
||||
support.other — the above should be exhaustive, but for everything else use support.other.
|
||||
|
||||
variable — variables. Not all languages allow easy identification (and thus markup) of these.
|
||||
variable.parameter — when the variable is declared as the parameter.
|
||||
variable.language — reserved language variables like this, super, self, etc.
|
||||
variable.other — other variables, like $some_variables.
|
0
test/.gitignore
vendored
0
test/.gitignore
vendored
|
@ -1 +0,0 @@
|
|||
|
0
test/package-lock.json
generated
0
test/package-lock.json
generated
|
@ -1,2 +0,0 @@
|
|||
#!/bin/bash
|
||||
echo "$RANDOM" # Supported in bash. No warnings.
|
|
@ -1,2 +0,0 @@
|
|||
#!/bin/sh
|
||||
echo "$RANDOM" # Unsupported in sh. Produces warning.
|
|
@ -1,60 +0,0 @@
|
|||
#include "ccv.h"
|
||||
#include "ccv_internal.h"
|
||||
#include <sys/time.h>
|
||||
#ifdef HAVE_GSL
|
||||
#include <gsl/gsl_rng.h>
|
||||
#include <gsl/gsl_randist.h>
|
||||
#endif
|
||||
#ifdef USE_OPENMP
|
||||
#include <omp.h>
|
||||
#endif
|
||||
|
||||
const ccv_bbf_param_t ccv_bbf_default_params = {
|
||||
.interval = 5,
|
||||
.min_neighbors = 2,
|
||||
.accurate = 1,
|
||||
.flags = 0,
|
||||
.size = {
|
||||
24,
|
||||
24,
|
||||
},
|
||||
};
|
||||
|
||||
#define _ccv_width_padding(x) (((x) + 3) & -4)
|
||||
|
||||
static inline int _ccv_run_bbf_feature(ccv_bbf_feature_t *feature, int *step, unsigned char **u8)
|
||||
{
|
||||
#define pf_at(i) (*(u8[feature->pz[i]] + feature->px[i] + feature->py[i] * step[feature->pz[i]]))
|
||||
#define nf_at(i) (*(u8[feature->nz[i]] + feature->nx[i] + feature->ny[i] * step[feature->nz[i]]))
|
||||
unsigned char pmin = pf_at(0), nmax = nf_at(0);
|
||||
/* check if every point in P > every point in N, and take a shortcut */
|
||||
if (pmin <= nmax)
|
||||
return 0;
|
||||
int i;
|
||||
for (i = 1; i < feature->size; i++)
|
||||
{
|
||||
if (feature->pz[i] >= 0)
|
||||
{
|
||||
int p = pf_at(i);
|
||||
if (p < pmin)
|
||||
{
|
||||
if (p <= nmax)
|
||||
return 0;
|
||||
pmin = p;
|
||||
}
|
||||
}
|
||||
if (feature->nz[i] >= 0)
|
||||
{
|
||||
int n = nf_at(i);
|
||||
if (n > nmax)
|
||||
{
|
||||
if (pmin <= n)
|
||||
return 0;
|
||||
nmax = n;
|
||||
}
|
||||
}
|
||||
}
|
||||
#undef pf_at
|
||||
#undef nf_at
|
||||
return 1;
|
||||
}
|
|
@ -1,91 +0,0 @@
|
|||
#include "ccv.h"
|
||||
#include "ccv_internal.h"
|
||||
#include <sys/time.h>
|
||||
#ifdef HAVE_GSL
|
||||
#include <gsl/gsl_rng.h>
|
||||
#include <gsl/gsl_randist.h>
|
||||
#endif
|
||||
#ifdef USE_OPENMP
|
||||
#include <omp.h>
|
||||
#endif
|
||||
|
||||
const ccv_bbf_param_t ccv_bbf_default_params = {
|
||||
.interval = 5,
|
||||
.min_neighbors = 2,
|
||||
.accurate = 1,
|
||||
.flags = 0,
|
||||
.size = {
|
||||
24,
|
||||
24,
|
||||
},
|
||||
};
|
||||
|
||||
#define _ccv_width_padding(x) (((x) + 3) & -4)
|
||||
|
||||
static inline int _ccv_run_bbf_feature(ccv_bbf_feature_t* feature, int* step, unsigned char** u8)
|
||||
{
|
||||
#define pf_at(i) (*(u8[feature->pz[i]] + feature->px[i] + feature->py[i] * step[feature->pz[i]]))
|
||||
#define nf_at(i) (*(u8[feature->nz[i]] + feature->nx[i] + feature->ny[i] * step[feature->nz[i]]))
|
||||
unsigned char pmin = pf_at(0), nmax = nf_at(0);
|
||||
/* check if every point in P > every point in N, and take a shortcut */
|
||||
if (pmin <= nmax)
|
||||
return 0;
|
||||
int i;
|
||||
for (i = 1; i < feature->size; i++)
|
||||
{
|
||||
if (feature->pz[i] >= 0)
|
||||
{
|
||||
int p = pf_at(i);
|
||||
if (p < pmin)
|
||||
{
|
||||
if (p <= nmax)
|
||||
return 0;
|
||||
pmin = p;
|
||||
}
|
||||
}
|
||||
if (feature->nz[i] >= 0)
|
||||
{
|
||||
int n = nf_at(i);
|
||||
if (n > nmax)
|
||||
{
|
||||
if (pmin <= n)
|
||||
return 0;
|
||||
nmax = n;
|
||||
}
|
||||
}
|
||||
}
|
||||
#undef pf_at
|
||||
#undef nf_at
|
||||
return 1;
|
||||
}
|
||||
|
||||
static int _ccv_read_bbf_stage_classifier(const char* file, ccv_bbf_stage_classifier_t* classifier)
|
||||
{
|
||||
FILE* r = fopen(file, "r");
|
||||
if (r == 0) return -1;
|
||||
int stat = 0;
|
||||
stat |= fscanf(r, "%d", &classifier->count);
|
||||
union { float fl; int i; } fli;
|
||||
stat |= fscanf(r, "%d", &fli.i);
|
||||
classifier->threshold = fli.fl;
|
||||
classifier->feature = (ccv_bbf_feature_t*)ccmalloc(classifier->count * sizeof(ccv_bbf_feature_t));
|
||||
classifier->alpha = (float*)ccmalloc(classifier->count * 2 * sizeof(float));
|
||||
int i, j;
|
||||
for (i = 0; i < classifier->count; i++)
|
||||
{
|
||||
stat |= fscanf(r, "%d", &classifier->feature[i].size);
|
||||
for (j = 0; j < classifier->feature[i].size; j++)
|
||||
{
|
||||
stat |= fscanf(r, "%d %d %d", &classifier->feature[i].px[j], &classifier->feature[i].py[j], &classifier->feature[i].pz[j]);
|
||||
stat |= fscanf(r, "%d %d %d", &classifier->feature[i].nx[j], &classifier->feature[i].ny[j], &classifier->feature[i].nz[j]);
|
||||
}
|
||||
union { float fl; int i; } flia, flib;
|
||||
stat |= fscanf(r, "%d %d", &flia.i, &flib.i);
|
||||
classifier->alpha[i * 2] = flia.fl;
|
||||
classifier->alpha[i * 2 + 1] = flib.fl;
|
||||
}
|
||||
fclose(r);
|
||||
return 0;
|
||||
}
|
||||
|
||||
#ifdef HAVE_GSL
|
|
@ -1,60 +0,0 @@
|
|||
#include "ccv.h"
|
||||
#include "ccv_internal.h"
|
||||
#include <sys/time.h>
|
||||
#ifdef HAVE_GSL
|
||||
#include <gsl/gsl_rng.h>
|
||||
#include <gsl/gsl_randist.h>
|
||||
#endif
|
||||
#ifdef USE_OPENMP
|
||||
#include <omp.h>
|
||||
#endif
|
||||
|
||||
const ccv_bbf_param_t ccv_bbf_default_params = {
|
||||
.interval = 5,
|
||||
.min_neighbors = 2,
|
||||
.accurate = 1,
|
||||
.flags = 0,
|
||||
.size = {
|
||||
24,
|
||||
24,
|
||||
},
|
||||
};
|
||||
|
||||
#define _ccv_width_padding(x) (((x) + 3) & -4)
|
||||
|
||||
static inline int _ccv_run_bbf_feature(ccv_bbf_feature_t *feature, int *step, unsigned char **u8)
|
||||
{
|
||||
#define pf_at(i) (*(u8[feature->pz[i]] + feature->px[i] + feature->py[i] * step[feature->pz[i]]))
|
||||
#define nf_at(i) (*(u8[feature->nz[i]] + feature->nx[i] + feature->ny[i] * step[feature->nz[i]]))
|
||||
unsigned char pmin = pf_at(0), nmax = nf_at(0);
|
||||
/* check if every point in P > every point in N, and take a shortcut */
|
||||
if (pmin <= nmax)
|
||||
return 0;
|
||||
int i;
|
||||
for (i = 1; i < feature->size; i++)
|
||||
{
|
||||
if (feature->pz[i] >= 0)
|
||||
{
|
||||
int p = pf_at(i);
|
||||
if (p < pmin)
|
||||
{
|
||||
if (p <= nmax)
|
||||
return 0;
|
||||
pmin = p;
|
||||
}
|
||||
}
|
||||
if (feature->nz[i] >= 0)
|
||||
{
|
||||
int n = nf_at(i);
|
||||
if (n > nmax)
|
||||
{
|
||||
if (pmin <= n)
|
||||
return 0;
|
||||
nmax = n;
|
||||
}
|
||||
}
|
||||
}
|
||||
#undef pf_at
|
||||
#undef nf_at
|
||||
return 1;
|
||||
}
|
1582
test/source.cpp
1582
test/source.cpp
File diff suppressed because it is too large
Load diff
259
test/source.cs
259
test/source.cs
|
@ -1,259 +0,0 @@
|
|||
using System;
|
||||
using System.Diagnostics;
|
||||
using System.IO;
|
||||
using System.IO.Compression;
|
||||
using System.Runtime.InteropServices;
|
||||
using System.Windows.Forms;
|
||||
using Microsoft.Win32;
|
||||
using Shadowsocks.Controller;
|
||||
|
||||
namespace Shadowsocks.Util
|
||||
{
|
||||
public struct BandwidthScaleInfo
|
||||
{
|
||||
public float value;
|
||||
public string unitName;
|
||||
public long unit;
|
||||
|
||||
public BandwidthScaleInfo(float value, string unitName, long unit)
|
||||
{
|
||||
this.value = value;
|
||||
this.unitName = unitName;
|
||||
this.unit = unit;
|
||||
}
|
||||
}
|
||||
|
||||
public static class Utils
|
||||
{
|
||||
private static string _tempPath = null;
|
||||
|
||||
// return path to store temporary files
|
||||
public static string GetTempPath()
|
||||
{
|
||||
if (_tempPath == null)
|
||||
{
|
||||
try
|
||||
{
|
||||
Directory.CreateDirectory(Path.Combine(Application.StartupPath, "ss_win_temp"));
|
||||
// don't use "/", it will fail when we call explorer /select xxx/ss_win_temp\xxx.log
|
||||
_tempPath = Path.Combine(Application.StartupPath, "ss_win_temp");
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
Logging.Error(e);
|
||||
throw;
|
||||
}
|
||||
}
|
||||
return _tempPath;
|
||||
}
|
||||
|
||||
// return a full path with filename combined which pointed to the temporary directory
|
||||
public static string GetTempPath(string filename)
|
||||
{
|
||||
return Path.Combine(GetTempPath(), filename);
|
||||
}
|
||||
|
||||
public static void ReleaseMemory(bool removePages)
|
||||
{
|
||||
// release any unused pages
|
||||
// making the numbers look good in task manager
|
||||
// this is totally nonsense in programming
|
||||
// but good for those users who care
|
||||
// making them happier with their everyday life
|
||||
// which is part of user experience
|
||||
GC.Collect(GC.MaxGeneration);
|
||||
GC.WaitForPendingFinalizers();
|
||||
if (removePages)
|
||||
{
|
||||
// as some users have pointed out
|
||||
// removing pages from working set will cause some IO
|
||||
// which lowered user experience for another group of users
|
||||
//
|
||||
// so we do 2 more things here to satisfy them:
|
||||
// 1. only remove pages once when configuration is changed
|
||||
// 2. add more comments here to tell users that calling
|
||||
// this function will not be more frequent than
|
||||
// IM apps writing chat logs, or web browsers writing cache files
|
||||
// if they're so concerned about their disk, they should
|
||||
// uninstall all IM apps and web browsers
|
||||
//
|
||||
// please open an issue if you're worried about anything else in your computer
|
||||
// no matter it's GPU performance, monitor contrast, audio fidelity
|
||||
// or anything else in the task manager
|
||||
// we'll do as much as we can to help you
|
||||
//
|
||||
// just kidding
|
||||
SetProcessWorkingSetSize(Process.GetCurrentProcess().Handle,
|
||||
(UIntPtr)0xFFFFFFFF,
|
||||
(UIntPtr)0xFFFFFFFF);
|
||||
}
|
||||
}
|
||||
|
||||
public static string UnGzip(byte[] buf)
|
||||
{
|
||||
byte[] buffer = new byte[1024];
|
||||
int n;
|
||||
using (MemoryStream sb = new MemoryStream())
|
||||
{
|
||||
using (GZipStream input = new GZipStream(new MemoryStream(buf),
|
||||
CompressionMode.Decompress,
|
||||
false))
|
||||
{
|
||||
while ((n = input.Read(buffer, 0, buffer.Length)) > 0)
|
||||
{
|
||||
sb.Write(buffer, 0, n);
|
||||
}
|
||||
}
|
||||
return System.Text.Encoding.UTF8.GetString(sb.ToArray());
|
||||
}
|
||||
}
|
||||
|
||||
public static string FormatBandwidth(long n)
|
||||
{
|
||||
var result = GetBandwidthScale(n);
|
||||
return $"{result.value:0.##}{result.unitName}";
|
||||
}
|
||||
|
||||
public static string FormatBytes(long bytes)
|
||||
{
|
||||
const long K = 1024L;
|
||||
const long M = K * 1024L;
|
||||
const long G = M * 1024L;
|
||||
const long T = G * 1024L;
|
||||
const long P = T * 1024L;
|
||||
const long E = P * 1024L;
|
||||
|
||||
if (bytes >= P * 990)
|
||||
return (bytes / (double)E).ToString("F5") + "EiB";
|
||||
if (bytes >= T * 990)
|
||||
return (bytes / (double)P).ToString("F5") + "PiB";
|
||||
if (bytes >= G * 990)
|
||||
return (bytes / (double)T).ToString("F5") + "TiB";
|
||||
if (bytes >= M * 990)
|
||||
{
|
||||
return (bytes / (double)G).ToString("F4") + "GiB";
|
||||
}
|
||||
if (bytes >= M * 100)
|
||||
{
|
||||
return (bytes / (double)M).ToString("F1") + "MiB";
|
||||
}
|
||||
if (bytes >= M * 10)
|
||||
{
|
||||
return (bytes / (double)M).ToString("F2") + "MiB";
|
||||
}
|
||||
if (bytes >= K * 990)
|
||||
{
|
||||
return (bytes / (double)M).ToString("F3") + "MiB";
|
||||
}
|
||||
if (bytes > K * 2)
|
||||
{
|
||||
return (bytes / (double)K).ToString("F1") + "KiB";
|
||||
}
|
||||
return bytes.ToString() + "B";
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Return scaled bandwidth
|
||||
/// </summary>
|
||||
/// <param name="n">Raw bandwidth</param>
|
||||
/// <returns>
|
||||
/// The BandwidthScaleInfo struct
|
||||
/// </returns>
|
||||
public static BandwidthScaleInfo GetBandwidthScale(long n)
|
||||
{
|
||||
long scale = 1;
|
||||
float f = n;
|
||||
string unit = "B";
|
||||
if (f > 1024)
|
||||
{
|
||||
f = f / 1024;
|
||||
scale <<= 10;
|
||||
unit = "KiB";
|
||||
}
|
||||
if (f > 1024)
|
||||
{
|
||||
f = f / 1024;
|
||||
scale <<= 10;
|
||||
unit = "MiB";
|
||||
}
|
||||
if (f > 1024)
|
||||
{
|
||||
f = f / 1024;
|
||||
scale <<= 10;
|
||||
unit = "GiB";
|
||||
}
|
||||
if (f > 1024)
|
||||
{
|
||||
f = f / 1024;
|
||||
scale <<= 10;
|
||||
unit = "TiB";
|
||||
}
|
||||
return new BandwidthScaleInfo(f, unit, scale);
|
||||
}
|
||||
|
||||
public static RegistryKey OpenRegKey(string name, bool writable, RegistryHive hive = RegistryHive.CurrentUser)
|
||||
{
|
||||
// we are building x86 binary for both x86 and x64, which will
|
||||
// cause problem when opening registry key
|
||||
// detect operating system instead of CPU
|
||||
if (name.IsNullOrEmpty()) throw new ArgumentException(nameof(name));
|
||||
try
|
||||
{
|
||||
RegistryKey userKey = RegistryKey.OpenBaseKey(hive,
|
||||
Environment.Is64BitOperatingSystem ? RegistryView.Registry64 : RegistryView.Registry32)
|
||||
.OpenSubKey(name, writable);
|
||||
return userKey;
|
||||
}
|
||||
catch (ArgumentException ae)
|
||||
{
|
||||
MessageBox.Show("OpenRegKey: " + ae.ToString());
|
||||
return null;
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
Logging.LogUsefulException(e);
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
public static bool IsWinVistaOrHigher()
|
||||
{
|
||||
return Environment.OSVersion.Version.Major > 5;
|
||||
}
|
||||
|
||||
[DllImport("kernel32.dll")]
|
||||
[return: MarshalAs(UnmanagedType.Bool)]
|
||||
private static extern bool SetProcessWorkingSetSize(IntPtr process,
|
||||
UIntPtr minimumWorkingSetSize, UIntPtr maximumWorkingSetSize);
|
||||
|
||||
|
||||
// See: https://msdn.microsoft.com/en-us/library/hh925568(v=vs.110).aspx
|
||||
public static bool IsSupportedRuntimeVersion()
|
||||
{
|
||||
/*
|
||||
* +-----------------------------------------------------------------+----------------------------+
|
||||
* | Version | Value of the Release DWORD |
|
||||
* +-----------------------------------------------------------------+----------------------------+
|
||||
* | .NET Framework 4.6.2 installed on Windows 10 Anniversary Update | 394802 |
|
||||
* | .NET Framework 4.6.2 installed on all other Windows OS versions | 394806 |
|
||||
* +-----------------------------------------------------------------+----------------------------+
|
||||
*/
|
||||
const int minSupportedRelease = 394802;
|
||||
|
||||
const string subkey = @"SOFTWARE\Microsoft\NET Framework Setup\NDP\v4\Full\";
|
||||
using (var ndpKey = OpenRegKey(subkey, false, RegistryHive.LocalMachine))
|
||||
{
|
||||
if (ndpKey?.GetValue("Release") != null)
|
||||
{
|
||||
var releaseKey = (int)ndpKey.GetValue("Release");
|
||||
|
||||
if (releaseKey >= minSupportedRelease)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
|
@ -1,61 +0,0 @@
|
|||
|
||||
body {
|
||||
font-family: arial;
|
||||
}
|
||||
|
||||
h1, p, table {
|
||||
background-color:#CCC;
|
||||
border: 1px solid;
|
||||
color:#39F;
|
||||
text-align: center;
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.addon-store .pagehead h1
|
||||
.addon-store .addon-summary:after { clear: both }
|
||||
|
||||
#addon-store .pagehead .electrocat-small {
|
||||
bottom: -7px;
|
||||
position: absolute;
|
||||
right: 0;
|
||||
}
|
||||
|
||||
.addon-store .addons-nav a.selected {
|
||||
border-bottom-color: #d26911;
|
||||
color: #333;
|
||||
font-weight: bold;
|
||||
padding: 0 0 14px;
|
||||
}
|
||||
|
||||
.addon-store .addon-icon {
|
||||
background: #fff;
|
||||
border: 1px solid #ddd;
|
||||
box-shadow: 0 1px 2px rgba(0,0,0,0.15);
|
||||
float: left;
|
||||
height: 80px;
|
||||
margin-right: 14px;
|
||||
width: 80px;
|
||||
}
|
||||
|
||||
.addon-store .developer-callout {
|
||||
background-color: #f1f1f1;
|
||||
background-image: -moz-linear-gradient(#fafafa, #f1f1f1);
|
||||
background-image: -webkit-linear-gradient(#fafafa, #f1f1f1);
|
||||
background-image: linear-gradient(#fafafa, #f1f1f1);
|
||||
background-repeat: repeat-x;
|
||||
border: 1px solid #ddd;
|
||||
border-bottom: 1px solid #ccc;
|
||||
border-radius: 3px;
|
||||
box-shadow: inset 0 1px 0 #fff, 0 1px 5px #f1f1f1;
|
||||
margin-top: 40px;
|
||||
text-shadow: 0 1px 0 #fff;
|
||||
}
|
||||
|
||||
.addon-field-editor .addon-field-list, .addon-field-editor .addon-new-field {
|
||||
-moz-box-sizing: border-box;
|
||||
border-radius: 3px;
|
||||
box-sizing: border-box;
|
||||
display: inline-block;
|
||||
text-align: center;
|
||||
width: 595px;
|
||||
}
|
|
@ -1 +0,0 @@
|
|||
//
|
|
@ -1,57 +0,0 @@
|
|||
<?php
|
||||
/**
|
||||
function hello($world) {}
|
||||
*/
|
||||
|
||||
// base class with member properties and methods
|
||||
class Vegetable {
|
||||
|
||||
var $edible;
|
||||
var $color;
|
||||
|
||||
Something::class;
|
||||
SomeThing::class;
|
||||
|
||||
function Vegetable($edible, $color="green")
|
||||
{
|
||||
$this->edible = $edible;
|
||||
$this->color = $color;
|
||||
}
|
||||
|
||||
function is_edible()
|
||||
{
|
||||
return $this->edible;
|
||||
}
|
||||
|
||||
function what_color()
|
||||
{
|
||||
return $this->color;
|
||||
}
|
||||
|
||||
} // end of class Vegetable
|
||||
|
||||
// extends the base class
|
||||
class Spinach extends Vegetable {
|
||||
|
||||
|
||||
var $cooked = false;
|
||||
|
||||
function Spinach()
|
||||
{
|
||||
$this->Vegetable(true, "green");
|
||||
}
|
||||
|
||||
function cook_it()
|
||||
{
|
||||
$this->cooked = true;
|
||||
}
|
||||
|
||||
function is_cooked()
|
||||
{
|
||||
return $this->cooked;
|
||||
}
|
||||
|
||||
} // end of class Spinach
|
||||
|
||||
?>
|
||||
|
Some files were not shown because too many files have changed in this diff Show more
Loading…
Reference in a new issue