Including files/header in SublimeClang - sublimetext2

I'm running on Ubuntu 14.04 and using SublimeText 3. For my master-thesis i will work with the logging-API Pantheios, so i want to include it into SublimeClang.
Everyhting works fine, but Pantheios won't be integrated. Here are my user settings from SublimeClang:
{
"enabled": true,
"dont_prepend_clang_includes": true,
"show_output_panel": true,
"hide_output_when_empty": true,
"show_status": true,
"show_visual_error_marks": true,
"auto_complete": true,
"tab_completion": true,
"additional_language_options":
{
"c++" : ["-std=c++11"]
},
"options":
[
"-I/usr/include/c++/4.6",
"-I${folder:${project_path:rmf.sublime-project}}/source/**",
]
}
And the error:
/media/tobias/Data/Dropbox/Masterarbeit/RateMeasurementFramework/source/measurementMethods/../pantheios/pantheiosHeader.h:5,10 - Fatal - 'pantheios/pantheios.hpp' file not found
Did you configure the include path used by clang properly?
See http://github.com/quarnster/SublimeClang for more details on how to configure SublimeClang.
The path for the pantheios.hpp is
/media/tobias/Data/Dropbox/Masterarbeit/RateMeasurementFramework/source/pantheios/pantheios.hpp
Last intereseting file maybe is the pantheios header itself:
/* FILE: pantheiosHeader.h */
#ifndef _pantheiosHeader_
#define _pantheiosHeader_
#include <pantheios/pantheios.hpp>
#include <pantheios/inserters/integer.hpp>
#include <pantheios/inserters/real.hpp>
#include <pantheios/backends/bec.file.h>
#include <pantheios/backends/bec.fprintf.h>
extern int pantheois_logLevel; // Reference to "rmf.cpp" to control the loglevel
#endif /* PANTHEIOSFRONTEND_H_ */

Related

nx:run-commands default args values

i have react library created inside nx mono repo using this version
nx: 15.6.3
i've added inside the packages/my-library command to run multiple commands
generate react component
generate react-stories
using these plugins #nrwl/react:component - #nrwl/react:component-story
this is the target
"generate-atom": {
"executor": "nx:run-commands",
"options": {
"commands": [
{
"command": "nx g #nrwl/react:component --project=core --style=#emotion/styled --export --directory=atoms/{args.group} --name={args.name}",
"forwardAllArgs": true,
"bgColor": "bgBlue"
},
{
"command": "nx g #nrwl/react:component-story --project=core --componentPath=atoms/{args.group || 'common'}/{args.name}/{args.name}.tsx",
"forwardAllArgs": true
}
],
"cwd": "packages/core",
"parallel": false
}
},
the components is been created inside when i call this target from nx
packages/core/src/atoms/undefined/button
this is the command i'm using
npx nx run core:generate-atom --args="--name=button"
any idea how can we default the value of group if was not passed?

should I replace wct-istanbul by WCT-istanbub in order to estimate how much polymer web compnents is test coveraged

There is some similiarity between my question and How to measure common coverage for Polymer components + .js files?. Nevertheless, it is accepted as answer "split to .js files and include it to components" in order to use wct-istanbul and all my web components and tests are in .html files (the javascript is inside of each .html file).
My straight question is: can I still use wct-istambul to check how much from my code is covered by tests? If so, what is wrong in configuration described bellow? If not, is wct-istanbub planned to replace wct-istanbul for polymer projects?
package.json
"polyserve": "^0.18.0",
"web-component-tester": "^6.0.0",
"web-component-tester-istanbul": "^0.10.0",
...
wct.conf.js
var path = require('path');
var ret = {
'suites': ['test'],
'webserver': {
'pathMappings': []
},
'plugins': {
'local': {
'browsers': ['chrome']
},
'sauce': {
'disabled': true
},
"istanbul": {
"dir": "./coverage",
"reporters": ["text-summary", "lcov"],
"include": [
"/*.html"
],
"exclude": [
],
thresholds: {
global: {
statements: 100
}
}
}
}
};
var mapping = {};
var rootPath = (__dirname).split(path.sep).slice(-1)[0];
mapping['/components/' + rootPath + '/bower_components'] = 'bower_components';
ret.webserver.pathMappings.push(mapping);
module.exports = ret;
Well, I tried WCT-istanbub (https://github.com/Bubbit/wct-istanbub) which seams to be a temporary workaround (Code coverage of Polymer Application with WCT), it works.
wct.conf.js
"istanbub": {
"dir": "./coverage",
"reporters": ["text-summary", "lcov"],
"include": [
"**/*.html"
],
"exclude": [
"**/test/**",
"*/*.js"
],
thresholds: {
global: {
statements: 100
}
}
}
...
and the result is
...
chrome 66 RESPONSE quit()
chrome 66 BrowserRunner complete
Test run ended with great success
chrome 66 (2/0/0)
=============================== Coverage summary ===============================
Statements : 21.18% ( 2011/9495 )
Branches : 15.15% ( 933/6160 )
Functions : 18.08% ( 367/2030 )
Lines : 21.14% ( 2001/9464 )
================================================================================
Coverage for statements (21.18%) does not meet configured threshold (100%)
Error: Coverage failed

Visual Studio Community 2017 spaces in launch.json args field

I'm currently trying to set the debugging startup arguments for a CMake based project in Visual Studio Community 2017. Normally this would be done via the launch.vs.json file. However, the arguments that I need to pass contain spaces in them. For example, the below launch.vs.json file should pass the arguemnts FIRST ARGUMENT and SECOND ARGUMENT as the first and second argument. However, the program ends up getting 4 arguments: FIRST, ARGUMENT, SECOND, and ARGUMENT. I've tried various different encodings for spaces, but cannot get a space to be encoded properly in the resulting arguments. This is especially problematic as one of the arguments to my program is a path inside C:\Program Files. As such, the path is broken into 2 separate arguments, rather than one as it should be. How do I make Visual Studio allow spaces within an argument?
For reference, launching via the command line with this command works as expected:
argtest.exe "FIRST ARGUMENT" "SECOND ARGUMENT"
launch.vs.json
{
"version": "0.2.1",
"defaults": {},
"configurations": [
{
"type": "default",
"project": "CMakeLists.txt",
"projectTarget": "argtest.exe",
"name": "argtest.exe",
"args": ["FIRST ARGUMENT", "SECOND ARGUMENT"]
}
]
}
test.c
#include <stdio.h>
int main(int argc, char ** argv) {
int i;
for (i = 0; i < argc; i++)
printf("%d = %s\n", i, argv[i]);
return 0;
}
CMakeLists.txt
cmake_minimum_required (VERSION 2.8.8)
project (argtest)
SET( CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_SOURCE_DIR}/ )
add_executable(argtest test.c)
You need to include the quotes in the args strings and escape them. For example:
{
"version": "0.2.1",
"defaults": {},
"configurations": [
{
"type": "default",
"project": "CMakeLists.txt",
"projectTarget": "argtest.exe",
"name": "argtest.exe",
"args": ["\"FIRST ARGUMENT\"", "\"SECOND ARGUMENT\""]
}
]
}
It is easier doing this through Visual Studio itself. To run a program with command-line arguments follow these steps:
Open the project in Visual Studio
Click on the 'Debug' tab in the menu bar.
Click on the '[NAME OF PROJECT] Properties' menu item.
A window will popup and should automatically go into the Debug menu within that window. Under the 'Start options' section enter your command-line arguments with a space between each argument.
Hope this helps.

Node.js how do you read a JSON with an element that is a HTTP address

OK I just ran into an issue. I am using Auth0 to create users with different rights (not scopes just rights) in the App Metadata. When I decode the Token I get this json:
{
"iss": "https://testing.auth0.com/",
"sub": "auth0|58e7bae154941844b507eaf5",
"aud": "OSBkLd832tIhpDe0QFJbQ9vutgB2s6cJ",
"exp": 1497016797,
"iat": 1496980797,
"https://thetestgroup.com/app_metadata": {
"is_admin": true
}
}
As you can see the app metadata is in the element "https://thetestgroup.com/app_metadata". Normally I would just do something like this in my code (auth.payload.iat) to get the iat but for the app_metadata it rejects it because of the :. Is there a good way to get at that data?
ok lets talk javascript (node) and your json
Firefox Scratchpad (Shift-F4)
var x = {
"iss": "https://testing.auth0.com/",
"sub": "auth0|58e7bae154941844b507eaf5",
"aud": "OSBkLd832tIhpDe0QFJbQ9vutgB2s6cJ",
"exp": 1497016797,
"iat": 1496980797,
"https://thetestgroup.com/app_metadata": {
"is_admin": true
}
}
x['https://thetestgroup.com/app_metadata'].is_admin // hit run
/*
true
*/
node.js
~ $ node -v
v8.1.0
~ $ node
> var x = {
... "iss": "https://testing.auth0.com/",
... "sub": "auth0|58e7bae154941844b507eaf5",
... "aud": "OSBkLd832tIhpDe0QFJbQ9vutgB2s6cJ",
... "exp": 1497016797,
... "iat": 1496980797,
... "https://thetestgroup.com/app_metadata": {
..... "is_admin": true
..... }
... }
undefined
> x['https://thetestgroup.com/app_metadata'].is_admin
true
>
Please provide a mcve since pure JS and JSON are quite happily using the (strange) key - as demonstrated.

Error trying to parse settings

Here is the exact error I get as I open the program:
Error trying to parse settings: Expected value in ~/Library/Application Support/Sublime Text 2/Packages/Default/Preferences.sublime-settings:1:13677
You can remove the comments and use a service like http://zaach.github.io/jsonlint/ to validate the JSON.
Packages/Default/Preferences.sublime-settings. Check that file instead (Sublime Text 2 -> Preferences -> Settings - Default
{
"bold_folder_labels": true,
"caret_style": "phase",
"fade_fold_buttons": false,
"font_face": "Consolas",
"font_size": 12,
"highlight_line": true,
"ignored_packages":
[
"Vintage"
],
"line_padding_bottom": 1,
"line_padding_top": 1
}