問題タブ [precompiler]

For questions regarding programming in ECMAScript (JavaScript/JS) and its various dialects/implementations (excluding ActionScript). Note JavaScript is NOT the same as Java! Please include all relevant tags on your question; e.g., [node.js], [jquery], [json], [reactjs], [angular], [ember.js], [vue.js], [typescript], [svelte], etc.

0 投票する
8 に答える
26273 参照

c - 単純に 1 ではなく、C ブール値マクロで TRUE (1==1) を #define するのはなぜですか?

Cでの定義を見てきました

これは必要ですか?TRUE を 1 に、FALSE を 0 に単純に定義する利点は何ですか?

0 投票する
3 に答える
3940 参照

c++ - C ++で関数定義をオーバーライドするプリプロセッサマクロ

私は C++ の基本にかなり精通していますが、経験が不足しています (主に Java のコード)。

私は、標準のビジュアル スタジオ クラス limits.h を使用する大規模なオープン ソース プロジェクトを拡張しています。ここには、次のコードがあります。

このコードを含む minwindef.h を使用する別のオープン ソース プロジェクトをインポートしました。

この行のため、ビルドが壊れるようになりました

コンパイラは、パラメーターなしで max() が使用されていると不平を言います。この問題を回避する簡単な方法はありますか? または、インポートしたライブラリを単に使用しないことはできますか? :/

これが十分に明確であることを願っています。提案に感謝します!!

0 投票する
1 に答える
789 参照

c - Implementing an Array Based Memory Pool of Various Sized Structs

I am working on a concurrent data structure that uses a number of small sized temporary objects. A lot of these objects are the same size. So to reduce the strain on the memory allocator I have been using a thread local map to store the objects as <size, list> tuples.

When a thread needs an object, it checks the map for a suitable object before going to the allocator. This works well and has improved performance significantly, however it is prone to the issue where overtime one thread loses its entire pool to other threads, forcing it to allocate new objects. If the application runs for a long period of time, I find a few threads having memory pools way to large.

To solve this I want to add a shared memory pool between the thread local pools and the allocator. Since the number of structs and the size of the structs are constant at compile time, I figure that there should be someway using macros to map each size to an array position. Allowing for a much lighter memory management.

Here is my current solution

Is there a way to echo the the result of the call to sizeof(object) into the defined variable name? Preferably without a separate configuration script.

0 投票する
3 に答える
474 参照

css - Grunt を介した CLI デバッグを容易にする SASS ワークフロー

これが私のワークフローですscss。1つの「app.scss」にインポートされる20個のファイルがあります。以下を参照してください

SASS フォルダー構造は編成されています 'SASS/base および SASS/base' ルートには、すべてをインポートする 1 つの 'app.scss' ファイルがあります

「Gruntfile.js」を介してコンパイルして変更を監視します-これは次のようになります

これは本番環境には最適ですが、開発中はデバッグ用に別の css ファイルが必要です..

開発段階で20を含める必要なく、開発用にGruntfileとSASSを介して複数のcssファイルを持つ方法はあります<link rel="stylesheet"...か...

ここでの使用に関するコメントに基づいてsourceMap, sourceComments、私のうなり声は次のようになります

しかし、エラーが発生しています... sourcemap と sourceComments の app.scss からすべてのマッピング情報を取得すると仮定しますか?

0 投票する
1 に答える
1057 参照

sql - PostgreSQL なぜ/いつ ECPG を使用する必要があるのか

ゲーム プロジェクト (C++) のデータベースとして postgreSQL を使用することにしました。

現在、私は Oracle を使用しており、Pro*C プリコンパイラが動作していて、postgreSQL にも ECPG と呼ばれる同様のものがあると聞きました。

文字列で SQL を使用して、postgres データベースのデータに直接アクセスすることもできます。

したがって、「通常」と ECPG の使用の違いは、SQL ステートメントをコードのように記述できることですか?それとも、他に注意すべき違いはありますか?

(PS: 仕事で使用していることは知っていますが、他に違いはありません)

皆さんからのご連絡をお待ちしております。