The CHIP Is a $9 Computer That Can Almost Do It All

If you need a computer about the size of a credit card, look no further. The CHIP is a $9 single-board computer that runs Linux and can do just about anything you want it to… including play Quake.

The board includes Wi-Fi and Bluetooth as well as optional ports for VGA and HDMI monitors. On board you’ll find a 1GHz processor, 512 RAM, and 4GB of storage. You can install a light version of Debian and you can even plug it into something called the PocketCHIP that adds a touchscreen and keyboard to the mix in a package about as big as the original Game Boy.


Why do you need this thing? Well, first off it’s pretty cool. A $9 computer – $19 with the VGA adapter and $24 with the HDMI adapter – is a wonderful feat. Like the Raspberry Pi, the medium is the message. Now that we have the ability to buy a tiny computer, we will all discover places we can use it. Furthermore, the creators have added the handheld device as a sort of spur to innovation. If you can carry the little guy around with you and play games with it or use it as a mini computer, the hacker mentality make take hold and you may wish to expand the platform.

The CHIP has already blown past its $50,000 goal and is now at about $200,000. They expect to ship in one year and they’re a Haxlr8r company so they have some solid manufacturing support. While you could obviously just pick up a Raspberry Pi 2 and rock out with that, this little guy seems like the perfect solution for folks experimenting with wearables and micro devices, an area of interest that is sure to grow over the next few years. Regardless, it’s a surprisingly tantalizing little computer and it will be great to see what hobbyists can do with.

Featured Image: Next Thing Co

Original URL:

Original article

Full text search in milliseconds with PostgreSQL

At Lateral we use PostgreSQL to store documents for our visualiser. Each document consists of a text column and a JSON column with meta data inside such as a title, date and URL. We wanted to create a fast search experience for the visualiser that lets you search the full text of documents as well as their titles to quickly find a document to get Lateral recommendations for.

To achieve this we assessed our options; we could use an open source solution such as Apache Solr or Elasticsearch, we could use a managed solution such as Elastic or Algolia or we could use PostgreSQL’s full text search. We decided to use PostgreSQL for the following reasons:

  • There’s no need to install extra software or libraries
  • We can use the same database interface we use in our app to perform search queries (in our case ActiveRecord)
  • We don’t need to provision any additional servers
  • There’s no extra cost to us
  • The data is stored in one place that we control
  • There’s no requirement to keep our database rows in sync with another source

The main arguments against using PostgreSQL search are accuracy and speed at scale. The accuracy of PostgreSQL searches is not the best. In the examples that follow I’ve explained how to weight titles over text, but we found a few cases where typing the exact title of a document wouldn’t return that document as the first result. This isn’t ideal and please let us know if you have any feedback about this. We’ve had issues in the past with the speed of PostgreSQL searches. This was for 23 million records and we found the speed deteriorates around 1 to 2 million rows.

So even though the dedicated solutions could probably work a bit better, we decided that for this use case they weren’t necessary.

To get optimum performance with PostgreSQL full text search you need to create a column to store the tsvector values with an index on it. Then you need to fill this column with the tsv values and create a trigger to update the field on INSERT and UPDATE. Then you’ll be able to query the table quickly.

To create the column for the tsvector values run:

ALTER TABLE documents ADD COLUMN tsv tsvector;

And then to create the index on this column run:

CREATE INDEX tsv_idx ON documents USING gin(tsv);

Now you have somewhere to store the tsvectors you can populate the column. In this example, I am assuming a table with the structure I mentioned above, with a text column and a meta column that contains a JSON object with a title. To populate the tsv column with tsvectors, run the following:

UPDATE data_rows SET tsv = setweight(to_tsvector(coalesce(meta->>'title','')), 'A') || setweight(to_tsvector(coalesce(text,'')), 'D');

This query gets the title from the meta JSON column and gives it the heighest weight of A. Then it gets the text value and weights it D. Then it combines the two tsvectors and writes them to the tsv column we just created.

At this point, if your data was static you could stop and start querying. But we want all future rows and updates to have up-to-date tsv columns so we need to create a trigger to do this. Firstly, you’ll need to create a function to take a column and update the tsv column:

CREATE FUNCTION documents_search_trigger() RETURNS trigger AS $$
  new.tsv :=
    setweight(to_tsvector(coalesce(new.meta->>'title','')), 'A') ||
    setweight(to_tsvector(coalesce(new.text,'')), 'D');
  return new;
$$ LANGUAGE plpgsql;

This basically does the same as the update query above but as a function. Now you need to create a trigger to execute that function when any row is updated or inserted:

ON data_rows FOR EACH ROW EXECUTE PROCEDURE documents_search_trigger();

Now you can search the database. Replace both occurences of YOUR QUERY text with what you want to search and run the following query:

SELECT id, meta->>'title' as title, meta FROM (
  SELECT id, meta, tsv
  FROM data_rows, plainto_tsquery('YOUR QUERY') AS q
  WHERE (tsv @@ q)
) AS t1 ORDER BY ts_rank_cd(t1.tsv, plainto_tsquery('YOUR QUERY')) DESC LIMIT 5;

This query performs two queries; firstly it performs the search on the indexed tsv column. Then it ranks and sorts those results and returns 5.

This query takes about 50ms! We experimented with returning the document text with results and found that if we returned the full text of documents, it added about 350ms to the query time which seems to be network overhead rather than a slower query. If we only returned 200 characters from the texts then it only added around 100ms.

There is some added overhead because we’re using Rails to query PostgreSQL, so it’s not as fast as something like Algolia but it’s good enough for our use case.

See the search in action in one of our recommender demos:

Making stuff with computers at Lateral.

Original URL:

Original article

CALIcon News and Updates – May 8, 2015

Can you believe that CALIcon is less than 6 weeks away? Well, maybe you can, but for those of us on the planning end of things, it seems like it’s coming very fast! We have some updates and reminders for you. We’re also going to highlight a few sessions to give you an idea of […]

Original URL:

Original article

Show HN: I made a command-line Slack chat client


Slacker is a simple weekend project CLI interface to Slack. This is not a
library and is not yet intended to be developed on top of. It’s not even very
good. This is just a simple, silly command line Slack client. But if you live
in tmux or the command line like me, you might just like it.

Slacker Screenshot

Right now this is a goof project. But if the world loves it and wants to
contribute to it, then I will maintain the app and make it a little more
robust. Currently there’s no testing, autoloading, no options, documentation,
logging, or any niceties that a real app should enjoy. I will build those
things if the project ends up warranting it, and that’s all up to you.


Quick version:

$ git clone
$ cd Slacker
$ sudo make install

That will copy the executable to your /usr/local/bin/ path. You can then run
the program with:

$ slacker

Then follow the instructions to install your Slack token. (See “Configuration” below)

More detail: this is just a PHP script. Run slacker.php any way you like.
Here are some options:

$ php slacker.php

$ chmod a+x slacker.php
$ ./slacker.php

$ chmod a+x slacker.php
$ sudo cp slacker.php /usr/local/bin/slacker
$ slacker

Installation Dependencies

Slacker requires the PHP CLI executable compiled with ncurses support.

If you don’t know how to do all of that, and are on Ubuntu, just run
sudo make ubuntu-dependencies to get the job done. That might work on
Debian too, but I haven’t tested it.

For other systems, you basically have to do the following:

1) Ensure php5-cli, php5-dev, php-pear, and libncursesw5-dev are installed. Usually a package manager can take care of this for you. On Ubuntu or debian apt-get install does the trick.

2) Install the PHP ncurses with sudo pecl install ncurses. You might need to resolve some other packages if the pecl command fails.

3) Once pecl successfully installs ncurses, add “” to the bottom of your php.ini file. This might be located somewhere like /etc/php5/cli/php.ini.

If you’ve figured this out on a non-debian system, it’d be great if you could
submit a pull request adding your system to the Makefile.


The app will yell at you if you don’t install a file with your slack token in

Visit, scroll down, and generate a token for

Then paste that token into ~/.slack_token and all will be well.


Use the up and down arrow keys to highlight a new room. Hit enter and you’ll
enter that room.

Start typing and your letters will appear in the box. Hit enter and your
message will be sent to the room you’re in.

Your box will now be empty. Hit enter again. That manually refreshes the room
you’re in (basically just re-selecting the current room from the menu). You may
or may not see new messages depending on how many friends you have.

Wait a little while. You may see new messages. That’s because we auto-refresh
the room for you.

Hit Escape to exit.

There are literally no other features right now. There are no colors. There are
no options. Unread counts probably don’t work. There are no unit tests. There’s only
one file and no build system. We can fix these things over time if you like.


Use github, create github issues, use topic branches, make pull requests, be
polite, be patient.


Check out git log for the Changelog. I will semver and tag once we hit v1.0.0.


Everything here is GPL v3.

About the Author

Burak Kanber is co-founder and CTO of Tidal Labs, a tech startup in digital
marketing. He loves the command line and wants to spend even more time in it,
so he took a day and built a simple CLI app using the Slack API.

Right now the plan for this repository is for me to continue contrbuting it
just to clean up some code and add the occasional feature. If I start using the
app every day, I’m sure certain things will bug me and I’ll fix them. But this
isn’t professional-grade software and isn’t intended to be. There are no unit
tests and the code is poorly organized. If you want to help me
fix that, please feel free to contribute! I’m happy to maintain this
repository, but I don’t want to hear criticism about not making this code
professional enough as I was never planning on sharing it publicly and only
made an attempt to clean if up after deciding to open source it ;).

Original URL:

Original article

Anonymous Tor Cloud Project Closes Down

Mark Wilson writes: The Tor browser is used by many to stay anonymous online — and it’s something that has been embraced by the likes of WikiLeaks as a way to safely gather information whilst hopefully avoiding the surveillance of the NSA. One lesser known project from the same stables is the Tor Cloud service, and Tor has announced that it is closing down. From the linked article: Based on the Amazon EC2 cloud computing platform, Tor Cloud provided a way to share computing resources and allow faster uncensored access to the internet. However, the project is plagued with ‘at least one major bug … that makes it completely dysfunctional’ and after failing to find anyone to undertake the work, the decision was taken to shutter Tor Cloud. This does not mean that Tor itself is dead — far from it — and developers are being encouraged to create their own forked versions of Tor Cloud.

Share on Google+

Read more of this story at Slashdot.

Original URL:

Original article

Proudly powered by WordPress | Theme: Baskerville 2 by Anders Noren.

Up ↑

%d bloggers like this: