|
PIEBALDconsult wrote: Fibonacci and Factorials are particularly poor targets for recursion
That depends a lot on your language. In Haskell, for example, which employs lazy evaluation, they work just fine.
In a procedural language, factorials only really work well in the presence of tail call optimization, and fibs not at all, without some form of Memoization[^] going on.
|
|
|
|
|
I find hiding the branch in the expression
res[n<2]</pre> to be kinda cheating.<br />
<div class="signature"><small><a href="http://www.codeproject.com/Articles/453077/Generating-Keys-for-a-Custom-Sort-Order"><code>ORDER BY what user wants
|
|
|
|
|
It looks like a pain in ***whatever really hurts here***
Seulement, dans certains cas, n'est-ce pas, on n'entend guère que ce qu'on désire entendre et ce qui vous arrange le mieux... [^]
|
|
|
|
|
This isn't a new idea. I first came across this type of programming back in the 90s when we had to integrate one of our systems into a language called ObjectStar (formerly Huron). I remember the O* devs as being real zealots - they worked for a company called Amdahl that was heavily involved in pushing it.
|
|
|
|
|
Objectstar did have conditionals, it just wasn't with if-then-else, do while, etc. You put in an evaluation and if it was true or false executed certain lines of code. It took a while to wrap your head around but was pretty simple once you had the "a-ha" moment.
|
|
|
|
|
Ahh. That wasn't what the Amdahl devs were telling us. They tried to keep it all mysterious and mystical. We had a visit from a guy called something like Dara Yuvari (who'd invented the language IIRC), and you'd have thought it was the second coming of the messiah.
|
|
|
|
|
No, no second coming. I did 6 years of O* programming with a VB front end. I liked it and they had plenty of great ideas but it was a closed system. Objectstar was the DB, the programming language and the problem reporting system all rolled into one. It allowed you to rewrite ANY of the programming language as well, gave you the option to fix anything. The programming environment was done in a 3270 terminal emulator so the coding window was small. if I remember correctly you were limited to 5 conditions, 40 lines of code and upon saveing the code you were obliged to add a comment to explain what it did.
Looked something like this.
variable1 > 3 | Y N
variable2 > 5 | Y Y N
---------------------------------
some code to execute | 1 1
more code to exectue | 2
still more code... | 2
still more code... | 1
call another chunk of code| 3 3 3
----------------------------------
|
|
|
|
|
Mathics is a free, general-purpose online computer algebra system featuring Mathematica-compatible syntax and functions. It is backed by highly extensible Python code, relying on SymPy for most mathematical tasks and, optionally, Sage for more advanced stuff. Use Mathics online or download and install in your local environment.
|
|
|
|
|
Adherence to DRY (“Don’t Repeat Yourself”) does not necessarily preclude repetition of code. In the endless struggle to refactor, the entropy we are trying to reduce is not in the raw text of our source code; it is in our business logic, which (in applications with little or poor testing) is often uncodified. Sometimes, refactoring can hamstring our code, and when done naïvely it can be a source of technical debt, rather than an antidote thereto. If you use copy and paste while you’re coding, you’re probably committing a design error. Except when you're not.
|
|
|
|
|
If you are not a computer scientist most of these people will, almost certainly, be unknown to you. Sadly the popular drinking game 'name that computer scientist' is, for you, over quickly. This may not seem a big problem but I would wish to argue otherwise. The scientists below have set out the foundations of our digital world. Their work is beautiful and important. It is furthermore, of the highest cultural significance spanning the boundaries of mathematics, engineering, psychology and the natural sciences. It is what we computer scientists aspire to. How many do you know? What others would you include?
|
|
|
|
|
|
I'd take Codd off the list. And I think maybe some others could have done their work without a computer, much as Alan Turing did.
I could nominate Sacha.
|
|
|
|
|
Facebook wants an awful lot from its emoticons: They should be able to convey complex emotions, for example, like contemplation, admiration, affirmation, maternal love, determination, devotion, resignation, and gratitude. But how, in a tiny digital image, do you depict something as subtle as shame as opposed to remorse, or shyness as opposed to modesty? Current emoticons can't do that, or anything close to it. So Facebook has turned to Pixar story illustrator and former storyboard artist at the Wallace and Gromit studio Matt Jones, to help make something entirely new. He's charged, basically, with reinventing the smiley.
|
|
|
|
|
Today, Nginx offers fewer features than Apache, but its performance is significantly higher. In this way, it's not unlike MySQL or NoSQL in the database market, or JBoss and Tomcat in the application server market, or any number of other open source examples where the open-source alternative is initially feature-constrained but significantly better for a particular purpose. Over time, it adds functionality and continues to improve performance until, like Linux in the server and mobile operating system markets, it dominates. Apache won the web server market ages ago... That is, until recently.
|
|
|
|
|
Microsoft has been pummeled by critics this week over supposedly inadequate storage space in its new Surface Pro. But those criticisms are horribly flawed. Big surprise: when you do the disk space math, Surface Pro and MacBook Air are practically twins. Gibibytes, Gigabytes... let's call the whole thing off.
|
|
|
|
|
No, there's only one area where Android falls really, horribly, undeniably short when it comes to the tablet form factor: The web browser. It's the most fundamental tablet app, IMHO, and yet the web experience on Android could not possibly be worse. I honestly have no idea how this is possible. And it's not just Chrome: a survey of browser experiences on Android.
|
|
|
|
|
There are plenty of people whose paths seem to be effortless when it comes to getting the best opportunities. And although you may wonder what the person’s secret is, the truth is that there’s really no secret to be bottled.
http://www.recruiter.com/i/4-habits-of-highly-successful-job-seekers/[^]
Twenty years from now you will be more disappointed by the things that you didn't do than by the ones you did do. So throw off the bowlines. Sail away from the safe harbor. Catch the trade winds in your sails. Explore, Dream. Discover.
|
|
|
|
|
A whole page of fluff. O, happy day.
Bastard Programmer from Hell
If you can't read my code, try converting it here[^]
|
|
|
|
|
TL;DR: Be fluffy. But not to much.
|
|
|
|
|
You’re close to shipping and you receive a shopping list of bugs and changes. Some are tiny and un-eventful, some are show stoppers, some let the bad guys in, and some are simply scope creep trying to sneak through the door. It’s hard to know where to start without reclassifying them because the majority of them are all labelled Critical. It’s time to sit down with whoever documented your bugs and do some talking… Prioritize your work: read this first!
|
|
|
|
|
I use a number of text editors. The three I have pinned to my taskbar are Visual Studio, Sublime Text 2, and Notepad 2. I have three because I like features from one and wish those features were in another. Sublime Text (and a few other editors) has a great feature called Simultaneous Editing. It's the very definition of an advanced - but core - editor feature. Enter the MultiEdit extension for Visual Studio. Holding down ALT while mouse-clicking in the editor will add multiple selection points, so when you type, text will be added to all the selected positions. Should this be a built-in feature of VS?
|
|
|
|
|
|
Most developers stagnate both intellectually and productively after 4-5 years in industry; they adopt some tools, pick up some patterns, learn a language or two, and maybe they’re even able to work at a successful company and contribute to some important products. Great! But what happens when you hand a developer a blank sheet of paper and the opportunity for them to own a product? Most of the time: chaos and failure. If you want to be a better developer, it starts with changing the way you look at your code and how you program.
|
|
|
|
|
He makes good points but perhaps misses the deaper reason for the 'lack of confidence' he often sites as being behind failures. All too often this is due to developers who can use the tools but don't really have a deep understanding of how they work. They panic when given a blank sheet of paper because they've never been asked or asked themselves the question. "What if I really had to start from scratch?" and then gone away and worked out the answers. This is not about taking the customer point of view or understanding that it's business problems that we're solving it's quite the reverse it's about caring about code for the sake of code. First wanting to do it right and to have full insight into what's happening from the registers upwards so that you can make sure it's done right, own it completely and understand it completely. If developers never get to do this why is it a surprise that they lack confidence and rely on habituated ways of doing things. Most have spent their entire carrers being told not to look under the hood, just fix the surface problem and get it shipped, because people who don't understand software will never grasp that that is not where the long term interest of the business lies.
"The secret of happiness is freedom, and the secret of freedom, courage."
Thucydides (B.C. 460-400)
|
|
|
|
|
How do you store sensitive configuration options (such as usernames, passwords, etc.) in source control? Typically what I’ve done is to just punt on the problem entirely. I create a dummy configuration file, such as conf/sample-settings.json which has the basic structure but none of the details filled out.... The technique I picked up from Craig was to, instead, keep an encrypted version of the configuration file in source control and then provide a means through which the user can encrypt and decrypt that data. Check out the comments for some potential concerns and additional tips.
|
|
|
|