w3hello.com logo
Home PHP C# C++ Android Java Javascript Python IOS SQL HTML videos Categories
New tab in Terminal.app does not open in same directory/bash fails (Mountain Lion)
I had this problem too, and discovered that I had accidentally changed a setting in the "Startup" tab of the Terminal preferences. The setting was "Shells open with: Command (complete path): ." I changed it back to "Shells open with: Default login shell" and that solved the problem.

Categories : Bash

Vim colors too bright (terminal)
You shouldn't compare colorschemes in GUI Vim and in CLI Vim: the number of colors that can be used in both contexts is very different and it makes any comparison worthless. You can get very subtle colors in GUI Vim but you can only approximate them in CLI Vim. The values used for the gui and those used for the cli are probably different which explains what you see. The only way to have the same colors in gui and cli vim is to use only colors from the xterm palette for the gui. In Vim, you could :set background=light (and read :help 'background') to see if it makes the colors less bright. In your terminal emulator, you could see if there's a setting that deals with color brightness or the usage of bold.

Categories : Vim

How do you set the 16 Terminal Colors for Git-Bash?
Console colors are stored in the registry under HKCU/Console/[window name]/ColorTable00-15. [window name] is either "Git Bash" for the start menu entry or something like "C:_Program Files (x86)_Git_git-cheetah_.._bin_sh.exe" for the Windows Explorer context menu entry (supplied by Git-Cheetah). Alternatively, the registry settings can be overridden by storing an NT_CONSOLE_PROPS structure with appropriate ColorTable settings in the "Git Bash.lnk" shortcut via IShellLinkDataList::AddDataBlock. This happens e.g. if you edit the properties of a console window started via shortcut, or if you edit the shortcut properties directly. If you want the values from the registry instead, create a new "Git Bash.lnk" shortcut from scratch and leave the Options/Font/Layout/Colors tabs alone.

Categories : Windows

I lost all my code when terminated eclipse from ubuntu terminal
I would ensure that (1) you're using the same workspace, (2) the project is created correctly with source and build target folders stored separately. It would help if you could specify what programming language you're working with, which version of Eclipse, and perhaps what your filesystem structure looks like. The .project and .settings file contents wouldn't hurt, either.

Categories : Eclipse

Custom terminal prompt colors results in cycling issue
You need to surround nonprinting characters in your prompt with [] so that bash can accurately count the length of the prompt. It looks like you have the end of (most of) those pairs but not the beginnings - perhaps you thought the e[... sequences had to be closed? They don't. Here's what it should look like: export PS1='[e[0;36m][u] w:[e[0;31m]$(__git_ps1 " (%s)") [e[00m] [e[1;33m]342230200 >[e[0m] '

Categories : Osx

Newly entered Data lost in C#.net when server connection has lost on local network
Check the code and accepted answer to the following question. It might give you a better solution to what you want to achieve In C# what is the best way to determine if a database is up and running?

Categories : C#

Navigation bar/menu not showing in customised colors with Safari (Correct colors in other browsers)
nav ul { margin: 80px 0 20px 0; padding: 0em; float: left; list-style: none; background: #1A1A1A; background: rgba(26,26,26,.2); -moz-border-radius: .5em; -webkit-border-radius: .5em; border-radius: .5em; -moz-box-shadow: 0 1px 0 rgba(255,255,255,.2), 0 2px 1px rgba(0,0,0,.8) inset; -webkit-box-shadow: 0 1px 0 rgba(26,26,26,.2), 0 2px 1px rgba(0,0,0,.8) inset; box-shadow: 0 1px 0 rgba(26,26,26,.2), 0 2px 1px rgba(0,0,0,.8) inset; } You've got background twice once as hex the other as rgba, I think you only need one.

Categories : Javascript

Weird colors in background of UIImage when trying to replace all white colors
Using a different code I slipped in my loop and it no longer showed the random background static: -(UIImage *)replaceWhiteWith{ NSString *str = [[NSUserDefaults standardUserDefaults] objectForKey:@"color"]; UIColor *color = [NSString colorFromNSString:str]; CGFloat red = 0.0, green = 0.0, blue = 0.0, alpha =0.0; [color getRed:&red green:&green blue:&blue alpha:&alpha]; CGImageRef inImage = self.CGImage; CFDataRef ref = CGDataProviderCopyData(CGImageGetDataProvider(inImage)); UInt8 * buf = (UInt8 *) CFDataGetBytePtr(ref); int length = CFDataGetLength(ref); for(int i=0; i<length; i+=4) { int r = buf[i]; int g = buf[i+1]; int b = buf[i+2]; if(r == 255 && g == 255 && b == 255){

Categories : IOS

Add alternating row colors with column grouping colors-is it possible?
Since your rows are alternating light/dark, you could take advantage of an alpha transparent background color: http://cssdeck.com/labs/6rgab657 <table> <colgroup class="a" span="4" /> <colgroup class="b" span="4" /> <colgroup class="c" span="4" /> <colgroup class="d" span="4" /> <tr> <td>A</td> <td>A</td> <td>A</td> <td>A</td> <td>B</td> <td>B</td> <td>B</td> <td>B</td> <td>C</td> <td>C</td> <td>C</td> <td>C</td> <td>D</td> <td>D</td> <td>D</td> <td>D</td> </tr> <tr> &l

Categories : Jquery

Pseudo-terminal will not be allocated because stdin is not a terminal ssh bash
You seem to assume that when you run ssh to connect to a server, the rest of the commands in the file are passed to the remote shell running in ssh. They are not; instead they will be processed by the local shell once ssh terminates and returns control to it. To run remote commands through ssh there are a couple of things you can do: Write the commands you want to execute to a file. Copy the file to the remote server using scp, and execute it with ssh user@remote command Learn a bit of TCL and use expect Write the commands in a heredoc, but be careful with variable substitution: substitution happens in the client, not on the server. For example this will output your local home directory, not the remote: ssh remote <<EOF echo $HOME EOF To make it print the remote home directory

Categories : Bash

Recognise the lost focus event of a DataGrid as a whole, not its controls lost focus
I think that most of us developers (including myself) have misunderstood MVVM widely for a long time. This leads to uneeded overcomplications everywhere as we tend to avoid code-behind at ALL, not really understanding that if we were not to place ANY code/logic in the View layer, there would be no Bindings, no converters, no RelativeSource, no XAML at all. The real spirit of MVVM is to separate logic from UI, not to avoid having any code in the view. This really means that you CAN and SHOULD resolve the Focus issue (which is purely a View concern, btw) via Code-Behind. However this does not mean that you are going to put any application/business logic in the Code-Behind. Simply put, just handle any UI events in code behind and then delegate the logic to the ViewModel: private void

Categories : Dotnet

gnome-terminal font resize (zoom in, zoom out), but adjust terminal height and width contrariwise for getting a "lock in" of window dimensions
I can’t tell you for sure, but since this is GNOME and moreover GNOME 3, it’s unlikely that the Terminal has this kind of customization built-in. But in Linux, you can always improvise. How about the following. Find a program that can send keys to an X11 window. Maybe xdotool. Find a program that can control an X11 window’s geometry. Maybe xdotool. Write a short script that locates the terminal window (probably just the focused one), sends it Ctrl-Plus / Ctrl-Minus, waits a tiny bit, then sets its geometry to the one you like (or to whatever it was initially, which you can also query with xdotool). Bind this script to a keyboard shortcut of your choice, say Win+Plus / Win+Minus. No idea how to do this in modern Ubuntu / GNOME 3, but GNOME 2’s Metacity used to have GConf keys f

Categories : Misc

Linux terminal input: reading user input from terminal truncating lines at 4095 character limit
I do not have a workaround for you, but I can answer question 2. In linux PIPE_BUF is set to 4096 (in limits.h) If you do a write of more than 4096 to a pipe it will be truncated. From /usr/include/linux/limits.h: #ifndef _LINUX_LIMITS_H #define _LINUX_LIMITS_H #define NR_OPEN 1024 #define NGROUPS_MAX 65536 /* supplemental group IDs are available */ #define ARG_MAX 131072 /* # bytes of args + environ for exec() */ #define LINK_MAX 127 /* # links a file may have */ #define MAX_CANON 255 /* size of the canonical input queue */ #define MAX_INPUT 255 /* size of the type-ahead buffer */ #define NAME_MAX 255 /* # chars in a file name */ #define PATH_MAX 4096 /* # chars in a path name including nul */ #define PIPE_BUF

Categories : Linux

Two versions of PHP - Mountain Lion
Your Apache is including libphp5.so of the wrong/the other installation. Option 1: See if you can find a libphp5.so file for your other PHP installation and point the Apache config to it (just put the whole path in the LoadModule line and restart Apache). If you cannot find such a file, the Apache module wasn't compiled for that PHP version. Compiling that may be a bit complicated, so in that case: Option 2: Figure out which PHP you're executing on the command line using which php and then just use the other one using the full path, e.g. instead of $ php ... use $ /usr/bin/php .... Note that you may still have different PHP configuration files for Apache and the CLI.

Categories : PHP

Installing JDK on OSX Lion for Scala
Scala is a popular enough of a language for there to be plenty of information on how to get started from scratch. For example, googling for "scala installation" gave me (amongst other stuff) http://www.tutorialspoint.com/scala/scala_environment_setup.htm —they talk about JVM versions, how to install Scala, etc; i.e. all you need. If that page won't do, I'm sure you'll find many more.

Categories : Scala

Will it be possible to upload to App Store from Lion?
Your Lion will be just fine as stated here: https://developer.apple.com/support/ios/ios-dev-center.html "To develop with the iOS SDK and Xcode, you must have an Intel-based Mac running Mac OS X Snow Leopard or later and you must be registered as an Apple Developer." Update July 2015 https://developer.apple.com/support/enrollment/ You must have an Intel-based Mac running OS X Yosemite (v10.10) or later.

Categories : IOS

MAC OSX LION: gcc on mac not compiling wget
Honestly, even though it appears that gcc exists; but does it point to a valid install? It still sounds like it is not installed properly and with an upgrade to Mountain Lion, all your open source tools have been scrubbed away and pushed to Xcode and must be manually installed if necessary.

Categories : C++

R - OSX Mountain Lion and CPU Limit
Tried ulimit... Appears I do not have access, even via sudo. I get the same output from ulimit -a -H before and after giving ulimit -t 12000 # sets cputime limit to 12000 seconds from 600 seconds SOLVED via Debian Virtual Machine. If someone has a Mountain Lionic solution, please let us know.

Categories : R

TideSDK Notifications in OSX Lion 10.7.5
Harry, I'm not too familiar with CoffeeScript, but the following code works for me in 10.7.5 and 10.8.4 - it seems similar to what you have: function showNotify(title, message) { var notification = Ti.Notification.createNotification({ 'title': title || 'No Title', 'message': message || 'No Message', 'timeout': 10 }); notification.show(); } showNotify("The Title", "The Message"); Hope it helps.

Categories : Misc

Mac OSX Lion/X11/CImg Library
The header file Xlib.h is in /opt/X11/include, so add that path to the Header Search Paths in Xcode: You'll probably need to add libraries from /opt/X11/lib as well...

Categories : Xcode

SublimeClang OSX Mountain Lion C++11
It may be too late, but I found how to do it. This matter is because clang uses headers for gcc-4.2, which is quite old and doesn't support C++11. To complete C++11 code, you have to get newer gcc and copy the include path it uses. If you have homebrew, open terminal and type brew tap homebrew/versions brew install gcc48 You can install gcc-4.8 and new libstdc++ with these two lines. Now, create some c++ file and try to use g++-4.8 with -v option. g++-4.8 -v example.cpp -v option tell gcc to show detailed log. In the output, there should be some lines like this. #include <...> search starts here: /usr/local/Cellar/gcc48/4.8.1/gcc/lib/gcc/x86_64-apple-darwin12.4.1/4.8.1/../../../../include/c++/4.8.1 /usr/local/Cellar/gcc48/4.8.1/gcc/lib/gcc/x86_64-apple-darwin12.4.1/4.8.1/

Categories : C++

How can I install pybrain on Mac OS X Mountain Lion?
Try using the Python package manager pip with the correct permissions: pip install pybrain or clone the repo and build the package git clone git://github.com/pybrain/pybrain.git python setup.py install

Categories : Python

Mac OS X Lion - mysql: command not found
In the past I've had problems installing the mysql2 gem, so I wrote a little shell script to make my life easier: #!/bin/sh -x env ARCHFLAGS="-arch x86_64" gem install mysql -- --with-mysql-config=/usr/local/mysql/bin/mysql_config Try updating that with the path to your mysql_config: /usr/local/Cellar/mysql/5.5.28/bin/mysql_config and change mysql to mysql2.

Categories : Mysql

Which Python architecture provided on Mac (Lion)?
Use platform.architecture(): >>> import platform >>> platform.architecture() ('64bit', '') Run on my Mac OS X 10.8.4. Note that your Python executable may be a universal binary, in which case you could get the wrong architecture quoted: Note: On Mac OS X (and perhaps other platforms), executable files may be universal files containing multiple architectures. You can also test sys.maxsize: >>> sys.maxsize > 2**32 True The above would return False if you were running a 32-bit platform.

Categories : Python

Tesseract and dylib on OSX Mountain Lion
Done by cleaning my installation of both the softwares and re-installing them through brew. Mind that if there is some linking problem, you have to execute brew link --overwrite tesseract to solve them.

Categories : Misc

Mac Lion: Issue with opencv and python 2.7.5
This is how I configured it in the end for the official python 2.7.5 from http://www.python.org First we need to install opencv via brew: brew tap homebrew/science brew install opencv now add /usr/local/Cellar/opencv/2.4.5/lib/python2.7/site-packages to your PYTHONPATH . I did it by editing bash_profile: open ~/.bash_profile add this line in TextEditor: export PYTHONPATH=/usr/local/Cellar/opencv/2.4.5/lib/python2.7/site-packages:$PYTHONPATH #Check the version in your directory Save the file and do: source ~/.bash_profile Now everything should be ready.

Categories : Python

Does anybody know how to sniff in promiscuous mode on OS X Lion?
I recall having to setup a script on terminal to "tweak the permissions" of some files / drivers That's probably referring to the permissions on the /dev/bpf* devices. That's not something necessary to sniff in promiscuous mode, it's something necessary to sniff at all unless you're running as root. Recent versions of Wireshark, going back at least to Wireshark 1.8.0, install a script to do that automatically. Open up a Terminal window and do ls -l /dev/bpf*; it should report the /dev/bpf* devices, e.g. /dev/bpf0, /dev/bpf1, etc. as having permissions rw-rw---- and as being owned by root and group access_bpf. In addition, the id command should report you as being a member of group access_bpf. If that's all the case, Wireshark should show an en0 device and possibly an en1 device.

Categories : Osx

RabbitMQ not working on OS X Mountain Lion
I've managed to fix this issue by completely removing brew from my system and reinstalling it again. I've used the following instructions (adapted from the official brew documentation) to completely remove brew from my system: cd `brew --prefix` rm -rf Cellar brew prune rm -r Library/Homebrew rm -rf .git rm -rf ~/Library/Caches/Homebrew I simply reinstalled RabbitMQ afterwards: brew install rabbitmq .. and everything worked like a charm!

Categories : Osx

Where are the files generated with Xcode 4.5 in Lion?
This has nothing to do with Lion. Xcode puts generated files in: ~/Library/Developer/Xcode/DerivedData where ~ is your home directory. Keep in mind that the ~/Library directory is hidden by default in Lion (and later).

Categories : Xcode

How do I create a .conf file in Mac osx Lion?
Open TextEdit's Preferences, and switch to the Open and Save section. Under the When Saving a File panel, uncheck the Add '.txt' extension to plain text files option.

Categories : Osx

Can't Uninstall Java 7 JDK on Mac OS X (Mountain Lion 10.8.4)
If you can't find the Java Home, open up terminal and enter: env look for or SOMETHING LIKE THIS Mine might not be the same as yours JAVA_HOME=/System/Library/Frameworks/JavaVM.framework/Versions/1.7/Home This is where your Java is installed If you want to see it in Finder then open up Finder and press Command + Shift + G and enter in the path to java home. to uninstall simply remove the java version from : /System/Library/Java/JavaVirtualMachines with cd /System/Library/Java/JavaVirtualMachines rm -r some.version.java.jdk Note: Sometimes Java is install in /System/Library but sometimes it's installed on /Library, so that's why you couldn't find Java in /Library which the Oracle document suggested.

Categories : Osx

Mono Program Crashes on OSX Lion
This might be a problem of where you built it: try building it in Lion instead to see if that makes a difference. I've seen problems before when trying to execute a program on an older OS than where it was built.

Categories : C#

Installing jpype in Mountain Lion
This is on a system running OSX 10.8.5. I modified the setup.py for JPype-0.5.4.2 and added an element to the end of the self.includeDirs list which is created in the function setupInclusion. This function is declared at line 61 for this particular version of JPype. def setupInclusion(self): self.includeDirs = [ self.javaHome+"/include", self.javaHome+"/include/"+self.jdkInclude, "src/native/common/include", "src/native/python/include", #I added this line below. The folder contains a jni.h "/System/Library/Frameworks/JavaVM.framework/Versions/A/Headers/" ] Finally I ran pip install ~/Path/To/JPype-folder/ and the installation was successful.

Categories : Java

Installing Cloudera Hue on mac os x mountain lion
You need to delete desktop/core/ext-py/Twisted and retry. Also Hue 2.5 release (which contains this fix) is around the corner (this Monday/Tuesday).

Categories : Osx

Installing Pow 0.4.1 on OS X Mountain Lion: Illegal Instruction 4
I had the same problem on OS X Lion. I haven't figured out what is wrong, so I used Homebrew. First, install Homebrew if you didn't: $ ruby -e "$(curl -fsSL https://raw.github.com/mxcl/homebrew/go)" Than run: $ brew install pow And follow these instructions: $ sudo pow --install-system $ pow --install-local $ sudo launchctl load -w /Library/LaunchDaemons/cx.pow.firewall.plist $ launchctl load -w ~/Library/LaunchAgents/cx.pow.powd.plist Also, you always can install Pow from source.

Categories : Ruby On Rails

Boost 1.54 build error under OS X 10.8.4 Mountain Lion
With the hint from Igor R, I tried gcc 4.8.1 on linux which works well. Then I think c++11 might play a role in the errors and tried to find how to get c++11. So eventually I got it to work. XCode comes with two sets of tool. gcc front-end + llvm backend and clang front-end + llvm backend. The gcc version is old as on my machine ( 4.2 ), the clang supports c++11, so once I use "toolset=clang", I can compile everything successfully.

Categories : Xcode

SubVersion on Apache on Mountain Lion Server
Weep.... On ML Server the Apache configuration file is /Library/Server/web/config/apache2/httpd_server_app.conf Not /etc/appache2/httpd.conf As I would have thought. Once I read this it all made sense and started working. https://help.apple.com/advancedserveradmin/mac/10.8/#apd9eb9f4ab-1377-47e6-a2c4-1311e25a74df Sorry.

Categories : Osx

No MIDI sound using CoreMIDI, Ruby, Mac OS X Lion
OK, finally found it. Found this: https://www.ruby-toolbox.com/categories/music_midi and https://github.com/arirusso/unimidi Thanks to folks over at reddit.com/r/ruby http://www.reddit.com/r/ruby/comments/1hwwk5/need_help_finding_a_software_that_takes_in_midi/ Love Reddit. Note: For some reason stackoverflow does not support URL address with double underscore. The first url is actually "music__midi

Categories : Ruby

Not seeing OSX desktop notifications with test app closed (Lion)
PushyMac app code was written during OSX 10.7 and the only notification type available was Badge. If you are running OSX 10.8, then add the alert notification type as well, as shown below. [NSApp registerForRemoteNotificationTypes:(NSRemoteNotificationTypeBadge | NSRemoteNotificationTypeAlert)] However, after doing this, I am not able to launch the app by clicking on the alert in notification area. If you find an answer for that, please do reply.

Categories : Objective C

installing pycrypto on mountain lion with xcode 5
The solution was to reset my active Xcode to Xcode4. You were right, XCode5 has all kinds of problems and isn't ready for primetime. To switch back to your 'regular' XCode (Xcode 4.6 current release) sudo xcode-select -switch /Applications/Xcode.app credit to: http://stackoverflow.com/questions/11961032/xcrun-error-could-not-stat-active-xcode-path-volumes-xcode-xcode45-dp1-app-c Now pycrypto installs perfectly.

Categories : Python



© Copyright 2017 w3hello.com Publishing Limited. All rights reserved.