Search Results

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

Page 8/244 | < Previous Page | 4 5 6 7 8 9 10 11 12 13 14 15  | Next Page >

  • How to define type member constant in F# ?

    - by zproxy
    In C# one can define a type member constant like this: class Foo { public const int Bar = 600; } The IL shall looks like this. .field public static literal int32 Bar = int32(600) How can I do the same within Visual F# / FSharp? I tried this to no avail: [<Sealed>] type Foo() = [<Literal>] let Bar = 600

    Read the article

  • Define a default .properties file in JAVA

    - by bnabilos
    Hello, I have 2 .properties files in my java project and I want to define one of them as default file to be used when the language of the operating system is different from the 2 languages already defined. Can you tell me please what should I add to my code to make that possible? Thank you

    Read the article

  • C/C++ pragma in define macro

    - by aaa
    is there some way to embed pragma statement in macro with other statements? I am trying to achieve something like: #define DEFINE_DELETE_OBJECT(type) \ void delete_ ## type_(int handle); \ void delete_ ## type(int handle); \ #pragma weak delete_ ## type_ = delete_ ## type I am okay with boost solutions (save for wave) if one exists. thank you

    Read the article

  • C preprocessor: using #if inside #define?

    - by Wxy
    I want to write a macro that spits out code based on the boolean value of its parameter. So say DEF_CONST(true) should be expanded into "const", and DEF_CONST(false) should be expanded into nothing. Clearly the following doesn't work because we can't use another preprocessor inside #defines: #define DEF_CONST(b_const) \ #if (b_const) \ const \ #endif Any idea about how to do it?

    Read the article

  • WPF: how to define collections for use in xaml

    - by Aran Mulholland
    I want to define something like this <myCustomControl> <myCustomControl.Images> <Image Source="{StaticResource LockedIcon16}" /> <Image Source="{StaticResource UnlockedIcon16}"/> <myCustomControl.Images> <myCustomControl/> what property definitions do i need to get that collection (Images) happening?

    Read the article

  • $ is not define on firfox in jQuery

    - by Alvin
    Hi, Whenever I try to load the following part in tag on firfox browser, I get the message as "$ is not define". May I know the reason? I'm trying to load the jquery.js file before loading any custom script after CSS part. <script type="text/javascript" src="jquery.js"></script> <script type="text/javascript"> $(document).ready(function(){

    Read the article

  • How to define a current user?

    - by ie
    Is it possible to define a current user? I found a stored procedure 'sp_mgGetConnectedUsers'. It returns a result set with the only unique field 'Address'. How could I associate an executing query with such 'Address'. Please advice. Note: As far as I understand, another way to get the current user is to set a unique application Id for each connection, but I don't like this way much.

    Read the article

  • Any tips on reducing wxWidgets application code size?

    - by Billy ONeal
    I have written a minimal wxWidgets application: stdafx.h #define wxNO_REGEX_LIB #define wxNO_XML_LIB #define wxNO_NET_LIB #define wxNO_EXPAT_LIB #define wxNO_JPEG_LIB #define wxNO_PNG_LIB #define wxNO_TIFF_LIB #define wxNO_ZLIB_LIB #define wxNO_ADV_LIB #define wxNO_HTML_LIB #define wxNO_GL_LIB #define wxNO_QA_LIB #define wxNO_XRC_LIB #define wxNO_AUI_LIB #define wxNO_PROPGRID_LIB #define wxNO_RIBBON_LIB #define wxNO_RICHTEXT_LIB #define wxNO_MEDIA_LIB #define wxNO_STC_LIB #include <wx/wxprec.h> Minimal.cpp #include "stdafx.h" #include <memory> #include <wx/wx.h> class Minimal : public wxApp { public: virtual bool OnInit(); }; IMPLEMENT_APP(Minimal) DECLARE_APP(Minimal) class MinimalFrame : public wxFrame { DECLARE_EVENT_TABLE() public: MinimalFrame(const wxString& title); void OnQuit(wxCommandEvent& e); void OnAbout(wxCommandEvent& e); }; BEGIN_EVENT_TABLE(MinimalFrame, wxFrame) EVT_MENU(wxID_ABOUT, MinimalFrame::OnAbout) EVT_MENU(wxID_EXIT, MinimalFrame::OnQuit) END_EVENT_TABLE() MinimalFrame::MinimalFrame(const wxString& title) : wxFrame(0, wxID_ANY, title) { std::auto_ptr<wxMenu> fileMenu(new wxMenu); fileMenu->Append(wxID_EXIT, L"E&xit\tAlt-X", L"Terminate the Minimal Example."); std::auto_ptr<wxMenu> helpMenu(new wxMenu); helpMenu->Append(wxID_ABOUT, L"&About\tF1", L"Show the about dialog box."); std::auto_ptr<wxMenuBar> bar(new wxMenuBar); bar->Append(fileMenu.get(), L"&File"); fileMenu.release(); bar->Append(helpMenu.get(), L"&Help"); helpMenu.release(); SetMenuBar(bar.get()); bar.release(); CreateStatusBar(2); SetStatusText(L"Welcome to wxWidgets!"); } void MinimalFrame::OnAbout(wxCommandEvent& e) { wxMessageBox(L"Some text about me!", L"About", wxOK, this); } void MinimalFrame::OnQuit(wxCommandEvent& e) { Close(); } bool Minimal::OnInit() { std::auto_ptr<MinimalFrame> mainFrame( new MinimalFrame(L"Minimal wxWidgets Application")); mainFrame->Show(); mainFrame.release(); return true; } This minimal program weighs in at 2.4MB! (Executable compression drops this to half a MB or so but that's still HUGE!) (I must statically link because this application needs to be single-binary-xcopy-deployed, so both the C runtime and wxWidgets itself are set for static linking) Any tips on cutting this down? (I'm using Microsoft Visual Studio 2010)

    Read the article

  • StructureMap : How to define default constructor by code ?

    - by cik
    Hi, I can't figure out how to define the default constructor (when it exists overloads) for a type in StructureMap (version 2.5) by code. I want to get an instance of a service and the container has to inject a Linq2Sql data context instance into it. I wrote this in my 'bootstrapper' method : ForRequestedType<MyDataContext>().TheDefault.Is.OfConcreteType<MyDataContext>(); When I run my app, I got this error : StructureMap Exception Code: 202 No Default Instance defined for PluginFamily MyNamespace.Data.SqlRepository.MyDataContext, MyNamespace.Data, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null If I comment out all Linq2Sql generated contructors that I don't need, it works fine. Update : Oh, and I forgot to say that I would not use the [StructureMap.DefaultConstructor] attribute.

    Read the article

  • How to define a function in ghci across multiple lines

    - by Peter McGrattan
    I'm trying to define any simple function that spans multiple lines in ghci, take the following as an example: let abs n | n >= 0 = n | otherwise = -n So far I've tried pressing Enter after the first line: Prelude> let abs n | n >= 0 = n Prelude> | otherwise = -n <interactive>:1:0: parse error on input `|' I've also attempted to use the :{ and :} commands but I don't get far: Prelude> :{ unknown command ':{' use :? for help. I'm using GHC Interactive version 6.6 for Haskell 98 on Linux, what am I missing?

    Read the article

  • Can't define static abstract string property

    - by goombaloon
    I've run into an interesting problem and am looking for some suggestions on how best to handle this... I have an abstract class that contains a static method that accepts a static string that I would like to define as an abstract property. Problem is that C# doesn't doesn't support the following (see the ConfigurationSectionName and Current properties): public abstract class ProviderConfiguration : ConfigurationSection { private const string _defaultProviderPropertyName = "defaultProvider"; private const string _providersPropertyName = "providers"; protected static string ConfigurationSectionName { get; } public static Configuration Current { get { return Configuration)ConfigurationManager.GetSection(ConfigurationSectionName); } } } I suppose one way to handle this would be to make ConfigurationSectionName NOT abstract and then create a new definition of ConfigurationSectionName in the derived classes, but that feels pretty hackish. Any suggestions would be most welcome. Gratias!!!

    Read the article

  • How define charset for HTMLhelp?

    - by Oleg Svechkarenko
    My C++ windows program uses htmlhelp. Structure HH_POPUP includes field pszFont in format: "Facename[, point size[, CHARSET[, color[, PLAIN BOLD ITALIC UNDERLINE]]]]", but I cannot find any info about way to define the charset. My russian popup help is totally unreadeable. HH_POPUP popupAttr; memset(&popupAttr, 0, sizeof(popupAttr)); popupAttr.cbStruct = sizeof(popupAttr); popupAttr.clrBackground = COLORREF(-1); popupAttr.clrForeground = COLORREF(-1); popupAttr.rcMargins.left = -1; popupAttr.rcMargins.bottom = -1; popupAttr.rcMargins.right = -1; popupAttr.idString = UINT(helpInfo->dwContextId); popupAttr.pt = helpInfo->MousePos; popupAttr.pszFont = _T("Arial,18,HOW_TO_DEFINE_THIS_CHARSET"); // please!!! CWnd::GetDesktopWindow()->HtmlHelp(reinterpret_cast<DWORD>(&popupAttr), HH_DISPLAY_TEXT_POPUP);

    Read the article

  • Reference WiX define made in included file.

    - by leiflundgren
    I have a defines.wxi-file which contains some good definitions used in all my wxs-files. When I attempt to reference the defined value I get Undefined preprocessor variable '$(var.MAGE_FOLDER)' back in my face. I guess there is something trivial I am missing here... Any ideas? defines.wxi <Include> <?define IMAGE_FOLDER="Images" ?> </Include> Product.wxs <Wix xmlns="http://schemas.microsoft.com/wix/2006/wi"> <?Include defines.wxi ?> <Product ... > <Component Id='c.Images' Directory='$(var.IMAGE_FOLDER)' />

    Read the article

  • Java: define terms initialization, declaration and assignment

    - by HH
    I find the defs circular statements, the subjects are defined by their verbs but the verbs are undefined! So how do you define them? The question is central to understand the term final, related. The Circular Definitions itialization: to initilise a variable. It can be can be done at the time of declaration. assignment: to assign value to a variable. It can be done anywhere. declaration: to declare value to a variable.

    Read the article

  • How to define the order with ImportMany attribute?

    - by JD
    Hi to all, I am just getting into MEF and was wondering how you could define the order of collection exported with [ImportMany]? What I mean here is if I had two classes (Class1, Class2) that implement the interface IService and each of the implementations are in two different libraries (although they could be in the same), I want the Class2 instance to be created before the Class1 instance in the IEnumerable collection defined by the ImportMany attribute. So it is like a pipeline of functionality where Class2 calls are made before Class1 calls. Also, I have an another Class (Class3 which also implements IService) in another library, which I want introduced later on (i.e. some logging utility), how do I make this the 3rd instance in the ImportMany collection? JD

    Read the article

  • Inheritance: when implementing an interface which define a base class property why cant the class im

    - by Deepak
    Lets create some interfaces public interface ITimeEventHandler { string Open(); } public interface IJobTimeEventHandler: ITimeEventHandler { string DeleteJob(); } public interface IActivityTimeEventHandler: ITimeEventHandler { string DeleteActivity(); } public interface ITimeEvent { ITimeEventHandler Handler; } Another Interface public interface IJobTimeEvent :ITimeEvent { int JobID; } Create a class public class JobTimeEvent : IJobTimeEvent { public int JobID = 0; public IJobTimeEventHandler Handler = null; } My question is .. when implementing an interface which define a base class property why cant the class implementing interface return a derived class type object ?? For ex in class JobTimeEvent, IJobtimeEvent needs a property of type ITimeEventHandler but why IJobTimeEventHandler type is not allowed which derived from ITimeEventHandler

    Read the article

< Previous Page | 4 5 6 7 8 9 10 11 12 13 14 15  | Next Page >