expectOutputString heredoc fails on windows - phpunit

So I have a simple test which runs fine under linux but fails under windows:
$output = <<<END
HTTP/1.1 404 Not Found
X-Foo: Bar
Where am I?
END;
$this->expectOutputString($output);
// Works under linux but fails under windows
echo $response;
// Works under linux and windows
echo str_replace("\r",'',$response);
It's a standard xampp php 5.5.15 phpunit 4.7.2 installation. Tried it on two different windows machines.
Did some searching but could not come up with the magic keywords. Refuse to accept that this has not been encountered before and can't really accept the notion that I need to hack my unit tests with a str_replace due to line endings on windows.
So where is the phpunit heredoc setting that will add \r under windows or conversely, remove them from echo under windows without messing up other things?

Related

Cray aprun is adding an extra dash to program arguments - how can I stop this?

I have an MPI application which has a command line option -ss to specify an argument. I've been running this successfully on various Cray machines, including ARCHER (www.archer.ac.uk) an XC30, for years. The OS was recently upgraded and as part of this ALPS was upgraded to version 5.1.1-2.0501.8507.1.1
Now when I launch the program on the compute nodes with aprun, the program is receiving the the option as --ss.
Checking with a shell script instead of a full application
#!/bin/bash
echo $*
confirms that this option is getting double-dashed by aprun.
Clearly there is a bug in aprun (I've reported it) but how can I work around the issue until this is patched?

Rails Application.css empty when changing from Windows to Ubuntu

I'm trying to switch my Rails code from Windows to Ubuntu, and the css files have stopped working. It's the same version of the code, and the same version of rails. The only major difference that I can think of is that the Ruby version is later, but I can't see why that would affect only the css.
If I look at the html source in Windows, under application.css, I can see the different elements loaded in, one after another. Everything appears properly. However, the exact same code contains nothing on Ubuntu - just the application.css file, with require self and require tree.
There aren't any errors on the Firefox console or the terminal where I'm running rails s.
I'm guessing that it has something to do with a configuration I've made or some resource being unavailable, but without any errors, I have no idea where to start looking. Is this a Ubuntu vs Windows thing?
How do I get the css to work again?
You can try clean the asset cache from your server:
rake assets::clean
Try also run dos2unix or something - maybe the carriage returns from windows is evil on ubuntu?
find . -name -exec dos2unix {} \;

On Windows, how to run Google's Native Client run outside of Chrome?

This question is specifically about Windows (64-bit).
A similar question was asked here, but the answers appear to be specific to Linux (and perhaps OS X).
The non-Windows answer is to use sel_ldr but no such file is present in a Chrome install on Windows. nacl64.exe seem like it is the file that files the same function. This page mentions the "NaCl Process" and that even though Chrome is 32-bit process on x64 Windows, sel_ldr needs to be 64-bit and thus a separate process. I also see nacl64.exe running when my plug-in is loaded, and not running when when I just start Chrome without a NaCl plug-in loaded.
The NaCl plug-in for Visual Studio requires being run on 64-bit windows, thus the comments about 64-bit above.
On this page I found an example that was reported as successful on Linux:
~/nacl_sdk/pepper_19/tools/sel_ldr_x86_64 -B ~/nacl_sdk/pepper_19/tools/irt_x86_64.nexe hello_x86_64.nexe
and here I found this example also for Linux:
/home/ubuntu/nacl_sdk/pepper_19/tools/sel_ldr_x86_32 -a -S -B /home/ubuntu/nacl_sdk/pepper_19/tools/irt_core_x86_32.nexe <plug-in path>
so I tried some commands modeled on that but all have resulted in nacl64.exe crashing:
<user directory>\AppData\Local\Google\Chrome\Application\23.0.1271.91>nacl64.exe -B nacl_irt_x86_64.nexe <NaCL SDK root>\vs_addin\examples\hello_nacl_cpp\hello_nacl_cpp\NaCl64\newlib\Debug\hello_nacl_cpp_64.nexe
d:\><user directory>\AppData\Local\Google\Chrome\Application\23.0.1271.64\nacl64.exe -B <user directory>\AppData\Local\Google\Chrome\Application\23.0.1271.64\nacl_irt_x86_64.nexe <NaCL SDK root>\vs_addin\examples\hello_nacl_cpp\hello_nacl_cpp\NaCl64\newlib\Debug\hello_nacl_cpp_64.nexe
d:\><user directory>\AppData\Local\Google\Chrome\Application\23.0.1271.64\nacl64.exe -a -S -B <user directory>\AppData\Local\Google\Chrome\Application\23.0.1271.64\nacl_irt_x86_64.nexe <NaCL SDK root>\vs_addin\examples\hello_nacl_cpp\hello_nacl_cpp\NaCl64\newlib\Debug\hello_nacl_cpp_64.nexe
and I've verified that hello_nacl_cpp_64.nexe works when run in Chrome via a web page.
So then the question is, on Windows, how does one successfully run Google's Native Client run outside of Chrome?
You can find sel_ldr.exe and non-browser IRT in NaCl SDK in pepper_<version>/tools folder.
Note that NaCl application can't be run successfully both in browser and sel_ldr. Browser application shouldn't have main, command line application must have it. Also command line application can not use Pepper APIs since sel_ldr doesn't implement them.

How to use XULRunner to run SQLite Manager outside of Firefox in Mac OS X Lion?

I have installed XULRunner 11.0 (xr) from here:
Downloads - sqlite-manager - Extension for Firefox and other apps to manage any sqlite database - Google Project Hosting
I have followed the steps listed here:
kiveo - Mac SQLite Manager Standalone App
I have read and tried the suggestions here (though they're for version 6.0):
stackoverflow: How to Install and run a XulRunner Application on Mac OS X?
I am able to get the help listing with this command:
/Library/Frameworks/XUL.framework/xulrunner-bin -h
I am able to run the app from Firefox using this command (after changing the max version in sqlitemanager-xr-0/application.ini to 11.0 from 11.0a1):
/Applications/Firefox.app/Contents/MacOS/firefox --app ~/Downloads/sqlitemanager-xr-0/application.ini
Here are the contents of the application.ini file:
[App]
Name=sqlite-manager
ID=SQLiteManager#mrinalkant.blogspot.com
Version=0.7.7
BuildID=201111132204
Vendor=lazierthanthou
Copyright=Copyright (c) 2008 - 2011 lazierthanthou
[Gecko]
MinVersion=2.0
MaxVersion=11.0
[XRE]
EnableExtensionManager=1
When I run the following command in Terminal, with or without sudo, it just immediately returns to the command prompt. There are no error messages. No application appears under Applications. Nothing seems to happen at all. (And, despite the stackoverflow page above noting that --install-app may not really be supported, it is in the XULRunner help listing - which I guess doesn't necessarily mean it'll work ;)
/Library/Frameworks/XUL.framework/xulrunner-bin --install-app Downloads/sqlitemanager-xr-0/ /Applications
Following a suggestion below, I checked for an exit code. The line above is returning 2.
Help?
Just like you did with Firefox, this command should run your app:
/Library/Frameworks/XUL.framework/xulrunner-bin --app ~/Downloads/sqlitemanager-xr-0/application.ini
Also, the --app switch is optional within XULRunner.
Here's how you can make a self-contained application you can run from the Dock.
Use the xulrunner --install-app command to create the application and then copy all contents of XUL.framework/Versions/Current into the generated application at /Applications/sqlite-manager.app/Contents/MacOS.
You can then create a wrapper script that runs the xulrunner within the generated app with the application.ini file as described here.
For example, put the following into sqlite-manager.app/Contents/MacOS/sqlite-manager and make it executable.
#!/usr/bin/env bash
APP_PATH="/Applications/sqlite-manager.app"
"$APP_PATH/Contents/MacOS/xulrunner" --app "$APP_PATH/Contents/Resources/application.ini"
Now you have to tell OS X to run sqlite-manager instead of xulrunner. You can do that by editing sqlite-manager.app/Contents/info.plist and setting CFBundleExecutable to sqlite-manager like this:
<key>CFBundleExecutable</key>
<string>sqlite-manager</string>
The only limitation of this approach is that it breaks when you move the application or rename it. I'd love suggestions on how to get rid of the absolute path within the sqlite-manager script.
try this:
firefox -chrome chrome://sqlitemanager/content/sqlitemanager.xul
or on OS X
/Applications/Firefox.app/Contents/MacOS/firefox -chrome chrome://sqlitemanager/content/sqlitemanager.xul
(found on http://www.egeek.me/2013/09/07/how-to-run-sqlite-manager-with-a-single-command/)
works fine for me on UBUNTU 12.04 to start sqlite manager without starting firefox first
If the install was successful, I think the app should be available in some usual place for your system (which wasn't mentioned, but I'm guessing OSX :). Have you looked under /Applications?
To see whether the command failed quietly, you could check its return value. Is there a verbose switch?
$ cd narnia
bash: cd: narnia: No such file or directory
$ echo $?
1
$ cd .
$ echo $?
0
$ cd narnia && echo "success"
bash: cd: narnia: No such file or directory
$ cd . && echo "success"
success

Qt installation error after trying all suggested

I think I tried everything on my Win7 64 machine but still got this error.
Run installer (Qt_SDK_Win_offline_v1_2_en.exe) as administrator in compatibility mode on XP SP2.
Include the directory containing nmake and cl into system path
reinstall it about 10 times without success.
I verified that the installer worked fine with a Win32 machine.
What else can I try to make this installed without an error?
UPDATE: I just gave up the SDK and downloaded library only. It worked without any problem.
The problem might be how you defined the environment variable.
If you notice the path in the error message, it contains double slashes before the bin directory: harmattan_10.2011.34-1\\bin and this is a problem on Windows.
You also can't have both \ and / defining a path. Use \ only.

Resources