Search Results

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

Page 149/676 | < Previous Page | 145 146 147 148 149 150 151 152 153 154 155 156  | Next Page >

  • Delphi SetLength Custom Indexing

    - by Andreas Rejbrand
    In Delphi, it is possible to create an array of the type var Arr: array[2..N] of MyType; which is an array of N - 1 elements indexed from 2 to N. If we instead declare a dynamic array var Arr: array of MyType and later allocate N - 1 elements by means of SetLength(Arr, N - 1) then the elements will be indexed from 0 to N - 2. Is it possible to make them indexed from 2 to N (say) instead?

    Read the article

  • Highlighting text beween custom tags

    - by Rachel
    In a xhtml, i want to highlight the text between two self closing tags s1 and s2 whose attribute value is the same. Eg. <s1 ind="1"/> and <s2 ind="1" /> Eg. <html> <body> <a> <b>Some <s1 ind="1"/> text</b> <c>data <s2 ind="1"/>here</c> </a> </body> </html> I want "text data" to get highlighted. Is is possible to achieve using javascript/jquery? I could have many such self closing tag pairs s1 and s2 with a unique value for "ind" for the pair indicating that the text within them needs to be highlighted.

    Read the article

  • Custom sort logic in OrderBy using LINQ

    - by Bala R
    What would be the right way to sort a list of strings where I want items starting with an underscore '_', to be at the bottom of the list, otherwise everything is alphabetical. Right now I'm doing something like this, autoList.OrderBy(a => a.StartsWith("_") ? "ZZZZZZ"+a : a ) EDIT: I ended up using something like this; optimization suggestions welcome! private class AutoCompleteComparer : IComparer<String> { public int Compare(string x, string y) { if (x.StartsWith("_") && y.StartsWith("_") || (!x.StartsWith("_") && !y.StartsWith("_"))) { return x.CompareTo(y); } else if (x.StartsWith("_")) { return 1; } else if (y.StartsWith("_")) { return -1; } return 0; } }

    Read the article

  • How to add Flex 4 spark List Item custom properties

    - by maik3l
    I'm trying to make a simple flash application providing interface for taking tests as a high school assignment. One of the requirements is to use an XML file as data source.Now, having a List component bound to the XML file with questions consisting of data such as question body, question type (ie. single choice, multiple choice, open, image etc.) and possible answers (where applicable), I was wondering if I could add some additional data (and what is the best possible way to do so) to each question upon its transfer to the List component. I am trying to achieve two main goals with this: firstly, to mark the questions to which an answer has already been given, like with such code in ItemRenderer class: <s:Label color="{data.color}" text="{data.label}"/> where data.color would be set whenever the user gives an answer to a question. Secondly, while at it, I thought of such possibility as a great way to store answers given to particular questions. In this case, the Class of the answer object would have been Object, since there has to be many type of questions (where the answer could also be a Bitmap for example). This is a question of both how to do it and if it seems a good idea at all (and if no, if there is a better way?), because I am quite new to the whole Flash Builder and Flex thing and I am not really accustomed to all the possibilities and best practices. Thanks!

    Read the article

  • Need help with a custom Spinner/ArrayAdapter setup

    - by MisterSquonk
    I have a WeatherSpinner class which extends Spinner. The class shows region names which I originally did using an ArrayAdapter<String> but I now want to use ArrayAdapter<Locale>(Locale is an abstract 'empty' class of my own). I'm getting a ClassCastException when trying to populate my ArrayAdapter with the following... protected ArrayList<?> theList; protected ArrayAdapter<Locale> aa = null; ... protected void updateContents(ArrayList<?> list, int selectedItem) { theList = list; // Exception thrown on next line aa = new ArrayAdapter<Locale>(theContext, android.R.layout.simple_spinner_item, (Locale[]) theList.toArray()); ... } I'm passing a RegionList object into updateContents() as the 'list' parameter and RegionList extends ArrayList<Region>, and Region extends Locale. I've also overriden Region's toString() method to return a valid String. What am I not seeing here? Am I wrong about the way ArrayList<?>.toArray() works?

    Read the article

  • custom *arbitrary* TemplateField definitions

    - by end-user
    I'm building a GridView on the fly, and I'd like to pre-define the TemplateFields to be included ondemand. So, what I'd like to do is have a declarative file that defines how the different templates look for a specific column. Like: <asp:TemplateField> <HeaderTemplate> this is a text column </HeaderTemplate> <ItemTemplate> data goes here </ItemTemplate> <EditItemTemplate> <asp:TextBox Text="databindhere" /> </EditItemTemplate> </asp:TemplateField> <asp:TemplateField> <HeaderTemplate> this is a bool column </HeaderTemplate> <ItemTemplate> if(true) "yes" else "no" </ItemTemplate> <EditItemTemplate> <asp:CheckBox Checked="databindme" /> </EditItemTemplate> </asp:TemplateField> So, if my query had a text and two bool fields, I could push the appropriate TemplateFields in the the Columns property as needed. (I hope I'm making sense here) So, how would I go about creating declarative files for the above definitions? And then, how would I reference those definitions programmatically?

    Read the article

  • custom Filter Android won't show me the results

    - by TiGer
    Hi, I have been implementing a class which class extends ArrayAdapter and implements Filterable. The filtering part (in the performFiltering method()) seems to go ok, it fills the FilterResults object just as expected. But then I think I'm not doing it right on how to publish the results, atm I have : protected void publishResults(CharSequence prefix, FilterResults results) { // NOTE: this function is *always* called from the UI thread. subItems = (Vector)results.values; notifyDataSetChanged(); } But this simply won't "populate" my List with the received data. So now my question is how do I populate my List with the received results ? Do I have to do that programmatically ?

    Read the article

  • Custom warning in Xcode

    - by maximumnamelength
    I'm working on an API library and I'd like to add a few warnings that would appear when another developers builds the app if an optional apikey is not included. It should be buildable w/o the key (since it's optional) so I can't just add a syntax error to force a build error. I know Xcode supports TODO and FIXME but those aren't really highlighted anywhere major. Any other thoughts on how to approach this?

    Read the article

  • How to make a custom ear file in maven

    - by Zombies
    Here is my challenge, I need to make an ear file for a specific container. To be more specific on how this ear will be created: This is a standard j2ee ear file, with 1 WAR in it. The container it is deployed to will expect certain xml files (which can easily be found (somewhere) inside the source project). Here are my obstacles The source folder contains various container specific xml files. But, these files do not map directly to where the container expects them inside the EAR file. For example, there will be a file that this container expects to be in 'EARFILE.ear/config/connections.xml'. But this file is located (in the source) at /some/obscure/unrelated/directory. This is the case for about 5-7 files. I cannot change the original source project layout at all. So, how can I create the compliant EAR file that I need. There is NO plugin at this time for the container that I am using, I have certainly looked.

    Read the article

  • PHP / Zend custom date input formats

    - by mld
    Hi, I'm creating a library component for other developers on my team using PHP and Zend. This component needs to be able to take as input a date (string) and another string telling it the format of that date. Looking through the Zend documentation and examples, I thought I found the solution - $dateObject = Zend_Date('13.04.2006', array('date_format' => 'dd.MM.yyyy')); this line, however, throws an error - call to undefined function. So instead I tried this - $dt = Zend_Locale_Format::getDate('13.04.2006', array('date_format' => 'dd.MM.yyyy')); This gets the job done, but throws an error if a date that is entered isn't valid. The docs make it look like you can use the isDate() function to check validity - Zend_Date::isDate('13.04.2006', array('date_format' => 'dd.MM.yyyy')) but this line always returns false. So my questions - Am I going about this the right way? If not, is there a better way to handle this via Zend or straight PHP? If I do use Zend_Locale_Format::getDate(), do I need to worry about a locale being set elsewhere and changing the results of the call? I'm locked into PHP 5.2.6 on windows, btw... so 5.3+ functions & strptime() are out.

    Read the article

  • Ruby on Rails: custom instance creation failing at redirect

    - by Jack
    I am at an absolute loss as to what I am doing wrong with the following code. I am trying to implement a messaging system within my application, but want it to be handle different types of messages. In this case, I want to create a "request" message of ':message_type = 1'. Instead of using forms as I usually have, I want to make this instance the moment the link is clicked. Here is how I have it set up in the show erb file for "user": <%=link_to "Send friend request", :action=>"request", :controller => "messages", :id => @user.id %> and in the controller: def request @message = Message.new(:sender_id => current_user.id,:user_id => params[:id],:message_type => 1) if @message.save flash[:notice] = 'Message was successfully created.' redirect_to message_path(@message) else redirect_to message_path(@message) end end This results in the following error message: undefined method `rewrite' for nil:NilClass with the trace looking like c:/ruby/lib/ruby/gems/1.8/gems/activesupport-2.3.5/lib/active_support/whiny_nil.rb:52:in `method_missing' c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.3.5/lib/action_controller/base.rb:634:in `url_for' (eval):16:in `message_path' app/controllers/messages_controller.rb:11:in `request' I have used map.resources :messages in the routes.rb file, and done the appropriate :has_many and :belongs_to associations in the models of user and message.

    Read the article

  • Java Custom exception throw behaves differently between different Projects

    - by Pablo
    I am attempting to call the following in my code: public void checkParticleLightRestriction(Particle parent) throws LightException { if ( parent == null ) { throw new LightException("quantum-particle-restrict.23", this); } In one Project the exception is thrown and the effect is similar to calling "return" whereby I am returned back to the point immediately succeeding where this method was called. However in another Project I get thrown completed out of the current package and to a point way prior to the point preceeding this method. It likes instead of being kicked out of a bar I am being deported all the way out of the country. My option are the wrap the throw in a try / catch but I am wondering why this difference in behaviour beween the 2 projects ?

    Read the article

  • Custom formats in Ruby on Rails

    - by Koning Baard XIV
    I'm creating a website in Ruby on Rails, where users can login using RESTful Authentication. Someone can get a specific user using html, xml and json, just like scaffolding. But I want to add one more format: vCard (e.g. /users/1.vcard). This has a specific format, but how do I define my own formats? Using views, or must I use another way? Thanks

    Read the article

  • C#: Custom assembly directory

    - by Svish
    Say we have an application which consists of one executable and 5 libraries. Regularly all of these will be contained in one directory and the libraries will be loaded from there. Is it possible to do so that I can have for example some of the libraries in one directory called Lib, and the rest in one called Lib2? So that the application directory would only contain the executable itself and the other assemblies would be contained in various logical directories. How can I do this? And I would like to know how to do the loading of the assemblies, but also how to make the building of the application put the assemblies in the right directory.

    Read the article

  • wx_ref and custom wx_object's

    - by Iogann
    Hi! I am developing MDI application with help of wxErlang. I have a parent frame, implemented as wx_object: -module(main_frame). -export([new/0, init/1, handle_call/3, handle_event/2, terminate/2]). -behaviour(wx_object). .... And I have a child frame, implemented as wx_object too: module(child_frame). -export([new/2, init/1, handle_call/3, handle_event/2, terminate/2]). -export([save/1]). -behaviour(wx_object). % some public API method save(Frame) -> wx_object:call(Frame, save). .... I want to call save/1 for an active child frame from the parent frame. There is my code: ActiveChild = wxMDIParentFrame:getActiveChild(Frame), case wx:is_null(ActiveChild) of false - child_frame:save(ActiveChild); _ - ignore end This code fails because ActiveChild is #wx_ref{} with state=[], but wx_object:call/2 needs #wx_ref{} where state is set to the pid of the process which we call. What is the right method to do this? I thought only to store a list of all created child frames with its pids in the parent frame and search the pid in this list, but this is ugly.

    Read the article

  • Is it possible to create custom methods in entity classes in linq to sql

    - by doekman
    I have a table Site in SQL with (amongst others) three properties idReviewer1, idReviewer2, idReviewer3. Now I would like to create a methods on the entity class of Site to check if a user is a reviewer: partial class Site { public bool IsReviewer(int idUser) { return idReviewer1 == idUser || idReviewer2 == idUser || idReviewer3 == idUser; } } and I use it like this: return from s in db.Sites where s.IsReviewer(user) select s; However, Linq to SQL doesn't know how to translate this to SQL. I get the following error message: Method 'Boolean IsReviewer(Int32)' has no supported translation to SQL. I'd rather not write this: return from s in db.Sites where idReviewer1 == idUser || idReviewer2 == idUser || idReviewer3 == idUser select s; Is there any way to put this functionality in one place, without resorting to SQL?

    Read the article

  • .Net Custom Components "disappear" after file save

    - by EatATaco
    I might have a hard time explaining this because I am at a total loss for what is happening so I am just looking for some guidance. I might be a bit wordy because I don't know exactly what is the relevant information. I am developing a GUI for a project that I am working on in using .Net (C#) Part of the interface mimics, exactly, what we do in another product. For consistency reasons, my boss wants me to make it look the same way. So I got the other software and basically copied and pasted the components into my new GUI. This required me to introduce a component library (the now defunct Graphics Server GSNet, so I can't go to them for help) so I could implement some simple graphs and temperature/pressure "widgets." The components show up fine, and when I compile, everything seems to work fine. However, at some point during my programming it just breaks. Sometimes the tab that these components are on starts throwing exceptions when I view the designer page (A missing method exception) so it won't display. Sometimes JUST those components from the GSNet library don't show up. Sometimes, if I try to run it, I get a not-instantiated exception on one of their lines of code in the designer code file. Sometimes I can't view the designer at all. No matter what I do I can't reverse it. Even if I undo what I just did it won't fix it. If it happens, I have to revert to a backup and start over again. So I started to backup pretty much every step. I compile it and it works. I comment out a line of code, save it, and then uncomment that same line of code (so I am working with the same exact code) and the components all disappear. It doesn't matter what line of code I actually comment out, as long as it is in the same project that these components are being used. I pretty much have to use the components. . . so does anyone have any suggestion or where I can look to debug this?

    Read the article

  • Javascript toggle using custom attributes

    - by Jacob
    Can't seem to get this to work for me, can anyone offer me some help? http://codepen.io/anon/pen/kABjC This should open and close a section of text based on click, it takes the ID # which is just a digit (1,2,3,4,etc) and using that id targets an id to open and close the section. Javascript $(document).ready(function(){ $('.classclick').click(function(){ $('#class'+$(this).Attr('data-id')+"show").show(400); }); }); HTML <div class="classes"> <?php foreach ($classes as $class): ?> <div class="class"> <div class="classclick" data-id="<?=$class['cid']?>"> <div class="class-title"> <?=$class['className']?> </div> <div class="class-intensity"> Intensity: <?=$class['classIntensity']?> </div> </div> <div class="class-show hidden" id="class<?=$class['cid']?>show"> <div class="class-inner-content"> <div class="two-thirds"> <?=$class['classDesc']?> </div> <div class="one-third"> Things To Know: asdfasd asdf afsdadfs fsda dfsa dfsadfsa </div> </div> </div> </div> <?php endforeach; ?> </div>

    Read the article

  • Send custom data when initializing java WebService over soap

    - by Mesni
    Hello. I have a question about sending additional data over soap to the functions. My webService function requests only one integer, for example an getDocumentPrivilage(DocumentID). In another WebService user registered and he got an unique ID, so the other application can see who he is. So on Service one he registers, gets id and it has to send it to the other webservice tor the privilage. Id dont wish to rewrite the function so that it gets the unique ID (like this getDocumentPrivilage(uniqID,DocumentID)) but, the wish is that i would be able to create a client that sends this data at the initialization or somehow as some sort of parameter behind the function. Is this possible?? I tried the ServiceLifecycle but cant see any setting i've given in. Im using WebSphere CE for the server and Jax-ws Creating the webapp in java. Thank you very much in advance. lp, Mesni

    Read the article

  • Unsure how to modify userDetailsService to allow for custom userDetails but keep datasource

    - by adam2510
    what i am trying to do is i'm following this http://www.theserverside.com/tip/-Spring-Security-Customizing-Your-User-and-Authorization-in website to attempt to customise the UserDetails so i can retrieve more fields regarding to the user... as far as implementing the UserDetails, where i am confused is the UserDetailsService at the moment i only have the code for the userDetailsService that is in the website linked above i'm just not sure on how to go about doing it

    Read the article

  • custom membership for dot net nuke

    - by Pius
    Hi!! i am new in dot net nuke.i just found that there is open id logging option in dot net nuke.And so i did need user to register afresh in my dnn application.This is because i have another mvc application which i would like to be the openid provider for my dnn application.and am totally confused on how to go about that? Again,is it possible to tamper with dnn membership such that i use aspnetsqlmembership? Your contributions will be highly appreciated. Thanks in advance..

    Read the article

  • Custom Rails Validation (Doesn't seem to be working)

    - by Karl Entwistle
    Hey guys ive got the following Model for Accounts require 'net/http' require 'uri' require 'date' class Account < ActiveRecord::Base validates_presence_of :username, :password, :on => :update validate :valid_expiry_date, :on => :update def valid_expiry_date reply = Net::HTTP.get URI.parse("http://api.rapidshare.com/cgi-bin/rsapi.cgi?sub=getaccountdetails_v1&type=prem&login=" + username + "&password=" + password) account = Time.at(reply[80..90].to_i) if (Time.now + 2419200) <= account return true else return false errors.add_to_base("Sorry this account isnt valid") end end end I know the code works in a ruby.rb file and will return true or false, however I seem to be having rather a lot of difficultly trying to translate this code into an actual validation, any help would be much appreciated. Thanks :) Its also defiantly at least connecting to the website as my firewall asked me if the Terminal was aloud to access it. At the moment not only is it displaying no errors its actually letting anything through and saving it.

    Read the article

< Previous Page | 145 146 147 148 149 150 151 152 153 154 155 156  | Next Page >