Search Results

Search found 6937 results on 278 pages for 'template'.

Page 16/278 | < Previous Page | 12 13 14 15 16 17 18 19 20 21 22 23  | Next Page >

  • Specializing function template for both std::string and char*

    - by sad_man
    As the title says I want to specialize a function template for both string and char pointer, so far I did this but I can not figure out passing the string parameters by reference. #include <iostream> #include <string> template<typename T> void xxx(T param) { std::cout << "General : "<< sizeof(T) << std::endl; } template<> void xxx<char*>(char* param) { std::cout << "Char ptr: "<< strlen(param) << std::endl; } template<> void xxx<const char* >(const char* param) { std::cout << "Const Char ptr : "<< strlen(param)<< std::endl; } template<> void xxx<const std::string & >(const std::string & param) { std::cout << "Const String : "<< param.size()<< std::endl; } template<> void xxx<std::string >(std::string param) { std::cout << "String : "<< param.size()<< std::endl; } int main() { xxx("word"); std::string aword("word"); xxx(aword); std::string const cword("const word"); xxx(cword); } Also template<> void xxx<const std::string & >(const std::string & param) thing just does not working. If I rearranged the opriginal template to accept parameters as T& then the char * is required to be char * & which is not good for static text in code. Please help !

    Read the article

  • MVC 2 Editor Template for Radio Buttons

    - by Steve Michelotti
    A while back I blogged about how to create an HTML Helper to produce a radio button list.  In that post, my HTML helper was “wrapping” the FluentHtml library from MvcContrib to produce the following html output (given an IEnumerable list containing the items “Foo” and “Bar”): 1: <div> 2: <input id="Name_Foo" name="Name" type="radio" value="Foo" /><label for="Name_Foo" id="Name_Foo_Label">Foo</label> 3: <input id="Name_Bar" name="Name" type="radio" value="Bar" /><label for="Name_Bar" id="Name_Bar_Label">Bar</label> 4: </div> With the release of MVC 2, we now have editor templates we can use that rely on metadata to allow us to customize our views appropriately.  For example, for the radio buttons above, we want the “id” attribute to be differentiated and unique and we want the “name” attribute to be the same across radio buttons so the buttons will be grouped together and so model binding will work appropriately. We also want the “for” attribute in the <label> element being set to correctly point to the id of the corresponding radio button.  The default behavior of the RadioButtonFor() method that comes OOTB with MVC produces the same value for the “id” and “name” attributes so this isn’t exactly what I want out the the box if I’m trying to produce the HTML mark up above. If we use an EditorTemplate, the first gotcha that we run into is that, by default, the templates just work on your view model’s property. But in this case, we *also* was the list of items to populate all the radio buttons. It turns out that the EditorFor() methods do give you a way to pass in additional data. There is an overload of the EditorFor() method where the last parameter allows you to pass an anonymous object for “extra” data that you can use in your view – it gets put on the view data dictionary: 1: <%: Html.EditorFor(m => m.Name, "RadioButtonList", new { selectList = new SelectList(new[] { "Foo", "Bar" }) })%> Now we can create a file called RadioButtonList.ascx that looks like this: 1: <%@ Control Language="C#" Inherits="System.Web.Mvc.ViewUserControl" %> 2: <% 3: var list = this.ViewData["selectList"] as SelectList; 4: %> 5: <div> 6: <% foreach (var item in list) { 7: var radioId = ViewData.TemplateInfo.GetFullHtmlFieldId(item.Value); 8: var checkedAttr = item.Selected ? "checked=\"checked\"" : string.Empty; 9: %> 10: <input type="radio" id="<%: radioId %>" name="<%: ViewData.TemplateInfo.HtmlFieldPrefix %>" value="<%: item.Value %>" <%: checkedAttr %>/> 11: <label for="<%: radioId %>"><%: item.Text %></label> 12: <% } %> 13: </div> There are several things to note about the code above. First, you can see in line #3, it’s getting the SelectList out of the view data dictionary. Then on line #7 it uses the GetFullHtmlFieldId() method from the TemplateInfo class to ensure we get unique IDs. We pass the Value to this method so that it will produce IDs like “Name_Foo” and “Name_Bar” rather than just “Name” which is our property name. However, for the “name” attribute (on line #10) we can just use the normal HtmlFieldPrefix property so that we ensure all radio buttons have the same name which corresponds to the view model’s property name. We also get to leverage the fact the a SelectListItem has a Boolean Selected property so we can set the checkedAttr variable on line #8 and use it on line #10. Finally, it’s trivial to set the correct “for” attribute for the <label> on line #11 since we already produced that value. Because the TemplateInfo class provides all the metadata for our view, we’re able to produce this view that is widely re-usable across our application. In fact, we can create a couple HTML helpers to better encapsulate this call and make it more user friendly: 1: public static MvcHtmlString RadioButtonList<TModel, TProperty>(this HtmlHelper<TModel> htmlHelper, Expression<Func<TModel, TProperty>> expression, params string[] items) 2: { 3: return htmlHelper.RadioButtonList(expression, new SelectList(items)); 4: } 5:   6: public static MvcHtmlString RadioButtonList<TModel, TProperty>(this HtmlHelper<TModel> htmlHelper, Expression<Func<TModel, TProperty>> expression, IEnumerable<SelectListItem> items) 7: { 8: var func = expression.Compile(); 9: var result = func(htmlHelper.ViewData.Model); 10: var list = new SelectList(items, "Value", "Text", result); 11: return htmlHelper.EditorFor(expression, "RadioButtonList", new { selectList = list }); 12: } This allows us to simply the call like this: 1: <%: Html.RadioButtonList(m => m.Name, "Foo", "Bar" ) %> In that example, the values for the radio button are hard-coded and being passed in directly. But if you had a view model that contained a property for the collection of items you could call the second overload like this: 1: <%: Html.RadioButtonList(m => m.Name, Model.FooBarList ) %> The Editor templates introduced in MVC 2 definitely allow for much more flexible views/editors than previously available. By knowing about the features you have available to you with the TemplateInfo class, you can take these concepts and customize your editors with extreme flexibility and re-usability.

    Read the article

  • Generate HTML pages from some template

    - by Appu
    I have an open-source project for which I have to generate HTML pages to put on the web. I wanted to keep everything as simple HTML pages. The problem with this approach is if I need to change the design, I have to goto all the pages and change it. This will be tough as I have lot of pages. Is there some kind of HTML generators which can process simple annotated text files? This way, I can maintain the documentation and website contents as plain text files and run it through this program to generate static HTML pages. This also helps in keeping the design consistent. Any help would be great!

    Read the article

  • Available for Download: SharePoint Video Library Template

    SharePoint Video Library provides a simple way to share and organize flash video files (.FLV) in a SharePoint site.  read moreBy Alon HaviviDid you know that DotNetSlackers also publishes .net articles written by top known .net Authors? We already have over 80 articles in several categories including Silverlight. Take a look: here.

    Read the article

  • storing map template in database

    - by Timigen
    I am working on an application that displays choropleth maps. These maps are of all different types, some display state by county, country by state/province, or world by country. How should I handle storing the map information in the database? My Thoughts: I won't need to do queries to find POI inside a region, so I don't think there is a need to use spatial datatypes. I am considering storing a map as a geoJSON object (I am using JS mapping library that accepts geoJSON). The only issue is what if I want a map of the US northeast. Then I would have geoJSON for the US and a separate one for the US northeast, which would be redundant. Would it make sense to have a shape database where I had each state then when I needed a map of the US I could query for each state, and when I needed a map of the US Northeast I could again query for what I need? Note: I am not concerned with storing the data for each region, just the region itself. I will query for the data on the fly for the specific region.

    Read the article

  • Converting PSD to Joomla Template

    The internet is home to millions of websites all advertising different products or services and competing for your attention with their attractive website designs. Many websites advertise free templates that can be downloaded and used for your own website and others that offer professional looking templates for a small fee. The problem with these services is that they are common throughout the internet with many websites using the same themes.

    Read the article

  • SharePoint Video Library Template Available For Download

    SharePoint Video Library provides a simple way to share and organize flash video files (.FLV) in a SharePoint site.  read moreBy Alon HaviviDid you know that DotNetSlackers also publishes .net articles written by top known .net Authors? We already have over 80 articles in several categories including Silverlight. Take a look: here.

    Read the article

  • Powerpoint template image placeholders can't send to back

    - by Marcus
    We want to be able to set up a PowerPoint 2007 template with a picture frame image. We then want to insert an image in normal view which would appear behind the picture frame image that was put in the template (so it looks logically like a picture in a picture frame). Problem is, when we insert the image in normal view it always appears on top of the picture frame image. It appears that you can't send to back when the other elements are included in a template. Any ideas?

    Read the article

  • Really simple FOSS CSS for a report?

    - by Andrew
    I'm creating a web-based report. It will be a single column, no menu. Just titles, graphs, tables. Maybe a header and a footer. I've scoured the internet for a free, open source (or just 'free') CSS 'template' that will turn my grotty looking HTML page in to a nicely colored page with good fonts. Something simple I can just drop in. Is there such a thing? My issue is that I'm not a designer, I just want to pop something in and have it work and look good.

    Read the article

  • Networking not starting - OpenVZ default Ubuntu 12.04 Template

    - by Stu2000
    I have been using HyperVM to deploy OpenVZ Ubuntu 12.04 server instances. Unfortunately, they all boot without networking enabled. I tried inserting int the crontab: @reboot /usr/sbin/service networking restart But this didn't work. Running this command (without @reboot) from the CLI will result in the network starting and being able to use commands like ifconfig so I get the feeling it is just a matter of the cron being called too soon? What is the best practice for resolving the issue. I am guessing something along the lines of adding an upstart job?

    Read the article

  • Joomla Template Club Makes Your Web Design a Breeze

    Building a new web site will be a lot of trouble when you begin looking at all the minute details. You have to find a company that can provide you with a domain name that is offered and expresses the... [Author: Joel Morrison - Web Design and Development - April 20, 2010]

    Read the article

  • Game engine IDE template [on hold]

    - by Spencer Killen
    Hey so I'm working on a fairly basic javascript game, and it's beginning to get to the point where my 'engine' to which I wrote, is difficult to manage in an all text environment, Iv already thought of using a javascript IDE like jet brains, but i was wondering if I could go 1 step further and have use a piece of software to purpose as an IDE and have a customizable GUI that I could use to automate class construction and such, for example, I have it set up right now so that everytime I want to create a new block (it's a platformer) I must copy a text file and fill in all the setting such as bounding box, sprite ect, it would be a lot easier if I could press a button and have a menu apear where I would fill in these values (I have a game maker background) is there software like this? If not what are some similar solutions to my problem?

    Read the article

  • Custom Team Build Template for Microsoft Dynamics NAV in TFS 2010

    - by ssmantha
    To cook this recipe you need the following ingredients: 1) An installation of TFS 2010 Team Build Service on a server 2) Visual Studio 2010 for cooking 3) Use the following Hints on the web: a)  http://www.codeproject.com/KB/library/AutoupateNAV.aspx – use this wrapper to perform the basic tasks b) http://www.richard-banks.org/2010/11/how-to-build-linux-code-with-tfs-2010.html – for ideas on how to customize the build templates   And finally lot of patience and luck, took me about 120 failed builds to get the first one right!!   Please feel free to ask questions, I would be happy to help!!

    Read the article

  • Building non (jsp/freemarker) template based website [on hold]

    - by Ismail Marmoush
    If my web app is supposed to work in one page, something like asana.com, and I wanted to make the whole website free of templates, meaning I would serve data and make js/mobile app call them, or even let other developers create new interfaces for it. So is it acceptable to have such a design for such a problem ? or you think I would eventually have use jsps/freemarker for a certain case. I found something when I started asking the right questions, here is it wiki: Single Page Application

    Read the article

  • Admin form that generates an email confirmation ends up in SPAM [duplicate]

    - by PJD Creative
    This question already has an answer here: How can I prevent my mail from being classified as spam? 10 answers I have an admin form that I have setup for a client, that generates an email confirmation from a template I have designer... It works really well but it ends up in spam some of the time, and this is real frustrating as it is just confirming some details for the customer of what they have just booked, not at all spam, and is accessed via a page where the admin requires login. Any suggestions as to why this may end up in spam. It does have dollar signs ($$) as it is confirming a price, im assuming this is one problem, the rest of it is just general dates and info about the confirmation. Is there any suggestions on how to get this out of spam? thanks in advance

    Read the article

  • HTML5 article tag application for the iPad/iPhone

    - by dspencer
    I've used article tags on websites. My understanding and practice is to use the article tag for publication content. I always use HTML/HTML5 tags as their intended purposes and not at will. Recently, I've seen an HTML template that uses the article tag for the non-publication page content such as the content of an About Us page or any other generic page. I asked the why it was used this way and the (vague) explanation was that it had to do with the way the iPad read the tag. Is this true?

    Read the article

  • Software developer resume template/builder/etc

    - by codecraig
    As a software developer, I'm curious as to what tools, apps, templates, etc. other developers use for creating a resume. Such as LinkedIn, ceevee.com, github resume generator, etc. I use some of the things I've mentioned but I don't really like the out-dated style of resume created by ceevee.com, but I'm also not much of a designer. Anyone have any "nice" (as in design, ease of use) templates/apps/services you use?

    Read the article

  • Creating Visual Studio Extension Files (VSIX) for Template Deployment

    While working on some plugins for the new Seesmic Desktop PlatformI got sick of copying and pasting some boiler plate code over and over. I had created some helper templates for myself so that I could say FileNew Seesmic Desktop Plugin and get everything I needed initially. This weekend I had some time and formalized those templates into an easy-to-use installer for anyone to consume. NOTE: It is likely that Seesmic themselves will create developer project/item templatesthese were for my own...Did you know that DotNetSlackers also publishes .net articles written by top known .net Authors? We already have over 80 articles in several categories including Silverlight. Take a look: here.

    Read the article

  • PDF form (not) saving

    - by gregseth
    Hi, I've created a form in a PDF with Adobe Acrobat Pro. When empy, I want to use it as a template which the user opens, fills in, and saves as a copy to preserve the blank state of the template. Here's the trick : I found both ways to make the document read only - the user can't save the form value, only print them make the document writeable, but in this case the document acting as a template can be modified too. Any ideas? Thanks.

    Read the article

  • Quickly ubuntu-application + indicator template don't work

    - by aliasbody
    I've started to work with quickly and python (because I wanted to have some GTk3 integration and create and appindicator), and so I create the projecto like this : quickly create ubuntu-application ualarm cd ualarm quickly run And the application launched. But then I tried to add the appindicator like this : quickly add indicator And since then the application doesn't start anymore and this error appear : aliasbody@BodyUbuntu-PC:~/Projectos/ualarm$ quickly run (ualarm:8515): Gtk-WARNING **: Theme parsing error: gnome-panel.css:28:11: Not using units is deprecated. Assuming 'px'. /usr/lib/python2.7/dist-packages/gi/overrides/Gtk.py:391: Warning: g_object_set_property: construct property "type" for object `Window' can't be set after construction Gtk.Window.__init__(self, type=type, **kwds) Traceback (most recent call last): File "bin/ualarm", line 33, in <module> ualarm.main() File "/home/aliasbody/Projectos/ualarm/ualarm/__init__.py", line 33, in main window = UalarmWindow.UalarmWindow() File "/home/aliasbody/Projectos/ualarm/ualarm_lib/Window.py", line 35, in __new__ new_object.finish_initializing(builder) File "/home/aliasbody/Projectos/ualarm/ualarm/UalarmWindow.py", line 24, in finish_initializing super(UalarmWindow, self).finish_initializing(builder) File "/home/aliasbody/Projectos/ualarm/ualarm_lib/Window.py", line 75, in finish_initializing self.indicator = indicator.new_application_indicator(self) File "/home/aliasbody/Projectos/ualarm/ualarm/indicator.py", line 52, in new_application_indicator ind = Indicator(window) File "/home/aliasbody/Projectos/ualarm/ualarm/indicator.py", line 20, in __init__ self.indicator = AppIndicator3.Indicator('ualarm', '', AppIndicator3.IndicatorCategory.APPLICATION_STATUS) TypeError: GObject.__init__() takes exactly 0 arguments (3 given) How can I solve this problem ?

    Read the article

  • Where is the best place to find stock website templates?

    - by Billy ONeal
    I think I'm in the majority of programmers in saying I can't do visual design for s***. But I do write programs occasionally, and I'd like to have a nice website to tell people about said programs. I used to use a site called "OSWD" to find templates, but it's been forever since it's been looked at, and most of the designs seem overly specifically tailored to a single kind of site -- for example, a site featuring a large picture of an ice cube wouldn't make much sense for a site displaying software for people to use. I know there are plenty of template sites out there which have freely available designs, but I'm not sure which ones are good, and which ones are garbage. Where is the best place to find website templates?

    Read the article

  • Template Method

    Consider you need to develop some searching engine. Engine will look for different messages that has been sent. Searching process consists with few operations which make sense for each of message, BUT could have some characteristic which differs.You want to write Searcher, which will allow you encap

    Read the article

< Previous Page | 12 13 14 15 16 17 18 19 20 21 22 23  | Next Page >