Skip to content

Instantly share code, notes, and snippets.

View proffix4's full-sized avatar
🌅
Работаю

Talipov S.N. proffix4

🌅
Работаю
View GitHub Profile
@proffix4
proffix4 / netbeans.conf
Created April 9, 2024 12:55
NetBeans 21 configuration for UTF-8
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not use this file except in compliance
# with the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
@proffix4
proffix4 / main.cpp
Created February 1, 2024 09:06
Test C++
#define _CRT_SECURE_NO_WARNINGS // отключение предупреждений о небезопасности
#include <iostream> // для cout, cin, endl
#include <stdio.h> // для printf, scanf
using namespace std; // пространство имен std
int main(int argc, char** argv) {
setlocale(LC_ALL, "Russian"); // подключение русского языка
int number1; // целое число
@proffix4
proffix4 / CppUTF8CrossPlatform.cpp
Created November 21, 2023 07:01
Cpp UTF8 Cross - platform program
#include <stdlib.h>
#include <iostream>
#ifdef _WIN32 // Если это Windows
#include <io.h>
#include <fcntl.h>
#endif
int main(int argc, char** argv)
@proffix4
proffix4 / CppConsoleUTF8win.cpp
Created November 19, 2023 17:01
Console UTF-8 application with boost
#pragma execution_character_set( "utf-8" ) // for MSVC
#include <boost/nowide/args.hpp> // for utf8_to_utf16
#include <boost/nowide/fstream.hpp> // for fstream
#include <boost/nowide/iostream.hpp> // for cout, cerr, cin, clog
using namespace boost::nowide; // for cout, cerr, cin, clog
using std::endl; // for endl
int main()
@proffix4
proffix4 / CppConsoleLinux.cpp
Created November 18, 2023 11:27
Cpp Console Linux example
#include <clocale>
#include <string>
#include <iostream>
using namespace std;
int main() {
setlocale(LC_ALL, "Russian");
string fio;
cout << "Введите строку: ";
@proffix4
proffix4 / wx_cp1251_unicode.cpp
Last active November 17, 2023 15:28
Русские буквы в C++ для Unicode-строк wxWidgets
#include <wx/wx.h>
int main(int argc, char** argv)
{
wxLocale m_locale; // Создать объект локали для wxWidgets
m_locale.Init(wxLANGUAGE_RUSSIAN, wxLOCALE_DONT_LOAD_DEFAULT); // Установить локаль для wxWidgets
#ifdef __WXMSW__ // Определение для Windows
SetConsoleCP(1251); // Установить кодовую страницу ввода для Windows
SetConsoleOutputCP(1251); // Установить кодовую страницу вывода для Windows
@proffix4
proffix4 / MyForm.cpp
Created October 21, 2023 13:06
C++ CLR Project for MS Visual Studio 2022
#include "MyForm.h"
#include <Windows.h>
using namespace Project1; // Название проекта
int WINAPI WinMain(HINSTANCE, HINSTANCE, LPSTR, int) {
Application::EnableVisualStyles();
Application::SetCompatibleTextRenderingDefault(false);
Application::Run(gcnew MyForm);
return 0;
}
@proffix4
proffix4 / launchSettings.json
Last active February 24, 2023 07:47
Полноценная отладка и запуск кроссплатформенных программ в Visual Studio 2022 с WSL
{
"profiles": {
"ConsoleApp": {
"commandName": "Project"
},
"WSL2": {
"commandName": "Executable",
"executablePath": "wsl",
"commandLineArgs": "dotnet ConsoleApp.dll [commandLineArgs]"
},
@proffix4
proffix4 / AndroidManifest.xml
Last active February 5, 2023 07:03
Проблема с разрешениями в программах на Android
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
package="kz.talipovsn.permissions">
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.READ_MEDIA_IMAGES"/>
<uses-permission android:name="android.permission.READ_MEDIA_AUDIO"/>
<uses-permission android:name="android.permission.READ_MEDIA_VIDEO"/>
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/>
@proffix4
proffix4 / TSN_CSh_lab6_Form1.cs
Created December 20, 2022 16:33
Работа с ini-файлами на C# для Windows в Visual Studio 2022
namespace TSN_CSh_lab6
{
public partial class Form1 : Form
{
public const string FILE_NAME = "Settings.ini"; // Имя файла настроек
public Form1()
{
InitializeComponent();
}