Can't export .json file - json

The problem is that (export, set) doesn't work
export : The term 'export' is not recognized as the name of a cmdlet, function, script file, or operable program. Check the spelling of the name, or if a path was
included, verify that the path is correct and try again.
At line:1 char:1
+ export DEBUG="true"
+ ~~~~~~
+ CategoryInfo : ObjectNotFound: (export:String) [], CommandNotFoundException
+ FullyQualifiedErrorId : CommandNotFoundException
I made fail.json and I can't export from it.
gives me an error.
I do DEBUG
export DEBUG="true"
I tried writing with a space and so on (also with set)
I need to create a database for the discord bot, so that when I exit, it immediately gives out the bot code.

Related

gulp fails to include files on case sensitive file systems

I'm trying to run a project on Ubuntu, which uses Nunjucks, and the gulp-nunjucks-render plugin is used to render the Nunjucks templates.
The developers were mainly using this project on Windows and Mac OS, so there was no issue when including files without respecting the case sensitivity, but this causes issues on Ubuntu, as it seems this plugin fails to include some files when they have a different casing in their names.
For example, I have this file: m-figures.njk, but in the code we have: {% import '../m-Figures.njk' as figures %}, in this case I get this error:
Plumber found unhandled error:
Template render error in plugin "gulp-nunjucks"
Message:
(unknown path)
Error: template not found: ../m-Figures.njk
For my gulp task it goes like this:
gulp.task("nunjucks", () => {
return gulp
.src([src_folder + "pages/**/*.njk"])
.pipe(plumber())
.pipe(
data(() =>
JSON.parse(fs.readFileSync(src_folder + "datas/dist/data.json"))
)
)
.pipe(nunjucks())
.pipe(beautify.html({ indent_size: 2 }))
.pipe(gulp.dest(dist_folder))
.pipe(browserSync.stream({match: '**/*.html'}));
});
Is there a solution I can add to my gulp task to solve this issue?
Edit
Actually, this is a global issue of gulp as gulp-sass also fails on case sensitive file systems

Calling a function within PowerShell ISE [closed]

Closed. This question is not reproducible or was caused by typos. It is not currently accepting answers.
This question was caused by a typo or a problem that can no longer be reproduced. While similar questions may be on-topic here, this one was resolved in a way less likely to help future readers.
Closed 6 years ago.
Improve this question
Could someone tell me why I can not call a function within a PowerShell script? See below my code:
Write-Host "Before calling Function."
testFunction
function testFunction()
{
Write-Host "Function has been called"
}
When I run the above code I get the following error message:
testFunction : The term 'testFunction' is not recognized as the name of a cmdlet,
function, script file, or operable program. Check the spelling of the name, or if
a path was included, verify that the path is correct and try again.
At C:\Users\andrew.short\Documents\Powershell\Backups\functionTest.ps1:3 char:1
+ testFunction
+ ~~~~~~~~~~~~
+ CategoryInfo : ObjectNotFound: (testFunction:String) [], CommandNotFoundException
+ FullyQualifiedErrorId : CommandNotFoundException
I'm sure that it must be possible to call functions within the same PowerShell script. Can somebody please help?
You have to declare the function before using it.
Write-Host "Before calling Function."
function testFunction {
Write-Host "Function has been called"
}
testFunction

ERROR - jmeter.util.BeanShellInterpreter: Error invoking bsh method: eval Sourced file: inline evaluation of:

Getting below error when i run the jmeter script having Beanshell Post Processor as a child to a sampler.
ERROR - jmeter.util.BeanShellInterpreter: Error invoking bsh method:
eval Sourced file: inline evaluation of: ``try { newuser=
vars.get("prevUsrResponse"); org.json.JSONObject userJSON= new o . . .
'' : Typed variable declaration : Class: org.json.JSONObject not found
in namespace
Below is the code written and run in jMeter 2.9.
newuser= vars.get("prevUsrResponse");
org.json.JSONObject userJSON= new org.json.JSONObject(newuser);
if(prevUsrJSON.has("User") && custJSON.get("User")!= null) {
org.json.JSONObject contactJSON = userJSON.getJSONObject("User");
contactJSON.put("UserType","Private");
}
vars.put("updatedUser", userJSON.toString());
${updatedUser} variable doesn't return the json(or any value) when used in the next sampler request.
There can be the following possible reasons:
You don't have the .jar which provides org.json.JSONObject class in JMeter CLASSPATH.
Download the jar i.e. from the Maven central repo
Copy it to JMeter's "lib" folder
Restart JMeter to pick the .jar up
You dont have the relevant import line. Add it to the beginning of your script:
import org.json.JSONObject;
You can also consider upgrading to JMeter 3.0 which comes with built-in JSON support and provides JSON Path PostProcessor to extract data from JSON responses. If you still want Beanshell - it is also possible, just use json-smart classes

Object of type 'manifest' and path 'C:\CustomManifest.xml' cannot be created

I am struggling with msdeploy (aka Web Deploy). I have tried to create a simple manifest (from the example of MSDN) :
<sitemanifest>
<appHostConfig path="mySite" />
</sitemanifest>
Unfortunately, any command with this manifest as a source dies with the following message :
msdeploy -verb:dump -source:manifest=c:\CustomManifest.xml
Error: Object of type 'manifest' and path 'C:\CustomManifest.xml' cannot be created.
Error: One or more entries in the manifest 'sitemanifest' are not valid.
Error Code: ERROR_SITE_DOES_NOT_EXIST
More Information: Site 'mySite' does not exist. Learn more at: http://go.microsoft.com/fwlink/?LinkId=221672#ERROR_SITE_DOES_NOT_EXIST.
Error count: 1.
Any Idea ?
OK, finally understood my issue : a manifest is made only to export what you need. It is not made to generate something from scratch. To generate a web site, the package provider has to be used.

installing an Ocaml hump library on mutualized server

I am trying to use the Ocaml csv library. I downloaded csv-1.2.3 and followed the installation instructions after installing findlib:
Uncompress the source archive and go to the root of the package,
Run 'ocaml setup.ml -configure',
Run 'ocaml setup.ml -build',
Run 'ocaml setup.ml -install'
Now I have META, csv.a, csv.cma, csv.cmi, csv.cmx, csv.cmxa, csv.mli files in ~/opt/lib/ocaml/site-lib/csv repertory. The shell command ocamlfind list -describe gives csv A pure OCaml library to read and write CSV files. (version: 1.2.3) which I believe means that csv is installed properly.
BUT when I add
let data = Csv.load "foo.csv" in
in my compute.ml module and try to compile it within the larger program package I have the compilation error :
File "_none_", line 1, characters 0-1:
Error: No implementations provided for the following modules:
Csv referenced from compute.cmx"
and if I simply type
let data = load "foo.csv" in
i get :
File "compute.ml", line 74, characters 13-17:
Error: Unbound value load
I have the same type of errors when I use Csv.load or load directly in the Ocaml terminal. Would somebody have an idea of what is wrong in my code or library installation?
My guess is that you're using ocamlfind for compilation (ocamlfind ocamlc -package csv ...), because you have a linking error, not a type-checking one (which would be the case if you had not specified at all where csv is). The solution may be, in this case, to add a -linkall option to the final compilation line producing an executable, to ask it to link csv.cmx with it. Otherwise, please try to use ocamlfind and yes, tell us what your compilation command is.
For the toplevel, it is very easy to use ocamlfind from it. Watch this toplevel interaction:
% ocaml
Objective Caml version 3.12.1
# #use "topfind";;
- : unit = ()
Findlib has been successfully loaded. Additional directives:
#require "package";; to load a package
#list;; to list the available packages
#camlp4o;; to load camlp4 (standard syntax)
#camlp4r;; to load camlp4 (revised syntax)
#predicates "p,q,...";; to set these predicates
Topfind.reset();; to force that packages will be reloaded
#thread;; to enable threads
- : unit = ()
# #require "csv";;
/usr/lib/ocaml/csv: added to search path
/usr/lib/ocaml/csv/csv.cma: loaded
# Csv.load;;
- : ?separator:char -> ?excel_tricks:bool -> string -> Csv.t = <fun>
To be explicit. What I typed once in the toplevel was:
#use "topfind";;
#require "csv";;
Csv.load;; (* or anything else that uses Csv *)