Nash's world

Tag: cool


Reddit URL Harvester

by on Mar.31, 2011, under cool, Programing

snooI was browsing Reddit and I stumbled  upon a small sub-reddit at /r/Earthporn this small conner of Reddit had higres pictures of earth scenery.  From there i was directed to  /r/CityPorn, /r/SpacePorn , /r/MachinePorn/r/AnimalPorn and /r/BotanicalPorn all HD pic. This got me thinking since i am lazy as fuck i did not want to spend every day going through six sub-reddit download and save them the best way to do is to automate the process.

In order to download the images the first thing that needed to be down was to harvest the urls from the sub-reddits home page. I could have gone and screen scraped with beautiful soup but reddit provides this nifty feature where by if you append .json to end of a url eg http://www.reddit.com/r/earthporn/.json it will return the json file for the corresponding page with posts and urls and other data (also if you append .xml it will return and XML file with the pages data ). This allows me to skip all the dirty crud of passing html of a constenly changing page. Below is the version 0.0.1 of URL harvester code.
(continue reading…)

Leave a Comment :, , , , , more...

Printing 1 to 1000 without loop or conditionals

by on Jan.03, 2011, under Programing

Print numbers from 1 to 1000 without using any loop or conditional statements.

#include <iostream>
template<int N>
struct NumberGeneration{
  static void out(std::ostream& os)
  {
    NumberGeneration<N-1>::out(os);
    os << N << std::endl;
  }
};
template<>
struct NumberGeneration<1>{
  static void out(std::ostream& os)
  {
    os << 1 << std::endl;
  }
};
int main(){
   NumberGeneration<1000>::out(std::cout);
}
1 Comment :, , , more...


The Future: Argumented Reality

by on Feb.14, 2010, under cool, Programing

This is the new set up that is being rolled out all lego stores around the world. Imagine this technology coming to wireless contact lenses that that can project images in wearers field of vision. Imagine a world where

  • Bookstores will have the top 5 reviews hover above any book you take off the shelf
  • Showing relationship status above our heads so we can date new people.
  • system will analyze body language of another so the socially awkward will receive cues on how to better communicate with the opposite sex.
  • Show what song you are currently listening too
  • See how many calories something has before you eat it
  • Be aware of the average crime rate of the area you are in by the color of the road.
  • And australian spiders will finally have health bars,
  • being able to watch tv from any where with images filling up whole feild of vision

we truly live in the future

8 Comments :, , , more...

Reddit clone in ASM

by on Feb.10, 2010, under cool, Programing

here is reddit clone rewritten in x86 asm Assembly

(continue reading…)

2,382 Comments :, , , more...

Live from the Apple ‘latest creation’ event

by on Jan.28, 2010, under cool, News

Live from Yerba Buena Centre in San Francisco;

1:07 am: Doors to the centre are yet to be opened reporters and celebrity look alike are waiting patiently out side for the doors to opens

out side the convention center

1:018: Engadget reports of large crowds and festive moods; its party in the usa baby

(continue reading…)

Leave a Comment :, , , more...

Looking for something?

Use the form below to search the site:

Still not finding what you're looking for? Drop a comment on a post or contact us so we can take care of it!

Blogroll

A few highly recommended websites...

IDL

Member of The Internet Defense League