windows,git,gitattributes,core.autocrlf
.gitattributes overrides all config settings, so it really can't be overridden; it is the "overrider," so to speak. While you can simply remove the line, this will cause inconsistent behavior on other developers' machines if they have core.autocrlf=true. So the best bet would be to add the following line to...
windows,batch-file,cmd,fortran
Instead of checking the path variable, directly check if the compiler is available where ifort >nul 2>&1 || call "%MY_PATH%\ifortvars.bat" intel64 where command will search for the indicated program inside the path and if found it echoes to console its path. If it does not find the program it echoes...
So, yes, Windows passes the file name into the script as one of the sys.argvs. It is (so far as I can tell from printing the value) a file name without the path, that I used to open the file, so that tells me that Windows starts my program with...
You can check the system's event log to determine what product is triggering the installation or repair. Please see these two posts for details: How can I determine what causes repeated Windows Installer self-repair? Uninstalling an MSI file from the command line without using msiexec Cleanup pending installation ...
mysql,windows,operating-system,scheduled-tasks,mysqldump
I think I've found it. The command to give to the scheduler is cmd.exe. In the parameters, the command file to be executed: /C commandfile.cmd And in commandfile.cmd add date and time (without the slashes, depending on your local settings): @echo off set YEAR=%DATE:~6,4% set MONTH=%DATE:~3,2% set DAY=%DATE:~0,2% "C:\Program Files\MySQL\MySQL...
Do not read anything into the identifiers chosen for Windows time zones. "W. Europe Standard Time" does not mean anything in particular, other than it's the ID for this specific time zone entry. It is indeed more accurate to state that Italy uses Central European Time, or Central European Summer...
windows,git,powershell,github,go
The root cause has been found: Because my computer use a web proxy, so I need to set proxy in environment variable: C:\Users\xiaona>set https_proxy=https://web-proxy.corp.hp.com:8080/ C:\Users\xiaona>set http_proxy=https://web-proxy.corp.hp.com:8080/ C:\Users\xiaona>go get -v gopkg.in/fatih/pool.v2 Fetching https://gopkg.in/fatih/pool.v2?go-get=1 Parsing meta tags from https://gopkg.in/fatih/pool.v2?go-get=1 (status code 200) get "gopkg.in/fatih/pool.v2": found meta tag main.metaImport{Prefix:"gopkg.in/fa tih/pool.v2", VCS:"git",...
Supply program with parameters to your batch script as follows C:\Siemens\NX10\UGII\setup_NX10_environment.bat "C:\Siemens\NX10\UGII\ugraf.exe" -nx and improve that batch as follows: rem all the original setup_NX10_environment.bat stuff here %* exit or rem all the original setup_NX10_environment.bat stuff here call %* exit or rem all the original setup_NX10_environment.bat stuff here start "" %*...
msg.exe is not available on all Windows platforms in all environments. There is just %SystemRoot%\Sysnative\msg.exe (64-bit), but no %SystemRoot%\SysWOW64\msg.exe (32-bit) on Windows 7 x64 Enterprise. Either the batch file is called with using explicitly %SystemRoot%\Sysnative\cmd.exe or inside the batch file %SystemRoot%\Sysnative\msg.exe is used on a Windows x64 machine while on...
See MSDN documentation at https://msdn.microsoft.com/en-us/library/cc249520.aspx, 0x104 = 260 characters. Not a lot... On file shares, NTFS supports file paths of up to 32K characters but for some reason you need to specify, when saving, that you want to use this feature by prefixing your path name with \\?\, for instance...
c++,windows,visual-studio-2012,fftw
For single precision routines in FFTW you need to use routines with an fftwf_ prefix rather than fftw_, so your call to fftw_plan_dft_r2c_2d() should actually be fftwf_plan_dft_r2c_2d().
ruby-on-rails,ruby,windows,nokogiri,ruby-2.1
I would propose upgrading to nokogiri 1.6.6.2, the latest version. It works just fine on windows using ruby 2.1.5.
The array exposed by the Lines property is zero based. You will want to change your for loop declaration to this: for (i=0;i<richTextBox1.Lines.Length;i++) As your code looks now you will try to access elements in the array that are out of bounds (as well as missing the first line)....
copy that file and paste in desktop edit what you want then paste into C:\Program Files\NetBeans 8.0.2\ location its works
Substring operations are not available in for replaceable parameters. You need to assign the data to a variable and then execute the operation on this variable @echo off setlocal enableextensions disabledelayedexpansion >"tempFile" ( echo bob binson echo ted jones echo binson ) set "pattern=binson" for /f "usebackq delims=" %%a in...
The way I'd check for the Java version is running a simple class with the following: class VersionChecker { public static void main(String[] args) { System.out.println(System.getProperty("java.version")); } } EDIT: The reason why is that java -version will give something like this: java version "1.8.0_45" Java(TM) SE Runtime Environment (build 1.8.0_45-b14)...
windows,batch-file,cmd,batch-processing
I suspect you have problems with it because it has Unix line endings instead of DOS style line endings. This appears to work, but it's a bit brittle - tied to the position of the contents of the example you linked: for /f "usebackq delims== tokens=28" %%a in (`findstr /n...
c#,.net,windows,winforms,sharpdevelop
Your program is looking for compas.ico inside the build directory, while it probably resides in some other directory in your project.
you can use httpd.exe -S it will list the config files used by all VHOSTs
python,windows,touchscreen,psychopy
I've managed this using a hook into the WndProc, it's not pretty but it works. The solution, for posterity: https://github.com/alisdt/pywmtouchhook A brief summary: I used a combination of ctypes and pywin32 (unfortunately neither alone could do the job) to register the target HWND to receive touch messages, and replace its...
Yes, we can't clear it on Windows as far as I know. If there is one escape that we can output to the IO device to clear screens on Windows, I would love to know and add this functionality to Windows too. :)
ruby,windows,batch-file,cmd,watir-webdriver
Try next approach: pushd %USERPROFILE%\Desktop start "1" cmd /k ruby script_1.rb start "2" cmd /k ruby script_2.rb start "3" cmd /k ruby script_3.rb ...
In general, when a batch file invokes another one, the flow execution is transfered to the called batch and does not return to the caller. To allow the caller retrieve the execution flow, it is necessary to use the call command. for /l %%x in (1,1,120) do ( echo %%x...
windows,batch-file,scripting,cmd
you don't need to parse the file line by line. @echo off :START cls echo. set /p "cho=Enter a word: -> " findstr /i "\<%cho%\>" yourwords.txt >nul 2>&1 if %errorlevel%==0 ( echo. echo Sorry! that word is repeated word. echo. ) else ( echo. echo That is a new word....
linux,windows,sockets,network-programming,raspberry-pi
InputStream input = client.getInputStream(); BufferedReader in = new BufferedReader(new InputStreamReader(input)); Your problem is here. You can't use multiple inputs on a socket when one or more of them is buffered. The buffered input stream/reader will read-ahead and 'steal' data from the other stream. You need to change your protocol so...
c++,windows,visual-c++,linker,linker-error
The problem was with the environment variable link that you used. The MS linker also uses this variable for flags. From https://msdn.microsoft.com/en-us/library/6y6t9esh.aspx: The LINK tool uses the following environment variables: LINK, if defined. The LINK tool processes options and arguments defined in the LINK environment variable before processing the command...
I changed the code to the following: var cursor = collection.Find(filter).ToCursorAsync(); cursor.Wait(); using (cursor.Result) { while (cursor.Result.MoveNextAsync().Result) { And it worked as expected. In the same way, the count works when I change it to: var temp = collection.CountAsync(new BsonDocument()); temp.Wait(); var count = temp.Result; ...
You can write it straight out as RGB in binary like you already have - say to a file called image.rgb. Then use ImageMagick, which is installed on most Linux distros, and available for OSX and Windows to convert it to PNG, JPEG or something more common: convert -size 300x400...
Simple answer: yes. But how to do it properly can be tricky. The basic strategy would be to wrap calls to your map in critical sections, including wrapping the lifetimes of iterators. But you also need to make sure that your app's assumptions about the map are handled carefully as...
As mentioned in this blog entry, the asynchronous work needs to be encapsulated in a background task deferral public async void Run(IBackgroundTaskInstance taskInstance) { BackgroundTaskDeferral _deferral = taskInstance.GetDeferral(); Debug.WriteLine("Test"); Debug.WriteLine(DateTime.Now.ToString("g")); StorageFolder dataFolder = ApplicationData.Current.LocalFolder; StorageFile logFile = await dataFolder.CreateFileAsync("logFile.txt", CreationCollisionOption.OpenIfExists); IList<string> logLines = await...
c++,windows,com,ms-media-foundation
As Roman pointed out, you can avoid dealing with the PROPVARIANT structure, by using the utility functions to access the IMFAttributes store. However, as #7 points out on the page you referenced: Query the media type for the MF_MT_FRAME_RATE_RANGE_MAX and MF_MT_FRAME_RATE_RANGE_MIN attributes. This values give the range of supported frame...
python,windows,batch-file,python-3.x
May be changing / to \\ in Popen can help.
windows,powershell,batch-file,recursion,cmd
If you retrieve all images using the Get-ChildItem cmdlet you can group it by directory and get all information you need: $root = 'c:' $7zipPath = "C:\Program Files\PeaZip\res\7z\7z.exe" Get-ChildItem $root -recurse -Filter '*.jpg' | group Directory | select -expand name | foreach { $directoryName = get-item $_ | select -expand...
Sure. Use tasklist to find the window based on its title, then taskkill to kill it by PID. @echo off setlocal for /f "skip=3 tokens=2" %%I in ( 'tasklist /fi "windowtitle eq Reminders.rtf - WordPad"' ) do taskkill /im "%%I" Or just taskkill /fi "windowtitle eq Reminders.rtf - WordPad" ...
You need to dig into the Windows SDK headers to see how large the type is. For example, for a 64 bit process, sizeof(HWND) is 8 in C++ and sizeof(int) is 4 in C# therefore if you use int to store HWND, you are corrupting memory. Same for HKEY, LPITEMIDLIST,...
vb.net,windows,visual-studio-2010,ms-access
There a number of other problems with the code (sql injection, sharing a connection among several commands), but here's a step in the right direction: Try conn.Open() cmdfoods.ExecuteNonQuery() cmdservices.ExecuteNonQuery() cmdreservations.ExecuteNonQuery() bill.ExecuteNonQuery() success = True Catch success = False Finally conn.Close() End Try A more-complete solution: Private Function save_to_data() Dim sql...
Did you do step 3 and 4 here? : Combining Qt 5.4.1 with vtk 6.2.0 (using CMake GUI 3.2.1) on windows I'm guessing you didn't change VK_QT_VERSION to 5...
some processes launched via "spyder 2.3.4 version in Winpython" in a separate process don't want to die when they should. I'm really not sure where is the problem, but your issue looks a little bit like mine, so: bottle and Windows seem not the guilty guys. spyder 2.3.5 or recent...
It turns out the delay is the Microsoft antivirus program scanning the executable each time it's run. Disabling protection on that file cuts the time to 47 milliseconds.
Just change your PATH environment variable to put C:\PythonXX\Scripts (where XX is the version of Python, usually 27 or 34) at the beginning. Click on My Computer -> Properties -> System Properties -> Advanced -> Environment Variables, then select Path in either the System Variables section (if you have Administrator...
You are calling the script wrong Bring up a cmd (command line prompt) and type: cd C:/Users/user/PycharmProjects/helloWorld/ module_using_sys.py we are arguments And you will get the correct output....
mkdir(), by default, creates only one subdirectory per execution. You are are trying to create two at the same time. You can either make two calls like so: mkdir("upload"); mkdir("upload/2015-06-21"); or use the recursive option like so: mkdir("upload/2015-06-21", 0777, true); ...
It seems that the 2nd arg is being interpreted (either in rust or c) as sizeof string, rather than the value passed from the Rust code. Correct. You are experiencing undefined behavior here. Your C-Function has a different signature from the extern function you declared in Rust-Code. First of...
windows,osx,ffmpeg,file-conversion,wmv
You can try a codec for encoding instead. Try this. ffmpeg -i input_gif -b:v 2M -vcodec msmpeg4 -acodec wmav2 output_wmv You may find this important....
I have no idea what the magical Windows incantations are to control what displays on the terminal but in general instead of calling system() and letting the command it calls produce it's own output that's getting mixed in with the awk output, use getline to read the result of the...
windows,batch-file,service,cmd,pid
Try the following code: FOR /F "tokens=3" %%A IN ('sc queryex %serviceName% ^| findstr PID') DO (SET pid=%%A) IF "!pid!" NEQ "0" ( taskkill /F /PID !pid! )...
If I understand correctly, you want to pull out all of the matches from an entire file, and write those results to a separate file. This will work if the below results are what you're after. I don't have a Windows box to test on, but this should work (you...
java,windows,command-line,classnotfoundexception
You have add the JAR to the CLASSPATH, not the folder which contains this JAR. So the -cp argument should something be like this C:\Users\ANNA\Downloads\SimplifiedConnectionProvider.jar;C:\Users\ANNA\Downloads\Windows64_Libjitsi\the_name_of_the_JAR.jar.
for %%f in (*.pdf) do ( set x=%%f ) echo %x% Assuming there's only one PDF in the current directory....
python,json,windows,osx,encoding
I get your OSX failure on Windows, and it should fail because writing a Unicode string to a file requires an encoding. When you write Unicode strings to a file Python 2 will implicitly convert it to a byte string using the default ascii codec and fails for non-ASCII characters....
You'll need to install (or enable) the Socket PHP extension: http://www.php.net/manual/en/sockets.installation.php You can enable the sockets extension on wamp, Wamp Icon -> PHP -> PHP Extensions -> Check php_sockets . If its already checked ,please inform me. Second way, call php in Administrator privilege CMD command line.So please open your...
linux,windows,perl,process,stdin
This isn't a Windows verus Linux thing. You simply picked two awful examples. type con reads from the console, not from STDIN. This can be seen using type con <nul. cat is extremely unusual. Buffering, on either system, is completely up to the individual application, but almost all applications work...
windows,.htaccess,redirect,isapi-rewrite
You need to check HTTP_HOST in your condition to check for the domain and then redirect based on that. RewriteEngine On RewriteCond %{HTTP_HOST} ^(www\.)?foo\.bar [NC] RewriteCond %{REMOTE_ADDR} !^123\.456\.789\.000 RewriteCond %{REQUEST_URI} !/maintWWW.html$ [NC] RewriteCond %{REQUEST_URI} !\.(jpe?g?|png|gif) [NC] RewriteRule .* /maintWWW.html [R=302,L] RewriteCond %{HTTP_HOST} ^(www\.)?bar\.foo [NC] RewriteCond %{REMOTE_ADDR} !^123\.456\.789\.000 RewriteCond %{REQUEST_URI} !/maintWWW2.html$...
windows,batch-file,cmd,scripting
You may avoid all the option identification problems if you use choice instead set /P. Choice command will respond just to a limited set of keys defined by you, so its answer is always correct. @echo off :START cls echo Choose your option & echo. echo [P] play echo [R]...
windows,string,batch-file,space
your line set temp=%%c is the reason. There are spaces at the end. Use this syntax to avoid unintended spaces: set "temp=%%c" ...
You could use powershell if you want. I think this would work. $names = (gc core.txt) $idx = 1 gci core*.jpg | %{ $newname = $names[$idx++].trim().split("`t")[0] + ".jpg" ren $_ $newname } Edit: It's this .trim().split("`t")[0] part that splits each line of core.txt on tabs and returns the first element....
windows,string,parsing,batch-file,xml-parsing
This should work: @ECHO OFF SETLOCAL ENABLEDELAYEDEXPANSION FOR /F "tokens=*" %%a in (pictures.xml) DO ( SET b=%%a SET b=!b:"=+! FOR /F "delims=+ tokens=2" %%c in ("!b!") DO ( ECHO %%c ) ) This will output only something.jpg. Here the expülanation: First we split the file into lines. Now we want...
python,windows,shell,command,virtualenv
You can activate your virtualenv and then start server using a bat file. Copy this script in to a file and save it with .bat extension (eg. runserver.bat) @echo off cmd /k "cd /d C:\Users\Admin\Desktop\venv\Scripts & activate & cd /d C:\Users\Admin\Desktop\helloworld & python manage.py runserver" Then you can just run...
A small example here: class DirectorySize { public string DirectoryName; public long DirectorySizes; } public class Program { static void Main(string[] args) { string[] cDirectories = Directory.GetDirectories("C:\\"); List<DirectorySize> listSizes = new List<DirectorySize>(); for (int i = 0; i < cDirectories.Length; i++) { long size = GetDirectorySize(cDirectories[i]); if(size != -1) {...
windows,sockets,winsock,winsock2
If you are using event handle (a member of the WSAOVERLAPPED structure) you should definitely use two different structures for sending and receiving.
This is possible by querying the WMI (Windows Management Instrumentation)'s Win32_WindowsProductActivation (XP and below) or SoftwareLicensingProduct (Vista or higher) class: Requires these namespaces to be declared: System System.Collections.Generic System.Management System.Text Declare those namespaces at the top of your codefile with using, as per se: using System; using System.Collections.Generic; using System.Management;...
c++,windows,visual-c++,mfc,keyboard-shortcuts
Hotkeys added via RegisterHotKey (or its equivalent in MFC) are definitely system global and you should not use them to trigger functions in your program unless you specifically want the user to be able to trigger them from anywhere. (e.g. your application might be a screenshot app, and so triggering...
c++,arrays,windows,winapi,text-to-speech
StringCchPrintf is not working. That is because you ignored the warning in the documentation: Behavior is undefined if the strings pointed to by pszDest, pszFormat, or any argument strings overlap. You are specifying ptrData as both pszDest and an argument string, so your code has undefined behavior. You must...
I believe you need to use: SendKeys.SendWait("^(s)"); Instead of: SendKeys.SendWait("^%s?"); Have a look at https://msdn.microsoft.com/en-us/library/system.windows.forms.sendkeys.send(v=vs.110).aspx for more information....
python,windows,python-2.7,web-scraping,scrapy
Your spider is being blocked from visiting pages after the start page by your allowed_domains specification. The value should include just the domain, not the protocol. Try allowed_domains = ["www.WebStore.com"] Also the line desc_out = Join() in your WebStoreItemLoader definition may give an error as you have no desc field....
@echo off cd /path_1 for /D %%d in (*) do ( if exist "%%d/x" ( if not exist "/path_2/%%d" md "/path_2/%%d" copy "%%d/x" "/path_2/%%d" ) ) ...
Well, you found a bug in the way the C# compiler deals with having to output text to the console when it is switched to UTF-8. It has a self-diagnostic to ensure the conversion from an UTF-16 encoded string to the console output code page worked correctly, it slams the...
It's because with powershell 2.0 you can't access an array with that method. get-WmiObject win32_physicalMemory -Impersonation 3 -ComputerName "localhost" | select -expand capacity that will work the other powershell 2.0 computers you mention probably only have one stick of memory, so it doesn't return an array...
When sending, you're assuming the data is null terminated: if((send(sockfd, buf, strlen(buf), 0)) < 0){ You should use the count actually returned by the read method, and you shouldn't use fgets() for that purpose. Your receive loop makes no sense. You're calling recv() several times and testing the result...
python,windows,scheduled-tasks
Take a look at http://apscheduler.readthedocs.org/en/3.0/ Here is an example from there site: from datetime import datetime import os from apscheduler.schedulers.blocking import BlockingScheduler def tick(): print('Tick! The time is: %s' % datetime.now()) if __name__ == '__main__': scheduler = BlockingScheduler() scheduler.add_executor('processpool') scheduler.add_job(tick, 'interval', seconds=3) print('Press Ctrl+{0} to exit'.format('Break' if os.name == 'nt'...
c++,windows,reference,system,command-line-interface
If your class of c is a ref class, you can use ^ (handle) to reference it. like the code here ref_class_c ^ d(gcnew ref_class_c); ref_class ^ e = d; As for the tracking reference versus a handle, the difference is similar to a reference/out parameter in C# method versus...
You can use Sys.info. On my system: Sys.info() # sysname release version nodename machine </snip> #"Windows" "7 x64" "build 7601, Service Pack 1" "***" "x86-64" </snip> ...
If you want nginx automatically started after system boot you should install it as a service. You can use a WMI query against the Win32_Service class to check if a service is running, and also start it in case it isn't: Set wmi = GetObject("winmgmts.//./root/cimv2") qry = "SELECT * FROM...
windows,powershell,command-line,exif,exiftool
You'll probably have to go to the command line rather than rely upon drag and drop as this command relies upon ExifTool's advance formatting. Exiftool "-SerialNumber<001-001-0001-${filesequence;$_=sprintf('%04d', $_+1 )}" <FILE/DIR> If you want to be more general purpose and to use the original serial number in the file, you could use...
you can hide it by ShowWindow(GetConsoleWindow(), SW_HIDE); Although I really think you should quit the program instead just closing the console....
You can tell the TextBox to select nothing Control nextControl; if (e.KeyCode == Keys.Enter) { nextControl = GetNextControl(ActiveControl, !e.Shift); if (nextControl == null) { nextControl = GetNextControl(null, true); } nextControl.Focus(); TextBox box = nextControl as TextBox; if (box != null) box.Select(box.Text.Length, 0); e.SuppressKeyPress = true; } ...
That error indicates that you are executing 32 bit code in the WOW64 emulator on 64 bit Windows, and trying to gain information about a 64 bit process. To get past this you should switch to running 64 bit code. So, you'll need 64 bit Python. ...
windows,cryptography,driver,signing,certificate-authority
Yes, Windows keeps a collection of trusted root certificates. Some software, such as IE and Chrome, uses that collection; some software, such as Firefox, ships with its own list. That's how certificate verification works; nobody gets root certificates from the CA over the internet, because how would you know you...
c++,windows,security,winapi,memory-mapped-files
Your service is closing its handle to the file mapping immediately after creating it, thus the mapping is being destroyed before the app has a chance to open its handle to the mapping. Your service needs to leave its handle to the mapping open, at least until after the app...
python,windows,ubuntu,vagrant,virtualbox
What I'm looking for is a way to run Ubuntu on this machine, for development work AND for personal use VirtualBox should be able to provide everything that you need. You can create a VM of your choosing, with or without a GUI and use it for whatever you...
windows,git,powershell,github,github-for-windows
After checking, it should under: %LocalAppData%\GitHub For example, in my PC, it is: C:\Users\xiaona\AppData\Local\GitHub\PortableGit_c2ba306e536fdf878271f7fe636a147ff37326ad\bin ...
This very simple sample should help you get going: set filename=files.txt set targetdir=bar set sourcedir=foo for /f %%i in (%filename%) do move "%sourcedir%\%%i" "%targetdir%" pause Note that there is absolutely no error handling. The pause at the end keeps the command window open so you can review the output type...
java,c++,windows,multithreading
Yes, the same problem exists in C++. But since C already introduce the keyword volatile with a different meaning (not related to threads), and C++ used they keyword in the same way, you can't use volatile in C++ like you can in Java. Instead, you're probably better off using std::atomic<T>...
Your batch file is called shutdown.cmd, so the line shutdown -s -t 00 -c "Shutdown Manager in process." will make the batch file call itself. Rename the batch file or change the line that calls shutdown to shutdown.exe -s -t 00 -c "Shutdown Manager in process." ...
windows,html5,apache2,vagrant,atom-editor
Actually it is an issue with sendfile protocoll when using vagrant with virtualbox: vagrant documentation The "solution" is to disable sendfile in your webserver....
The answer was that if a directory or file is not marked to be deleted then the directory in which it is in will not be deleted. (Just as IInspectable noted) "The system deletes a directory that is tagged for deletion with the MOVEFILE_DELAY_UNTIL_REBOOT flag only if it is empty."...
Your Linux result is produced using 64-bit software. The Windows result comes from 32-bit software. The difference here is the maximum size of an integer, which in a 32-bit system is 2147483647. When you try to parse the string to an integer the value is too large for a 32-bit...
windows,batch-file,text,comparison
The code below keep lines from File2.txt from the first line that differ vs. File1.txt on: @echo off setlocal EnableDelayedExpansion rem Redirect the *larger* file as input < File2.txt ( rem Merge it with lines from shorter file for /F "delims=" %%a in (file1.txt) do ( rem Read the next...