Questions tagged [boilerplate]

In computer programming, boilerplate is the term used to describe sections of code that have to be included in many places with little or no alteration. It is more often used when referring to languages which are considered verbose, i.e. the programmer must write a lot of code to do minimal jobs.

524 questions
6
votes
2 answers

Question about cl_mem in OpenCL

I have been using cl_mem in some of my OpenCL boilerplate code, but I have been using it through context and not a sharp understanding of what exactly it is. I have been using it as a type for the memory I push on and off the board, which has so far…
smuggledPancakes
  • 9,881
  • 20
  • 74
  • 113
6
votes
3 answers

Factoring product type assignments in OCaml

I'm generally unsatisfied with writing code like this: let load_record_field cursor gets geti gett a = function | 0x01 -> let c, s = gets () in (a.a_record_uuid <- s; `More_record c) | 0x02 -> let c, s = gets () in (a.a_group <- s; `More_record…
mbac32768
  • 11,453
  • 9
  • 34
  • 40
5
votes
1 answer

Backbone Boilerplate Template

I'm very new to backbone but I manage to get it working from tutorial. But when I want to port those application to the backbone boilerplate I find myself stuck at the template. How do I access my model from my template? or even from the js file…
Athiwat Chunlakhan
  • 7,589
  • 14
  • 44
  • 72
5
votes
3 answers

Is there an existing library of extension methods for C#? or share your own

Possible Duplicate: Post your extension goodies for C# .Net (codeplex.com/extensionoverflow) I'm fond of C# 3.0. One of my favorite parts is extension methods. I like to think of extension methods as utility functions that can apply to a broad…
Jeff Meatball Yang
  • 37,839
  • 27
  • 91
  • 125
5
votes
1 answer

How to call a Vimscript function that has a range using local variables, from within another function?

Here is an example that I am working with. It is intended to add a boilerplate to a file, and then comment out those lines using Vim BlockComment() plugin function. The goal is to mark the line number before I read from the file and after I have…
MrDaniel
  • 583
  • 1
  • 7
  • 19
5
votes
2 answers

How to remove gap between header and container div in HTML5 Boilerplate

I'm keen to use Paul Irish's HTML5 boilerplate but I've encountered a css problem. I want the header to be flush at the top of the page but I can't the container div adds a gap that I'm unable to get rid of. I think this has something to do with the…
techjacker
  • 1,348
  • 2
  • 13
  • 13
5
votes
5 answers

How do I use Paul Irish's Conditional comments in a SharePoint 2010 master page

I want to use Paul Irish's Conditional comments from the Boilerplate HTML template: