In our stack, we have a rule base compiler which is an exe-file that generates bat-file and calls it. Yesterday, right after installing monthly updates from Microsoft, this compiler has stopped working properly on some of our Windows 7 sp1 x64 machines, throwing the «Applcation has stopped working» window at the moment of calling bat-file from exe. Bat-file ran fine separately. Neither UAC no Security Essentials deactivating helped, as well as running the stuff as Administrator. Finally, we got the soft working right after setting "Compatibility: Windows 7" for our exe. It seems that Microsoft has shipped a strange security update which treats exe-s that run bat-s as "bad". Our bat actually read registry, because it ran vsvars32.bat. Maybe an MS intern plays pranks? :) We didn't figure out what exactly the update it was, hope they'll fix the problem in a couple of weeks.
Wednesday, 9 October 2013
Monday, 7 October 2013
Build Rus, Eng, Ger AOT morpho for .NET
1) Download trunk from http://seman.sourceforge.net/. I check out it to p:\SEMAN\. Build Debug. Don't try to build other configs, they will fail even worse than in Debug configuration.
2) Download http://aot.ru/download.php — RusLemmatizer.zip and MorphWizard.zip. Install with default paths.
3) Delete all from c:\Rml\Dicts\.
4) Copy p:\SEMAN\Dicts\Morph\ to c:\Rml\Dicts\.
5) Copy p:\SEMAN\Dicts\SrcMorph\ to To c:\Rml\Dicts\.
6) From p:\SEMAN\Source\MorphGen\Debug take MorphGen.exe and replace it into c:\Rml\Bin\.
7) Now just run eng_gen.bat, ger_gen.bat and rus_gen.bat. It is slow, schedule 2-4 hours.
8) Use the resulting binaries with Lemmatizer.NET, which is compilable from p:\SEMAN\Source\LemmatizerNET.sln .
9) But introduce a little workaround to Lemmatizer.NET. In Lemmatizer.cs, in LoadDictionariesRegistry function, replace the following:
_useStatistic = true;
_statistic.Load(this, "l", manager);
to:
if (Language == InternalMorphLanguage.morphRussian)
{
_useStatistic = true;
_statistic.Load(this, "l", manager);
}
else
{
_useStatistic = false;
}
10) To work with dictionaries, make separate folder like p:\Lemmatize\Rml and put there c:\Rml\Bin and c:\Rml\Dicts.
11) The minimal test program to do lemmatizing is the following.
class Program
{
static void Main(string[] args)
{
Console.WriteLine("Enter Russian word (0 to exit)");
ILemmatizer lem = LemmatizerFactory.
Create(MorphLanguage.Russian);
var manager = FileManager.
GetFileManager(@"p:\Lemmatize\Rml"); // make it relative!
lem.LoadDictionariesRegistry(manager);
string word;
do
{
Console.Write("> ");
word = Console.ReadLine();
var paradigmList = lem.
CreateParadigmCollectionFromForm(word, false, true);
for (var i = 0; i < paradigmList.Count; i++)
{
var paradigm = paradigmList[i];
Console.WriteLine ("\t" + paradigm.Norm);
}
}
while (word != "0");
}
}
2) Download http://aot.ru/download.php — RusLemmatizer.zip and MorphWizard.zip. Install with default paths.
3) Delete all from c:\Rml\Dicts\.
4) Copy p:\SEMAN\Dicts\Morph\ to c:\Rml\Dicts\.
5) Copy p:\SEMAN\Dicts\SrcMorph\ to To c:\Rml\Dicts\.
6) From p:\SEMAN\Source\MorphGen\Debug take MorphGen.exe and replace it into c:\Rml\Bin\.
7) Now just run eng_gen.bat, ger_gen.bat and rus_gen.bat. It is slow, schedule 2-4 hours.
8) Use the resulting binaries with Lemmatizer.NET, which is compilable from p:\SEMAN\Source\LemmatizerNET.sln .
9) But introduce a little workaround to Lemmatizer.NET. In Lemmatizer.cs, in LoadDictionariesRegistry function, replace the following:
_useStatistic = true;
_statistic.Load(this, "l", manager);
to:
if (Language == InternalMorphLanguage.morphRussian)
{
_useStatistic = true;
_statistic.Load(this, "l", manager);
}
else
{
_useStatistic = false;
}
10) To work with dictionaries, make separate folder like p:\Lemmatize\Rml and put there c:\Rml\Bin and c:\Rml\Dicts.
11) The minimal test program to do lemmatizing is the following.
class Program
{
static void Main(string[] args)
{
Console.WriteLine("Enter Russian word (0 to exit)");
ILemmatizer lem = LemmatizerFactory.
Create(MorphLanguage.Russian);
var manager = FileManager.
GetFileManager(@"p:\Lemmatize\Rml"); // make it relative!
lem.LoadDictionariesRegistry(manager);
string word;
do
{
Console.Write("> ");
word = Console.ReadLine();
var paradigmList = lem.
CreateParadigmCollectionFromForm(word, false, true);
for (var i = 0; i < paradigmList.Count; i++)
{
var paradigm = paradigmList[i];
Console.WriteLine ("\t" + paradigm.Norm);
}
}
while (word != "0");
}
}
Friday, 4 October 2013
File assocs grab between versions of MS Office
When, e.g., Office 2010 tries to take file associations from Office 2003 previously installed, and then back, and then back. Use this batch:
set P=HKCU\Software\Microsoft\Office
reg add %P%\11.0\Word\Options /v NoReReg /t REG_DWORD /d 1
reg add %P%\11.0\Word\Options /v NoReReg /t REG_DWORD /d 1
reg add %P%\12.0\Word\Options /v NoReReg /t REG_DWORD /d 1
reg add %P%\15.0\Word\Options /v NoReReg /t REG_DWORD /d 1
reg add %P%\11.0\Excel\Options /v NoReReg /t REG_DWORD /d 1
reg add %P%\12.0\Excel\Options /v NoReReg /t REG_DWORD /d 1
reg add %P%\15.0\Excel\Options /v NoReReg /t REG_DWORD /d 1
... the same for PowerPoint, Access ...
... the same for PowerPoint, Access ...
1) Substitute here certain versions of MS Office (maybe 14.0, there is no 13.0, I think) from your machine.
2) Check whether other programs like OneNote have such branches in registry, I haven't checked.
3) Never use spaces around "=" sign in set operation :)
3) Never use spaces around "=" sign in set operation :)
Thursday, 3 October 2013
Restore file associations and icons under Windows
Soft for Windows likes to override icons and extentions assocs so that it's so difficult to bring them to normal state. For instance, you can get crappy icons on Word files after reinstallation of MS Office. The solution to this mess is damn simple.
Backup.bat
FTYPE > backup_types.txt
ASSOC > backup_ext.txt
Restore.bat
FOR / F "tokens =* delims =" %%G IN (backup_types.txt) DO FTYPE %%G
FOR / F "tokens =* delims =" %%G IN (backup_ext.txt) DO ASSOC %%G
Don't forget to generate and put to safe place those two files after fresh install of Windows and soft. For those who is in search for the solution like I did before, here is the list of keywords to let Google find the post:
Backup.bat
FTYPE > backup_types.txt
ASSOC > backup_ext.txt
Restore.bat
FOR / F "tokens =* delims =" %%G IN (backup_types.txt) DO FTYPE %%G
FOR / F "tokens =* delims =" %%G IN (backup_ext.txt) DO ASSOC %%G
Don't forget to generate and put to safe place those two files after fresh install of Windows and soft. For those who is in search for the solution like I did before, here is the list of keywords to let Google find the post:
- restore file associations Windows
- restore icons Windows
- restore exntention associations Windows
- how to restore file associations Windows
- restore file types Windows
- recover file associations Windows
Wednesday, 28 August 2013
MS Word facts, really useful
Store them for later reference.
- Fast swap current paragraph with upper/lower: Alt+Shift+↑/↓
- Select current sentence: Ctrl+MouseLeft (on any word)
- Select current paragraph: tripple left mouse click
- Move text: F2 on selection → Enter at the destination
- Clear formatting of the selection: Ctrl+Space
- =rand(N,M) — generate N paragraphs, each of M sentences from help
- =lorem(N,M) — the same, but not random and from "Lorem Ipsum"
- You can insert EPS images into Word document by "Insert picture"
- Excel: Alt+Enter to enter new line in a current cell
Friday, 16 August 2013
Batch to remove empty dirs in Windows
Staring from its directory: for /f "usebackq delims=" %%d in (`"dir /ad/b/s | sort /R"`) do rd "%%d"
Wednesday, 7 August 2013
Software for every day
Virtual desktops: VirtuaWin Unicode
Mindmapping: XMind
Pomodoro: Tomighty
Download videos from youtube, yandex etc: http://savefrom.net/
Charge iPad from usb: http://event.asus.com/mb/2010/ai_charger/
Password Asterisk logger: http://www.nirsoft.net/utils/astlog.html
Mindmapping: XMind
Pomodoro: Tomighty
Download videos from youtube, yandex etc: http://savefrom.net/
Charge iPad from usb: http://event.asus.com/mb/2010/ai_charger/
Password Asterisk logger: http://www.nirsoft.net/utils/astlog.html
Subscribe to:
Comments (Atom)