Emgucv + SURF feature - emgucv

I am using emgucv2.3.
When I type the line MCvSURFParams surfParam = new MCvSURFParams(500, false); , I get the error The type or namespace name 'MCvSURFParams' could not be found (are you missing a using directive or an assembly reference?) . But I have included all necessary references. Can anyone tell where I am wrong ?
Thanks in advance

I believe your using an old call to the code it should now be:
SURFDetector surfParam = new SURFDetector(500, false);
Assuming you have the correct references and using statements this will work, refere to the SurfFeature example in 2.3.0 to check your code.
Cheers,
Chris

Related

'IHtmlHelper<dynamic>' does not contain a definition for 'Widget' in nopcommerce 4.0

I am getting the red line and shows the title error when I add
#Html.Widget("home_page_top") and
#Html.Action("TopicBlock", "Topic", new { systemName = "HomePageText" })
in nop.web Home view in nopcommerce.
And the full error shows the following message i.e. :
Error CS1061 'IHtmlHelper' does not contain a definition for 'Widget' and no accessible extension method 'Widget' accepting a first argument of type 'IHtmlHelper' could be found (are you missing a using directive or an assembly reference?)
I got the solution. I am going in a wrong way I am doing code 3.8 in 4.0. Thats why I am getting this issue.
In case anyone else comes across this question, in version 4.0 the code for adding a widget zone has changed. Use this :
#await Component.InvokeAsync("Widget", new { widgetZone = "custom_widget_zone" })

Get AST for C fragment, using Clang?

I am building a clang plugin, and I am trying to generate the AST for a C fragment at some point within the plugin. Something like:
std::string c_code = "...";
getAST(c_code);
Can someone point me to, how to go about this?
May be there are several ways to achieve this, but finally I got the following snippet working and to me it looks simple enough:
//arguments to the compiler
std::unique_ptr <std::vector<const char*>> args(new std::vector<const char*>());
args->push_back("my_file.c");
//do the magic
ASTUnit *au = ASTUnit::LoadFromCommandLine(
&(*args)[0],
&(*args)[0] + args->size(),
IntrusiveRefCntPtr<DiagnosticsEngine>(
CompilerInstance::createDiagnostics(new DiagnosticOptions)),
StringRef()
);
//get the translation unit node
Declr *d = au->getASTContext().getTranslationUnitDecl();
Simpler alternatives or suggestions to improve this are welcome.
I don't have a code snipped ready to copy-paste, but the idea that I used before is the following:
Note that clang_parseTranslationUnit has unsaved_files as one of the arguments. So the idea would be to provide a command line g++ main.cpp, and then provide an unsaved file with name main.cpp and the content from your string.

How to use HMAC in Lua - Lightroom plugin

First thing I have to mention is I'm really really new to Lua and please be patient if you think my question is too dumb
Here is my requirement
I need to use HMAC-sha256 for Lightroom plugin development as I'm using that for security.
I was trying to use this but with no luck
https://code.google.com/p/lua-files/wiki/hmac
These are the steps I followed
Got the code of
https://code.google.com/p/lua-files/source/browse/hmac.lua and saved
as 'hmac.lua' file in my plugin directory
Got the code from this
https://code.google.com/p/lua-files/source/browse/sha2.lua and saved
as 'sha2.lua' file
Now in the file I use it like this
local hmac = require'hmac'
local sha2 = require'sha2'
--somewhere doend the line inside a function
local hashvalue = hmac.sha2('key', 'message')
but unfortunately this does not work and I'm not sure what I'm doing wrong.
Can anyone advice me what I'm doing wrong here? Or is there an easier and better way of doing this with a good example.
EDIT:
I'm doing this to get the result. When I include that code the plugin does stops working. I cannot get the output string when I do this
hashvalue = hmac.sha2('key', 'message')
local LrLogger = import 'LrLogger'
myLogger = LrLogger('FlaggedFiles')
myLogger:enable("logfile")
myLogger:trace ("=========================================\n")
myLogger:trace ('Winter is coming, ' .. hashvalue)
myLogger:trace ("=========================================\n")
and the Lightroom refuses to load the plugin and there is nothing on the log as well
Thank you very much for your help
I'd first make sure your code works outside of Lightroom. It seems that HMAC module you referenced has some other dependencies: it requires "glue", "bit", and "ffi" modules. Of these, bit and ffi are binary modules and I'm not sure you will be able to load them into Lightroom (unless they are already available there). In any case, you probably won't be able to make it run in LR if you don't have required modules and can't make it run without issues outside of LR.
If you just need to get SHA256 hash there is a way to do it Lightroom
I posted my question here and was able to get an answer. But there there was no reference of this on SDK documentation (Lightroom SDK)
local sha = import 'LrDigest'
d = sha.SHA256.digest ("Hello world")
but unfortunately there was no HMAC so I decided to use md5 with a salt because this was taking too much of my time
Spent quite some time trying to find a solution :-/
LrDigest is not documented, thanks Adobe!
Solution:
local LrDigest = import "LrDigest"
LrDigest.HMAC.digest(string, 'SHA256', key)

Convert sxw to rml error

When I try to convert sxw file to rml file using OpenOffice , this error occurs :
Exception: 'asci' codec can't encode character u'\xe9'
what's the meaning of that error? and how can I fix it?
please check this link UnicodeEncodeError when trying to convert Django models to XML This is the same issue that we got here.
You can use yourfield.encode("utf-8") or use format() in openerp. [[format(obj.your_str_field or '')]]
We have Similar issues posted on lp: https://bugs.launchpad.net/openobject-server/+bug/956798
and it has been fixed on linked branch you can take the patch apply, which will make your report to tolerate the Unicode encoding.
Thank You

actionscript: DownloadProgressBar and Flex 4 can't find resource bundle

I am using flex 4 and I want to custom the preloader, but I meet error of DownloadProgressBar. The code:
public class MyPreLoader extends DownloadProgressBar
{
var progress:ProgressBar = new ProgressBar();
Or substitude ProgressBar to Label will produce the same error:
Error: Could not find compiled resource bundle 'collections' for locale 'en_US'.
Anyone has implemented the custom preloader? I am almost missing here.
Resolved by adding:
[ResourceBundle("")] tag in the source!
Hope this can help others.

Resources