background preloader

Polls - What is the best comment in source code you have ever encountered

Polls - What is the best comment in source code you have ever encountered

Le Long Voyage. Q : Hé moi aussi je veux un beau site comme ça, vous me le faites ? WordPress est un logiciel participatif, normalement chacun peut reprendre un habillage et l’adapter, rien n’est “déposé”.Cela dit nous avons décidé de ne pas le mettre non plus en open-source. On s’est donné du mal pour faire un truc joli et on ne veut pas que ce soit repris n’importe comment par n’importe qui. Nous avons donc préféré nous dire que nous filerions l’accès à ce format d’habillage à des dessinateurs dont nous connaissons/apprécions le travail !Après, personnellement, je considère la partie WordPress comme le travail d’Arnold et je le laisse complètement décider de ce qu’il veut faire avec ! Q : Ouah quel joli blog, comment t’as fait ?

language agnostic - What's your most controversial programming opinion Human teleportation would take so long, it’d be more like a death ray Teleportation is always as sci-fi dream, but recently scientists have been able to teleport nano-sized objects across significant distances. We’re still nowhere near teleporting even the smallest, visible-to-the-naked-eye objects, but that didn’t stop a team of researchers from calculating how long it’d take to teleport an entire human being. It’s very, very long. Students from the University of Leicester, David Starkey, Suzanne Thomas, Declan Roberts, and James Nelms, have calculated how long it would take to teleport a human. The length of time is dependent on bandwidth, and more bandwidth requires more power. Since we can’t teleport humans — or even a paperclip — just yet, the researchers performed a fair bit of guesswork that checks out in theory. If the bandwidth used to perform the transfer were around 30GHz, it would take 4.85×1015 years to complete. You would’ve died long before you reached your destination, unless of course the teleportation process also somehow preserves you.

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.

30 Books I’m Glad I Read Before 30 In various ways, these 30 books convey some of the philosophy of how Angel and I live our lives. I honestly credit a fraction of who I am today to each title. Thus, they have indirectly influenced much of what I write about on this site. A medley of both fiction and nonfiction, these great reads challenged my internal status quo, opening my mind to new ideas and opportunities, and together they gave me a basic framework for living, loving, learning and working successfully. If you haven’t read these books yet, I highly recommend doing so. They will enrich your library and your life. Stumbling on Happiness by Daniel Gilbert – Gilbert, a Harvard professor of psychology has studied happiness for decades, and he shares scientific findings that just might change the way you look at the world. What are your favorite books? Photo by: Katie Harris

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

10 Forgotten Fantastical Novels You Should Read Immediately Fans of magical prose and magical worlds, take heart. Titan Books has recently released a special limited edition version of steampunk legend James Blaylock’s The Aylesford Skull, a classic from one of the genre’s trailblazers. To celebrate the release, Blaylock has put together a list of forgotten or ignored works of literature that have inspired his own writing, and should be must-reads for anyone interested in science fiction or the fantastic. Blaylock writes: “Why these novels turned out to be inspirational is a long story, too long to recount here, and in fact sometimes I can’t quite say: a sensibility, maybe, that seemed to me to be True in some regard, a sense of humor that was also a sense of proportion, wisdom of a whimsical variety, an evocative atmosphere, intriguing characters, a level of eccentricity that was somehow made perfectly plausible, a giant cephalopod. All of that is very murky, of course. Phantastes, George MacDonald

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

A l'heure de pointe, l'enfer de la ligne 13 du métro... de Pékin 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?

The 30 Best Films of the Decade We’re all in that humanistic mode of evaluating our lives – coming up on the end of the year and the last time a zero will be the third digit on our calendars. We’re all (from Variety to Cat Fancy) also waxing expert on what films were the best of the best of the best of the past ten years. Which is why there is an unnavigable sea of opinion polluting the internet right now. Neil and I thought, ‘If everyone else is doing it, why can’t we? You may ask (since I’m forcing you to rhetorically), “How can giving your opinion be better than everyone else’s tepid version of an almost-arbitrary-seeming list?” I’m glad you asked. Neil and I anticipated this task back in October and began planning what would become far too much work for two people who essentially sit around watching Animal House all day. The algorithm, which we’ve nicknamed Simon, spat out just over 300 films, reducing our master list by 90%. After 6 cutting sessions and over 4 hours of arguing, we’d chopped the list down to 60.

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.

J.K. Rowling Should Try the Voting Algorithm Frequent contributor Bennett Haselton proposes a new use for online, anonymous voting: helping sort skill from luck in the cheek-by-jowl world of best-selling (and would-be best-selling) authors: "J.K. Rowling recently confirmed that she was the author of a book she had published under a pseudonym, which spiked in sales after she was outed as the true author. Perhaps she was doing an experiment to see how much luck had played a role in propelling her to worldwide success, and whether she could recreate anything close to that success when starting from scratch. Rowling confirmed (after the information leaked accidentally) that she had authored a new book, The Cuckoo's Calling, under the male pseudonym Robert Galbraith, which went on to sell only about 1,500 copies before she announced that she was the real author and sales of the book spiked 150,000%. But if either J.K. Rowling or King could approach a pre-established amateur fiction hosting site with a large number of registered users.

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”.

Related: