Tuesday, August 16, 2016

How to get started with AI (Artificial Intelligence)

http://www.artificialbrain.xyz/465/how-to-get-started-with-ai-artificial-intelligence.html

How to Build Your First Bot?
You can start learning how to create bots in Python through the following two tutorials in the simplest way –
You can also start by using APIs and tools that offer the ability to build end-user application. This helps you by actually building something without worrying too much about the theory at first. Some of the APIs that you can use for the same are –
https://cloud.google.com/prediction/docs
http://www.diffbot.com/products/
http://mallet.cs.umass.edu/
http://scrapy.org/
http://products.wolframalpha.com/api/

Monday, August 15, 2016

Torch for Mac OS X

Use this guide to install torch-rnn on Mac.

http://www.jeffreythompson.org/blog/2016/03/25/torch-rnn-mac-install/


 

------------------------

Torch is a scientific computing framework with wide support for machine learning algorithms that puts GPUs first. 

----------------------

We provide a simple installation process for Torch on Mac OS X and Ubuntu 12+
http://torch.ch/docs/getting-started.html#_ 

14 Best Podcast Episodes for Men | The Art of Manliness

http://www.artofmanliness.com/2016/08/05/my-favorite-art-of-manliness-podcasts-this-year-so-far/

Tinder

chrome extension for Tinder
flamite

https://flamite.com/#/signin

-----------------------------------

for mac or windows

--------------------------------

http://www.neonbutmore.com/finding-your-seoul-mate-korean-dating-apps/

---------------------------------

good discussion about Korean dating sites

--------------------------------

 

If you shop at Walmart, save your receipt and scan them into the Walmart app and get cash back

omgblvd

It's called Savings Catcher. It works best if you install the Walmart app on your phone. Right after you check out, just open up the Walmart app and scan your receipt. Or, you can enter your receipt on Walmart's website.
It takes a few days for them to process it, but then you will get an email saying how much you saved. You can then either let the amount accumulate, or immediately have them email you a "gift card" that you print out and take to the store (it has a bar code for them to scan at the register).
You can even attach that "gift card" to Walmart Pay (accessed through the Walmart app), and pay at the register using your phone! If you don't have enough savings for your total purchase amount, just use the Walmart Pay first, and then you can pay the rest another way (cash, card, etc.).
Sure beats driving around to a bunch of different stores to get the best prices on everything!
If you shop at Walmart a lot, the amount will quickly add up. I've been using it since August 2014, so 2 years now. I've redeemed $385.02, and have $14.80 waiting to be spent.
 
 
https://www.reddit.com/r/Frugal/comments/4xu2cy/if_you_shop_at_walmart_save_your_receipt_and_scan/

Sunday, August 14, 2016

Python - Virtual Environments

http://docs.python-guide.org/en/latest/dev/virtualenvs/#virtualenvironments-ref

A Virtual Environment is a tool to keep the dependencies required by different projects in separate places, by creating virtual Python environments for them. It solves the “Project X depends on version 1.x but, Project Y needs 4.x” dilemma, and keeps your global site-packages directory clean and manageable.
For example, you can work on a project which requires Django 1.3 while also maintaining a project which requires Django 1.0.

virtualenv

virtualenv is a tool to create isolated Python environments. virtualenv creates a folder which contains all the necessary executables to use the packages that a Python project would need.
Install virtualenv via pip:
$ pip install virtualenv

Basic Usage

  1. Create a virtual environment for a project:
$ cd my_project_folder
$ virtualenv venv
virtualenv venv will create a folder in the current directory which will contain the Python executable files, and a copy of the pip library which you can use to install other packages. The name of the virtual environment (in this case, it was venv) can be anything; omitting the name will place the files in the current directory instead.
This creates a copy of Python in whichever directory you ran the command in, placing it in a folder named venv.
You can also use a Python interpreter of your choice.
$ virtualenv -p /usr/bin/python2.7 venv
This will use the Python interpreter in /usr/bin/python2.7
  1. To begin using the virtual environment, it needs to be activated:
$ source venv/bin/activate
The name of the current virtual environment will now appear on the left of the prompt (e.g. (venv)Your-Computer:your_project UserName$) to let you know that it’s active. From now on, any package that you install using pip will be placed in the venv folder, isolated from the global Python installation.
Install packages as usual, for example:
$ pip install requests
  1. If you are done working in the virtual environment for the moment, you can deactivate it:
$ deactivate
This puts you back to the system’s default Python interpreter with all its installed libraries.
To delete a virtual environment, just delete its folder. (In this case, it would be rm -rf venv.)
After a while, though, you might end up with a lot of virtual environments littered across your system, and its possible you’ll forget their names or where they were placed.

Other Notes

Running virtualenv with the option --no-site-packages will not include the packages that are installed globally. This can be useful for keeping the package list clean in case it needs to be accessed later. [This is the default behavior for virtualenv 1.7 and later.]
In order to keep your environment consistent, it’s a good idea to “freeze” the current state of the environment packages. To do this, run
$ pip freeze > requirements.txt
This will create a requirements.txt file, which contains a simple list of all the packages in the current environment, and their respective versions. You can see the list of installed packages without the requirements format using “pip list”. Later it will be easier for a different developer (or you, if you need to re-create the environment) to install the same packages using the same versions:
$ pip install -r requirements.txt
This can help ensure consistency across installations, across deployments, and across developers.
Lastly, remember to exclude the virtual environment folder from source control by adding it to the ignore list.

virtualenvwrapper

virtualenvwrapper provides a set of commands which makes working with virtual environments much more pleasant. It also places all your virtual environments in one place.
To install (make sure virtualenv is already installed):
$ pip install virtualenvwrapper
$ export WORKON_HOME=~/Envs
$ source /usr/local/bin/virtualenvwrapper.sh
(Full virtualenvwrapper install instructions.)
For Windows, you can use the virtualenvwrapper-win.
To install (make sure virtualenv is already installed):
$ pip install virtualenvwrapper-win
In Windows, the default path for WORKON_HOME is %USERPROFILE%Envs

Basic Usage

  1. Create a virtual environment:
$ mkvirtualenv venv
This creates the venv folder inside ~/Envs.
  1. Work on a virtual environment:
$ workon venv
Alternatively, you can make a project, which creates the virtual environment, and also a project directory inside $PROJECT_HOME, which is cd -ed into when you workon myproject.
$ mkproject myproject
virtualenvwrapper provides tab-completion on environment names. It really helps when you have a lot of environments and have trouble remembering their names.
workon also deactivates whatever environment you are currently in, so you can quickly switch between environments.
  1. Deactivating is still the same:
$ deactivate
  1. To delete:
$ rmvirtualenv venv

Other useful commands

lsvirtualenv
List all of the environments.
cdvirtualenv
Navigate into the directory of the currently activated virtual environment, so you can browse its site-packages, for example.
cdsitepackages
Like the above, but directly into site-packages directory.
lssitepackages
Shows contents of site-packages directory.
Full list of virtualenvwrapper commands.

virtualenv-burrito

With virtualenv-burrito, you can have a working virtualenv + virtualenvwrapper environment in a single command.

autoenv

When you cd into a directory containing a .env, autoenv automagically activates the environment.
Install it on Mac OS X using brew:
$ brew install autoenv
And on Linux:
$ git clone git://github.com/kennethreitz/autoenv.git ~/.autoenv
$ echo 'source ~/.autoenv/activate.sh' >> ~/.bashrc

Mac video edit - What options are available to _losslessly_ trim mp4/m4v video on 10.8 or above?

http://apple.stackexchange.com/questions/117306/what-options-are-available-to-losslessly-trim-mp4-m4v-video-on-10-8-or-above

iMovie (not lossless, but better than before)

iMovie v10 (released some time after the question was originally asked) now better handles more media types, so avoids the import re-encode for most H.264 (mp4, m4v, mov, AVHDC, mts, mt2s) content.
It will still, however, re-encode on export so cannot be technically lossless—another new feature, however, is the ability to customise the export quality, which can be closer-to-lossless. I suspect this part of the answer can apply equally to other 'project driven' video editing software (e.g. Premiere or Final Cut) because I think they all generally re-encode on output, though are usually very easy to use for precise trimming.
Personally, I generally think a single re-encode isn't a huge problem, but understand you did specifically ask for a lossless solution, so...

Lossless (but way more complicated!)

There are technical limitations as to how precisely you can cut a video without having to re-encode at least some part of it, and it basically depends on the i-frame frequency. If every frame is an i-frame, you can cut anywhere, but if they're only every few seconds, then you can only cut losslessly at those i-frames without losing content or having to re-encode (at least part of the stream) so it can start with an i-frame.

ffmpeg

This SO Q&A specifically raises the question of how to cut between i-frames using ffmpeg. I don't know of any GUI apps to do this, but basically you run a command something like the following:
ffmpeg -i input.m4v -vcodec copy -acodec copy -ss 00:01:20.000 -t 00:37:50.000 output.m4v
The two times specified are start and duration, and can be specified either as seconds or hh:mm:ss.ss, and the -acodec copy and -vcodec copy tell ffmpeg not to re-encode.
I'm not exactly sure what happens if you cut too early, but I think the video is essentially blank (or maybe corrupt, depending on player) until it encounters an i-frame. So you'll probably want to find the nearest i-frame before your cut. This answer solves that problem using ffprobe and awk, albeit a little awkwardly. Essentially you use ffprobe to scan the frames and find the nearest keyframe (flags=K) before your ideal cut-point. Full output for each frame of the video can be seen like this:
ffprobe -select_streams v -show_frames <INPUT>
The linked answer supplies this command to find a keyframe before a specific time:
ffprobe -select_streams v -show_frames -v quiet INPUT.mp4 | 
awk -F= ' 
  /pict_type=/ { if (index($2, "I")) { i=1; } else { i=0; } } 
  /pkt_pts_time/ { if (i && ($2 >= 150)) print $2; }  
' | head -n 1
And finally, if you really need to cut somewhere between two i-frames, you can split the video and re-join. Based on the info from this answer, it should be something like:
ffmpeg -f concat -i list_of_videos.txt -c copy OUTPUT.mp4
Where list_of_videos.txt is a simple text file listing the files you want to concatenate.

Summary

iMovie is probably good enough for most cases (since v10), and very easy.
ffmpeg can do it losslessly (or very close to losslessly), with a bit of fiddling; level of difficulty depends on how picky you are about the precise starting point, and frequency of i-frames.