What is the fastest way to get the value of π?

I'm looking for the fastest way to obtain the value of π, as a personal challenge. More specifically, I'm using ways that don't involve using #define constants like M_PI, or hard-coding the...

C++ syntax for explicit specialization of a template function in a template class?

I have code which works in VC9 (Microsoft Visual C++ 2008 SP1) but not in GCC 4.2 (on Mac): struct tag {}; template< typename T > struct C { template< typename Tag > void f( T ); ...

GDB error invalid offset, value too big (0x00000400) Unable to build app in debug mode need help

I have an app which was working fine few days ago. But today I'm getting this error: {standard input}:1948:invalid offset, value too big (0x00000400) Command...

Line Drawing in ncurses

I've been trying to do simple line drawing (e.g. boxes) in ncurses all day, but I can't get it to work. I'm trying to print extended ASCII characters like the ones found here:...

Compiling Haskell "Hello World" on Mac Snow Leopard - crt1.10.5.o not found

Just trying to compile some trivial Haskell, but its not finding the c runtimes, despite the fact that they're right there: $ cat hello_world.hs main = putStrLn "hello, world" $ ghc --make...

"framework not found" when compiling C++ program on Mac OS-X

I definitely need some help with this problem. I'm trying to fix this since 5 days and as I tried almost every single idea I was able to find on the Internet, I'm going crazy... When I compile my...

Installing PIL on MAC OS X LION 10.7.2 with PIP INSTALLER

I am trying to install PIL using PIP installer, and I'm getting this: llvm-gcc-4.2 -fno-strict-aliasing -fno-common -dynamic -g -Os -pipe -fno-common -fno-strict-aliasing -fwrapv -mno-fused-madd...

How to print a int64_t type in C

C99 standard has integer types with bytes size like int64_t. I am using Windows's %I64d format currently (or unsigned %I64u), like: #include <stdio.h> #include <stdint.h> int64_t my_int =...

Can't install psycopg2 with pip in virtualenv on Mac OS X 10.7

I am following Heroku's tutorial to deploy a Django app: http://devcenter.heroku.com/articles/django#prerequisites. Everything is working fine until I get to this part: $ pip install Django...

Can't install bcrypt-ruby for new Rails installation

I'm getting the following error on a new Rails installation. I run bundle install and after installing a bunch of gems, I get an error upon trying to install bcrypt-ruby. I'm using a brand new Mac...

FFmpeg saving rtmp live stream cuts off after 3 minutes

I was playing with ffmpeg and was able to save a live stream to a file. The command to do so is: ffmpeg -re -i "rtmp://<ip addr>/livestream live=1" -f h264 test.flv However, I have tested this...

Installing Pandas on Mac OSX

I'm having trouble installing the Python Pandas library on my Mac OSX computer. I type the following in Terminal: $ sudo easy_install pandas But then I get the following: Searching for...

The compiler failed to generate an executable file. (RuntimeError)

I recently upgraded to OS Mountain Lion. A project I'm working on requires gem sys-proctable as a dependency, but when I run bundle install I get: Fetching gem metadata from...

i have an error when executing "from lxml import etree" in the python command line after successfully installed lxml by pip

bash-3.2$ pip install lxml-2.3.5.tgz Unpacking ./lxml-2.3.5.tgz Running setup.py egg_info for package from file:///Users/apple/workspace/pythonhome/misc/lxml-2.3.5.tgz ...

MySQLdb install error - _mysql.c:44:23: error: my_config.h: No such file or directory

I'm trying to install MySQLdb extension, but I get this error any idea what may be the cause? Could be something with permissions? I'm using Mac OX Lion.... This is a part of the error a got....

Pyaudio, portaudio and mac 10.7.5

I'm having trouble installing pyaudio correctly. I have a virtualenv set up for the project. I first tried to install portaudio: sudo port install portaudio which returns: ---> Cleaning...

Why won't the bcrypt ruby gem install properly?

I am trying to encorporate bcrypt-ruby, v. 3.0.1. I enter the gem in my gem file as follows: gem 'bcrypt-ruby', '3.0.1' And I then go to the terminal and run: bundle install I get the...

Brew Update not working after mac 10.9

First time running brew since 10.9 upgrade. From the output below, should I just remove Library/Formula/ant.rb and Library/Formula/apple-gcc42.rb? Also, unclear why git pull is failing. Thanks for...

Update ruby version on MAC

I'm trying to update ma ruby version. I'm with ruby 1.8.7 and I would like to install 2.1.0. I just installed rvm, rbenv, brew and gem. But when I try to do $ rbenv install 2.1.0. I get an error...

No source code coverage color highlighting in eclipse-cpp-luna-SR1 for static library project

I'm using eclipse-cpp-luna-SR1 for both Linux and Windows with tool chain gcc 4.9.1 Code is partitioned into two projects: Production code in a static library project Properties|C/C++...

No acceptable C compiler found in $PATH

So here's the situation. I want to setup a portable programming environment by installing my programming stuff (Vim, Clang, Git, GCC) in a single folder that I can create on any Mac. I am...

Trouble Installing bcrypt-ruby (3.0.1)

I am having trouble installing crypt-ruby 3.0.1 on my mac. Does anyone now what the cause of this maybe? Below is the following output error. Dorians-MacBook-Pro:rentsnap_webapp dorianflowers$ gem...

Ubuntu AWS instance reachability check failed

I've recently added more storage to the /dev/sda (it was 8GB..made it to 150GB) by stopping the instance, detaching the volume and adding storage and reattaching and then starting the instance. I...

how to install package for python3 using pip? Now it always install for python2

I've been puzzled for a while. I can't install/upgrade any package for my python35 now. I have python27 and python35(via anaconda) on mac. Whenever I want to install a python package via pip, the...

Unable to access ec2 ebs backed instance

For some unknown reason, an instance that was accessible via ssh on port 22 is no longer allowing access. After checking security groups and NACLs, correct routing tables associated with Gateways...

CUDA_ERROR_LAUNCH_FAILED with Tensorflow and Keras

I'm using Keras to train a convolutional neural network using the fit_generator function as the images are stored in .h5 files and don't fit in memory. Most of the times I'm not able to train the...

Overlay a video on another video at specific time with FFmpeg

I am trying to overlay a video with another video. I followed the original command OP posted here. And it works, but it overlays the video from time 0: ffmpeg -i 720480.mp4 -i sdbug.mov...

Understanding the gibberish error when compiling LLVM from source

Here are the things I did, Compiled and installed gcc-9.2. Compiled and installed GNU binutils-2.32 Compiled and installed GNU Make-4.2 I downloaded the source codes for LLVM, Clang, LLD, libcxx,...

Compiling GCC-5.0 OS X Lion dyld: Symbol not found: __ZNKSt11logic_error4whatEv

I'm trying to install gcc-5.0 from source on my OS X 10.7.5 using the (Apple built) /usr/bin/gcc-4.2 and the appropriate versions of gcc dependencies (gmp,mpfr,mpc) which are installed at...

Updating /usr/include/c++ in CentOS-7

I have installed the devtoolset-10 package on CentOS 7 and run the /opt/rh/devtoolset-10/enable script so that now when I do this: g++ --version I get this: g++ (GCC) 10.2.1 20210130 (Red Hat...