1,286 Matching Annotations
  1. May 2016
    1. Class - Is the description or the blueprint of an object. Once a class is defined, we can create objects/instances of that class. A class name should be a noun, should begin with an uppercase letter, and each word within the name should also begin with an uppercase letter. Class names may not contain spaces.

      Body of a class - The body of a class starts with an opening brace { and ends with a closing brace }. Member variables are declared after the opening brace, and outside of any methods. Class constructors and methods are coded within the opening brace { and closing brace }. Private variables and methods have a local scope ( visibility ), that extends from the opening brace of the class body to the closing brace. (see Encapsulation)

      Constructor - A constructor is automatically called when an object is created. The constructor is were variables are initialized.

      Getters - Getters or accessor methods are called to determine the value of a variable.

      Setters - A setter or a modifier method is called to change the value of a variable.

      Other Methods - We can include as many methods in the class as we like. Some useful methods are: toString(), equals(), clone(), draw(), etc.

      Client Code - Refers to an application that uses one or more classes. The client can access the methods ot the class, but cannot directly access the data declared private in the class.

    1. The statements below placed in the main() method runs the GUI (Graphical User Interface) from an event dispatching-thread. GUIs should ve invoked from an event-dispatching thread to ensure that each event-handler finishes executing before the next one executes. Thorough coverage of this topic is beyond the scope of this lesson. However, the code shown is needed in every application that implements a Swing GUI.

    2. A Swing timer (an instance of javax.swing.Timer) fires one or more action events after a specified delay. You can use Swing timers to perform a task repeatedly. For example, you might perform animation or update a component that displays progress toward a goal.

      Swing timers are very easy to use. You create the timer, and you specify an action listener to be notified when the timer "goes off". The actionPerformed() method in this listener should contain the code for whatever task you need to be performed. To start the timer, call its start() method. In our example, the actionPerformed() method contains a call to the repaint() method. Basically this is how the paint() method is being called. We don't call paint() directly, we call repaint(), and the Java environment will run the paint() method.

    1. A class can only "implement" an interface. A class only "extends" a class. Likewise, an interface can extend another interface. A class can only extend one other class. A class can implement several interfaces.

      Extends makes it a child, inherit the class' methods and shit. You can override its shit if you want.

      Implements allows you inherit the constants that are declared, and you can define these constants. The way that works is it provides a bunch of empty methods, and you fill in the gaps

    1. Java Programming Language was developed by James Gosling, Chris Warth, Patrick Naughton, Mike Sheridan and Ed Frank at Sun Microsystems, Inc in the year 1991. At first Java Programming Language was named as Oak, later that it was renamed to Java in the year 1995. Java Programming is a platform independent language. The Internet (World Wide Web) made Java programming more valuable. Since, Internet is connected to different types of systems which having different CPU's & environments, it must have the programs to run on any OS, CPU and Platform. Since, Java programming obtain platform independence and can able to run on any platform like Unix, Intel, Mac etc., it was widely used. Java language also protects two other major issues of Internet, they are security & portability.

      Java Programming Language was developed by James Gosling, Chris Warth, Patrick Naughton, Mike Sheridan and Ed Frank at Sun Microsystems, Inc in the year 1991. At first Java Programming Language was named as Oak, later that it was renamed to Java in the year 1995.

      Java Programming is a platform independent language. The Internet (World Wide Web) made Java programming more valuable. Since, Internet is connected to different types of systems which having different CPU's & environments, it must have the programs to run on any OS, CPU and Platform. Since, Java programming obtain platform independence and can able to run on any platform like Unix, Intel, Mac etc., it was widely used. Java language also protects two other major issues of Internet, they are security & portability.

  2. Apr 2016
    1. Great Principles of Computing<br> Peter J. Denning, Craig H. Martell

      This is a book about the whole of computing—its algorithms, architectures, and designs.

      Denning and Martell divide the great principles of computing into six categories: communication, computation, coordination, recollection, evaluation, and design.

      "Programmers have the largest impact when they are designers; otherwise, they are just coders for someone else's design."

  3. Mar 2016
  4. Feb 2016
    1. Since its start in 1998, Software Carpentry has evolved from a week-long training course at the US national laboratories into a worldwide volunteer effort to improve researchers' computing skills. This paper explains what we have learned along the way, the challenges we now face, and our plans for the future.

      http://software-carpentry.org/lessons/<br> Basic programming skills for scientific researchers.<br> SQL, and Python, R, or MATLAB.

      http://www.datacarpentry.org/lessons/<br> Managing and analyzing data.

  5. Jan 2016
  6. kotlinlang.org kotlinlang.org
    1. Kent C. Dodds shares some ideas about making open source projects friendly to new contributors. He starts with the obvious things: provide guides and good documentation. He suggests adding labels that make beginner-friendly issues easy to find. One idea that was new to me: Write the specification and tests for a new feature, then let someone else implement it.

      How getting into open source has been awesome for me<br> What open source project should I contribute to?

    1. Some people are porting Apple's Swift programming language to the Raspberry Pi. At the time of this post in December 2015, they had the compiler running on RPi 2 with Ubuntu Linux. They did not yet have the Foundation libraries, the Swift Package Manager, or a version for RPi 1, and it was not certain whether it would run on Raspbian Linux.

  7. Dec 2015
    1. “The key is deliberate practice: not just doing it again and again, but challenging yourself with a task that is just beyond your current ability, trying it, analyzing your performance while and after doing it, and correcting any mistakes. Then repeat. And repeat again. There appear to be no real shortcuts: even Mozart, who was a musical prodigy at age 4, took 13 more years before he began to produce world-class music.”

      Peter Norvig's definition of deliberate practice, from "Teach Yourself to Program in 10 Years" http://norvig.com/21-days.html

    1. Pronunciations for hexadecimal numbers:<br> 0xB3 "bibbity-three"<br> 0xF5 "fleventy-five"<br> 0xDB "dickety-bee"

      BZARG is the work of Tim Babb, who lives in the San Francisco Bay Area, and is Lighting Optimization Lead for Pixar Animation Studios.

      This blog focuses primarily on graphics, physics, programming, and probably some philosophy and fiction

    1. Figuring out all subclasses of a class is called Class Hierarchy Analysis, and doing static CHA in a language with dynamic code loading is equivalent to solving the Halting Problem.

      Answer to question:

      Why can't the Scala compiler give pattern matching warning for nonsealed classes/traits?

      Elaboration:

      one of the goals of Scala is separate compilation and deployment of independent modules, so the compiler simply cannot know whether or not a class is subclass in another module, because it never looks at more than one module.

      Example: ??? When I try it, it seems to work, but this may be because everything I need is already loaded in the same compilation context. A subsequent answer seems to confirm this:

      It can be done (at least for all classes known at compile time), it's just expensive. You'd completely destroy incremental compilation, because everything that contains a pattern match would effectively have to be recompiled every time any other file changed.

    1. In 1980 Joachim Lambek showed that the types and programs used in computerscience form a specific kind of category. This provided a new semantics for talking aboutprograms, allowing people to investigate how programs combine and compose to createother programs, without caring about the specifics of implementation. Eugenio Moggibrought the category theoretic notion of monads into computer science to encapsulateideas that up to that point were considered outside the realm of such theory.
    1. A more active approach would be, for example, to introduce different types for temperatures and masses.

      Assuming that the type system provides for this. And assuming that it doesn't penalize you for doing this, for example by no longer allowing you to multiply both temperatures and masses by a plain scalar factor.

    2. Haskell has a much more expressive type system than less formal languages, and yet the Haskell community is looking for ways to make the type system even more expressive.

      Again I think the problem is that type systems want to be universal, one size fits all. Even Haskell's type system (at least at the level of the '98 standard, I don't dare make a statement about the hundreds of extensions) is not sufficient to implement dimensional analysis. And yet, implementing dimensional analysis on its own is quite straightforward.

    3. Although I mostly agree with this argument, it leaves out cost. Stronger type checking catches more errors, but at what cost?

      Dimensional analysis is indeed a simple protocol with a well-defined application domain. Type systems in programming languages want to be universal and in most cases compulsory for all of a program. Gradual typing is more flexible, but still assumes that a single type system is good for everything. Could we have type systems as libraries and use them as it seems appropriate?

  8. Nov 2015
    1. Without feedback, there are three options: I can believe, without evidence, that I am an awesome programmer.  I can believe, without evidence, that I am a terrible programmer and quit to go do something else.  Or finally, I can believe, without evidence, that I am a terrible programmer somehow successfully pretending to be an awesome programmer.

      This is a thoughtful, eloquent article. My main takeaway is that perfection is delusional, but good teamwork will overcome flaws and help everyone improve continually. All of these points are forms of feedback, or prerequisites to good feedback.

      • treat coworkers with respect
      • clear, open, honest communication
      • 3 code reviews before release
      • style guidelines
      • pair programming
      • unit tests
      • manual testing
      • user experience surveys
      • user experience analytics
    1. “Many random number generators in use today are not very good. There is a tendency for people to avoid learning anything about such subroutines; quite often we find that some old method that is comparatively unsatisfactory has blindly been passed down from one programmer to another, and today’s users have no understanding of its limitations.”— Donald Knuth; The Art of Computer Programming, Volume 2.

      Mike Malone examines JavaScript's Math.random() in v8, argues that the algorithm used should be replaced, and suggests alternatives.

    1. In my opinion one of the key properties of a scripting language is not to be found in the language itself, but rather the tools that are used to deploy it. Traditionally a script in Perl or Python can just be run, without explicitly invoking a complex compilation and linkage script.

      A good point, but unlike the author, I still feel that having a REPL is also important for distinction as a scripting language, as it facilitates rapid prototyping.

    2. almost all languages are dynamic and involve dynamic typing, even languages like Ocaml and Haskell. Every time your code interprets data and makes choices based on that, you have dynamic typing. The simple fact is that there's no hard and fast distinction between type information and data: constraints on data, such as the format of a stream of text, are type constraints which are beyond the static type system to check, so the checks are done dynamically at run time by your code, and that's dynamic typing!

      An interesting perspective, which is a bit like the dual of the Lisp mantra: "code is data".

  9. Oct 2015
  10. Sep 2015
  11. Jul 2015
  12. Jun 2015
  13. Apr 2015
  14. Feb 2015
  15. Dec 2014
    1. He said that the rock-star model makes sense only for people with “unique talents, which most people do not have.” Talented coders are like heart surgeons: “I’d rather have one really good heart surgery than three mediocre ones. This is what an economist would call indivisibility.” Like Tom Cruise and heart surgeons, the best programmers will probably always be in demand. The rest of us are more replaceable, Autor said, which means that, in general, given the choice most of us would probably choose to have an employer shield us from the vicissitudes of the marketplace.
    2. “A bad programmer might write a function that makes a hundred different ‘calls’ to the database,” Guvench said. I could almost see the dreaded spinning beach ball on the screen. A good programmer would find a more efficient way, or “hack.” “He could write a function that would just ask the database one question: ‘Give me these hundred people, along with this data about them.’ ”
    3. “There’s a programming principle called DRY,” Guvench said. “Don’t Repeat Yourself.” A bad programmer might copy and paste a command—“Make this wiggle”—a hundred different times. But a good programmer would turn the command into a handy little function.
    4. The first quality of good code is that it’s “readable—both by computers and by humans.” Humans, after all, might have to fix it at a later date—when it crashes and there are thousands of angry customers on the phone.
    5. In response, many startups have devised offbeat measures for luring candidates: offices that resemble a Chuck E. Cheese’s, with a music room (at Dropbox) and an indoor tree house (at Airbnb). Scopely, a mobile-game publishing company, rewards a new hire—or anyone who can deliver one—with eleven thousand dollars wrapped in bacon, an oil portrait of himself, and a harpoon gun.
    6. To prevent a programmer from defecting to Facebook, Google paid him three and a half million dollars in restricted stock options. Facebook has also become known for the “acquihire”: paying millions of dollars to acquire a company in order to poach its tech talent. The company gets shut down, and the engineers work for Facebook.
    7. The computer science taught in colleges still focusses more on theory than on commercial application; the business of teaching practical coding skills has the whiff of trade school. So-called coding “boot camps,” such as General Assembly, founded in 2010, are trying to fill the gap, teaching crash courses in how to design Web sites and write code. But Jake Schwartz, the co-founder and C.E.O. of General Assembly, told me, “There’s simply not enough senior people in the system.”
  16. Nov 2014
    1. The goal of this site is to provide a set of materials in support of my Python for Informatics: Exploring Information book to allow you to learn Python on your own. This page serves as an outline of the materials to support the textbook.

      http://www.pythonlearn.com/ | A great resource for starting programmers looking to build knowledge and gain skills. Open Source Course

  17. Oct 2014
  18. Feb 2014
  19. Jan 2014
    1. Once you abandon entirely the crazy idea that the type of a value has anything whatsoever to do with the storage, it becomes much easier to reason about it. Of course, my point above stands: you don't need to reason about it unless you are writing unsafe code or doing some sort of heavy interoperating with unmanaged code. Let the compiler and the runtime manage the lifetime of your storage locations; that's what its good at.

      Understanding what you should (and should not) reason about in the language you are using is an important part of good programming; and a language that lets you reason (nee worry) about only the things you need to worry about is an important part of a good programming language.

  20. Oct 2013
  21. Sep 2013
    1. Much as it is not the criminal defense lawyer's place to judge their client regardless of how guilty they are, it is not the doctor's place to force experimental treatment upon a patient regardless of how badly the research is needed, and it is not the priest's place to pass worldly judgement on their flock, it is not the programmer's place to try and decide whether the user is using the software in a "good" way or not.

      Taking this to heart / putting it on my wall.