windows

Strange utf8 decoding error in windows notepad

|▌冷眼眸甩不掉的悲伤 提交于 2021-02-17 02:06:59
问题 If you type the following string into a text file encoded with utf8(without bom) and open it with notepad.exe,you will get some weired characters on screen. But notepad can actually decode this string well without the last 'a'. Very strange behavior. I am using Windows 10 1809. [19, 16, 12, 14, 15, 15, 12, 17, 18, 15, 14, 15, 19, 13, 20, 18, 16, 19, 14, 16, 20, 16, 18, 12, 13, 14, 15, 20, 19, 17, 14, 17, 18, 16, 13, 12, 17, 14, 16, 13, 13, 12, 15, 20, 19, 15, 19, 13, 18, 19, 17, 14, 17, 18,

CMake cannot find freeglut on windows in Clion

心已入冬 提交于 2021-02-17 01:54:12
问题 I've been stuck for a while now and I can't figure out how to get freeglut working. I thought I knew what it was asking me to do, so I added that set(prefix_path) line but it didn't do anything. Am I supposed to write my own freeglut-config.cmake or what? Note: I am using the freeglut for MinGW package from this website CMake File: cmake_minimum_required(VERSION 3.7) project(HW1) set(CMAKE_CXX_STANDARD 11) set(SOURCE_FILES Triangle.cpp) set(CMAKE_PREFIX_PATH "C:/freeglut") find_package(GLEW

CMake cannot find freeglut on windows in Clion

半世苍凉 提交于 2021-02-17 01:54:05
问题 I've been stuck for a while now and I can't figure out how to get freeglut working. I thought I knew what it was asking me to do, so I added that set(prefix_path) line but it didn't do anything. Am I supposed to write my own freeglut-config.cmake or what? Note: I am using the freeglut for MinGW package from this website CMake File: cmake_minimum_required(VERSION 3.7) project(HW1) set(CMAKE_CXX_STANDARD 11) set(SOURCE_FILES Triangle.cpp) set(CMAKE_PREFIX_PATH "C:/freeglut") find_package(GLEW

Regex: Select and Delete all content of file, except “DATE” format

Deadly 提交于 2021-02-16 21:49:57
问题 I have a file with many dates in the format of 03/07/2017 . For exemple: My lovely letter can't be read... academicsdirectbu.tps 10.7 k 03/07/2017 11:39 -a-- bash: remove all files except last version in file name 02/04/2015 before Table So, I want to match and delete all content except Date format. First I made a regex to find all Dates: \d{1,2}/\d{1,4}/\d{1,4} And I include this into another regex \b(?!(\d{1,2}/\d{1,4}/\d{1,4}))[\w-]+\b But, my second regex, which has to select and Delete

Regex: Select and Delete all content of file, except “DATE” format

老子叫甜甜 提交于 2021-02-16 21:48:20
问题 I have a file with many dates in the format of 03/07/2017 . For exemple: My lovely letter can't be read... academicsdirectbu.tps 10.7 k 03/07/2017 11:39 -a-- bash: remove all files except last version in file name 02/04/2015 before Table So, I want to match and delete all content except Date format. First I made a regex to find all Dates: \d{1,2}/\d{1,4}/\d{1,4} And I include this into another regex \b(?!(\d{1,2}/\d{1,4}/\d{1,4}))[\w-]+\b But, my second regex, which has to select and Delete

Python27 - on windows 10 how can i tell printing paper size is 50.8mm x 25.4mm?

主宰稳场 提交于 2021-02-16 21:00:29
问题 I have this code on windows which is working with A4 printers. But i have a very small printer, when i print something it does not print anything but only push the ticket out. TRY0: import win32ui X=0; Y=0 input_string = "Print 1234 test" multi_line_string = input_string.split() hDC = win32ui.CreateDC () hDC.CreatePrinterDC ('Dymo label printer') hDC.StartDoc ('FILE NAME FILE NAME') hDC.StartPage () for line in multi_line_string: hDC.TextOut(X,Y,line) #Y += 100 hDC.EndPage () hDC.EndDoc ()

Python27 - on windows 10 how can i tell printing paper size is 50.8mm x 25.4mm?

五迷三道 提交于 2021-02-16 20:58:07
问题 I have this code on windows which is working with A4 printers. But i have a very small printer, when i print something it does not print anything but only push the ticket out. TRY0: import win32ui X=0; Y=0 input_string = "Print 1234 test" multi_line_string = input_string.split() hDC = win32ui.CreateDC () hDC.CreatePrinterDC ('Dymo label printer') hDC.StartDoc ('FILE NAME FILE NAME') hDC.StartPage () for line in multi_line_string: hDC.TextOut(X,Y,line) #Y += 100 hDC.EndPage () hDC.EndDoc ()

How does PowerShell treat “.” in paths?

懵懂的女人 提交于 2021-02-16 20:21:27
问题 Consider the following sequence of commands upon opening a PowerShell terminal: PS C:\Users\username> cd source PS C:\Users\username\source> $dir = ".\temp" PS C:\Users\username\source> [System.IO.Path]::GetFullPath($dir) C:\Users\username\temp Now this: PS C:\Users\username> cd source PS C:\Users\username\source> powershell Windows PowerShell Copyright (C) Microsoft Corporation. All rights reserved. Try the new cross-platform PowerShell https://aka.ms/pscore6 PS C:\Users\username\source>

How to use the Windows MessageBox() C function?

点点圈 提交于 2021-02-16 20:16:07
问题 Can someone tell me how I can display a message box in C that can print variables? I mean like this: #include <stdio.h> #include <windows.h> main() { int x = 5; MessageBox(0, "Variable x is equal to %d", "Variable", 0); /* Where do I specify the variable so that 5 will display?*/ getch(); } To look like this: Variable Variable x is equal to 5. Thanks in advance! 回答1: MessageBox itself doen't support printf like formatting. You'll have to use snprintf for that: char buf[1024]; snprintf(buf,

From command line download latest Java SE Runtime Environment 8 on Windows

半腔热情 提交于 2021-02-16 19:53:14
问题 On a Windows server, I am looking for a robust way to download latest Java SE Runtimes from command-line . My requirement is to check if java is installed on the system. If java is not found, our MSI installer (created with WIX) need to connect oracle java download page and silently download java installer in the background and invoke the installer silently. Download option can be in VB script/PowerShell/batch/Java Installing java silently is easy with jre-8u121-windows-x64.exe /s option. I