Search Results

Search found 22083 results on 884 pages for 'display templates'.

Page 11/884 | < Previous Page | 7 8 9 10 11 12 13 14 15 16 17 18  | Next Page >

  • Haml Inherit Templates

    - by kjfletch
    I'm using Haml (Haml/Sass 3.0.9 - Classy Cassidy) stand-alone to generate static HTML. I want to create a shared layout template that all my other templates inherit. Layout.haml %html %head %title Test Template %body .Content Content.haml SOMEHOW INHERIT Layout.haml SOMEHOW Change the title of the page "My Content". %p This is my content To produce: Content.html <html> <head> <title>My Content</title> </head> <body> <div class="Content"> <p>This is my content</p> </div> </body> </html> But this doesn't seem possible. I have seen the use of rendering partials when using Haml with Rails but can't find any solution when using Haml stand-alone. Having to put the layout code in all of my templates would be a maintenance nightmare; so my question is how do I avoid doing this? Is there a standard way to solve this problem? Have I missed something fundamental?

    Read the article

  • Building static (but complicated) lookup table using templates.

    - by MarkD
    I am currently in the process of optimizing a numerical analysis code. Within the code, there is a 200x150 element lookup table (currently a static std::vector < std::vector < double ) that is constructed at the beginning of every run. The construction of the lookup table is actually quite complex- the values in the lookup table are constructed using an iterative secant method on a complicated set of equations. Currently, for a simulation, the construction of the lookup table is 20% of the run time (run times are on the order of 25 second, lookup table construction takes 5 seconds). While 5-seconds might not seem to be a lot, when running our MC simulations, where we are running 50k+ simulations, it suddenly becomes a big chunk of time. Along with some other ideas, one thing that has been floated- can we construct this lookup table using templates at compile time? The table itself never changes. Hard-coding a large array isn't a maintainable solution (the equations that go into generating the table are constantly being tweaked), but it seems that if the table can be generated at compile time, it would give us the best of both worlds (easily maintainable, no overhead during runtime). So, I propose the following (much simplified) scenario. Lets say you wanted to generate a static array (use whatever container suits you best- 2D c array, vector of vectors, etc..) at compile time. You have a function defined- double f(int row, int col); where the return value is the entry in the table, row is the lookup table row, and col is the lookup table column. Is it possible to generate this static array at compile time using templates, and how?

    Read the article

  • How to convert a lambda to an std::function using templates

    - by retep998
    Basically, what I want to be able to do is take a lambda with any number of any type of parameters and convert it to an std::function. I've tried the following and neither method works. std::function([](){});//Complains that std::function is missing template parameters template <typename T> void foo(function<T> f){} foo([](){});//Complains that it cannot find a matching candidate The following code does work however, but it is not what I want because it requires explicitly stating the template parameters which does not work for generic code. std::function<void()>([](){}); I've been mucking around with functions and templates all evening and I just can't figure this out, so any help would be much appreciated. As mentioned in a comment, the reason I'm trying to do this is because I'm trying to implement currying in C++ using variadic templates. Unfortunately, this fails horribly when using lambdas. For example, I can pass a standard function using a function pointer. template <typename R, typename...A> void foo(R (*f)(A...)) {} void bar() {} int main() { foo(bar); } However, I can't figure out how to pass a lambda to such a variadic function. Why I'm interested in converting a generic lambda into an std::function is because I can do the following, but it ends up requiring that I explicitly state the template parameters to std::function which is what I am trying to avoid. template <typename R, typename...A> void foo(std::function<R(A...)>) {} int main() { foo(std::function<void()>([](){})); }

    Read the article

  • django templates array assignment

    - by Hulk
    The following is in views: rows=query.evaluation_set.all() row_arr = [] for row in rows: row_arr.append(row.row_details) dict.update({'row_arr' : row_arr ,'col_arr' : col_arr}) return render_to_response('valuemart/show.html',context_instance=RequestContext(request,{'dict': dict})) How to extract the row_Arr array in the templates in javascript and list out all its values.row_Arr contains data of a column <script> var row_arr = '{{dict.row_arr}}'; //extract values here </script> Thanks..

    Read the article

  • Default template arguments for function templates

    - by Arman
    Why are default template arguments only allowed on class templates? Why can't we define a default type in a member function template? For example: struct mycclass { template<class T=int> void mymember(T* vec) { // ... } }; Instead, C++ forces that default template arguments are only allowed on a class template.

    Read the article

  • Good Administration Center Templates

    - by Alec Smart
    Hello, This may not be a programming question per se. But I am wondering what template do you use for your sites/webapps admin centers. Am looking primarily at free templates that give a basic structure. I know I can build my own, but I haven't had too much success in something that works for all my webapps/sites. Wondering if there is something nice and comprehensive available. Thank you for your time.

    Read the article

  • Django templates tag error

    - by Hulk
    def _table_(request,id,has_permissions): dict = {} dict.update(get_newdata(request,rid)) return render_to_response('home/_display.html',context_instance=RequestContext(request,{'dict': dict, 'rid' : rid, 'has_permissions' : str(has_permissions)})) In templates the code is as, {% if has_permissions == "1" %} <input type="button" value="Edit" id="edit" onclick="javascript:edit('{{id}}')" style="display:inline;"/>&nbsp;&nbsp;&nbsp;&nbsp; {% endif %} There is a template error in has_permissions line. Can any 1 tell me what is wrong here. has_permissions has the value 1 or 0.

    Read the article

  • Is it possible to have 'sub-templates' when using MailDefinition

    - by Dan
    I am using the MailDefinition class to create html emails for my site. The only problem I am having is that there is alot of repetition in the string templates. For example the email footer along with all the associated html and css has to be repeated in each template type. Is there a way to have sub-template? or some mechanism for avoiding this repetition?

    Read the article

  • High quality graph/waveform display component in C#.

    - by dlopeztt
    Hi, I'm looking for a fast, professionally looking and customizable waveform display component in C#. I'm wanting to display mainly real-time audio waveforms (fast!) in both time and frequency domain. I would like the ability to zoom, change axis settings, display multiple channels, customize the feel and colors etc... Anybody knows of anything, whether commercial or not? Thank you! Diego

    Read the article

  • [jQuery] Animate hidden hyperlink to display:block

    - by cube
    Hi guys, given a hidden hyperlink (hidden by setting display: inline in a css file), how can I achieve to animate this hyperlink to 'display:block'? Neither show() nor the following code .animate({ display: block }, { duration: 500 } do work! Anny suggestions? Cheers, cube

    Read the article

  • Mirroring a portion of the screen to an external display (in OSX)

    - by Adam
    I would like to write a program that can mirror a portion of the main display into a new window. Ideally this new window could then be displayed on an external monitor. I have seen this uiltity for a flightsim that does this on a pc (a multifunction display extractor). MFDex http://trac2.assembla.com/lightnings..._x86_Setup.msi I have looked at screen magnifiers or vnc clients for ideas but I think I need to write something from scratch. I have tried to do some reading on osx programing but where do I start in terms of gaining access to the display? I somehow need to extract the graphics from a particular program. Is it best to go near the final output stage (the individual pixels sent to the display) or somewhere nearer the window management stage. Any ideas or pointers would be much appreciated. I just need somewhere to start from. Regards,

    Read the article

  • How can I solve display glitches and poor performance with ATI fglrx driver on my ThinkPad X100e?

    - by rewbs
    I noticed that video performance on my Thinkpad X100e was very poor compared to Windows 7, so I installed the ATI fglrx proprietary drivers by using the "Additional Drivers" dialogue box. The system has an ATI Radeon Mobility HD 3200 chip. The result of installing the drivers is pretty devastatingly negative, with symptoms such as skewed content in windows, browser tabs and text boxes failing to refresh when their content changes. In fact, please excuse typos in this post, because I can't really see what I am typing. :) I also notice that HD video playback performance is no better - perhaps even worse - than prior to installing the drivers. Example of what I see: Here's the output of fglrxinfo: display: :0.0 screen: 0 OpenGL vendor string: ATI Technologies Inc. OpenGL renderer string: ATI Radeon HD 3200 Graphics OpenGL version string: 3.3.10237 Compatibility Profile Context Output of lspci | grep -i vga: 01:05.0 VGA compatible controller: ATI Technologies Inc RS780M/RS780MN [Radeon HD 3200 Graphics] I'm on Ubuntu 10.10 with kernel 2.6.35-22-generic-pae. What can I try? Many thanks, -R

    Read the article

  • Why is my display name in Ubuntu Software Center some weird set of letters?

    - by Ike
    In USC, after I submit a review, my display name is "Bnxdcty"... a swell name, but where did it come from? I have checked the ubuntu single sign on page, verified my nickname on there, changed it to something else and back again for good measure, but still my reviewer name is somehow still "Bnxdcty". I even unauthorized ubuntu software center and then re-opened it/authorized it to my account. Does this just appear as this to me and others see my correct user nickname? It doesn't bother as much as it confuses me. I just know it will be something stupid that everyone knows but me.

    Read the article

  • How can I solve display glitches and poor performance with ATI fglrx driver on my ThinkPad X100e?

    - by rewbs
    Hi all, I noticed that video performance on my Thinkpad X100e was very poor compared to Windows 7, so I installed the ATI fglrx proprietary drivers by using the "Additional Drivers" dialogue box. The system has an ATI Radeon Mobility HD 3200 chip. The result of installing the drivers is pretty devastatingly negative, with symptoms such as skewed content in windows, browser tabs and text boxes failing to refresh when their content changes. In fact, please excuse typos in this post, because I can't really see what I am typing. :) I also notice that HD video playback performance is no better - perhaps even worse - than prior to installing the drivers. Example of what I see: Here's the output of fglrxinfo: display: :0.0 screen: 0 OpenGL vendor string: ATI Technologies Inc. OpenGL renderer string: ATI Radeon HD 3200 Graphics OpenGL version string: 3.3.10237 Compatibility Profile Context Output of lspci | grep -i vga: 01:05.0 VGA compatible controller: ATI Technologies Inc RS780M/RS780MN [Radeon HD 3200 Graphics] I'm on Ubuntu 10.10 with kernel 2.6.35-22-generic-pae. What can I try? Many thanks, -R

    Read the article

  • Display size comparison chart?

    - by Pekka
    I am in the process of collecting laptop recommendations for a friend. I need a way to show to her the size differences of the various formats (15" 4:3, 15" 16:9, 15" 16:10 .... up to 17.3") in a graphical way, so she can compare them to the laptop she currently has (15"). Does anybody know a simple comparison chart where those sizes are shown side-by-side? We have E-Mail connection only right now, so I would need some sort of a link or PDF document.

    Read the article

  • Set Display Refresh Rate in OSX w/o External Utilities

    - by codedonut
    I have an iMac and an LG Flatron connected as a secondary monitor. The recommended resolution for the flatron is 1680x1050 @ 65.290 Hz (horiz), 59.954 Hz (vert). For some reason, OSX is choosing a slightly different set of scan rates and this is currently my best guess of why the monitor goes into power saving mode when connected to the iMac (but works fine on a PC). Now, I resolved this by installing switchResX and fudging the scan rates according to the specs in the manual. But how does one change these rates w/o 3rd party tools? Which config files need editing? Thanks

    Read the article

  • Setting Screen Resolution for Extended Display on Windows 8

    - by ptamzz
    I'm using a Dell Inspiron laptop with Windows 8 Developers Preview. I've connected a second screen (some Dell 22 inch one) and have been using it with 'Extend these displays' options in the Screen Resolution settings. It use to be all fine but yesterday I changed my VGA cable to the 2nd monitor and since then the resolution of the 2nd monitor is not setting properly. Earlier, while auto detecting the monitor, the right resolution use to appear but now, as you can see from the attached image, none of the resolution in the drop down fits with the right proportion. So how do I set the right screen resolution. (I think the right one is 1680 x 1050 which is not there in the list)

    Read the article

< Previous Page | 7 8 9 10 11 12 13 14 15 16 17 18  | Next Page >