Typescript build error (TS5007) - msbuild

I've been trying to get typescript building via the build servers on visualstudio.com, and I've done the normal thing of bringing typescript into source control. But I'm getting the following issue:
VSTSC : error TS5007: Build:
Cannot resolvereferenced file:
'COMPUTE_PATHS_ONLY'.
[C:\a\src\Main\RecruitCloud\RecruitCloud.csproj]
I'm aware of the encoding issues, but in all the examples I've seen the culprit file has been named in the error message.
I'm starting to think this could be down to the number of typescript files I'm compiling in the project.
Any ideas?

This is a configuration option for the VsTsc task, the one that runs the compiler. It is used in the PreComputeCompileTypeScript target. The intention is to make the VsTsc task go through all the motions, except to run the compiler. That didn't pan out on your machine, it actually did run the compiler. Which then threw a fit since it can't find a file named COMPUTE_PATHS_ONLY.
The VsTsc task is stored in C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v12.0\TypeScript\TypeScript.Tasks.dll. Looking at the assembly with a decompiler:
protected override int ExecuteTool(string pathToTool, string responseFileCommands, string commandLineCommands)
{
if (this.Configurations.Contains("--sourcemap"))
{
this.generateSourceMaps = true;
}
else
{
this.generateSourceMaps = false;
}
if (this.Configurations.Contains("--declaration"))
{
this.generateDeclarations = true;
}
else
{
this.generateDeclarations = false;
}
this.GenerateOutputPaths();
if (!responseFileCommands.Contains("COMPUTE_PATHS_ONLY"))
{
return base.ExecuteTool(pathToTool, responseFileCommands, commandLineCommands);
}
return 0;
}
Note the !responseFileCommands.Contains() test to bypass the base.ExecuteTool() call.
All I can guess is that the method doesn't look like this on your machine. With the most likely cause that you have an outdated version of TypeScript.Tasks.dll. On my machine with VS2013 Update 4 installed it is dated Nov 11, 2014 with a size of 27816 bytes.

Your best bet would be to simply resave all the files in Unicode encoding. You can do it from a quick powershell script (Change files' encoding recursively on Windows?)
Get-ChildItem *.txt | ForEach-Object {
$content = $_ | Get-Content
Set-Content -PassThru $_.Fullname $content -Encoding UTF8 -Force}

Related

failed can't find input bag file in rs_bag2image code

I am trying to run "rs_bag2image" code (https://github.com/UnaNancyOwen/rs_bag2image) for extracting frames from a bag file. I am new in c++ and got the error "failed can't find input bag file" when I am running the code. It seems the issue occurs in the following piece of code. Can you please help me to resolve this issue?
// Retrieve Bag File Path (Required)
if( !parser.has( "bag") ){
throw std::runtime_error( "failed can't find input bag
file");
}
else{
bag_file = parser.get<cv::String>( "bag" ).c_str();
if( !filesystem::is_regular_file( bag_file ) ||
bag_file.extension() != ".bag" ){
throw std::runtime_error( "failed can't find input bag
file" );
}
}
You didn't provide path to the bag in the commandline. It says so in the github project's readme. Run the code as
$ ./rs_bag2image -b="./file.bag" -s=true -d=true
If you're running the project inside IDE, find out how to add commandline arguments in the Project's configuration.

Executing a Jpype file

I am trying to implement a example given in the following tutorial:
enter link description here
I have been trying to execute this program.However I am stuck on an step which is to "Then place the .class file in the (current_directory)/org/wg3i/test/ directory.".So, when I made a Java file from BlueJ I have the .class file however I am not sure how I can place that file in (current_directory)/org/wg3i/test/ directory.Also where exactly is this directory located.
Additional Question:
I am trying to implement the following code.
import org.nlogo.headless.HeadlessWorkspace;
public class Example2 {
public static void main(String[] argv) {
HeadlessWorkspace workspace =
HeadlessWorkspace.newInstance() ;
try {
workspace.open(
"models/Sample Models/Earth Science/"
+ "Fire.nlogo");
workspace.command("set density 62");
workspace.command("random-seed 0");
workspace.command("setup");
workspace.command("repeat 50 [ go ]") ;
System.out.println(
workspace.report("burned-trees"));
workspace.dispose();
}
catch(Exception ex) {
ex.printStackTrace();
}
}
}
which is given in the following linkenter link description here
However, whenever I try to execute this java code using javac I get an error saying package org.nlogo.headless.HeadlessWorkspace doesn't exist and also says HeadlessWorkspace doesn't exist for line 4th.
I know that the link I inserted says this:
In order to compile and run this, NetLogo.jar must be in your classpath. The lib directory, containing additional required libraries, must also be present.
But I am not sure what it exactly asks me to do.
Also, I am working in Linux.

Scope of the extra properties in Gradle?

I have a Gradle script similar to this:
ext {
dir = null
}
task init << {
build()
}
task buildAll(type: Exec){
workingDir ext.dir
commandLine 'cmd', '/c', "echo %JAVA_HOME%"
}
def build(){
ext.dir = "asdf"
buildAll.execute()
}
When I run the script, I get:
groovy.lang.MissingPropertyException: Cannot get property 'dir' on extra properties extension as it does not exist
Whatever I tried, I couldn't get a task to read a property from "ext". It can be seen from methods (like "build()" in my example), but not from any other task except the default one ("init" in my example).
I understand that the "ext" properties should be accessible from anywhere inside the project, so what am I doing wrong?
UPDATE:
The workflow I'm trying to achieve (as asked by Opal):
I have several environments I need to build with one script. Each of these environments is listed in a CSV file with a line: <environment>,<version>.
Script then needs to do the following:
Delete existing directory
Checkout code from SVN into new directory (both directory and SVN url depend on environment and version)
Copy some settings files (paths depend on version)
Edit some of those settings files (values depend on environment and version)
Set some environment variables (JAVA_HOME, ANT_HOME...) (depends on version)
Run three build commands (${ANT_HOME}/bin/ant -f $checkedOutCodeDirectory/Build/build-all.xml target1, then target2 and target3)
This needs to be executed for each environment
Extra properties should be created via ext but referred via project instance without any instance at all so: project.dir or dir, so the first change to script will be:
ext {
dir = null
}
task init << {
build()
}
task buildAll(type: Exec){
workingDir dir // ext.dir -> dir
commandLine 'cmd', '/c', "echo %JAVA_HOME%"
}
def build(){
ext.dir = "asdf"
buildAll.execute()
}
Now, before any task or method is executed the script is read and parsed, sot the whole body of buildAll will be configured before any other part is run. Thus it will always fail, since dir property has no value. Proof:
ext {
dir = null
}
task init << {
build()
}
task buildAll(type: Exec){
workingDir dir ? dir : project.rootDir
commandLine 'cmd', '/c', "echo %JAVA_HOME%"
}
def build(){
ext.dir = "asdf"
buildAll.execute()
}

OpenNI 1.5::Could not run code from documentation

I am trying to run a sample code from the OpenNI 1.5 documentation.I have imported the library required XnCppWrapper.h so that I can use C++.The code has only one error on a particular variable "bshouldrun".I know that it should be declared as something but since I am new at this and the documentation does not contain anything above the main, I dont know what to declare it as..Please help!!
And thanks in advance.
#include <XnOpenNI.h>
#include <XnCppWrapper.h>
#include <stdio.h>
int main()
{
XnStatus nRetVal = XN_STATUS_OK;
xn::Context context;
// Initialize context object
nRetVal = context.Init();
// TODO: check error code
// Create a DepthGenerator node
xn::DepthGenerator depth;
nRetVal = depth.Create(context);
// TODO: check error code
// Make it start generating data
nRetVal = context.StartGeneratingAll();
// TODO: check error code
// Main loop
while (bShouldRun) //<-----------------------------**ERROR;bShouldRun Undefined**
{
// Wait for new data to be available
nRetVal = context.WaitOneUpdateAll(depth);
if (nRetVal != XN_STATUS_OK)
{
printf("Failed updating data: %s\n", xnGetStatusString(nRetVal));
continue;
}
// Take current depth map
const XnDepthPixel* pDepthMap = depth.GetDepthMap();
// TODO: process depth map
}
// Clean-up
context.Shutdown();
}
Here's what I did to run a sample from Visual Studio 2010 Express on Windows (8):
Opened the NiSimpleViewer.vcxproj VS2010 project from C:\Program Files (x86)\OpenNI\Samples\NiSimpleViewer
Edited OpenNI.rc to comment out #include "afxres.h" on line 10(might be missing this because I'm using Express version, not sure. Your machine might compile this fine/not complain about the missing header file)
Enabled Tools > Options > Debugging > Symbols > Microsoft Symbol Servers (to get past missing pdb files issue)
Optionally edit the SAMPLE_XML_PATH to "SamplesConfig.xml" rather than the default "../../../Data/SamplesConfig.xml", otherwise you need to run the sample executable from ..\Bin\Debug\NiSimpleViewer.exe by navigating to there rather than using the Ctrl+F5. A;so copy the SamplesConfig.xml file into your sample folder as you can see bellow
Here are a few images to illustrate some of the above steps:
You can also compile the NiHandTracker sample, which sounds closer to what you need.
So this explains the setup for OpenNI 1.5 which is what your question is about.
I've noticed your OpenNI 2 lib issue in the comments. It should be a matter of linking against SimpleHandTracker.lib which you can do via Project Properties (right-click project->select Properties) > Linker > Input > Additional Dependencies > Edit.
I don't have OpenNI2 setup on this machine, but assuming SimpleHandTracker.lib would be in OpenNI_INSTALL_FOLDER\Lib. Try a file search in case I might be wrong.

Run a terminal/shell in a SlickEdit window?

I'd like to run a bash shell in a 'normal' document window in Slick Edit.
At a minimum I'd be content with running a command and having all output captured into a document window. Better would be the ability to interactively work with the shell in that window.
This is a bit crude, but it is what I use for launching external programs
(including bash scripts). When I used to work in Win+Cygwin I also had a wrapper around the bash script but I forget why I needed that.
but remember that you can always tie specific actions to your project
(build, compile, etc), you can always add your own as well Project->Properties->Tools->New. All those commands can execute in the process window
#include "slick.sh"
static _str mytmp='/tmp/myvstmp.txt'
_command git_annotate(_str filename='') name_info(',' VSARG2_MACRO )
{
if (filename=='') {
filename=p_buf_name;
}
curr_line=p_line;
delete_file(mytmp); // make sure we dont get old file
if( file_match(mytmp,'1')==mytmp ) {
message('Tmp file delete failed! ('mytmp') change permissions and if still failing - restart vs');
return 1
}
shell('/usr/bin/git blame -s 'filename' | sed "s#^\(.\{8\}\) [^)]*) #\1 #" >'mytmp, 'p');
if( file_match(mytmp,'1')!=mytmp ) {
message('Annotate failed');
return 1
}
status=edit('-w 'mytmp);
if (status) {
message('Error opening output file for display.');
return 1
}
goto_line(curr_line+1);
// keep disk clean
p_buf_flags |= VSBUFFLAG_THROW_AWAY_CHANGES;
name("* annotate output *" filename, false);
delete_file(mytmp);
}