Deprecated: Required parameter $totalcount follows optional parameter $categoryid in /home/host2474/public_html/lib/deprecatedlib.php on line 2767 - moodle

Deprecated: Required parameter $totalcount follows optional parameter
$categoryid in /home/host2474/public_html/lib/deprecatedlib.php on
line 2767
Deprecated: Required parameter $accesssince follows optional parameter
$groupid in /home/host2474/public_html/lib/deprecatedlib.php on line
3334
Deprecated: Required parameter $roleid follows optional parameter
$groupid in /home/host2474/public_html/lib/deprecatedlib.php on line
3334
Deprecated: Required parameter $statusid follows optional parameter
$groupid in /home/host2474/public_html/lib/deprecatedlib.php on line
3334
Deprecated: Required parameter $search follows optional parameter
$groupid in /home/host2474/public_html/lib/deprecatedlib.php on line
3334
Fatal error: Method lang_string::__set_state() must take exactly 1
argument in /home/host2474/public_html/lib/moodlelib.php on line 10706
I tried but couldn't

Related

How to add a numeric switch to a PowerShell script

I know how to add switch parameters to PowerShell scripts, but the name of the switch is always a (valid) identifier like -Enable because the name is generated from the backing PowerShell variable.
[CmdletBinding()]
param(
[switch] $Enable = $false
)
Some tools have switches like -2008. Normally, one would name the switch $2008 but this is not a valid identifier.
How can I implement such a switch as a boolean value in PowerShell?
Or in other words: How to specify a different parameter name then the backing variable?
Edit 1
I wasn't aware of number only variables (which is very strange for a programming language...). Anyhow, I created that example:
function foo
{ [CmdletBinding()]
param(
[switch] $2008
)
Write-Host "2008=$2008"
}
For this code, which is accepted as valid PowerShell, I get a auto completion as wanted. But when providing that parameter, I get this error message:
foo : Es wurde kein Positionsparameter gefunden, der das Argument "-2008" akzeptiert.
In Zeile:1 Zeichen:1
+ foo -2008
+ ~~~~~~~~~
+ CategoryInfo : InvalidArgument: (:) [foo], ParameterBindingException
+ FullyQualifiedErrorId : PositionalParameterNotFound,foo
Translation: No positional parameter was found, that accepts the argument "-2008".
The purpose of the script is to provide translations / wrappers for command line interfaces.
Here is a set of standardized executables with parameters:
vcom.exe -2008 design.vhdl
vsim.exe -2008 design
Translation:
ghdl.exe -a --std=2008 design.vhdl
ghdl.exe -e --std=2008 design
ghdl.exe -r --std=2008 design
I would like to keep the feature of auto completion for parameters, otherwise I could process all remaining parameters and translate them by hand.
PowerShell doesn't support numeric parameters (See this answer).
Could a validateset be an acceptable solution to your problem ?
Validate set does benefit from the autocompletion feature and this is the next best thing, in my opinion, of what you wanted.
Foo & Foos — both are the same, except Foos accept multiple parameters.
foo -std 2008
foos -std 2008,2009,2010
function foo
{ [CmdletBinding()]
param(
[ValidateSet("2008",
"2009",
"2010",
"2011","2012")][INT]$std
)
Write-Host "std:$std"
}
function foos
{ [CmdletBinding()]
param(
[ValidateSet("2008",
"2009",
"2010",
"2011","2012")][INT[]]$std
)
$std | foreach {Write-Host "std: $_"}
}
foo -std 2008
foos -std 2008,2009,2010

How do I use a secret variable in a vsts release task?

I've got a release definition in vsts that needs access to a password I've defined as a secret variable in a variable group. I've linked that group to this release definition but when I run the task the parameter ends up blank. Is there anything special I need to do to get the value of a secret variable?
Definition of the powershell task that uses the password
Linked variable group
Error output:
2017-08-09T14:01:17.9262375Z ##[command]. 'C:\agent_work\r1\a\$(AGENT.BUILDDIRECTORY)\RCV\deploys\common\Get-FromArtifactory.ps1' -repoUsername developer -repoPassword -repoPath libs-snapshot-local
2017-08-09T14:01:18.8168538Z ##[error]C:\agent_work\r1\a\$(AGENT.BUILDDIRECTORY)\RCV\deploys\common\Get-FromArtifactory.ps1 : Missing an argument for parameter 'repoPassword'. Specify a parameter of type 'System.String' and try again.
Edited to add more info as requested.
This is the start of my Get-FromArtifactory.ps1
[CmdletBinding()]
param (
[Parameter(Mandatory)]
[String]
$repoUsername,
[Parameter()]
[String]
$repoPassword,
# Other params
)
#setup credentials object for arty access
$secPassword = $repoPassword | ConvertTo-SecureString -asPlainText -Force
$credential = New-Object System.Management.Automation.PSCredential($repoUsername, $secPassword)
Edit 15/08/2017 - I've updated it to use quotes as suggested by #Marina-MSFT but it's still just passing in blank.
Amended script to print out part of password:
[CmdletBinding()]
param (
[Parameter(Mandatory)]
[String]
$repoUsername,
[Parameter()]
[String]
$repoPassword,
#other params
)
write-host "pword $repoPassword"
write-host "1st char: $($repoPassword[0])"
2017-08-15T09:23:00.8606081Z ##[command]. 'C:\agent_work\r1\a\RCV\deploys\common\Get-FromArtifactory.ps1' -repoUsername developer -repoPassword "" -repoPath libs-snapshot-local -artifactName ipo-deposit-accounts_2.11 -artifactPath uk/gov/ipo -artifactVersion 0.1-SNAPSHOT -downloadDir C:\agent_work\r1\a
2017-08-15T09:23:02.3606174Z pword
2017-08-15T09:23:02.3606174Z 1st char:
Same with single quotes
2017-08-15T09:22:10.6573655Z ##[command]. 'C:\agent_work\r1\a\RCV\deploys\common\Get-FromArtifactory.ps1' -repoUsername developer -repoPassword '' -repoPath libs-snapshot-local -artifactName ipo-deposit-accounts_2.11 -artifactPath uk/gov/ipo -artifactVersion 0.1-SNAPSHOT -downloadDir C:\agent_work\r1\a
2017-08-15T09:22:11.2198723Z pword
2017-08-15T09:22:11.3761178Z 1st char:
I've got it working now, there were 2 things going on.
Having . in the name of a secret variable in a variable group
doesn't work. I recreated this issue in a separate release
definition/variable group.
Even after I removed the . in my var
names I still had to recreate the variable group for it to work.
Bug for issue with . in variable name raised here: https://developercommunity.visualstudio.com/content/problem/94475/secret-variable-in-variable-not-group-not-availabl.html

error while compiling with matlab mex

I am try to compile using matlab mex, but i keep receiving this error:
Warning: You are using gcc version "5.4.0-6ubuntu1~16.04.1)". The version
currently supported with MEX is "4.2.3".
For a list of currently supported compilers see:
http://www.mathworks.com/support/compilers/current_release/
In file included from descriptor.h:4:0,
from calc_shot.cpp:11:
mesh.h: In function ‘double magnitude(const vec3d<T>&)’:
mesh.h:106:9: error: ‘sqrt’ is not a member of ‘std’
return std::sqrt((v1.x*v1.x) + (v1.y*v1.y) + (v1.z*v1.z));
^
In file included from calc_shot.cpp:11:0:
descriptor.h: At global scope:
descriptor.h:7:57: error: expected class-name before ‘{’ token
class invalid_mesh_descriptor : public std::logic_error {
^
descriptor.h: In constructor ‘invalid_mesh_descriptor::invalid_mesh_descriptor()’:
descriptor.h:9:57: error: expected class-name before ‘(’ token
explicit invalid_mesh_descriptor() : std::logic_error("Exception invalid_mesh_descriptor caught.") {}
^
descriptor.h:9:57: error: expected ‘{’ before ‘(’ token
descriptor.h: In constructor ‘invalid_mesh_descriptor::invalid_mesh_descriptor(const string&)’:
descriptor.h:10:70: error: expected class-name before ‘(’ token
invalid_mesh_descriptor(const std::string& msg) : std::logic_error("Exception invalid_mesh_descriptor caught: "+msg) {}
^
descriptor.h:10:70: error: expected ‘{’ before ‘(’ token
descriptor.h: In function ‘std::ostream& operator<<(std::ostream&, const vec_descriptor<T>&)’:
descriptor.h:123:45: error: no match for ‘operator<<’ (operand types are ‘std::ostream {aka std::basic_ostream<char>}’ and ‘const char [2]’)
for (size_t k=1; k < d.size(); ++k) s << " " << d(k);
^
In file included from /usr/include/c++/5/string:52:0,
from descriptor.h:5,
from calc_shot.cpp:11:
/usr/include/c++/5/bits/basic_string.h:5172:5: note: candidate: template<class _CharT, class _Traits, class _Alloc> std::basic_ostream<_CharT, _Traits>& std::operator<<(std::basic_ostream<_CharT, _Traits>&, const std::__cxx11::basic_string<_CharT, _Traits, _Alloc>&)
operator<<(basic_ostream<_CharT, _Traits>& __os,
^
/usr/include/c++/5/bits/basic_string.h:5172:5: note: template argument deduction/substitution failed:
In file included from calc_shot.cpp:11:0:
descriptor.h:123:48: note: mismatched types ‘const std::__cxx11::basic_string<_CharT, _Traits, _Alloc>’ and ‘const char [2]’
for (size_t k=1; k < d.size(); ++k) s << " " << d(k);
^
mex: compile of ' "calc_shot.cpp"' failed.
i used to compile this code with LD_PRELOAD but at the moment i do not remember the argument, how can i solve?
solution:
mex -v calc_shot.cpp shot_descriptor.cpp -DUSE_FLANN -I"C:\Program Files\flann\include" -I/usr/include/eigen3
using this command the programs works like a charm

Cocos2d-x HockeyApp integration

I tried to integrate HockeyApp in my cocos2d-x project, using following link:-
http://support.hockeyapp.net/kb/client-integration-android/hockeyapp-for-android-ndk-early-access
But it gives me following error when I tried to run ndk-build command
jni/../../breakpad/android/google_breakpad/../../src/client/linux/log/log.cc:47:7: error: expected nested-name-specifier before 'AndroidLogBufferWriteFunc'
using AndroidLogBufferWriteFunc = int (*)(int bufID, int prio, const char *tag,
^
jni/../../breakpad/android/google_breakpad/../../src/client/linux/log/log.cc:47:7: error: 'AndroidLogBufferWriteFunc' has not been declared
jni/../../breakpad/android/google_breakpad/../../src/client/linux/log/log.cc:47:33: error: expected ';' before '=' token
using AndroidLogBufferWriteFunc = int (*)(int bufID, int prio, const char *tag,
^
jni/../../breakpad/android/google_breakpad/../../src/client/linux/log/log.cc:47:33: error: expected unqualified-id before '=' token
jni/../../breakpad/android/google_breakpad/../../src/client/linux/log/log.cc:53:1: error: 'AndroidLogBufferWriteFunc' does not name a type
AndroidLogBufferWriteFunc g_android_log_buf_write = nullptr;
^
jni/../../breakpad/android/google_breakpad/../../src/client/linux/log/log.cc: In function 'void logger::initializeCrashLogWriter()':
jni/../../breakpad/android/google_breakpad/../../src/client/linux/log/log.cc:60:3: error: 'g_android_log_buf_write' was not declared in this scope
g_android_log_buf_write = reinterpret_cast<AndroidLogBufferWriteFunc>(
^
jni/../../breakpad/android/google_breakpad/../../src/client/linux/log/log.cc:60:46: error: expected type-specifier before 'AndroidLogBufferWriteFunc'
g_android_log_buf_write = reinterpret_cast<AndroidLogBufferWriteFunc>(
^
jni/../../breakpad/android/google_breakpad/../../src/client/linux/log/log.cc:60:46: error: expected '>' before 'AndroidLogBufferWriteFunc'
jni/../../breakpad/android/google_breakpad/../../src/client/linux/log/log.cc:60:46: error: expected '(' before 'AndroidLogBufferWriteFunc'
jni/../../breakpad/android/google_breakpad/../../src/client/linux/log/log.cc:60:46: error: 'AndroidLogBufferWriteFunc' was not declared in this scope
jni/../../breakpad/android/google_breakpad/../../src/client/linux/log/log.cc:61:54: error: expected ')' before ';' token
dlsym(RTLD_DEFAULT, "__android_log_buf_write"));
^
jni/../../breakpad/android/google_breakpad/../../src/client/linux/log/log.cc: In function 'int logger::writeToCrashLog(const char*)':
jni/../../breakpad/android/google_breakpad/../../src/client/linux/log/log.cc:68:7: error: 'g_android_log_buf_write' was not declared in this scope
if (g_android_log_buf_write) {
^
make: *** [obj/local/armeabi/objs/breakpad_client/src/client/linux/log/log.o] Error 1
GCC 4.6.3 doesn't support C++11 type aliases:
in
Breakpad\src\client\linux\log\log.cc
replace
using AndroidLogBufferWriteFunc = int (*)(int bufID, int prio, const char *tag,const char *text);
with
typedef int (*AndroidLogBufferWriteFunc)(int bufID, int prio, const char *tag,const char *text);

windows r inside rcpp eclipse

I'm trying to use Rinside in an IDE, Eclipse. Follow step by step manual
http://blog.fellstat.com/?p=170
However, when you Build All I mark the following errors
C:/R/R-2.15.2/library/Rcpp/include/Rcpp/string.h:55:17: error: 'internal' does not name a type
C:/R/R-2.15.2/library/Rcpp/include/Rcpp/string.h:68:21: error: expected ')' before 'charsxp'
C:/R/R-2.15.2/library/Rcpp/include/Rcpp/string.h:73:23: error: 'StringProxy' does not name a type
C:/R/R-2.15.2/library/Rcpp/include/Rcpp/string.h:73:36: error: ISO C++ forbids declaration of 'proxy' with no type [-fpermissive]
C:/R/R-2.15.2/library/Rcpp/include/Rcpp/string.h:92:23: error: expected ')' before 'x'
C:/R/R-2.15.2/library/Rcpp/include/Rcpp/string.h:97:35: error: declaration of 'operator=' as non-function
C:/R/R-2.15.2/library/Rcpp/include/Rcpp/string.h:97:32: error: expected ';' at end of member declaration
C:/R/R-2.15.2/library/Rcpp/include/Rcpp/string.h:97:41: error: expected ')' before 'x'
C:/R/R-2.15.2/library/Rcpp/include/Rcpp/string.h:100:35: error: declaration of 'operator=' as non-function
C:/R/R-2.15.2/library/Rcpp/include/Rcpp/string.h:100:32: error: expected ';' at end of member declaration
C:/R/R-2.15.2/library/Rcpp/include/Rcpp/string.h:100:40: error: expected ')' before 'x'
C:/R/R-2.15.2/library/Rcpp/include/Rcpp/string.h:103:41: error: 'StringProxy' does not name a type
C:/R/R-2.15.2/library/Rcpp/include/Rcpp/string.h:103:54: error: ISO C++ forbids declaration of 'proxy' with no type [-fpermissive]
C:/R/R-2.15.2/library/Rcpp/include/Rcpp/string.h:125:42: error: 'StringProxy' does not name a type
C:/R/R-2.15.2/library/Rcpp/include/Rcpp/string.h:125:55: error: ISO C++ forbids declaration of 'proxy' with no type [-fpermissive]
C:/R/R-2.15.2/library/Rcpp/include/Rcpp/string.h:133:36: error: declaration of 'operator+=' as non-function
C:/R/R-2.15.2/library/Rcpp/include/Rcpp/string.h:133:32: error: expected ';' at end of member declaration
C:/R/R-2.15.2/library/Rcpp/include/Rcpp/string.h:133:41: error: expected ')' before 'x'
In file included from c:\r\rtools\gcc-4.6.3\bin\../lib/gcc/i686-w64-mingw32/4.6.3/../../../../include/c++/4.6.3/cwchar:46:0,
from c:\r\rtools\gcc-4.6.3\bin\../lib/gcc/i686-w64-mingw32/4.6.3/../../../../include/c++/4.6.3/bits/postypes.h:42,
from c:\r\rtools\gcc-4.6.3\bin\../lib/gcc/i686-w64-mingw32/4.6.3/../../../../include/c++/4.6.3/iosfwd:42,
from c:\r\rtools\gcc-4.6.3\bin\../lib/gcc/i686-w64-mingw32/4.6.3/../../../../include/c++/4.6.3/ios:39,
from c:\r\rtools\gcc-4.6.3\bin\../lib/gcc/i686-w64-mingw32/4.6.3/../../../../include/c++/4.6.3/ostream:40,
from c:\r\rtools\gcc-4.6.3\bin\../lib/gcc/i686-w64- mingw32/4.6.3/../../../../include/c++/4.6.3/iterator:64,
from C:/R/R-2.15.2/library/Rcpp/include/RcppCommon.h:57,
from C:/R/R-2.15.2/library/Rcpp/include/Rcpp.h:27,
from ../src/main.cpp:12:
c:\r\rtools\gcc-4.6.3\bin\../lib/gcc/i686-w64-mingw32/4.6.3/../../../../i686-w64- mingw32/include/wchar.h:12:32: error: expected '}' before end of line
In file included from C:/R/R-2.15.2/include/R_ext/RS.h:26:0,
from C:/R/R-2.15.2/include/R.h:44,
from C:/R/R-2.15.2/library/Rcpp/include/RcppCommon.h:32,
from C:/R/R-2.15.2/library/Rcpp/include/Rcpp.h:27,
from ../src/main.cpp:12:
And the error list continues
Somebody help me, really I did everything and nothing helps.
thanks