I'm working with ABBYY cloud OCR, when my popruse is to scan 3 specific places in each document that I'm scanning. These 3 places will always be the same so I want to use the ProcessFields function do it and having some problems with it.
When I want to scan only one specific place I used this :
string url1 = String.Format("http://cloud.ocrsdk.com/processFields?region=0,0,200,200&language=english");
When trying to scan 2 places I've tried this :
string url1 = String.Format("http://cloud.ocrsdk.com/processFields?region=0,0,200,200 region 100,100,100,100&language=english");
it gave me an error.
Anyone has any advise how to do it?
I also tried defieng 3 Uri's but as the upload is done only once - how can I reach the 2 other Uri's without scanning it again?
thanks a lot!
According to documentation of processField method, you can't pass field parameters in URI, you should form an XML and submit it using POST method instead of GET. There is also a sample XML file on that page.
Simple method with URI works only for one field and processTextField method.
Related
I have a URL something like below. The URL gets generated each time, basically links are ephemeral. I want to mark this link as obsolete/invalid once it has been accessed in a browser. The second time when we access this URL, it should say invalid link. URL format is having an auth token. How can we do this in C#?
http://example.com/ui/landing?authToken=wwlC7bjUugIT5lo8uuX8d2wQhS__k6l80fSwPKzFuJWwDANgGVQtNT6C3q1lGcNk1p_ApBdurzPTayOzaGb6YibAdTKfzBdhKCcTNZwO54mg1KU_lPD6Zmg
Link must be marked as invalid once used.
I don't think this can be done just by code.
I think a workaround would be to store the links on your server (database, file or watever). When someone uses the link you can check on that db if the link has been used and mark it as "used" if not.
Something like:
id
Link (string)
Used (boolean)
1
https://stack...
1
2
https://stack...
1
3
https://stack...
0
I am going to create a function in my application that is going to send som status mails to several receivers in a list.
Earlier i used plane text format on the email, but now i want to send the mail based on som html templates. I need tips reguarding a good way to insert data into these templates before sending them.
eks
%CpuStatus%
%HardriveStatus%
and so on. I have the solution for everything except a way to fill anchors like that with data. This is a WinForm application so i dont have access to the ASP functionality
Maybe this sort of thing would be the simplest?
// This would most likely be loaded from a file or database.
string emailBody = "CPU Status: %CpuStatus%\nHard Drive Status: %HardriveStatus%";
string cpuStatus = MyService.GetCpuStatus();
emailBody.Replace("%CpuStatus%", cpuStatus);
If you really wanted to make a big project out of it, you can use a webbrowser control, load it with your html file and then use the WebBrowser's Document property to get an HtmlDocument object. You can then loop through it's children (recursively) to find the tags you want to change.
Personally, I would do the .Replace method suggested previously.
Currently I'm finishing my very first iPhone application with MonoTouch. Localization through the "*.lproj" folders works as expected.
Having an UIWebView that displays some user guidelines, I'm populating this one with the LoadHtmlString() method. (I.e. no internet connection is required).
Since the text is a bit longer, I do not want it to be placed inside the "Localizable.strings" file but being swapped out to a completely separate file (as I'm doing it for Windows .NET applications, too):
In the above screenshot, I would have one "help.html" file inside each language folder and call the LoadHtmlString method to read from the appropriate file in a way that would be similar to NSBundle.MainBundle.LocalizedString.
My question:
Is it possible to have per-language files and access them from within a MonoTouch application?
Follow-up to Dimitris' solution
Based on Dimitris' solution, I solved it by this code:
var localizedHtmlFile = NSBundle.MainBundle.PathForResource("help", "html");
var text = File.ReadAllText(localizedHtmlFile);
helpTextView.LoadHtmlString (text, null);
Yes, of course it is possible. You can get the path of the localized file like this:
string localizedHtmlFile = NSBundle.MainBundle.PathForResource("help", "html");
You can use the PathForResource method for various different types of resources (PDFs, images, etc.). The first parameter is the file name and the second one is its extension. Check the other overload of the PathForResource method for more options.
This is my idea:
I get this address from source, for example: http://api.recaptcha.net/challenge?k=6Lc_Wb0SAAAAAPpDWSnsxg7rFxSJT46Wmic3Ximb
Then I get "challenge" from this site, for example: challenge : '03AHJ_VuumDpsD-dz-rSeL_Vyd5fUqHMJLNtlpiyaEq0RzDhsaNTWTydaOcYk5cdRX55C6VyaojWJwCa6T6PF8LF4Io5NUC09Kj0HRNczh9tJXBsrx26BcfBtrwvPabvbR_SnJXdmc9YS2L76PqI9EdtfXPhhCV9V2jw'
Then I get address of picture, for example: http://www.google.com/recaptcha/api/image?c=03AHJ_VuumDpsD-dz-rSeL_Vyd5fUqHMJLNtlpiyaEq0RzDhsaNTWTydaOcYk5cdRX55C6VyaojWJwCa6T6PF8LF4Io5NUC09Kj0HRNczh9tJXBsrx26BcfBtrwvPabvbR_SnJXdmc9YS2L76PqI9EdtfXPhhCV9V2jw
But there is a problem - pic is other than I have to write. Can you tell me how I can get oryginal address?
If the image you get doesn't match up with the one that you have to type then I'm guessing you aren't passing the same challenge code to the verification method of the api as to the image part.
It would help if you could paste a bit of code.
If you look at the non-javascript API call output for how it actually gets fetched without all the javascript getting in the way, there wouldn't appear to be a reason your strategy would give the wrong image.
http://www.google.com/recaptcha/api/noscript?k=6Lc_Wb0SAAAAAPpDWSnsxg7rFxSJT46Wmic3Ximb
Mike got the point you need to pass recaptcha_challenge_field=03AHJ_VuumDpsD-dz-rSeL_Vyd5fUqHMJLNtlpiyaEq0RzDhsaNTWTydaOcYk5cdRX55C6VyaojWJwCa6T6PF8LF4Io5NUC09Kj0HRNczh9tJXBsrx26BcfBtrwvPabvbR_SnJXdmc9YS2L76PqI9EdtfXPhhCV9V2jw
I ask here about XNA and not on it's official forums because people from my country are not allowed to sign in to the new XNA website.
Well, these are my questions:
I want to use some 2D images I create in Paint Shop Pro/Photo Shop/Paint, but for some reason I need to use web safe pallet and such settings for it to be displayed currently (I use transparency).
could any1 please explain to me how can I use transparency & other settings (while creating & saving the image) so that the XNA (4.0) could display it correctly?
By the way, it might be that I just need some 1 to explain to me how to set the "GraphicsDevice"-s settings to work with transparency layer/channel.
I really do try to do things as I am supposed to (by Microsoft's view) & thus I use the content pipeline for ALL of my content loading (including classes initiation data files).
I use .txt files for storing my class initiation data & I edit them with simple good old notepad (++ :P).
Now, the problem is that all I managed to do is loading the .txt file as a really long string instead of creating a new instance of my GameDataFile class.
because of that I was forced to do it in 2 steps:
Step 1:
string tempStrData = content.load<string>("data/filename").Replace("\r", "");
/* Loads a string from a file (the string is the whole file!) */
Step 2:
GameDataFile gameDataFile = new GameDataFile(tempStrData.Split('\n'));
/* Sends the string to my GameDataFile class constructor which knows how to handle that string and break it to it's data elements (ints, strings vectors, etc...) */
I want to upgrade it to be of the following form:
GameDataFile gameDataFile = content.load<GameDataFile>("data/fileName");
I think I should do this using a custom Content pipeline Processor, any opinions if I'm right & how should I achieve that?
P.S please don't make me to use public members as I always set that to private and I hate and strictly forbid myself from using the C#-ONLY-get-&-set methods.
Thanks In Advance, Tal A.
For your first question, set the blendstate to AlphaBlend when you begin your SpriteBatch:
spriteBatch.Begin(SpriteSortMode.Immediate, BlendState.AlphaBlend, null, null, null);
I save my images as PNGs in PhotoShop which allows transparency.
Edit: Unless you're referring to 3D textures. If so I'll have to revise my answer
Edit: As for question 2, this example on App Hub shows how to do it.