Search Results

Search found 6079 results on 244 pages for 'define'.

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

  • How to define a preprocessor symbol in Xcode

    - by Steph Thirion
    Is it possible to set a symbol for conditional compilation by setting up properties in an Xcode project? My aim is to to create a symbol that is available to all files, without having to use import/include, so that a set of common classes can have a special behavior in some projects. Like the following, but with my own symbols. #if TARGET_IPHONE_SIMULATOR ... #endif

    Read the article

  • Is it possible to define a generic lambda?

    - by Mike OBrien
    I have some logic in a method that operates on a specified type and I'd like to create a generic lambda that encapsulates the logic. This is the spirit of what I'm trying to do: public void DoSomething() { // ... Func<T> GetTypeName = () => T.GetType().Name; GetTypeName<string>(); GetTypeName<DateTime>(); GetTypeName<int>(); // ... } I know I can pass the type as a parameter or create a generic method but I'm interested if it can just be a generic lambda (So I'm not looking for alternatives). From what I can tell C# 3.0 doesn't support this. TIA, m

    Read the article

  • How to define a query om a n-m table

    - by user559889
    Hi, I have some troubles defining a query. I have a Product and a Category table. A product can belong to multiple categories and vice versa so there is also a Product-Category table. Now I want to select all products that belong to a certain category. But if the user does not provide a category I want all products. I try to create a query using a join but this results in the product being selected multiple times if it belongs to multiple categories (in the case no specific category is queried). What kind of query do I have to create? Thanks

    Read the article

  • Define interface for loading custom UserControls through reflection

    - by Tim
    I'm loading custom user controls into my form using reflection. I would like all my user controls to have a "Start" and "End" method so they should all be like: public interface IStartEnd { void Start(); void End(); } public class AnotherControl : UserControl, IStartEnd { public void Start() { } public void End() { } } I would like an interface to load through reflection, but the following obviously wont work as an interface cannot inherit a class: public interface IMyUserControls : UserControl, IInit, IDispose { }

    Read the article

  • Javascript expression to define object's property name?

    - by Kirzilla
    Hello, I'd like to create this object... object = { 'object[1][var_name_1]' : 'value1', 'object[1][var_name_2]' : 'value2', }; I'm trying to it this way, but I'm getting error missing : after property id... function getPrefix() { return 'object[1]'; } object = { getPrefix() + '[var_name_1]' : 'value1', getPrefix() + '[var_name_2]' : 'value2', } What am I doing wrong? Or maybbe it is impossible to set object property name using js experession? Thank you

    Read the article

  • Define Instance Variable Outside of Method Defenition (ruby)

    - by Ell
    Hi all, I am developing (well, trying to at least) a Game framework for the Ruby Gosu library. I have made a basic event system wherebye each Blocks::Event has a list of handlers and when the event is fired the methods are called. At the moment the way to implement an event is as follows: class TestClass attr_accessor :on_close def initialize @on_close = Blocks::Event.new end def close @on_close.fire(self, Blocks::OnCloseArgs.new) end end But this method of implementing events seems rather long, my question is, how can I make a way so that when one wants an event in a class, they can just do this class TestClass event :on_close def close @on_close.fire(self, Blocks::OnCloseArgs.new) end end Thanks in advance, ell.

    Read the article

  • How to define a predicate as a function argument

    - by devoured elysium
    I want to be able to write something as void Start(some condition that might evaluate to either true or false) { //function will only really start if the predicate evaluates to true } I'd guess it must be something of the form: void Start(Predicate predicate) { } How can I check inside my Start function whenever the predicate evaluated to true or false? Is my use of a predicate correct? Thanks

    Read the article

  • Define Servlet Context in WAR-File

    - by er4z0r
    Hi, How can I tell e.g. Tomcat to use a specific context path when given my WAR-File? Example: I have a war file created by maven build and the resulting name of the file is rather long. So I do not want the tomcat manager application to use the filename of the war as the context. Supplying a context.xml in META-INF did not produce the desired results I also found this in the documentation for the path attribute of Context: The value of this field must not be set except when statically defining a Context in server.xml, as it will be inferred from the filenames used for either the .xml context file or the docBase. So it does not seem to be the right way to tell the application-server what the path for my WAR should be. Any more hints?

    Read the article

  • possible to define an array in Sass?

    - by yaya3
    wondering if it is possible to use an array with Sass as I find my self repeating the following sort of thing: .donkey h2 background-color= !donkey .giraffe h2 background-color= !giraffe .iguana h2 background-color= !iguana

    Read the article

  • How to define specific permissions ?

    - by Don Carnage
    Hi, on the project i'm working we have a site (the front office) which is accessible by anonymous users, and a subsite (the back office) which access is restricted. In the back office, i want to restrict the access of one specific page (e.g, /Pages/specificpage.aspx) to only users who are members of a certain group. How can i do that ? Thanks.

    Read the article

  • How does mysql define DISTINCT()

    - by goran
    AFAIK SQL defines two uses of DISTINCT keywords - SELECT DISTINCT field... and SELECT COUNT(DISTINCT field) ... However in one of web applications that I administer I've noticed performance issues on queries like SELECT DISTINCT(field1), field2, field3 ... DISTINCT() on a single column makes no sense and I am almost sure it is interpreted as SELECT DISTINCT field1, field2, field3 ... but how can I prove this? I've searched mysql site for a reference on this particular syntax but could not find any. Does anyone have a link to definition of DISTINCT() in mysql or knows about other authoritative source on this? Best

    Read the article

  • Why does std queue not define a swap method specialisation

    - by Jamie Cook
    I've read that all stl containers provide a specialisation of the swap algorithm so as to avoid calling the copy constructor and two assignment operations that the default method uses. However, when I thought it would be nice to use a queue in some code I was working on I noticed that (unlike vector and deque) queue doesn't provide this method? I just decided to use a deque instead of a queue, but still I'm interested to know why this is?

    Read the article

  • WordPress: Using custom field to define posts to display in loop

    - by j-man86
    Hi, I'm trying to use a custom field in which I input the post ID numbers of the posts I want to show, seperated by commas. For some reason though, only the first post of the series of the post IDs are displaying. Can someone help? The value of $nlPostIds is (minus the quotes): "1542,1534,1546". Here's the code... the most important part is the 4th line 'post__in' => array($nlPostIds) <?php $nlPostIds = get_post_meta($post->ID, 'nlPostIds', true); $args=array( 'post__in' => array($nlPostIds) ); query_posts($args); if ( $wp_query->have_posts() ) : while ( $wp_query->have_posts() ) : $wp_query->the_post(); ?> <div class="entry"> <div class="post" id="post-<?php the_ID(); ?>"> <h2><a href="<?php the_permalink() ?>" rel="bookmark" title="Permanent Link to <?php the_title_attribute(); ?>"><?php the_title(); ?></a></h2> <div class="allinfos"><span class="date"><?php the_time('F jS, Y') ?></span> | <span class="comments"><?php comments_popup_link('No Comments', '1 Comment', '% Comments'); ?> </span> | <span class="category">Posted in <?php the_category(', ') ?></span> <!-- by <?php the_author() ?> --></div> <?php the_content('More &raquo;'); ?> <?php the_tags('Tags: ', ', ', ' '); ?> <?php edit_post_link('Edit', '[ ', ' ]'); ?> <div class="clear"></div> </div></div> <?php endwhile; endif; ?> Thanks!

    Read the article

  • Should interfaces define properties?

    - by Otávio Décio
    Interfaces, as defined by MSDN "contain only the signatures of methods, delegates or events." However, since properties are no more than syntactic sugar for a get and set method, they are also allowed in interfaces. My question is - is there any situation where defining properties in an interface is appropriate or should we stick to the scenarios described by MSDN?

    Read the article

  • define keys in multidimensional array from csv

    - by mourique
    I want to compare two arrays, one coming from a shoppingcart and the other one parsed from a csv-file. The array from the shopping cart looks like this: Array ( [0] => Array ( [id] => 7 [qty] => 1 [price] => 07.39 [name] => walkthebridge [subtotal] => 7.39 ) [1] => Array ( [id] => 2 [qty] => 1 [price] => 07.39 [name] => milkyway [subtotal] => 7.39 ) ) The array from my csv-file however looks like this Array ( [0] => Array ( [0] => 1 [1] => walkthebridge [2] => 07.39 ) [1] => Array ( [0] => 2 [1] => milkyway [2] => 07.39 ) ) and is build using this code $checkitems = array(); $file = fopen('checkitems.csv', 'r'); while (($result = fgetcsv($file)) !== false) { $checkitems[] = $result; } fclose($file); how can i get the keys in the second array to match those in the first one? ( So that 0 would be id, and 1 would be name and so on) thanks in advance

    Read the article

  • Flex - How do I use a variable to define the name of an instantiated object

    - by flexfanatic
    Essentially this is what I want to accomplish, however it doesn't work like this. Is there any solution: - The problem is I can't dynamically name a new object... ??? pulling my hair out. import views.printingView; public function initComponent(o:Array):void{ SomeObject::Array = o; for(i=0; i <=SomeObject.length-1; i++){ 'invoice'+{SomeObject[i].namedID}:printingView = new printingView(); someDisplayContainer.addChild('invoice'+{SomeObject[i].namedID}); 'invoice'+{SomeObject.namedID}.publicInitFunction(SomeObject[i]); } }

    Read the article

  • How to define custom path to Interop *.dll

    - by NoviceAndNovice
    Well, I have an ActiveX (*.ocx) component, and i use it in a managed C++/CLI project: write a managed wrapper around ActiveX component[ NET has a great Interop services : provides me genarated dll so i can easily use it in my managed code] The problem is that Visual Studio (2008) automatically copy the generated Interop *.dll to the directory where my *.exe file stay.But i want put all my genarated Interop *.dll to a folder ... Suppose My directory structure is so: D:\MyProject\Output\MyProject.exe //My mamanged exe D:\MyProject\Output\Interop.XXXLib.1.0.dll // *Interop .dll I want to put Interop.XXXLib.1.0.dll into new folder D:\MyProject\Output\Interops and use it from that directory...How Can i do it? Best Wishes PS: What I found so far was using using codeBase/ probing tags in my app.config file such as <?xml version="1.0"?> <configuration> <runtime> <assemblyBinding xmlns="urn:schemas-microsoft-com.asm.v1"> <probing privatePath="Interops" /> </assemblyBinding> </runtime> </configuration> But i did not work in C++/CLI

    Read the article

  • C# define string format of double/floats to be US english by default

    - by neil
    Hi, I have got several thousands of lines of a web application source code, initially written on a US development system, to maintain. It makes heavy use of SQL statement strings, which are combined on the fly, e.g. string SQL = "select * from table where double_value = " + Math.Round(double_value, 2); Don't comment on bad programming style, that doesn't help me in this case :) The cruix: My system uses a German locale, which in turn leads to wrong SQL statements, like this: "select * from table where double_value = 15,5" (Note the comma as decimal separator instead of a point). Question: What is the most "elegant" way to change the locale of the web app in this case) to US or UK in order to prevent being forced to change and inspect every single line of code? .net 3.5 is not an option (would give me the chance to overwrite ToString() in an extension class) Kind regards

    Read the article

  • Can an interface define the signature of a c#-constructor

    - by happyclicker
    I have a .net-app that provides a mechanism to extend the app with plugins. Each plugin must implement a plugin-interface and must provide furthermore a constructor that receives one parameter (a resource context). During the instantiation of the plugin-class I look via reflection, if the needed constructor exists and if yes, I instantiate the class (via Reflection). If the constructor does not exists, I throw an exception that says that the plugin not could be created, because the desired constructor is not available. My question is, if there is a way to declare the signature of a constructor in the plugin-interface so that everyone that implements the plugin-interface must also provide a constructor with the desired signature. This would ease the creation of plugins. I don’t think that such a possibility exists because I think such a feature falls not in the main purpose for what interfaces were designed for but perhaps someone knows a statement that does this, something like: public interface IPlugin { ctor(IResourceContext resourceContext); int AnotherPluginFunction(); } I want to add that I don't want to change the constructor to be parameterless and then set the resource-context through a property, because this will make the creation of plugins much more complicated. The persons that write plugins are not persons with deep programming experience. The plugins are used to calculate statistical data that will be visualized by the app.

    Read the article

  • define mysql indexing

    - by Bharanikumar
    Hi Am not sure, This is the right place to post this question , But in our stack overflow only am getting clear vision solutions , What is indexing and what is fulltext , for the above both questions i know the ans, but i cant expose that ans in the exact way to the interviewer , (indexing means somthing like index in book) (fulltext means for search string), Can please give me very simple defination for this questions , Advance thanks

    Read the article

  • define colors as variables in CSS

    - by patrick
    Hi all, I'm working CSS file which is quite long. I know the client could ask for changes to the color scheme, and was wondering: is it possible to assign colors to variables so I can just change them to have the new color applied to all elements that use it? Please note I can't use php to dynamically change the css file.

    Read the article

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