language agnostic - What's your most controversial programming opinion Top 10 Pinterest Pins This Week We repin images on Pinterest that capture our attention and inspire new ideas. This week's top 10 Pinterest pins contains 10 items that will have you clicking the "repin" button. This week, we included pins that ranged from handy household items to helpful tips for living. Pinners this week were quick to repin a special hairbrush that uses absorbent microfiber bristles to dry your hair as you brush. FOLLOW: Mashable on Pinterest For our top 10 pins post, we use Pinterest analytics tool Repinly to see what pinners are repinning and find interesting. What were some of your favorite Pinterest pins this week? Mashable See On Thumbnail Courtesy of Etsy, Fishstikks
No Studying After 5pm: Using Parkinson's Law to Kick Procrastination's Ass I’ve recently made four lifestyle changes that have allowed me to get more done and put much more effort into everything I do, all while feeling great with very little stress. I sleep 8 hours a dayI work out for an hour every weekdayI hide all clocks while I’m workingI don’t do anything related to academics on Saturdays and past 5pm on weekdays My main focus of this post is the last two, but I’ll briefly address the first two because I think they’re very important. Sleep I read a lot of what tech entrepreneurs have to say, and I’ve noticed a trend. Working more hours in a day doesn’t necessarily correlate with getting more done. Exercise I also made a habit of going to the gym every day from 5-6pm. Parkinson’s Law But my real trick for getting more done with much less stress is in the things that I don’t do. Work expands so as to fill the time available for its completion.— Cyril Northcote Parkinson Focus Scott H. Distractions Cover the clocks So I eliminate clocks whenever I’m working.
(2) Chinese Room Menu, Menu for Chinese Room, Kothrud Pune Chinese Room Oriental ( CRO) Was my favourite restaurant when I was in school ....! Anytime, anyone , used to ask me where I wanted to go, pat came the reply.....CRO ! I was passing by the other day....and realized that it had been a very long time since I visited this place.... Looks like nothing has changed in terms of decor, in all these years.....the same Oriental theme obvious in the artifacts and overall interior. Chicken Wonton soup- The same taste that I remember.....a teeny tiny piece of chicken inside huge wantons, in a clear broth....with lots of fresh spring onion. Paper wrapped Chicken (steamed) - Now this one is really good...! Veg Fried Rice - Decent... Shredded Lamb with diced Capsicum - This one had lamb, onion, capsicum in a medium spicy, brown sauce... Stewed Chicken with Green Onion - I like bland food in general.... so I liked this one. Desert- This was the moment I was waiting for... Though happy with the food.... Now the most annoying part...
7 Python Libraries you should know about In my years of programming in Python and roaming around GitHub's Explore section, I've come across a few libraries that stood out to me as being particularly enjoyable to use. This blog post is an effort to further spread that knowledge. I specifically excluded awesome libs like requests, SQLAlchemy, Flask, fabric etc. because I think they're already pretty "main-stream". 1. pyquery (with lxml) pip install pyquery For parsing HTML in Python, Beautiful Soup is oft recommended and it does a great job. Just how slow? What immediately stands out is how fast lxml is. So either slow and easy to use or fast and hard to use, right? Wrong! Enter PyQuery Oh PyQuery you beautiful seductress: from pyquery import PyQuerypage = PyQuery(some_html) last_red_anchor = page('#container > a.red:last') Easy as pie. There are some gotchas, like for example that PyQuery, like jQuery, exposes its internals upon iteration, forcing you to re-wrap: 2. dateutil pip install python-dateutil Handling dates is a pain. 5. sh
The Film Sufi: "About Elly" - Asghar Farhadi (2009) When middle-class Iranians in Tehran have a holiday, they often like to escape their dry urban confines and trek up north to the Caspian seaside, where everything is cooler and greener. It’s also an opportunity for people to be a little more casual and relaxed in the open air. About Elly (Darbareye Elly, 2009) is a deceptively clever film about one such holiday visit, where events don’t go exactly as planned. Over the course of the three-day weekend by the sea, the viewer is exposed to the fascinatingly complex social dynamics of people under stress. In particular, this film has things to say about some of the nuances of Iranian culture under these circumstances (but, of course, much of what happens relates generally to how all of us interact with others). The film was written and directed by Asghar Farhadi, whose subsequent production was the more famous and highly praised A Separation (2011), which won the US Oscar for Best Foreign Film. Now the finger-pointing begins. Notes:
How To Reverse a Linked List (3 Different Ways) Introduction There are a couple of ways to reverse a linked list. One of them requires knowledge of pointers and one of them is pretty straight forward. In this article, 3 different methods of reversing a linked list are demonstrated. Technique 1 In this way, a new linked list will be created and all the items of the first linked list will be added to the new linked list in reverse order. public void ReverseLinkedList (LinkedList linkedList) { LinkedList copyList = new LinkedList(); LinkedListNode start = linkedList.Tail; while (start ! This way is probably the most inefficient among the three. Technique 2 In this method, we will swap linked list node objects (references to the data). Assuming we have N nodes in the link list: Swap: 1st node’s object with Nth node’s object Swap: 2nd node’s object with (N-1)th node’s object Swap: 3rd node’s object with (N-2)th node’s object After swapping: Swapping goes on until the middle of the linked list is found. Technique 3 Conclusion
Dionysus The earliest cult images of Dionysus show a mature male, bearded and robed. He holds a fennel staff, tipped with a pine-cone and known as a thyrsus. Later images show him as a beardless, sensuous, naked or half-naked androgynous youth: the literature describes him as womanly or "man-womanish".[10] In its fully developed form, his central cult imagery shows his triumphant, disorderly arrival or return, as if from some place beyond the borders of the known and civilized. His procession (thiasus) is made up of wild female followers (maenads) and bearded satyrs with erect penises. He was also known as Bacchus (/ˈbækəs/ or /ˈbɑːkəs/; Greek: Βάκχος, Bakkhos), the name adopted by the Romans[12] and the frenzy he induces, bakkheia. In Greek mythology, he is presented as a son of Zeus and the mortal Semele, thus semi-divine or heroic: and as son of Zeus and Persephone or Demeter, thus both fully divine, part-chthonic and possibly identical with Iacchus of the Eleusinian Mysteries. Names Epithets
Leasing a Car Overview" Some of the sweetest car lease deals have dried up -- especially since automakers began offering zero-percent and low-rate financing to entice buyers. Even so, leasing remains an attractive alternative to buying a new vehicle for many motorists. Half of all luxury cars are still leased, as are more than 20 percent of vehicles in general. For most consumers, leasing a new vehicle every two or three years would be more expensive than buying one and keeping it after the final payment. Leasing has two principal benefits: (1) You can drive a newer vehicle that is always under warranty and seldom needs more than routine maintenance, and (2) you can often get a larger, more luxurious, better-equipped car. In this article, we'll help you get a better understanding of this alternative to buying, making it easier to decide whether leasing makes sense for you. Should You Buy or Lease a Car?
Exotic Data Structures A few basic data structures: Dynamic arrays Linked lists Unordered maps Ordered maps Ordered maps (over finite keys) Fully persistent ordered maps Fully persistent ordered sets Heaps 1. Compact dynamic array (compact-arrays) An indexable deque which is optimal in space and time [1]. This is simply a O(sqrtN) array of O(sqrtN) sub-arrays. Two lists of arrays are maintained, small and big (twice bigger) Also, pointers to head/tail indexes, and the big/small separation are maintained. Conceptually, the virtual array is the concatenation of all small sub-arrays followed by the big sub-arrays, and indexed between head/tail. All operations are straightforward. Asymptotic complexity: O(1) worst case queries (get/set) O(1) amortized, O(sqrtN) worst case update (push/pop) at both ends N + O(sqrtN) records of space Variant: Compact integer arrays This is implemented by growing the integer range of sub-arrays dynamically when an update overflows. 2. Monolithic lists Succinct lists Thus at least lg(N!) 3. 4.
The “static” Keyword in Java Class Variable vs Instance Variable “static” Keyword = Class Variables Variables can be declared with the “static” keyword. Example: static int y = 0; When a variable is declared with the keyword “static”, its called a “class variable”. No “static” Keyword = Instance Variables Without the “static” keyword, it's called “instance variable”, and each instance of the class has its own copy of the variable. In the following code, the class “T2” has two variables x and y. class T2 { int x = 0; static int y = 0; void setX (int n) { x = n;} void setY (int n) { y = n;} int getX () { return x;} int getY () { return y;} } class T1 { public static void main(String[] arg) { T2 b1 = new T2(); T2 b2 = new T2(); b1.setX(9); b2.setX(10); System.out.println( b1.getX() ); System.out.println( b2.getX() ); System.out.println( T2.y ); T2.y = 7; System.out.println( T2.y ); b1.setY(T2.y+1); System.out.println( b1.getY() ); } } Instance Method vs Class Methods Methods can also be declared with the keyword “static”.
Binary Trees by Nick Parlante This article introduces the basic concepts of binary trees, and then works through a series of practice problems with solution code in C/C++ and Java. Binary trees have an elegant recursive pointer structure, so they are a good way to learn recursive pointer algorithms. Contents Section 1. Stanford CS Education Library -- #110 This is article #110 in the Stanford CS Education Library. Related CSLibrary Articles Linked List Problems ( -- a large collection of linked list problems using various pointer techniques (while this binary tree article concentrates on recursion) Pointer and Memory ( -- basic concepts of pointers and memory The Great Tree-List Problem ( -- a great pointer recursion problem that uses both trees and lists Section 1 -- Introduction To Binary Trees Binary Search Tree Niche Basically, binary search trees are fast at insert and lookup. Strategy Lookup() 1.
Online Python Tutor - Learn programming by visualizing code execution Learning C with GDB Coming from a background in higher-level languages like Ruby, Scheme, or Haskell, learning C can be challenging. In addition to having to wrestle with C's lower-level features like manual memory management and pointers, you have to make do without a REPL. Once you get used to exploratory programming in a REPL, having to deal with the write-compile-run loop is a bit of a bummer. It occurred to me recently that I could use gdb as a pseudo-REPL for C. I've been experimenting with using gdb as a tool for learning C, rather than merely debugging C, and it's a lot of fun. My goal in this post is to show you that gdb is a great tool for learning C. An introduction to gdb Start by creating the following little C program, minimal.c: int main() { int i = 1337; return 0; } Note that the program does nothing and has not a single printf statement. Compile it with the -g flag so that gdb has debug information to work with, and then feed it to gdb: $ gcc -g minimal.c -o minimal $ gdb minimal Amazing!