background preloader

Programing

Facebook Twitter

The one line you should add to every makefile. If you're using GNU make and you need help debugging a makefile then there's a single line your should add. And it's so useful that you should add it to every makefile you create. It's: print-%: ; @echo $*=$($*) It allows you to quickly get the value of any makefile variable. For example, suppose you want to know the value of a variable called SOURCE_FILES.

Make print-SOURCE_FILES If you are using GNU make 3.82 or above it's not even necessary to modify the makefile itself. Make --eval="print-%: ; @echo $*=$($*)" print-SOURCE_FILES to get the value of SOURCE_FILES. How that works The line defines a pattern-rule that matches any target in the form print-% (the % is the wildcard character). The command executed by print-% is @echo $*=$($*). Print-%: @echo $*=$($*) Using semicolon makes this easy to copy and paste. The automatic variable $* matches the % in print-% (so when executing print-SOURCE_FILES, $* will be SOURCE_FILES). More? Using Lua with C++. Part 4. LuaBridge. Variables and functions | Elias Daler.

This part of tutorial doesn’t depend on the others so you can start here even if you haven’t read the previous parts! Part 1. Why Lua is great and why you should use it. Writing simple wrapper/binding and using Lua for configuration files Part 2. Getting arrays and calling Lua functions from C++ Part 2.5. Template getArray function and other modifications Part 3. Using scripts with C++ is great. I wrote about how you can develop your own binding library in previous chapters. I’ve tested lots of libraries and found LuaBridge to be the most awesome.

Download LuaBridge from the repository You also need to download Lua. Add Lua include/ directory and LuaBridge to include directories and link lua52.lib to your project. Create script.lua with this code in it: Add main.cpp to your project: Compile and run this program. LuaBridge works! Note: if your program doesn’t compile and you get something like “error C2065: ‘lua_State’ : undeclared identifier” in luahelpers.h, you need to do the following Yes.

How to destroy Programmer Productivity | George Stocker. The following image about programmer productivity is making its rounds on the internet: As Homer Simpson might say, it’s funny because it’s true. I haven’t figured out the secret to being productive yet, largely because I have never been consistently productive. Ever. Joel Spolsky talks about this in one of his blog posts: Sometimes I just can’t get anything done.Sure, I come into the office, putter around, check my email every ten seconds, read the web, even do a few brainless tasks like paying the American Express bill. I’ve read that blog post about half a dozen times now, and It still shocks me that someone who we see as an icon in the programmer community has a problem getting started.

I’m glad I’m not alone. I’m not here to share any secret methods to being productive, but I can tell you what has kept me from being productive: Open Floor plansDevelopers arguing about Django vs. .NETDevelopers arguing in generalA coworker coming up to me and asking, “Hey, did you get that email I sent?” Lessons | typing.io. Details details details details details details details details details details details details details details details details details. Windows Phone Dev Center. Questions I'm asking in interviews - Julia Evans.

In a fit of “open source your interview process”, I tweeted yesterday with the list of questions I’m drawing from when interviewing. A lot of people responded in the gist with amazing suggestions, and I thought I’d consolidate them here so they don’t get lost in my pile of gists. My basic strategy is to spend 20 minutes before each interview I do and pick some appropriate questions from this list.

I’ve tried to categorize them a bit. A lot of these are outright stolen from Edward O’Campo-Gooding’s list of questions, as well as from various people at Hacker School. I’d love suggestions for more! Special thanks to @bmastenbrook, @marcprecipice, @danluu, @kelseyinnis, @zmagg, @graue, and @ircolle for awesome question suggestions. Edit: A few more things: I don’t ask all of these in first interviews.

Engineering practices What version control system do you use? Management style How does engineering work get assigned? Quality of life How much vacation do people get? Community involvement Culture. What Makes a Good Programmer Good? - Hi, I'm Josh Symonds. I’ve worked with a lot of programmers over the years — some of them super amazing, and some distinctly lackluster. As I’ve had the pleasure of working with some very skilled individuals recently, I spent some time thinking about what I admire in them.

What makes a good programmer so good, and a bad programmer so bad? Or, to mangle English a little bit, what makes a good programmer good? Based on my experiences, being a great programmer has nothing to do with age, education, or how much money you make. Certainly there’s more to being a good programmer than anyone can enumerate, and I wouldn’t judge any programmer solely based on the presence (or lack) of these practices. They do their research Or “measure twice, cut once.” Whatever you call it, most programming problems you’re likely to encounter have been solved in some form already — Ecclesiastes had it right in observing there was nothing new under the sun.

They read error messages (and act on them) They go to the source They just do it. Questions I'm asking in interviews - Julia Evans. Things I Wish Someone Had Told Me When I Was Learning How to Code — Learning to Code. Before you learn to code, think about what you want to code Knowing how to code is mostly about building things, and the path is a lot clearer when you have a sense of the end goal. If your goal is “learn to code,” without a clear idea of the kinds of programs you will write and how they will make your life better, you will probably find it a frustrating exercise.

I’m a little ashamed to admit that part of my motivation for studying computer science was that I wanted to prove I was smart, and I wanted to be able to get Smart Person jobs. I also liked thinking about math and theory (this book blew my mind at an impressionable age) and the program was a good fit. It wasn’t enough to sustain me for long, though, until I found ways to connect technology to the things I really loved, like music and literature. So, what do you want to code? There’s nothing mystical about it Coding is a skill like any other.

This guy (a very smart guy! It never works the first time HTML isn’t real coding. What Makes a Good Programmer Good? - Hi, I'm Josh Symonds. 10 Easy Steps to a Complete Understanding of SQL. Too many programmers think SQL is a bit of a beast. It is one of the few declarative languages out there, and as such, behaves in an entirely different way from imperative, object-oriented, or even functional languages (although, some say that SQL is also somewhat functional). I'm writing SQL every day and embracing SQL with my Open Source Software jOOQ. I thus feel compelled to bring the beauty of SQL a bit closer to those of you still struggling with it. The following tutorial is destined for readers who have already worked with SQL but never completely understood itreaders who know SQL well but have never really thought about its syntaxreaders who want to teach SQL to others This tutorial will focus on SELECT statements only. 1.

Get this into your head first. SELECT first_name, last_name FROM employees WHERE salary > 100000 Easy to understand. What do we learn from this? So if this is so simple, what's the problem? Forget about all that. 2. There are three things to note: 3. FROM a, b 4. HOW A BLACKSMITH LEARNED TO CODE AND 9 MONTHS LATER GOT HIRED MAKING $70K. UPDATE September 2016: We are now inundated with bootcamps and it's getting harder to land a junior developer position. I created a course to help you get hired faster, a proven method that I've used for the past year with my coaching clients.

This course is the EXACT way I helped my coaching clients get hired, for a more affordable price and in the shortest amount of time! Everyone everywhere is pushing this whole "Learn To Code" movement, but is it actually possible? This former Blacksmith/Farrier says a resounding: "YES! " I wrote a Book on how to do what I did, but here's the condensed version of how I went from zero experience writing code to getting hired 9 months later as a junior developer and how you can do the same! I finally decided to teach myself to code after getting my hand kicked real bad and breaking my thumb while shoeing a horse. Month 1 ~Pick a language to learn.

. ~ Start a blog today and blog 3x per week. ~ Download and start learning how to use Sublime Text 3. Month 2. Good tests, bad tests. No doubt about it, automated testing is in vogue. Everyone knows that if you want to impress an interviewer, all you have to do is fawn on about getting paranoid with whatever JUnit clone is in your language’s ecosystem. This is better than a complete ambivalence or hostility towards testing, but a middle is commonly excluded. Yes, testing is great One of the saving graces of being a human is that you can anticipate your own stupidity and avoid error with planning and practices.

But we can go too far. So what do you test? One of the things that I always ask a serious engineering candidate at Percolate is, given some basic module, what does the shape of your automated test look like? I usually give them a contrived but illustrative example, the sorter module: The example is not very Pythonic in all sorts of ways, but it’s a great playground for getting a sense of how someone decides what to test. 4 times out of 5, a candidate’s answer will resemble something like Wow! Slow down, Tonto Better. Pen. Programmer's Guide to XYZ, RGB. Written October 2013. Updated February 2015. All RGB, XYZ, and yxY numbers in this tutorial are floating point numbers. RGB numbers have the nominal range 0 to 1, as does Y from XYZ and xyY.

Nominal ranges are often extended in practice. Color On the one hand, light comes from the sun or other radiant sources, and is refracted by mediums (water, the atmosphere, glass) and diffusely or specularly reflected by surfaces. Color mapping experiments: what the average human sees In the late 1920s William David Wright and John Guild independently conducted a series of color matching experiments that mapped out all the colors the average human (meaning the average of the humans in the experiments) can see.

Visualizing XYZ To visualize XYZ, think of a three-dimensional cartesian coordinate system (high school algebra) with axes labelled X, Y, and Z. Real colors and imaginary colors Theoretically, the XYZ axes go off to infinity in both the positive and negative direction. Imaginary colors. Real colors. Setting up SDL in Visual Studio. Now that we’ve got the libraries installed we’ll want to create a new project to include and link against SDL. At the end we’ll save this as a template project so in the future we can just load our template and get to work. First we need a new empty C++ project. Setting the Include Path We’ll need to add the SDL include directory so that the compiler can find the SDL headers.

Since we also want these configurations to be the same for Debug and Release modes, be sure to select All Configurations on the Configuration menu. Add a new folder to this window and navigate to your SDL include directory. Setting the Library Path To add the library paths and the linker dependencies head to the Linker settings section and open the General page. Adding the Library Dependencies Now we’ll add the libraries themselves as dependencies. Selecting the SubSystem The final step is to select the SubSystem target. The Test Program The program we’re building for this lesson is a simple sanity check for SDL. Select a Language. Help What is repl.it? It is an online environment for interactively exploring programming languages. The name comes from the read-eval-print loop, the interactive toplevel used by languages like Lisp and Python.

How do I start? Once you have selected a language, start by typing an expression into the console on the right side of the screen and pressing Enter. Your expression will be evaluated in the selected language and its result will be printed. Repeat until satisfied. Can I use variables or other state? Yes! Can I save my session? Yes! Is repl.it open source? Can I use repl.it on my phone or tablet? Yes! How does repl.it work? All code processed by repl.it runs entirely on your computer, with no server-side evaluation. Enter Evaluate the entered command. Shift+Enter Continue to the next line. Tab Indent. Shift+Tab Unindent. Up Previous history item. Down Next history item. Ctrl+Up Move to the line above the cursor. Ctrl+Down Move to the line below the cursor. Ctrl+E Move to the end of the current line. Untitled.

Tutorials

Languages. Free & Open Source Engines. Brain Fuck Scheduler. The objective of BFS, compared to other schedulers, is to provide a scheduler with a simpler algorithm, that does not require adjustment of heuristics or tuning parameters to tailor performance to a specific type of computation workload. The BFS author asserted that these tunable parameters were difficult for the average user to understand, especially in terms of interactions of multiple parameters with each other, and claimed that the use of such tuning parameters could often result in improved performance in a specific targeted type of computation, at the cost of worse performance in the general case.[4] BFS has been reported to improve responsiveness on light-NUMA (non-uniform memory access) Linux mobile devices and desktop computers with fewer than 16 cores.

[citation needed] Benchmarks[edit] Kernels patched with the ck1 patch set including the BFS outperformed the vanilla kernel using the CFS at nearly all the performance-based benchmarks tested. Adoption[edit] See also[edit] BFS's FAQ.

Scripting