.NET Pains – #1

Me: Hey, I’d like to automatically invoke all my authentication / logging code for my API calls.
.NET: Totally got just the thing for you. Use IDisptachMethodInspector, look for the right events and call your Auth code. Also, use Aspect Oriented Programming. Since AOP is a giant pain in the ass to configure though, use this plugin that you can buy for $500 to automate it.
Rails: Use before_filter, around_filter.

Of perspective hacks.

So, I’ve recently finished reading Betty Edwards’ excellent Drawing on the right side of the brain. Here’re my before and after sketches .. and these were within a week or so of each other.

Before:

Image

After:Image

Hey, don’t judge!

Anyways, was doing a bit of research on where to go from here, and ended up reaching the following conclusions about sketching:

1. There are no lines.

2. The lines you think you see are just changes in contrast.

3. When sketching, ignore / look past color. Imagine a HSB scale and varying brightness values with the same hue / sat. Imagine a red scarf half in bright light and half in shadow. Even though your brain adapts and recognizes the scarf as one single object with just one color due to a bunch of cool hacks, the raw color values you perceive are different.

4. Drawing what you see is relatively easy (Judging by my improvement over the past week). Drawing what you imagine is hard. This is even more complicated because we think we can imagine landscapes and faces in detail, but in reality they are incredibly fuzzy and impossible to recall with any amount of detail. This applies even to your most recent / strongest memories. And by recent, I mean even something you saw a couple of seconds ago. You look up at your subject. You think you see the shape of a shadow. You look down to draw it from memory. Look up, and what do you know, you screwed it up.

5. Following #4, since drawing from imagination was so hard, how did people do it? Well .. they’ve developed a bunch of hacks or frameworks if you prefer on how light / shadows work, perspectives and compositions.

(Note: Approaching a territory where my knowledge is spotty at best. Don’t take this to be true. I shall update this post as I learn more.)

6. Lets start with lights / shadows: You start with the idea that all of reality can be depicted using basic shapes: Spheres, cylinders, cones and cubes. You study each of these objects with one light source and then multiple light sources to figure out how shadows are cast. Then you look to nature for inspiration. One rule which is kinda cool: “If the object casting the shadow be of the same color as the subject upon which the shadow falls, the the shadow itself is darker than the shaded side of the object casting it, and it is still darker than if it falls on an object darker than itself. When an object casts its shadow on another object of a lighter color then the shadow is lighter than the shaded side of the object casting the shadow”. Here’s a lot more info: http://www.drawinghowtodraw.com/drawing-lessons/improve-drawing/articles/jsa-drawing-lights-shadows.html
7. perspective, I haven’t explored too much. But this seems to be a reasonably good article from the youtube vids I’ve explored. http://drawsketch.about.com/od/perspectivetechdrawing/tp/perspectiveindex.htm
8. Most people are atleast already vaguely familiar with rules of composition. Rule of thirds, golden ratio and such. No point jumping into another complicated topic right now.
Additional notes: To draw humans well, you’d also need a working knowledge of human anatomy along with an intuitive understand of how the body will look like in various poses. To aid this there are again a bunch of ways you can practice starting with drawing everything from an anatomy text book to doing quick 30 second sketches of the human body in a dynamic pose.
All in all, it’s a lot of work / fun. Get sketching!

Facebook Page Categories

A quick piece of info about Facebook Categories. A page’s category differs based on what API you use to access the page. I’ll give a few examples to illustrate my point:

PageId: 138834692818669

Name: Q-Management

Category (via Graph API): Local Business.

Category (via FQL): Modeling Agency (more accurate)

PageId: 100383549148

Name: Bouley

Category via Graph API: Restaurant/cafe

Category via FQL: French Restaurant / Fine Dining Restaurant

This behavior is bugging me a lot. There’s an authoritative list of categories you can get if you’re just sticking with the Graph API. But if you need finer resolution (and honestly, more accurate), that’s obviously not enough.

I’ve written a python script that takes a set of coordinates and gets a list of the categories of the closest 1000 places to those coordinates. It was heavily biased towards the USA and NY / SF in particular because I expect that is the target audience for an app I’m making. If you’d like to run it with a different set of coordinates, I’ll leave the code up on github.

But anyway, to save you some frustration, here’s an authoritative list of categories as far as I could find. Please let me know if I’m missing anything down in the comments (along with the page_id) and I’ll happily add it.

 

Trade School 1
Lodge 1
Buddhist Temple 1
Insurance Agent 1
Region 1
Toy Store 1
Patio/Garden 1
State 1
Entertainment Consultant 1
Bridal Shop 1
Automotive 1
Pub 1
Health/Medical/Pharmaceuticals 1
Specialty Food Store 1
Lutheran Church 1
Antiques & Vintage 1
Church 1
Transport/Freight 1
Home Cleaning 1
Animal Shelter 1
Home 1
Consulate/Embassy 1
Bike Shop 1
Just For Fun 1
Tattoo & Piercing 1
Dermatologist 1
Commercial & Industrial Equipment 1
Health Food Restaurant 1
Public Relations 1
Event Planner 1
Computers & Electronics 1
Library 1
Inn 1
Housewares 1
Scandinavian Restaurant 1
Educational Research 1
Brewery 1
OBGYN 1
Thrift or Consignment Store 1
Mobile Phone Shop 1
Social Services 1
Sports Club 1
Russian Restaurant 1
Scuba Diving 1
Korean Restaurant 1
Music Store 1
Gift Shop 1
Personal Trainer 1
Locksmith 1
Limo Service 1
Comic Book Store 1
Hunting and Fishing 1
Accountant 1
Outlet Store 1
App Page 1
Convenience Store 1
Public Transportation 1
Railroad 1
Candy Store 1
TV Network 1
Alternative & Holistic Health 1
Health Agency 1
Shoe Store 1
Sports Instruction 1
Swimwear 1
Church of God 1
Health/Wellness Website 1
Ethiopian Restaurant 1
Women’s Health 1
Music Lessons & Instruction 1
Taxi 1
Camera Store 1
Airport Shuttle 1
Pet Store 1
Medical Research 1
Attraction 1
Computer Training 1
Insurance Broker 1
Bank 1
Restaurant Wholesale 1
Advertising Service 1
Sports Arena 1
Bridge 1
Gay Bar 1
Hawaiian Restaurant 1
Sportswear 1
Insurance Company 1
Musical Instrument Store 1
Hotel Supply Service 1
Studio 1
German Restaurant 1
Entertainment Service 1
Kosher Restaurant 1
Clinic 1
Mattresses & Bedding 1
Non-Governmental Organization (NGO) 1
Synagogue 1
Fruit & Vegetable Store 1
Janitorial Service 1
Asian Fusion Restaurant 1
Rental Shop 1
African Restaurant 1
Senior Center 1
Blood Bank 1
Circus 1
Commercial Real Estate 1
Collectibles Store 1
Swimming Pool 1
Health Care Administration 1
Casino 1
Meat Shop 1
Language School 1
Food Consultant 1
Small Business 1
Business Consultant 1
Photographer 1
Tennis 1
Email Marketing 1
Petting Zoo 1
Music Production 1
Episcopal Church 1
Cooking Lesson 1
Social Club 1
Mediterranean Restaurant 1
Antique Store 1
Ramen Restaurant 1
Aerospace/Defense 1
Tour Guide 1
Beach Resort 1
Pregnancy & Childbirth Service 1
Karaoke 1
Community Center 1
Law Practice 1
Malaysian Restaurant 1
Pharmacy 1
Writing Service 1
Home Improvement 1
Greek Restaurant 1
Family Medicine Practice 1
Kitchen Supplies 1
Accessories Store 1
Race Track 1
Research Service 1
Asian Restaurant 1
Web Development 1
Religious Book Store 1
Tutoring 1
Barber Shop 1
Technical Institute 1
Parking 1
City Hall 1
Highway 1
Nondenominational Church 1
Food & Beverage Service & Distribution 1
Airline 1
Airport Lounge 1
Tex-Mex Restaurant 2
Dessert Restaurant 2
Pool & Billiards 2
Professional Sports Team 2
Medical Spa 2
Educational Service 2
School Sports Team 2
Deli 2
Hospital/Clinic 2
Furniture Store 2
Brazilian Restaurant 2
Attractions/Things to Do 2
Modern Art Museum 2
Diner 2
Train Station 2
Hair Salon 2
Veterinarian 2
Auction House 2
Legal/Law 2
Subway/Light Rail Station 2
Pet Service 2
Sports Center 2
Vietnamese Restaurant 2
Tours & Sightseeing 2
Wine Bar 2
Police Station 2
Caribbean Restaurant 2
Health Food Store 2
Sporting Goods Store 2
Online Advertising Service 2
Vegetarian/Vegan Restaurant 2
Tapas Bar/Restaurant 2
Ice Cream Parlor 2
Physical Fitness 2
Shopping Service 2
Medical School 2
Market 2
Medical Center 2
Physical Therapist 2
Cultural Gifts Store 2
Christian Church 2
Wedding Planning 2
Counseling & Mental Health 2
Florist 2
Entertainer 2
Playground 2
Recreation Center 2
Party Center 2
Newspaper 2
Tour Company 2
Broadcasting & Media Production 2
Donuts & Bagels 2
Book & Magazine Distribution 2
Yoga & Pilates 2
Acupuncture 2
Spanish Restaurant 2
Public Square 2
Vacation Home Rental 2
Church of Jesus Christ of Latter-day Saints 2
Cemetery 2
Funeral Service 2
DVD & Video Store 2
Dim Sum Restaurant 2
Outdoor Gear/Sporting Goods 3
Spa 3
Interior Designer 3
Automobiles and Parts 3
Winery/Vineyard 3
Culinary School 3
Apartment/Condo Building 3
Department Store 3
Video Games 3
Hair & Beauty Supply 3
Modeling Agency 3
Photographic Services & Equipment 3
Arts & Marketing 3
Courthouse 3
Skin Care 3
Marketing Consultant 3
Latin American Restaurant 3
Charity Organization 3
Bands & Musicians 3
Architect 3
Residence & Other 3
Convention Center 3
Performing Arts Education 3
Liquor Store 3
Graphic Design 3
Business Center 3
Makeup Artist 3
Dance Club 3
Catholic Church 3
Event Planning 4
Jewelry Store 4
Specialty Grocery Store 4
Publisher 4
High School 4
Golf Course 4
Barbecue Restaurant 4
Web Design 4
Outdoor Recreation 4
Tourist Information 4
Nightlife 4
Tea Room 4
Martial Arts 4
Cosmetics & Beauty Supply 4
Advertising Agency 4
Children’s Clothing Store 4
Music 4
Transportation Service 4
Airport 4
Thai Restaurant 4
Bank/Financial Institution 4
National Park 4
Educational Organization 4
Workplace/Office 4
Street 4
Art Museum 5
Museum/Art Gallery 5
Electronics Store 5
Pediatrics 5
Fast Food Restaurant 5
Community & Government 5
Seafood Restaurant 5
Women’s Clothing Store 5
Nail Salon 5
Dentist 5
Roller Coaster 5
Bakery 5
Arcade 5
Outdoors 5
Sports Bar 5
Real Estate Service 6
Zoo & Aquarium 6
Water Park 6
Beauty Salon 6
Book Store 6
Burger Restaurant 6
Grocery Store 6
Startup 6
Real Estate Agent 6
Bar & Grill 6
Spa, Beauty & Personal Care 7
Doctor 7
Corporate Office 7
French Restaurant 7
New American Restaurant 7
Lounge 7
Consulting/Business Services 7
Beach 7
Pizza Place 7
Religious Center 7
Sushi Restaurant 8
Steakhouse 8
Retail and Consumer Merchandise 8
Event Venue 8
Sandwich Shop 8
Performance Venue 8
Computers/Technology 8
Japanese Restaurant 8
Real Estate 8
Dance Instruction 8
Gym 8
Media/News/Publishing 8
Radio Station 8
Mexican Restaurant 8
Airport Terminal 9
Fine Dining Restaurant 9
Movie Theatre 9
Historical Place 9
Lodging 9
Religious Organization 9
Shopping District 9
Food & Grocery 9
Breakfast & Brunch Restaurant 10
Concert Venue 10
Food & Restaurant 10
Organization 10
Clothing Store 10
Event 10
Shopping Mall 11
Theatre 11
Health/Beauty 11
Business Services 11
Museum 11
Public School 12
Coffee Shop 13
Travel Agency 13
Art Gallery 13
Community Organization 13
Hospital 13
Chinese Restaurant 13
Amusement Park Ride 14
Italian Restaurant 14
Fitness Center 14
Park 14
Food/Beverages 14
Landmark 15
Night Club 15
Internet/Software 15
Family Style Restaurant 16
Medical & Health 16
American Restaurant 17
Cafe 17
Government Organization 18
School 18
Amusement 19
Sports & Recreation 20
Resort 21
Sports Venue/Stadium 21
Public Places & Attractions 22
City 25
Company 32
Hotel 32
Professional Services 33
Arts & Entertainment 34
Education 34
Theme Park 36
College/University 36
Shopping & Retail 42
Bar 43
Tourist Attraction 46
Non-Profit Organization 49
Restaurant 59
Neighborhood 66
Local Business 89

Happy Coding!

Teja

Sketching

So, one of my new years resolutions was to learn how to sketch. It is a pretty amazing thing .. being able to draw. I was distinctly average at it all through out my childhood. I don’t mean that in a bad way .. I wasn’t horrible. I could copy biology diagrams and maps from text books just fine. But when it came to drawing / painting contests, I was stuck in this no mans land between bad and good. And as a lil’ guy, you care more about kicking peoples asses in Cricket than painting right?

So, fast forward 20 years or so and I haven’t thought too much about sketching / painting myself till I discovered this link on hackernews. I was going through the books in that list and found this little gem called “Drawing on the right side of the brain”. It piqued my curiosity. I thought drawing and painting were gifts you were either born with or not. And now there’s this little book that promises to teach anyone how to draw. Their before and after paintings were orders of magnitude more legit than your pet weight loss program’s. So, why not, right?

First up, the book is brilliant and I would totally recommend it to any newbie learning how to sketch. I’ve scoured the internets and decided that if I was to learn to sketch, it had to be this book. It approaches sketching in a very n00b friendly / logical way. Without spoiling too much .. let me just say I was enlightened in the first few hours of working through the book. It gave me belief that I’ll end up being reasonably good at drawing pictures.

So, naturally, I’ve progressed to reading and learning about paintings in my spare time in the past week. I’ve learnt about the renaissance, baroque, romanticism till upto cubism / abstract-art. The last two have been very hard hitting philosophically. It forced me to ask myself the question – “why do I sketch?” Obviously any old point and shoot camera will do a better job at capturing a subject than anything even the best artists could come up with. So why? I guess the logical extension is that you give up on depicting real-world subjects in paint. Painting then stops being about how well you can depict reality and moves to what is your interpretation of reality. I admit, I’m as clueless as you are when it comes to paintings by people like Jackson Pollock, but it does give a framework to think about paintings by the impressionists, post-impressionists, cubists and the fauvists.

That about wraps up what I wanted to vent about today (And to think I wanted to tweet this!). Next few blog posts, I might end up posting a few sketches I’ve been making =)

Coffee

Image

There’s something magical about the afternoon coffee. Just watching a steaming hot mug ‘o joe gets your brain working overdrive. Your mood instantly elevates. The delicious aroma of the coffee bean primes your tongue for a sip of the dark brown liquid. You take that first sip and briefly feel almost omnipotent.

You’re ready to sieze the day but there’s a nagging feeling. What if you’re missing out? What if it could be even better ? Here’s some coffee geekery. It’s the time of the year for resolutions, so why not start with drinking or brewing better coffee? I’ll leave you with an excerpt:

Good coffee is good – great even – all by itself. It’s also dirt cheap and easy to make. Therefore, don’t settle for a cup of crappy coffee: make a cup of the good stuff for yourself.

The coffee quick course

If you follow these three guidelines and do nothing more, you will enjoy coffee better than you can find in most specialty coffee shops:

  1. Buy only whole-bean coffee roasted within the last few days.

  2. Grind it fresh, just before brewing.

  3. Brew it in a French press or a pour-over filter using fresh water, off the boil.

Have a great 2013!

Quotable Quotes

                       Who really knows? Who will here proclaim it? 
                       Whence was it produced? Whence is this creation? 
                       The Gods came afterwards, with the creation of this universe. 
                       Who then knows whence it has arisen?

                       Whence this creation has arisen
                       – perhaps it formed itself, or perhaps it did not - 
                       the One who looks down on it, 
                       in the highest heaven, only He knows 
                       or perhaps even He does not know. 

                                                   – Nasadiya Shloka, Rig Veda c.1700 – 1100 BC