Mono Tesseract 3 ddlmap can't map liblept172.so - mono

I want to use tesseract 3 nuget package with mono. I have a dll not found error at runtime : System.DllNotFoundException : Failed to find library liblept172.so for platform x64.
I tried to add a config file in the same folder of dll , and in et/mono/config too.
<dllmap dll="liblept172.dll" target="/usr/lib/liblept.so"/>
I tried rename dll in liblept.dll.
I added /usr/lib to ldconfig and i linked liblept172.so to liblept.so with no result. Is someone using tesseract 3 with mono (archlinux) ?
using System;
using Tesseract;
using System.Drawing;
namespace tesstessarct
{
class MainClass
{
public static void Main (string[] args)
{
using (TesseractEngine engine = new TesseractEngine (#"/usr/share/tessdata", "fra", EngineMode.TesseractOnly, "config"))
{
engine.SetVariable("tessedit_char_whitelist", "0123456789");
var page = engine.Process (new Bitmap("/test.jpg"));
Console.Write (page.GetText ());
}
}
}
}

The Tesseract Nuget :
<package id="Tesseract" version="3.0.2.0" targetFramework="net45" />
Is only the .Net/Mono wrapper. You will also need the language files and the native shared libraries built for ArchLinux
Build from Source: https://github.com/tesseract-ocr/tesseract
Install from package: https://www.archlinux.org/packages/community/i686/tesseract/

Related

TestLinkAPIClient cannot be resolved to a type, already I added "testlink-java-api" dependency in maven, language used is java

TestLinkAPIClient cannot be resolved to a type, already I added “testlink-java-api” dependency in pom.xml.
Its maven project by using java
please find the below code
package com.tesco.pom.baseClass;
import br.eti.kinoshita.testlinkjavaapi.TestLinkAPIException;
public class ExecuteTestLinkResults implements TestLinkIntegration {
public static void reportTestCaseResult(String Project, String TestPlan,
String TestCase, String Build, String notes, String teststatus) throws TestLinkAPIException {
TestLinkAPIClient testlinkAPIClient = new TestLinkAPIClient(APIKEY, URL);
testlinkAPIClient.reportTestCaseResult(Project, TestPlan, TestCase, Build, notes,
teststatus);
}
}
TestLinkAPIClient does not provide any Maven dependency because it is a third party tool.
So you have to download and add jar files for that you can follow this link:
https://code.google.com/archive/p/dbfacade-testlink-rpc-api/downloads
Download "testlink-api-client-2.0.tar.gz" and import this jar file and start doing your work.
If you still want jar as Maven dependency then you can try and install jar files by following this link:
https://maven.apache.org/guides/mini/guide-3rd-party-jars-local.html

Nancy support for .NETCoreApp

Trying to add the Nancy package to a new project. In project.json (dependencies segment) red squigly under "Nancy": "1.4.3". Mouseover displays an error relating to support for .NETCoreApp
The master branch of Nancy on github already runs on .net core.We are moving from Rake to Cake for the build script , hoping to wrap that up this week so .netcore support can be pushed to Nuget.So yes wait just a bit.
This example was original written on Stack Overflow Documentation:
Setup Nancyfx with Dotnet core v1.1, Kestrel, and Visual Studio Code on *nix systems
Prerequiste steps:
Get dotnet core for your platform:
Dotnet Core
Follow instructions and make sure dotnet core is working
Get Visual Studio Code for your platform:
VS Code
Launch Visual Studio Code (VS code) and install the C# extension then reload
Create self hosted NancyFx project:
Setup a project with a correct project directory structure.
Open Bash Terminal and type:
mkdir nancydotnetcore
cd nancydotnetcore
mkdir src
mkdir test
touch global.json
Open global.json and enter the following code:
{
"projects":["src", "test"]
}
In Bash terminal:
cd src
mkdir NancyProject1
dotnet new
Open folder NancyProject1 in VS code
You will get a warning: "Required assets to build and debug are missing from 'nancyproject1'."
Click "Yes"
Also you will see: There are unresolved dependencies from 'project.json'. Please execute the restore command to continue.
Click "Close" we will get to this soon.
Add the dependencies, open "project.json" and overwrite it with the following:
{
"version": "1.0.0-*",
"buildOptions": {
"debugType": "portable",
"emitEntryPoint": true
},
"frameworks": {
"netcoreapp1.1": {
"dependencies": {
"Microsoft.AspNetCore.Hosting": "1.1.0",
"Microsoft.AspNetCore.Server.Kestrel": "1.1.0",
"Microsoft.AspNetCore.Owin": "1.1.0",
"Nancy": "2.0.0-barneyrubble",
"Microsoft.NETCore.App": {
"type": "platform",
"version": "1.1.0"
}
}
}
}
}
VS code will ask to restore click "Restore"
Create folder "Modules" in VSCode project
In the Modules folder add a file named "IndexModule.cs" then copy and save the following:
namespace NancyProject1
{
using Nancy;
public class IndexModule : NancyModule
{
public IndexModule()
{
Get("/", _ => "Hello dotnet core world!");
}
}
}
In the root directory of the project create a file called "Startup.cs" and copy and paste the following:
namespace NancyProject1
{
using Microsoft.AspNetCore.Builder;
using Nancy.Owin;
public class Startup
{
public void Configure(IApplicationBuilder app)
{
app.UseOwin(x => x.UseNancy());
}
}
}
Open file "Program.cs" and overwrite the content with the following and save:
namespace NancyProject1
{
using System.IO;
using Microsoft.AspNetCore.Builder;
using Microsoft.AspNetCore.Hosting;
public class Program
{
public static void Main(string[] args)
{
var host = new WebHostBuilder()
.UseContentRoot(Directory.GetCurrentDirectory())
.UseKestrel()
.UseStartup()
.Build();
host.Run();
}
}
}
Done! Now lets run this and see the output.
Click the debug symbol in VS Code, and Click the run button. It should compile and start the project.
Open the browser # http://localhost:5000
Pat yourself on the back and enjoy!
still pre release version but works with .net core as the time of this writing, view engines are very limited on core.
Install-Package Nancy -Version 2.0.0-barneyrubble -Pre

System.InvalidOperationException : Migration failed

My solution have 3 projects :
Web (i added the connection string in the appsetting file)
Business (contains models class)
Infrastructure (contains DbContext)
I tried to make a migration :
dnx ef migration add firstMigration -s Web
I had this error :
System.InvalidOperationException: The current runtime target framework is not compatible with 'Infrastructure'.
Current runtime target framework: 'DNX,Version=v4.5.1 (dnx451)'
Version: 1.0.0-rc1-16202
Type: Clr
Architecture: x86
OS Name: Windows
OS Version: 10.0
Runtime Id: win10-x86
Please make sure the runtime matches a framework specified in project.json
When i put dnvm list, i have 1.0.0-rc1-final like a default runtime and i don't find 1.0.0*rc1-16202 in the list ?
The projet.json file of Infrastuture project is :
"frameworks": {
"dotnet5.4": {
},
"net451": {
"EntityFramework.Commands": "7.0.0-rc1-final",
"frameworkAssemblies": { "System.Runtime": "4.0.10.0" }
}
}
I had the same problem and I solved it by changing "net451" to "dnx451" in the project.json file under the "frameworks" object.
It's ok now, it was my mistake : i executed the command (dnx ef migrations add) in Infrasturtucre folder instead of web folder.

How do you make an ASP.Net 5 Application be able to consume class libraries?

Step 1: Open VS 2015 RC and create a new "ASP.Net Web Application"
Step 2: Right-click the solution, add a new windows "Class Library" (a normal one, not the "Class Library (Package)"
Step 3: Put a method in Class1.cs in the class library. Doesn't matter what.
Step 4: Right-click "References" in the Web Project and add a reference to your class library.
Step 5: From a code file in the web project, call the method you made in Class1.cs
So for me, Class1.cs looks like this:
public class Class1
{
public void X()
{
}
}
And I added code in the web application like this:
var x = new ClassLibrary1.Class1();
x.X();
Step 6: Try to compile, you will get this error:
Error CS0246 The type or namespace name 'ClassLibrary1' could not be found (are you missing a using directive or an assembly reference?)
What magic must be done to make normal class libraries (of which I have a lot) work with ASP.Net 5 apps?
When downloading your project and building, I got the following error in the output:
C:\REDACTED\AspNet5Test\src\AspNet5Test\Startup.cs(26,25,26,38): DNX Core 5.0 error CS0246: The type or namespace name 'ClassLibrary1' could not be found (are you missing a using directive or an assembly reference?)
Note, especially the DNX Core 5.0 portion - .Net 4.5 libraries (such as your ClassLibrary1) are not compatible with .Net Core.
The easiest solution is to remove the dependency on dnxcore50 from your project.json file.
Current:
"frameworks": {
"dnx451": {
"dependencies": {
"ClassLibrary1": "1.0.0-*"
}
},
"dnxcore50": { }
},
Change to:
"frameworks": {
"dnx451": {
"dependencies": {
"ClassLibrary1": "1.0.0-*"
}
}
},

How do I add a reference to a mono assembly in asp.net vNext

So I've installed Asp.net vNext onto my Linux box and have been playing around with it. I have everything set up and can build and run mvc applications. I'm building a console application and need to reference an assembly that doesn't exist in NuGet. I want to add a reference to Mono.Data.SqliteClient to my project.json. I know the path to the assembly /usr/local/lib/mono/4.5/Mono.Data.Sqlite.dll.
How do I add the reference to the dll? My project.json file currently looks like this:
{
"dependencies": {
"System.Console": "4.0.0.0",
"Dapper":"1.27",
"Mono.Data.Sqlite":""
},
"configurations": {
"net45": {},
"k10": {}
}
}
I found the answer on a forum...
In a nutshell, you can only reference your dlls if they are inside a nuget package... ( I hope this will be improved. It is a hassle IMO. )
The long story :
Ok, after a lot of fannying about, it seems that the way to do this is to create a nuget package using the DLL (i'll use Quartz version 2.2.4.400 as an example).
use http://docs.nuget.org/docs/creating-packages/using-a-gui-to-build-packages to build it. Drag and drop Quartz.dll into the right hand side (nb. it does need to be placed in the lib directory). File -> save as... save it in the following location:
projectRoot\packages\Quartz.2.2.4.400\Quartz.2.2.4.400.nupkg
With the dll in the following:
projectRoot\packages\Quartz.2.2.4.400\lib\Quartz.dll
nb. placing the DLL outside of the lib directory will compile alright, but won't work with intellisense. If you are compiling with a specific version, then i'd put it in a net45, net451 or k10 folder; as i'm not, I didn't bother. my project.json then looks like:
{
"dependencies": {
"Quartz" : "2.2.4.400"
},
"configurations" : {
"k10" : {
"dependencies": {
"System.Console": "4.0.0.0"
}
}
}
}