Standalone WinDbg v6.12.0002.633
WinDbg v6.12.2.633, part of Debugging Tools for Windows package, famous for debugging memory dumps and kernel mode.
New WinDbg version with bug fixes and enhancements is extracted as standalone package here:
windbg_6.12.0002.633_x64.cab 13 Mb
windbg_6.12.0002.633_x86.cab 15 Mb
NetWeaver RFC SDK
The [C]RFC SDK examples and test programs are no longer available in the 7.20 SDK. You must use the source code from an older release and re-compile the programs on your own.
There are two RFC SDKs:
Classical RFC SDK:
classical.rfc.sdk.win32.cab (~16 Mb)
including RFC C++ Class Library (BC-FES-AIT)
List of files: rfc.sdk.contents.html + programming_examples.html
and
NW RFC SDK:
NW RFC SDK 32 x86: nwrfcsdk32_x86.cab (~4 Mb)
NW RFC SDK x64: nwrfc750P_6-70002755.nwrfcsdk.cab (~12 Mb)
+ sapnwrfc.dll 32-bit: sapnwrfc.dll.x32.x86.cab (~1,5 Mb)
|
1 2 3 4 5 6 7 8 9 10 |
companyClient.c rfcexec.cpp rfcexec.h sapnwrfc.ini sflightClient.c sso2sample.c startrfc.cpp startrfc.h stfcDeepTableServer.c ThroughputSample.c |
PDF – Part 1: RFC client programs – cpp-rfc1_client.pdf
PDF – Part 2: RFC server programs – cpp-rfc2_server.pdf
samples.cab (~16 Kb)
|
1 2 3 4 5 6 7 8 9 10 11 12 13 14 |
callbackDemo.c demoClient.c demoServer.c hardCodedServer.c helperFunctions.c iDocClient.c iDocServer.c printDescription.c sapnwrfc.ini statusTracking.c statusTracking.h toc.txt Z_CALL_DOC_DOLITTLE.abap Z_CALL_EXTERNAL_SERVER.abap |
PDF – Part 3: Advanced topics – cpp-rfc3.pdf
callback.cab (~2 Kb)
|
1 2 |
callbackDemo.c Z_PERFORM_CALLBACK.abap |
nw.rfc.sdk.linux.tar.gz (~18 Mb)
saptype.h:
|
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 |
/* @(#) saptype.h 20.24 SAP 98/02/12 ========== licence begin GPL Copyright (c) 2000-2005 SAP AG This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. ========== licence end */ typedef char SAP_CHAR; typedef unsigned char SAP_BYTE; /* Value range: 0 .. UCHAR_MAX */ typedef short SAP_SHORT; /* Value range: SHRT_MIN .. SHRT_MAX */ typedef unsigned short SAP_USHORT; /* Value range: */ typedef int SAP_INT; /* Value range: */ typedef unsigned int SAP_UINT; /* Value range: */ /**********************************************************************/ /* Min/max macros */ /* To prevent compiler warnings the macros MAX and MIN now have the */ /* same wording as those in /usr/include/sys/param.h. */ /**********************************************************************/ #ifndef MIN #define MIN(a,b) (((a)<(b))?(a):(b)) #endif #ifndef MAX #define MAX(a,b) (((a)>(b))?(a):(b)) #endif #define SAPonNT #define USE(param) ((param)=(param)) |


Access Vanilla Forum’s DB via browser’s menu
So, few days after migration from Ikonboard CGI Forum v2 to Vanilla Forum I’ve noticed, that some posts has wrong date. Database was copied into local copy for local r/w access.
Download and install mysql CPP connector
Do not forget to add mysqlcppconn.lib to additional linker input dependencies in project settings // or add #pragma comment( lib, “mysqlcppconn.lib” ) to vanied.cpp
|
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 |
#include "mysqlx\xdevapi.h" using namespace ::mysqlx; ... sql::mysql::MySQL_Driver* driver; sql::Connection* con; string ID = ""; string dt = ""; driver = sql::mysql::get_mysql_driver_instance(); con = driver->connect("tcp://10.10.250.11:3306", "solan_tv", ""); con->setSchema("test"); sql::Statement* stmt; stmt = con->createStatement(); ... string updDataSQL = "UPDATE GDN_Discussion set DateInserted=" + dt + " where DiscussionID=" + ID + ";"; stmt->execute(updDataSQL); ... |
To launch files from Chrome’s context menu, I’ve registered a simple new URI handler: https://docs.microsoft.com/en-us/previous-versions/windows/internet-explorer/ie-developer/platform-apis/aa767914(v=vs.85) i.e. vanied:
Now, add it into Chrome (or Edge) context menu through Windows Registry:
|
1 2 3 4 5 6 7 8 9 10 |
HKEY_CLASSES_ROOT vanied (Default) = "URL:Vanied Protocol" URL Protocol = "" DefaultIcon (Default) = "devenv.exe,1" shell open command (Default) = "D:\projects\vanied\Release\vanied.exe" "%1" |
Context Menu Editor plugin for Chrome: cme3.4.0.cab
After installing right click on Options:

Add new item

Edit and apply. Except info.linkUrl there are number of different data. More – https://developer.chrome.com/extensions/contextMenus#property-onclick-info

Создаем Drupal-страницы (XML-RPC “node.save”)
В данном способе создания нод будут использоваться модули Key Authentication, XMLRPC Server, Node Service и User Service из решения Drupal Services 6.x-2.2 (выбрал 6.x-2.2 как наиболее безглючную)
Подключаем их, далее идем в панели Administer › Site building › Services Administer › Site building › Services, жмем “Создать ключ”, задаем название, указываем что-нибудь в поле “Allowed domain” и выбираем разрешенные методы – в моем случае это system.connect, user.login и node.save. В настройках модуля Services выбираем тип авторизации – “Key Authentication”.
Скачиваем библиотеку XML-RPC, компилим ее и добавляем в ссылки проекта VS2008 файл CookComputing.XmlRpcV2.dll, в using добавляем CookComputing.XmlRpc и System.Security.Cryptography.
Внутри класса добавляем:
|
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 |
[XmlRpcMissingMapping(MappingAction.Ignore)] public struct DrupalUser { public string name; public string email; } public struct Drupal { public string sessid; public DrupalUser user; } [XmlRpcUrl("http://0x2.dev/services/xmlrpc")] public interface IServiceSystem : IXmlRpcProxy { [XmlRpcMethod("node.save")] string NodeSave(string hash, string domain_name, string domain_time_stamp, string nonce, string sessid, XmlRpcStruct node); [XmlRpcMethod("system.connect")] Drupal Connect(); [XmlRpcMethod("user.login")] Drupal Login(string hash, string timestamp, string domain, string nonce, string sessid, string username, string password); } |
Создание ноды будем производить, скажем, по нажатию кнопки, обработчик будет такой:
|
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 |
private void button1_Click(object sender, EventArgs e) { IServiceSystem iss = XmlRpcProxyGen.Create<IServiceSystem>(); Drupal cnct = iss.Connect(); // сначала выполняем подключение string timestamp = GetUnixTimestamp(); string nonce = GetNonce(10); string domain = "domain"; string key = "s5741111141bbe123b211e77ccf4ca304"; // api key берем созданный нами на сайте StringBuilder sb = new StringBuilder(); sb.Append(timestamp); sb.Append(";"); sb.Append(domain); sb.Append(";"); sb.Append(nonce); sb.Append(";"); sb.Append("user.login"); string hash = GetHMAC(sb.ToString(), key); Drupal lgn = iss.Login(hash, domain, timestamp, nonce, cnct.sessid, "мой_логин", "мой_пароль"); // выполняем вход, используя полученный ранее cnct.sessid // теперь подготавливаем материал к постингу (тип - "Страница") var saveData = new XmlRpcStruct(); saveData["title"] = "Первая страница!"; saveData["body"] = "Некоторый текст"; saveData["field_tseloe"] = 1; // CCK поле saveData["type"] = "page"; // или свой тип nonce = GetNonce(10); hash = GetHMAC(timestamp + ";" + domain + ";" + nonce + ";node.save", key); iss.NodeSave(hash, domain, timestamp, nonce, lgn.sessid, saveData); } |
Дополнительные функции:
|
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 |
public string GetUnixTimestamp() { TimeSpan ts = (DateTime.UtcNow - new DateTime(1970, 1, 1, 0, 0, 0)); return Convert.ToString(Convert.ToUInt64(ts.TotalSeconds)); } // Similar to the 'user_password' function Drupal uses. public string GetNonce(int length) { string allowedCharacters = "abcdefghijkmnopqrstuvwxyzABCDEFGHJKLMNPQRSTUVWXYZ23456789"; StringBuilder password = new StringBuilder(); Random rand = new Random(); for (int i = 0; i < length; i++) { password.Append(allowedCharacters[rand.Next(0, (allowedCharacters.Length - 1))]); } return password.ToString(); } // вычисление SHA256 public string GetHMAC(string message, string key) { System.Text.ASCIIEncoding encoding = new System.Text.ASCIIEncoding(); byte[] keyByte = encoding.GetBytes(key); byte[] messageByte = encoding.GetBytes(message); HMACSHA256 hmac = new HMACSHA256(keyByte); byte[] hashMessageByte = hmac.ComputeHash(messageByte); string sbinary = String.Empty; for (int i = 0; i < hashMessageByte.Length; i++) { // Converting to hex, but using lowercase 'x' to get lowercase characters sbinary += hashMessageByte[i].ToString("x2"); } return sbinary; } |
Из-за string CCK-полей VS у меня ругалась “Response from server does not contain valid xml” и “Существует несколько корневых элементов” (“There are multiple root elements”). Fiddler показал ошибку “Cannot unset string offsets”.
Исправил применением патча
|
1 2 3 4 5 6 |
- unset($items[$field['field_name'] .'_add_more']); + if (is_array($items)) { + if(!empty($items[$field['field_name'] .'_add_more'])) { + unset($items[$field['field_name'] .'_add_more']); + } + } |
к файлу /sites/all/modules/cck/includes/content.node_form.inc
Скачать проект Visual Studio 2008: drU-XRPC.cab
Fuzzy Clock — Неточные часы
Сами часы я впервые увидел в 2003-м году в KDE и в 2004-м написал свои под win32.
Вкратце, »неточные часы« позволяют взглянуть на время не языком цифр, а разговорными фразами.
»Сколько времени?« – мысленно задается вопрос, и глаза тянутся в область системного лотка.
»Без десяти час« – отвечают часы.
Вы можете регулировать степень неточности часов – например, »будни/выходные«, затем день недели, затем утро/день/вечер/ночь, и так далее – вплоть до точности 5 минут.

Исходный код:
github.com/fuzzyClock




– – – – – – –
Ссылки:
https://extensions.gnome.org/extension/202/fuzzy-clock
Скачать римейк версии 2.1 от 12.01.2004 (для Windows): fuzzy_clock_3.1.cab
L0mFin BCB 6
Программа, написанная в юности для ломбарда конца 90х
Что использовалось:
– ADO – MDAC 2.6
– Indy 9
– DevExpress Vertical Grid
– EhLib DBGridhEh

Если при запуске программы была нажата правая клавиша ‘Windows’, то программа переходила в монопольный режим для смены пароля на базу данных
|
1 2 |
#define VK_RWIN 0x5C if (GetKeyState(VK_RWIN) < 0) |
вот так выглядело окно добавления нового залогового билета (когда кто-то закладывал видеокамеру, плеер, сегу, DECT, КПК, или пейджер)

Уеннар
VIM [ad]ventures – после третьего уровня подписка становится платной
Regex [ad]venture – Условно-бесплатная
robocode
codecombat
colobot
codemonkey
Ребилд кеша иконок (C++, Windows)
Пересоздать (перестроить) кеш иконок Windows, так, как это делала Microangelo On Display:

|
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 |
#define NO_WIN32_LEAN_AND_MEAN #include <string> #include <shlobj.h> #include <tchar.h> #include <registry.hpp> #include <sstream> #define SSTR( x ) static_cast< std::ostringstream & >( \ ( std::ostringstream() << std::dec << x ) ).str() const std::string keyWindowMetrics = "Control Panel\\Desktop\\WindowMetrics\\"; std::string paramShellIconSize = "Shell Icon Size"; bool regWriteString(HKEY rootKey, std::string Key, std::string paramName, std::string Value) { bool ret = false; TRegistry *reg = new TRegistry(KEY_WRITE); try { reg->RootKey = rootKey; reg->OpenKey(Key.c_str(), true); reg->WriteString(paramName.c_str(), Value.c_str()); reg->CloseKey(); } __finally { delete reg; } return ret; } std::string regReadString(HKEY rootKey, std::string Key, std::string paramName) { std::string ret; TRegistry *reg = new TRegistry(KEY_READ); try { reg->RootKey = rootKey; if(reg->OpenKeyReadOnly(Key.c_str())) ret = reg->ReadString(paramName.c_str()).c_str(); reg->CloseKey(); } __finally { delete reg; } return ret; } std::string WindowsDir() { char buffer[255]; GetWindowsDirectory(buffer, sizeof(buffer)); return buffer; } static BOOL _stdcall PASCAL UpdateAllWindowsCallback(HWND WHandle, void *Parm) // Parm Pointer { SendMessage(WHandle, WM_SETTINGCHANGE, 0, 0); return true; } void _stdcall UpdateAllWindows() { EnumWindows((int (__stdcall *)())UpdateAllWindowsCallback, WM_SETTINGCHANGE); } std::string GetIconCacheFile() { TCHAR winDir[MAX_PATH]; SHGetSpecialFolderPath(0, winDir, CSIDL_WINDOWS, false); AnsiString aStr_winDir = winDir; AnsiString s_winDir = aStr_winDir + "ShellIconCache"; return s_winDir.c_str(); } void DeleteIconCache() { std::string sfile; sfile = GetIconCacheFile(); if(FileExists(sfile.c_str())) { if (!DeleteFile(sfile.c_str())) ShowMessage("Can not erase file!"); // Can not erase file [sfile] } ////////////////////////////////////////////////////////////////////////////////////// // Здесь необходимо проверить, необходима ли перезагрузка ОС ////////////////////////////////////////////////////////////////////////////////////// } bool RefreshActiveDesktop() { TGUID CLSID_ActiveDesktop = StringToGUID("{75048700-EF1F-11D0-9888-006097DEACF9}"); //IActiveDesktop ActiveDesktop; HRESULT hr; IActiveDesktop* pIAD; try { // Вместо Borland-овской функции CreateComObject(CLSID_ActiveDesktop) используем CoCreateInstance(ShlObj::CLSID_ActiveDesktop) // 1. Инициализация библиотеки COM (заставляем Windows загрузить библиотеки DLL). CoInitialize(NULL); // Создаем COM-объект, используя CO-класс Active Desktop, поставляемый оболочкой. // Четвертый параметр сообщает COM какой именно интерфейс нам нужен (IActiveDesktop). hr = CoCreateInstance(CLSID_ActiveDesktop, NULL, CLSCTX_INPROC_SERVER, IID_IActiveDesktop, (void**)&pIAD); // ???? | CLSCTX_LOCAL_SERVER, ???? if (SUCCEEDED(hr)) { // Если COM-объект был создан, то вызываем его метод hr = pIAD->ApplyChanges(AD_APPLY_ALL || AD_APPLY_FORCE); // ActiveDesktop = CreateComObject(CLSID_ActiveDesktop) as IActiveDesktop; // ActiveDesktop.ApplyChanges(AD_APPLY_ALL or AD_APPLY_FORCE); } } catch(...) { // Exception // cout << _T("CoCreateInstance() failed.") << endl return false; } // __finally { // Освобождаем интерфейс. pIAD->Release(); // Разинициализируем библиотеку COM CoUninitialize(); return true; } } void RefreshDesktop() { HWND Hwnd; bool fl; fl = RefreshActiveDesktop(); if (!fl) { Hwnd = FindWindow("Progman", "Program Manager"); if (Hwnd != 0) SendMessage(Hwnd, WM_COMMAND, 0xA065, 0); else UpdateAllWindows; } } void RebuildIconCache() { std::string news, olds; int sz; // Changing cursor to clock - StartWait(); try { DeleteFile(GetIconCacheFile().c_str()); olds = regReadString(HKEY_CURRENT_USER, keyWindowMetrics, paramShellIconSize); sz = StrToIntDef(olds.c_str(), 32); ++sz; news = SSTR(sz); regWriteString(HKEY_CURRENT_USER, keyWindowMetrics, paramShellIconSize, news); UpdateAllWindows(); if(olds == "") olds = "32"; regWriteString(HKEY_CURRENT_USER, keyWindowMetrics, paramShellIconSize, olds); UpdateAllWindows(); RefreshDesktop(); } catch(...) { } // StopWait(); } |

