How to modify easy.py in libsvm-3.18 to solve error "Trackback <most recent call last>: File "easy.py", line 6---- - libsvm

While using easy.py script it generates error as shown in figure:
Path for gnuplot is set well. There is no problem in using grid.py
Some people suggested (http://www.cnblogs.com/tekson/archive/2009/05/25/1489222.html) to change following line in easy.py:
cmd = '{0} -svmtrain "{1}" -gnuplot "{2}" "{3}"'.format(grid_py, svmtrain_exe, gnuplot_exe, scaled_file)
But no idea how to modify above code line to resolve the problem.
If anyone have got same problem and solved this, please let me know.
Thanks in advance.

Finally I found the solution. I think it will be helpful for those who are facing same problem.
Thanks to: http://huangbo929.blog.edu.cn/home.php?mod=space&uid=294073&do=blog&id=70541
Solution:
Replace Line
"cmd = '{0} -svmtrain "{1}" -gnuplot "{2}" "{3}"'.format(grid_py, svmtrain_exe, gnuplot_exe, scaled_file)"
With
cmd = 'python {0} -svmtrain "{1}" -gnuplot "{2}" "{3}"'.format(grid_py, svmtrain_exe, gnuplot_exe, scaled_file)

Related

PowerShell doesn't recognize string correctly

I'm passing a command to powershell
Dim command As String
command = "ffmpeg -vsync 0 –hwaccel cuvid -c:v h264_cuvid –resize 1280x720 -i D:\Imagens\nova\bol.mkv -c:a copy -c:v h264_nvenc -b:v 5M D:\Imagens\nova\bol_encod.mkv"
with
Dim powerShell As String = "C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe"
Process.Start("powershell", "-noexit " + command)
but powershell returns
Unable to find a suitable output format for 'ÔÇôhwaccel' ÔÇôhwaccel:
Invalid argument
where I believe 'ÔÇôhwaccel' to be –hwaccel; That's completely strange, once when I past the code directly on PowerShell it works fine.
Is that a problem with my string?
thank you!
I'm assuming powershell 5 and not core, I copied the test and pasted it into the terminal and found this u instead of a '-'. I would start by retyping and avoiding what looks like it may be a long hyphen or something else which is breaking the terminal.

R studio: "Error in system(command, intern = T) : 'ls' not found"

I am in the process of using the GenABEL package of R studio to convert the output of the Affymetrix Genotyping Console into a .tfam file. This is my code thus far:
rm(list = ls())
setwd("C:/U/Is/GD/Affymetrix")
library("GenABEL", lib.loc="C:/PROGRA~1/R/R-211~1.1-X/library")
read.table("Genotyping_results.txt", fill = TRUE)
convert.snp.affymetrix(dir = "C:/U/Is/GD/Affymetrix", map = "Genotyping_results.txt" , outfile ="Genotyping_results.tfam")
I am getting the following error:
"Error in system(command, intern = T) : 'ls' not found".
I have a limited understanding of programming and am finding it difficult to understand what is wrong or how I can solve it.
Any help would be greatly appreciated
You mentioned in the comments that you're using Windows. ls is not a command on your OS.
ls is a command in Linux and in R.
There are many ways to add that command to Windows, like Cygwin.

Can't create view from Bigquery command line tools

I tried to create a view using the bq command line tool.
The bq command line tool version is 2.0.18
I followed the instruction in this page:
My command looks like this:
mk --view="select title from [publicdata:samples.wikipedia] where contributor_id = 3894110" views.my_test_view
I received this output:
int() argument must be a string or a number, not 'NoneType'
What did I do wrong?
Any help would be appreciated. Thanks.
The latest bq version is 2.0.19. Can you run gcloud components update and try again?

Running DOS command from vb.net

I want to run the following command from vb.net code. When I put it in process.start(" ")
it returns syntax error. Please advise
>E:\UnInstall\SQLServer\SQLServerExpress2008\SQLEXPR_x64_ENU.exe / SQ/SAPWD="testpwd123"/security=SQL/BROWSERSVCSTARTUPTYPE="Enabled"/TCPENABLED="1"/NPENABLED="0"/INDICATEPROGRESS="True"/INSTANCENAME="CBEInstance"/IACCEPTSQLSERVERLICENSETERMS="True"
You specify the file to run with Process.StartInfo.Filename, and the command line arguments with Process.StartInfo.Arguments.
Dim DosRun As Process = New Process
DosRun.StartInfo.FileName = "E:\UnInstall\SQLServer\SQLServerExpress2008\SQLEXPR_x64_ENU.exe"
DosRun.StartInfo.Arguments = String.Format("SQ/SAPWD=testpwd123/security=SQL/BROWSERSVCSTARTUPTYPE=Enabled/TCPENABLED=1/NPENABLED=0/INDICATEPROGRESS=True/INSTANCENAME=CBEInstance/IACCEPTSQLSERVERLICENSETERMS=True")
DosRun.Start()

Vim script: How to easily pipe data into the cwindow

I use a custom function (currently residing in .vimrc) and not :make or another direct command line tool to compile/check my currently edited file for errors. Like this:
function! CompileMyCode(...)
set errorformat=Error:\ %m\\,\ in\ line\ %l
let l:output = "Error: bad code!, in line 9"
return l:output
endfunction
command! -nargs=* CompileMyCode :call CompileMyCode(<f-args>)
when using the new command in command mode, no error window shows up.
:CompileMyCode | cwindow
What am I doing wrong?
Edit:
I now tried the following which also does not open any cwindow.
function! CompileMyCode(...)
set errorformat=Error:\ %m\\,\ in\ line\ %l
let l:output = "Error: bad code!, in line 9"
" I tried both of the following lines separately
cexpr l:output
call setqflist([l:output])
endfunction
The proposed commands cexpr and setqflist() do not open the cwindow correctly in my example. Maybe somebody can propose a complete solution?
Edit 2:
The main problem is solved. Here is my current code:
let l:result = expand("%").'|8| errortext'
cexpr [ l:result, l:result ]
caddexpr ''
cwindow
This example respects a default error format that vim seems to support. When cexpring the actual error output and using an errorformat the cwindow seems to ignore that.
Nevertheless, I wanted stick to a default error format anyway in the output, not having to rely on a custom errorformat
Thx for your answers!
I did something similar using cexpr l:output instead of returning the string and that placed the output of the compile in the quickfix window. You can see my vim function here: http://www.zenskg.net/wordpress/?p=199
Update
Adding a blank line to the quickfix list seems to allow the cwindow to appear. For example:
function! MyCompile()
let l:output = "Error: line 1"
cexpr l:output
caddexpr ""
cwindow
endfunction
If you already have access to the error information as structured data in Vim (or can easily obtain it), you can use setqflist().