Run tests in popup - textmate

In TextMate 1 when I do cmd+R in tests - it opens a popup. In TextMate 2 it shows the running tests in the footer panel.
How can I get the popup back?

You can take a look at these release notes below:
http://tm2tips.tumblr.com/post/14373351819/8949-released (The first point)
From the textmate blog:
http://wiki.macromates.com/FAQ/TextMate2ExpertPreferences
So the command should be
defaults write com.macromates.TextMate.preview htmlOutputPlacement bottom
or
defaults write com.macromates.TextMate.preview htmlOutputPlacement right
depending on where you want the window. (The default value is "window").

Related

How do I play a blf file in CANalzyer

I'm somewhat new to using CANalyzer and have never used the logging feature in the product. I was sent a BLF file to analyze and am unsure how to use it. Can someone point me in the right direction? Thanks
To be a little more specific:
Set the offline mode in the standard toolbar.
Click on the configuration tab, usually at the bottom of the window. You will see the Measurement Setup window.
Double click on the Configuration of the Log Files block - there you can add your recorded log file (should be in .blf format).
For more CANalyzer documentation, you can go to: https://kb.vector.com/29/
When the .blf file is ready, after logging the activity in CANalyzer, open with desired workspace and change the mode to Offline mode.
In "Measurement Setup" make sure that the mode is "Offline" and now right click on the icon which comes as input to Offline block.
Click "Configuration" and in the next window, remove unwanted file selection and Add your required .blf file and press OK.
Now press F9 or select the "Start" icon on the tool bar.
After these steps, the activity logged will play in the corresponding tab.
This is not replaying the CANoe but it is analyzing the traces from given logs.
For Replaying you need to add this logs into real time ECU running with all configurations

Open a new Firefox tab without focusing the browser window

I know that I can open a tab in Firefox from another program, for example using the following command:
firefox -new-tab https://stackoverflow.com/
When running this command, however, the Firefox window will get the focus (at least on Fedora 21 with Gnome 3). This is really annoying: My use case is that I browse through the headlines in my feed reader, which is a standalone program, and hit "open in browser" (which executes a configurable command, see above) on every article I'd like to read, before reading even one. This is necessary for example when I want to open tabs while I'm online but read them later while commuting or traveling.
Thus, my question boils down to the following:
Is there any way I can open a link in Firefox without needing to hit Alt+Tab every time to switch back from Firefox to the program I opened the tab with?

Is it possible to run terminal/command prompt inside Rubymine?

I would work much faster if I could have some kind of command line running inside rubymine, is this possible? When testing I repeatedly have to switch to my terminal window and it gets quite annoying.
I can run rails console and also the sandboxed version side rubymine aswell as my rails server and spork server.
It would be nice to have a command prompt inside rubymine also would speed things up. Infact that would make rubymine 100% perfect for my rails development as it does everything else require.
There is no such feature in IDEA platform based products. You need to run terminal externally. Note that you can create an External Tool to run terminal window in the current file or module directory for convenience.
UPDATE: Terminal (SSH console) was added in PhpStorm/WebStorm 7.0, IDEA 13, RubyMine 6, PyCharm 2.7.3.
I have used CrazyCoder's instructions to do this. Here are the instructions for Windows:
File, Settings
bottom half of menu is titled IDE Settings, look in this list to find External Tools
Click in the only available button (for most), [+]
give your custom thing a name ("terminal"? "command prompt"?)
most of this stuff you just leave blank
click the [...] button next to Program, then simply navigate to Windows/system32/cmd.exe
Lastly, unless you want to have your starting command line (terminal) path as C:\Windows\system32 (CHANGE YOUR PATH), simply click on the [...] next to the "Working Directory" just below, and change your path to Desktop or whatever it is you prefer.
Click OK.
You're done! It's that easy. Now to access this (no restart required), click on Tools, and then under 'XML actions' (for me anyway) you should find your "terminal" or "cmd" or whatever it is you called it. You can test it out with an 'ipconfig' command. You can always go back to the the settings/external-tools place you went to in the first place to edit your settings (like your default path), or to make another custom tool, because this (RubyMine External Tools creator) is obviously a very powerful tool.
If someone is searching this for rubymine in version 7.
Press Alt+f12 for the terminal.
Source : https://www.jetbrains.com/ruby/webhelp/working-with-embedded-local-terminal.html

Problems running Ruby program with Aptana Studio

The request below is based upon an earlier version posted on the Aptana Tender site, where it didn't receive a response - presumably because the Aptana Tender site has now been deprecated in favour of StackOverflow.
I'm using Eclipse 3.6.2.r362_v20110210 with the Aptana Studio plugin version 3.0.3.201107141410 (i.e. all fully up-to-date, I believe) on Mac OS X 10.6.8 Snow Leopard on a Macbook.
I created a Ruby project, and then created a single file inside it called "item.rb", into which I wrote some Ruby code.
The file is very short: it defines an "Item" class with an initialisation method that asks the user for a value (using a "puts" followed by a "gets.chomp") and a get method that returns the value, and it also contains two more lines: one to create a new Item, and one to call that method on the newly-created Item.
When I run "ruby item.rb" from the Terminal, it works as expected: it asks the user for a value, and returns that value. No errors/warnings.
Now, I don't want to have to use the Terminal every time I want to execute the file, but I'm having trouble getting it running any other way.
Here are the steps to reproduce:
In the main Eclipse menu, go to Window > Open Perspective > Other.
In the resulting dialogue box, click "Ruby" and click "OK".
In the Script Explorer view, click the triangle next to the name of the project containing the file I want to run, so that the project's contents are shown.
In the Script Explorer view, double-click on the name of the file I want to run (item.rb).
This causes item.rb to open in an editor view, and gives that view focus (i.e. the editor view containing item.rb has a blue rather than a grey border, and there is an active cursor inside the view).
Click the "Run" button on the Eclipse toolbar (the one that looks like a green "Play") button.
THE FIRST PROBLEM: a "Run as..." dialogue box pops up (I don't know why) asking me to "Select a way to run 'item.rb'". It gives me two options (again, I don't know why): "Android Application", "Ruby Application".
Expected behaviour: because item.rb is a file ending in ".rb" and containing only valid Ruby code, Eclipse/Aptana should, by default, run it as a Ruby application.
I click "Ruby Application", and then click "OK".
THE SECOND PROBLEM: the dialogue box disappears, but nothing else happens.
Expected behaviour: the Console view should get focus, and item.rb should be executed, with the results showing up in the Console view's textarea.
By this point, it would be reasonable to give up. But programmers are unreasonably persistent, right? So: click the Console tab.
The Console view's header says, "item.rb [Ruby Application] /usr/bin/ruby", and below this is a blank textarea containing only a blinking cursor.
Press the <Return/Enter> key on the Macbook's keyboard once or twice.
THE THIRD PROBLEM: the Console view's textarea suddenly updates with the output of item.rb, but weirdly, it doesn't stop at gets.chomp, it just acts as though the user has entered an empty response at that stage (i.e. as though the user has simply pressed the <Return/Enter> key on the keyboard), and ploughs on until the entire program has executed. The Console view's header then changes to "<terminated> item.rb [Ruby Application] /usr/bin/ruby".
Expected behaviour: item.rb should execute in the Console view just as it does in the Terminal.
Please can you help me troubleshoot these three problems?
Many thanks.
It sounds like you have an older version of Aptana, RDT, RadRails or DLTK Ruby installed, as there is no "Ruby" perspective in Aptana Studio 3.x.
You should be able to right click the file in the Project Explorer, App Explorer, or in the open editor for the file and choose Run As > Ruby Application.
Ideally you'd remove any old installation of ruby plugins to avoid some sort of conflict before doing so. It should then launch the file as expected.
The Enter/Return behavior you're talking about sounds like the program is not flushing STDERR/STDOUT and hitting Enter is proceeding to enter in the input (so, it's buffering the output you should see that forms the prompt, then you hit Enter/Return and it takes that as the input so it proceeds after the gets call). if things printed to STDOUT don't show, you can try and force auto-flushing by adding $stdout.sync = true to the top of your script. Studio 3.x should set that up silently for you on programs launched through it. If not, then you should file a bug: http://jira.appcelerator.org/secure/CreateIssue!default.jspa

How can I change the main display via AppleScript?

From the Displays pane in System Preferences, I can manually change the main monitor by dragging the menu bar from one display to the other. I'd like to automate this and make it part of an AppleScript.
The tool I wrote, displayplacer, does this.
Configure your screens how you like, drag the "white bar" to your primary screen in the macOS system settings, and then execute displayplacer list. It will output the command to run to put your screens in their current configuration. The screen with origin:(0,0) is the main display with the "white bar". Run this terminal command through a script, Automator, BetterTouchTool, etc.
Example profile 1 puts the white bar on the menu bar on the left monitor.
displayplacer "id:<leftScreenId> res:1920x1080 scaling:on origin:(0,0) degree:0" "id:<rightScreenId> res:1920x1080 scaling:on origin:(1920,0) degree:0"
Example profile 1 puts the white bar on the menu bar on the right monitor.
displayplacer "id:<leftScreenId> res:1920x1080 scaling:on origin:(1920,0) degree:0" "id:<rightScreenId> res:1920x1080 scaling:on origin:(0,0) degree:0"
Also available via Homebrew brew tap jakehilborn/jakehilborn && brew install displayplacer
The displays are controlled by the /Library/Preferences/com.apple.windowserver.plist preference file:
A flag controls whether the main display is the onboard screen the DisplayMainOnInternal key.
The DisplaySets key contains the list of the display sets. The first set is the one used (fact to check).
In the set, each item contains the screen properties. The IOFlags key seems to indicate if the display is the main one (value of 7) or not (value of 3).
Before going Apple Script, you may change the display configuration by hand, and save a copy of the /Library/Preferences/com.apple.windowserver.plist file to study it.
Note that the following procedure has not been tested !!!
With AppleScript, the keys in the plist file are changed individually, in order to change the main display:
Make a backup of the /Library/Preferences/com.apple.windowserver.plist (in case of)
Alter the display set the select the main display (DisplaySets and IOFlags keys) by using the defaults command
Restart the Window Server: killall -KILL SystemUIServer
You should see if you can do it via AppleScript's User Interface Scripting. It allows you to manipulate an application's GUI elements; useful when the app doesn't support scripting directly. I'd test it myself but I don't have any extra displays lying around.
Here's a pretty good overview by MacTech.
Much like you can tell System Events.app to sleep your Mac, you can tell Image Events.app to mess with your displays. The Image Events application provides a "displays" collection. Each display has a "profile" with lots of goodies. However, everything I just mentioned is read-only, so I don't have a good way to do it from within script.
You might have better luck in Automator – Hit record, run System Preferences, go to Displays, drag the menu bar to the other screen, and hit stop. I bet something will work.
Using AppleScript, you can invoke default to write the setting to change the main monitor.

Resources