Search Results

Search found 16885 results on 676 pages for 'custom headers'.

Page 146/676 | < Previous Page | 142 143 144 145 146 147 148 149 150 151 152 153  | Next Page >

  • Adding custom tags in Wordpress

    - by givp
    Hello, I'm creating a new WP theme and I would like to allow the user to insert a divider in between paragraphs or images he/she is entering, for a post/page. I want the output to be something like: <div class="divider"></div> But I don't want the user to have to enter HTML in the WYSIWYG editor. Is it possible to ask them to enter something like: <-- break --> and then translate that to the div markup on display? Thanks.

    Read the article

  • custom progress bar in net compact framework

    - by amolitrivedi
    Hi all, I want to have my own progress bar in .net compact framework, instead of default wait cursor. I have tried with a form, having only a progress bar, and showing and hiding the form when I want to show some background activity running, but that does not update the progress bar. I have found out that it needs to be on different thread. I am quite weak at threads, I cant get it working. Please help me out. Thanks in advance.

    Read the article

  • django-registration password reset custom template not loading

    - by ip.
    I'm using django-registration for registering users, however when I want to use my own template for password reset I get the admin template and not the template I created. My template is in myapp/templates/registration/password_reset_form.html and my template loaders are properly set: TEMPLATE_LOADERS = ( 'django.template.loaders.filesystem.Loader', 'django.template.loaders.app_directories.Loader', ) What could I be missing? I'm using Django 1.4

    Read the article

  • Custom spring <strike>bean</strike> interceptor

    - by Hari
    Hi, I want to convert some of our internal API into a spring bean spring interceptor that we can use in other projects. This API needs some instantiation and other logic which I want to encapsulate in this bean so that we can just put the bean into our app context with necessary propoerties alone, and this will then apply the logic. I remember having read an article on this somewhere in the past - but cant find it now. Any pointers to something similar will be helpful EDIT: Sorry, I meant a spring interceptor, not a bean - my bad - please see my edit. I want to apply this interceptor to another bean dealing in XML messages.

    Read the article

  • Creating a custom widget using django for use on external sites

    - by ajt
    I have a new site that I am putting together and part of it has statistics for the site's users. I would like to create a widget that others can use on another website by invoking javascript that reads data from my server and shows that statistics for a given user, but I am having a hard time finding specific tutorials that covers this in django. I have seen the link at Alex Maradon's site [0], but it looks to me like that is passing html back to the widget and I am having a hard time figuring out how to do this using something like xml. Are there any django apps for doing this or does anyone know of good how-tos? [0] http://alexmarandon.com/articles/web_widget_jquery/

    Read the article

  • SharePoint form-based authentication with custom database

    - by Clodin
    Hi, I have SharePoint site and I want to use form-based authentication, not Windows how it is by default. For this I read that I have to modify the web.config from Central Administration and web.config from my site with the membership and roleManager tags configured properly. But if I use this: <membership> <providers> <add name="MyProvider" type="System.Web.Security.SqlMembershipProvider, System.Web, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" .../> </providers> </membership> System.Web.Security.SqlMembershipProvider requires a database generated with ASP.NET SQL Server Setup Wizard (aspnet_regsql.exe), and this is my problem! I want to use another database with cunstom table 'Users' from where to take the username and password for authentication. How can I do this? Thank you in advance

    Read the article

  • How to retrieve XML attribute for custom control

    - by David
    I've created a combo box control with a edittext and spinner. I'm trying to let the android:prompt attribute be passed onto the spinner, which means I need to catch it in the constructor which passes my the AttributeSet and set it on the spinner. I can't figure out how to get the value of the prompt. I'm trying, int[] ra = { android.R.attr.prompt }; TypedArray ta = context.getTheme().obtainStyledAttributes(ra); int id = ta.getResourceId(0, 0); I get back 0, which means it didn't find the attribute. I also did a ta.count() which returned 0. So I'm not getting anything back. My XML simply defines an android:prompt value. Thanks

    Read the article

  • Custom search engine in asp.net mvc and entity framework

    - by Rahat
    Hi, does anyone have any idea how I can get started building a search engine for my asp.net mvc site using entity framework. I plan to build something like: http://www.carsguide.com.au/search/?N=4294962119++492&type=cars there on the left there is a refine search option panel. What's the best approach to design a model for the UI and optimized query with entity framework.

    Read the article

  • Custom accessor for array element

    - by memph1s
    I'm trying to create an accessor for one element from array with specific flag set to true: class EntranceObject < ActiveRecord::Base has_many :subscribers def customer self.subscribers.find(:first, :conditions => {:is_customer => true}) end def customer=(customer_params) self.subscribers << Subscriber.new(:name => customer_params[:name], :apartment => customer_params[:apartment], :phone_number => customer_params[:phone_number], :is_customer => true) end end class Subscriber < ActiveRecord::Base belongs_to :entrance_object validates_presence_of :name, :apartment end How do i need to validate this accessor in order to hightlight missing fields in a view? P.S. I'm newbie in RoR, maybe there is another approach to such work with one element from a collection? Thanks.

    Read the article

  • Cant print contents of a custom file

    - by ZaZu
    Hello, Im trying to scan contents from a random file into an array in a structure. Then I want to print those contents on screen. (NOTE: The following code is from a bigger program, this is just a sample, but all structures and arrays used are needed as declared ) The contents of the file being tested are simply: 5 4 3 2 5 3 4 2 #include<stdio.h> #define first 500 #define sec 500 struct trial{ int f; int r; float what[first][sec]; }; int trialtest(trial *test); int trialdisplay(trial *test); main(){ trial test; trialtest(&test); trialdisplay(&test); } int trialtest(trial *test){ int z,x,i; FILE *inputf; inputf=fopen("randomfile.txt","r"); for(i=0;i<5;i++){ fscanf(inputf,"%f",&(*test).what[z][x]); } fclose(inputf); return 0; } int trialdisplay(trial *test){ int i,z,x; printf("printing\n\n\n"); for (i=0;i<10;i++){ printf("%f",(*test).what[z][x]); } return 0; } The problem is, I get this error whenever I run the code .. I cant really understand whats going on : Any suggestions ? Thanks alot !

    Read the article

  • Custom class object in Initialization list

    - by Michael
    I have a class Bar: class Bar { public: Bar(void); ~Bar(void); }; And a class Foo that gets a reference to Bar object as a constructor parameter and needs to save it in a private member bar_ : class Foo { private: Bar& bar_; public: Foo(Bar& bar) : bar_(bar) {} ~Foo(void) {} }; This doesn't compile : overloaded member function not found in 'Parser' missing type specifier - int assumed. Note: C++ does not support default-int Now i suspect couple of things that i need to assure, the second error is for Bar& bar_; declaration in Foo. Do i need to use an explicit constructor when declaring bar_ ? I am interested in learning how the compiler works regarding this matter, so a detailed explanation would be highly appreciated. Thanks.

    Read the article

  • Java library suggestions for implementing a custom web server

    - by dexter
    I would like to create a web server that will serve/accept json files through REST. The JSON files being served will come from a database query and format the results into JSON. Any suggestions for a good java library. I have tried using Apache HTTPComponents. While maybe I can just create a servlet but I am not really allowed to install a servlet container in the server machine.

    Read the article

  • How to use custom UITableViewCell from Interface Builder?

    - by Krumelur
    I want to be able to design my own UITableViewCell in IB. But I keep getting a null ref exception when trying to access the label I defined in IB. Here's what I'm doing: In Interface Builder: I removed the "View" and added a UITableViewCell instead. Changed the class of the UITableViewCell to "TestCellView". Added a UILabel to the cell. Added an outlet "oLblText" to TestCellView and connected the UILabel to it. Changed the identifier of the class to "TestCellView". Implement TestCellView.xib.cs public partial class TestCellView : UITableViewCell { public TestCellView(string sKey) : base(UITableViewCellStyle.Default, sKey) { } public TestCellView(IntPtr oHandle) : base(oHandle) { } public string TestText { get { return this.oLblText.Text; } set { // HERE I get the null ref exception! this.oLblText.Text = value; } } } ** The TestCellView.designer.cs** [MonoTouch.Foundation.Register("TestCellView")] public partial class TestCellView { private MonoTouch.UIKit.UILabel __mt_oLblText; #pragma warning disable 0169 [MonoTouch.Foundation.Connect("oLblText")] private MonoTouch.UIKit.UILabel oLblText { get { this.__mt_oLblText = ((MonoTouch.UIKit.UILabel)(this.GetNativeField("oLblText"))); return this.__mt_oLblText; } set { this.__mt_oLblText = value; this.SetNativeField("oLblText", value); } } } In my table's source: public override UITableViewCell GetCell (UITableView tableView, NSIndexPath indexPath) { TestCellView oCell = (TestCellView)tableView.DequeueReusableCell("myCell"); if(oCell == null) { // I suppose this is wrong but how to do it correctly? // this == my UITableViewSource. NSBundle.MainBundle.LoadNib("TestCellView", this, null); oCell = new TestCellView("myCell"); } oCell.TestText = "Cell " + indexPath.Row; return oCell; } Please note that I do NOT want a solution that involves a UIViewController for every cell. I have seen a couple of examples on the web doing this. I just think it is total overkill. What am I doing wrong?

    Read the article

  • Sort a Vector of custom objects

    - by user307818
    I'm trying to sort a Vector in java but my Vector is not a vector of int, it is a vector of objects the object is: public MyObject() { numObj = 0; price = new Price(); pax = new Pax(); } so I have a Vector of MyObject and I want to order it by numObject, how do i do it, I'm new in java? Thank you so much for all your help.

    Read the article

  • Custom string class (C++)

    - by Sanctus2099
    Hey guys. I'm trying to write my own C++ String class for educational and need purposes. The first thing is that I don't know that much about operators and that's why I want to learn them. I started writing my class but when I run it it blocks the program but does not do any crash. Take a look at the following code please before reading further: class CString { private: char* cstr; public: CString(); CString(char* str); CString(CString& str); ~CString(); operator char*(); operator const char*(); CString operator+(const CString& q)const; CString operator=(const CString& q); }; First of all I'm not so sure I declared everything right. I tried googleing about it but all the tutorials about overloading explain the basic ideea which is very simple but lack to explain how and when each thing is called. For instance in my = operator the program calls CString(CString& str); but I have no ideea why. I have also attached the cpp file below: CString::CString() { cstr=0; } CString::CString(char *str) { cstr=new char[strlen(str)]; strcpy(cstr,str); } CString::CString(CString& q) { if(this==&q) return; cstr = new char[strlen(q.cstr)+1]; strcpy(cstr,q.cstr); } CString::~CString() { if(cstr) delete[] cstr; } CString::operator char*() { return cstr; } CString::operator const char* () { return cstr; } CString CString::operator +(const CString &q) const { CString s; s.cstr = new char[strlen(cstr)+strlen(q.cstr)+1]; strcpy(s.cstr,cstr); strcat(s.cstr,q.cstr); return s; } CString CString::operator =(const CString &q) { if(this!=&q) { if(cstr) delete[] cstr; cstr = new char[strlen(q.cstr)+1]; strcpy(cstr,q.cstr); } return *this; } For testing I used a code just as simple as this CString a = CString("Hello") + CString(" World"); printf(a); I tried debugging it but at a point I get lost. First it calls the constructor 2 times for "hello" and for " world". Then it get's in the + operator which is fine. Then it calls the constructor for the empty string. After that it get's into "CString(CString& str)" and now I'm lost. Why is this happening? After this I noticed my string containing "Hello World" is in the destructor (a few times in a row). Again I'm very puzzeled. After converting again from char* to Cstring and back and forth it stops. It never get's into the = operator but neither does it go further. printf(a) is never reached. I use VisualStudio 2010 for this but it's basically just standard c++ code and thus I don't think it should make that much of a difference

    Read the article

  • Writing a managed wrapper for unmanaged (C++) code - custom types/structs

    - by Bobby
    faacEncConfigurationPtr FAACAPI faacEncGetCurrentConfiguration( faacEncHandle hEncoder); I'm trying to come up with a simple wrapper for this C++ library; I've never done more than very simple p/invoke interop before - like one function call with primitive arguments. So, given the above C++ function, for example, what should I do to deal with the return type, and parameter? FAACAPI is defined as: #define FAACAPI __stdcall faacEncConfigurationPtr is defined: typedef struct faacEncConfiguration { int version; char *name; char *copyright; unsigned int mpegVersion; unsigned long bitRate; unsigned int inputFormat; int shortctl; psymodellist_t *psymodellist; int channel_map[64]; } faacEncConfiguration, *faacEncConfigurationPtr; AFAIK this means that the return type of the function is a reference to this struct? And faacEncHandle is: typedef struct { unsigned int numChannels; unsigned long sampleRate; ... SR_INFO *srInfo; double *sampleBuff[MAX_CHANNELS]; ... double *freqBuff[MAX_CHANNELS]; double *overlapBuff[MAX_CHANNELS]; double *msSpectrum[MAX_CHANNELS]; CoderInfo coderInfo[MAX_CHANNELS]; ChannelInfo channelInfo[MAX_CHANNELS]; PsyInfo psyInfo[MAX_CHANNELS]; GlobalPsyInfo gpsyInfo; faacEncConfiguration config; psymodel_t *psymodel; /* quantizer specific config */ AACQuantCfg aacquantCfg; /* FFT Tables */ FFT_Tables fft_tables; int bitDiff; } faacEncStruct, *faacEncHandle; So within that struct we see a lot of other types... hmm. Essentially, I'm trying to figure out how to deal with these types in my managed wrapper? Do I need to create versions of these types/structs, in C#? Something like this: [StructLayout(LayoutKind.Sequential)] struct faacEncConfiguration { uint useTns; ulong bitRate; ... } If so then can the runtime automatically "map" these objects onto eachother? And, would I have to create these "mapped" types for all the types in these return types/parameter type hierarchies, all the way down until I get to all primitives? I know this is a broad topic, any advice on getting up-to-speed quickly on what I need to learn to make this happen would be very much appreciated! Thanks!

    Read the article

  • Creating custom html text boxes

    - by Caylem
    Hi guys Just wondering how you would go about creating the effect as seen in the following image: Image The part i'd like to attempt to recreate is the gradient within the text field itself along with the line border surrounding the text box. Thanks.

    Read the article

  • Loop through custom template hooking thing

    - by tarnfeld
    Hi, I am building a template system for emailing people that currently works in the format of: $array['key1'] = "text; $array['key2'] = "more text"; <!--key1--> // replaced with *text* <!--key2--> // replaced with *more text* For this particular project I have a nested array with this kind of structure: $array['object1']['nest1']['key1'] = "text"; $array['object2']['next1']['key1'] = "more text"; <!--[object1][nest1][key1]--> // replaced with *text* <!--[object2][nest1][key1]--> // replaced with *more text* What would be the best way to do this in PHP? I thought I could loop through the arrays but then I just lost my trail of thought and got lost in what I was doing! All help would be appreciated!! Thanks

    Read the article

  • java: retrieving the "canonical value" from a Set<T> where T has a custom equals()

    - by Jason S
    I have a class Foo which overrides equals() and hashCode() properly. I would like to also would like to use a HashSet<Foo> to keep track of "canonical values" e.g. I have a class that I would like to write like this, so that if I have two separate objects that are equivalent I can coalesce them into references to the same object: class Canonicalizer<T> { final private Set<T> values = new HashSet<T>(); public T findCanonicalValue(T value) { T canonical = this.values.get(value); if (canonical == null) { // not in the set, so put it there for the future this.values.add(value); return value; } else { return canonical; } } } except that Set doesn't have a "get" method that would return the actual value stored in the set, just the "contains" method that returns true or false. (I guess that it assumes that if you have an object that is equal to a separate object in the set, you don't need to retrieve the one in the set) Is there a convenient way to do this? The only other thing I can think of is to use a map and a list: class Canonicalizer<T> { // warning: neglects concurrency issues final private Map<T, Integer> valueIndex = new HashMap<T, Integer>(); final private List<T> values = new ArrayList<T>(); public T findCanonicalValue(T value) { Integer i = this.valueIndex.get(value); if (i == null) { // not in the set, so put it there for the future i = this.values.size(); this.values.add(value); this.valueIndex.put(value, i); return value; } else { // in the set return this.values.get(i); } } }

    Read the article

  • JSF2.0: variable list of custom component

    - by rattaman
    Hello Is there any way of using JSF2.0 in connection with variable lists of components? For example, lets say I have list o people that I would like to edit. They are presented on the page as list of components PersonEditor, which allow changing person data. Each editor is associated with single Person element. In order for this to work I need to perform following steps: On initial request: Get list of people For each person create PersonEditor and associate it with Person object. Fill editor's data. On user action: When user changes values and presses Save, data is processed by backing bean. I can either fill editor with data from list of people or bind it to the backing bean, but not at the same time, so I am stuck. I tried people.xhtml <ui:render value="#{bean.people}" var="person"> <example:personEditor person="#{person}"/> </ui:render> where personEditor.xhtml: a) proper association with person object, but no connection to backing bean <h:form> <h:outputText value="#{cc.attr.person.name}"/> <h:commandButton name="Save" actionListener="editorBean.save"> <f:ajax execute="@form" render="@form"/> </h:commandButton> </h:form> b) no association with person object, but there is connection to backing bean - there is no way to pass that person to the backing bean <h:form> <h:outputText value="#{editorBean.name}"/> <h:commandButton name="Save" actionListener="editorBean.save"> <f:ajax execute="@form" render="@form"/> </h:commandButton> </h:form> If I had each editor on separate page, I could pass the person id as url parameter (either using f:param or f:attribute) and initialize it accordingly. Is there any solution to this problem?

    Read the article

  • How to Implement Custom List View for the list Items in Android Application

    - by avadhani
    I had a problem with the list view having both parent list and the child list of the list activity(implemented through database query). I wish to show them differing their properties by changing the text style (parent list items are in bold, child list items are in normal style). The following is the code from which all the child and parent list items having the same style(bold): String sql = "SELECT Parentid,Childid,Name from (select com.Parentid, com.Childid, com.Name from table1 mem inner join table2 cd on mem.column1=cd.column1 inner join table3 com on com.childid = mem.childid where Parentid is NULL UNION SELECT com.Parentid, com.Childid,com.Name from table1 mem inner join table3 com on com.childid = mem.childid inner join table2 cd on mem.column1=cd.column1 where Parentid is NOT NULL) a group by Parentid, Childid;"; Cursor cdata = myDbHelper.getView(sql); and the List Adapter is: private static final String fields[] = {"Name"}; int[] names = new int[] {R.id.name}; SimpleCursorAdapter adapter2 = new SimpleCursorAdapter(this,R.layout.clientlist1, cdata, fields,names ); and the clientlist.xml is: <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:orientation="horizontal" android:layout_width="fill_parent" android:layout_height="fill_parent" android:id="@+id/MainLayout" android:padding="5px"> <TextView android:id="@+id/name" android:layout_alignParentRight="true" android:layout_width="fill_parent" android:layout_height="wrap_content" android:textSize="12sp" android:textColor="#104082" android:textStyle="bold" android:layout_weight="1" /> From this i am getting the list having the complete list having both parent and child list items in a single list view. I wish to differ in their text style(bold, normal) for parent and child items respectively. Please help me with the code/links. Thanks a lot in advance.

    Read the article

  • MediaElement not showing in custom 3D class

    - by user3271180
    I'm trying to display a videostream in a Viewport3d. When I add the MediaElement via xaml, the video plays without a problem; even when I add the video as ModelVisual3D in the code-behind, the video works. When I abstract the video into a class, however, the video stops appearing. This happens with both web and local video files. I tried compiling with both x86 and 64 bit. Any way to fix this behaviour? Why is this happening? I have the following viewport: <Viewport3D> <!-- Camera --> <Viewport3D.Camera> <PerspectiveCamera Position="0,0,100" LookDirection="0,0,-1" UpDirection="0,1,0" /> </Viewport3D.Camera> <!-- Light --> <ModelVisual3D> <ModelVisual3D.Content> <AmbientLight Color="White" /> </ModelVisual3D.Content> </ModelVisual3D> <!-- this doesn't work --> <mediaElementTest:VideoControl /> <!-- but this does? --> <!--<ModelVisual3D> <ModelVisual3D.Content> <GeometryModel3D> <GeometryModel3D.Geometry> <MeshGeometry3D Positions="-100,-100,0 100,-100,0 100,100,0 -100,100,0" TextureCoordinates="0,1 1,1 1,0 0,0" TriangleIndices="0 1 2 0 2 3" /> </GeometryModel3D.Geometry> <GeometryModel3D.Material> <DiffuseMaterial> <DiffuseMaterial.Brush> <VisualBrush> <VisualBrush.Visual> <MediaElement Source="http://www.quirksmode.org/html5/videos/big_buck_bunny.mp4" /> </VisualBrush.Visual> </VisualBrush> </DiffuseMaterial.Brush> </DiffuseMaterial> </GeometryModel3D.Material> </GeometryModel3D> </ModelVisual3D.Content> </ModelVisual3D>--> </Viewport3D> VideoControl.xaml <UIElement3D x:Class="MediaElementTest.VideoControl" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"/> VideoControl.xaml.cs public partial class VideoControl { public VideoControl() { InitializeComponent(); Visual3DModel = CreateModel(); } private GeometryModel3D CreateModel() { return new GeometryModel3D { Geometry = new MeshGeometry3D { Positions = new Point3DCollection { new Point3D(-100, -100, 0), new Point3D(100, -100, 0), new Point3D(100, 100, 0), new Point3D(-100, 100, 0) }, TextureCoordinates = new PointCollection { new Point(0, 1), new Point(1, 1), new Point(1, 0), new Point(0, 0) }, TriangleIndices = new Int32Collection { 0, 1, 2, 0, 2, 3 } }, Material = new DiffuseMaterial(new VisualBrush(new MediaElement { Source = new Uri("http://www.quirksmode.org/html5/videos/big_buck_bunny.mp4", UriKind.RelativeOrAbsolute) })) }; } }

    Read the article

  • Hundreds of custom UserControls create thousands of USER Objects

    - by Andy Blackman
    I'm creating a dashboard application that shows hundreds of "items" on a FlowLayoutPanel. Each "item" is a UserControl that is made up of 12 or labels. My app queries a database and then creates an "item" instance for each record, populating ethe labels and textboxes with data before adding it to the FlowLayoutPanel. After adding about 560 items to the panel, I noticed that the USER Objects count in my Task Manager had gone up to about 7300, which was much much larger than any other app on my machine. I did a quick spot of mental arithmetic (OK, I might have used calc.exe) and figured that 560 * 13 (12 labels plus the UserControl itself) is 7280. So that suddenly gave away where all the objects were coming from... Knowing that there is a 10,000 USER object limit before windows throws in the towel, I'm trying to figure better ways of drawing these items onto the FlowLayoutPanel. My ideas so far are as follows: 1) User-draw the "item", using graphics.DrawText and DrawImage in place of many of the labels. I'm hoping that this will mean 1 item = 1 USER Object, not 13. 2) Have 1 instance of the "item", then for each record, populate the instance and use the Control.DrawToBitmap() method to grab an image and then use that in the FlowLayoutPanel (or similar) So... Does anyone have any other suggestions ??? P.S. It's a zoomable interface, so I have already ruled out "Paging" as there is a requirement to see all items at once :( Thanks everyone.

    Read the article

  • Flex Custom UIComponents

    - by user164142
    I have created a graph component in AS3 which extends UIComponent. I created an mxml component which is just a Label. The idea is to use the label component to show the values on the graph when you hover over points. I have tried two approaches. Create the Label component using ClassFactory inside the graph so it gets created in the graph component and addChild is called there. The problem is it is always 0 in size. Create in main mxml file and pass in to graph using a setter, the sizing is perfect but the x an y dont relate to my graph :( I suppose its similar to flex and itemrenderers, but in my case i have a graph and another component which can be changed, at the moment it is just a Label. Thanks Neil

    Read the article

< Previous Page | 142 143 144 145 146 147 148 149 150 151 152 153  | Next Page >