Move data from one string to another - c#

I am writing a calculator for a school project. I ran into a problem when parsing form in c# program using VBScript MSScriptControl.ScriptControl().Eval(). That is alright, except for logarithms. VBS cant do c# logarithms with custom base so I need to use an equation to reform it.
I need to get from log10(x) to (log(x)/log(10)) or from log(x, a) where a is base to (log(x)/log(a).
I've tried to search but I can't really find a way to grab two values and put them in a different way. And as I'm a little new to c#, I couldn't come up with better idea than RegEx
Thanks for help

If Eval in VBScript is your problem, try Mono.CSharp which has got Evaluator.Eval method and it pretty much Eval anything which you can in C#.
Here is the link to download David Ebbo's blog about Mono CSharp Compiler Service

Related

How to pass images between C# and Ironpython with opencv (or Emgucv)

I'm working on a project which involves image processing being done in Python and finally the result must be displayed on a WPF UI. I've heard that it is possible to pass data (integer, string, ... etc) between C# and Python using Ironpython, but I couldn't find any solution for my problem. Can somebody help me out, I really appreciate it. Thank you !

control a wpf from matlab by using a c# dll

i would like to know weather it is possible to control some wpf application written in c# by using a c# dll out of matlab.
what i need is the possibility to start the MainWindow and i have to be able
to get some values into my controller.
What i found so far was things working from c# that use matlab, but the other way round seems not to be that much populatet, as i found nothing i could really use.
I allready tried to import a .net Library, but i dont seem to be able to open a external class from my dll.
So if you could help me on this it would be great.
Regards,
justSomeone
Ok, i did just find out, that i can also import my .exe file into Matlab instead of only dlls .
I am using the function NET.addAssebly('Path.exe') to do this.
Path.exe is just a symbol that it is directed to the place of the .exe file.
I achieved to be able to use my methods as i wanted i do have my instance of the class. So i am happy now. :D
But if you have other solutions which are more handy, dont hesitate to post them. There might still be interesting things to discover :)
Regards,
justSomeone

Parsing PCL for Text

Ok, so I know this is a crappy question but it has been driving me crazy all day...
I have a bunch of files containing raw PCL6/PCL XL code from printing jobs run to our printers. What I need to be able to do is somehow parse them so I can search for specific text.
Does anyone know if this is possible or understand PCL enough to suggest a reason why even on basic prints from say notepad the raw text doesn't seem to be visible within the code?
I suppose I should mention, I need to be able to code this into my C# app. Manual converters or the ability to print the pcl is not going to do what I want.
#mcalex is correct, PCL 6 (PCLXL) is a compiled binary. You can't read it. You need something that can decompile for you. Pagetech have some solutions for this. You could also look to convert to some other format where the data might be more readable. If the source could be generated in PCL 5 or PS you "might" have a better chance or reading the data directly (although not likely).

Reading a File While Being Written to by Another Program(Windows)

So basically, I'm trying to read a log file from a game while that game is running in order to have my program react to it in dynamic ways. I know it's possible, as other programs such as Notepad(++) are able to do it. However, after searching for an answer, most of what I can come up with is only Linux related.
I have no idea as to how to go about this, help in doing so with either C++ or C# would be great. Even though I would prefer native C++ over C#.
The "native" winapi solution is CreateFile, and in particular its dwShareMode parameter.

Free Math equation image generator

I'm looking for a component that generates math equations.
like what wikipedia has but for windows server.
if i enter x^2, it will generate a gif with proper formatting as output
It must run on IIS and .NET and not a web service from somewhere.
has anyone seen anything that does this?
Check this out. They have a LaTeX like equation editor, and apparently the can compile their code with Visual Studio. You might be able to get something working related to your question.
Well, one option would be to write your own parser - i.e. that takes "x^2" and builds a .NET 3.5 Expression to do the same. Once you have an Expression, you can use Compile() to get a delegate (Func<double,double>, for example) that you can use to generate the points. That isn't a huge amount of work (it took me about 2 hours to write a similar (though basic) parser a few months ago).
Of course, you'd still need to worry about the imaging side... maybe the .NET chart control released a few months ago? (it isn't just ASP.NET)
I am using MathJax to generate equations in websites,
basically I write HTML. I've had no problems with it.

Categories