Search Results

Search found 8286 results on 332 pages for 'defined'.

Page 116/332 | < Previous Page | 112 113 114 115 116 117 118 119 120 121 122 123  | Next Page >

  • Include Obj-C++ header from C++ source file

    - by Schwitzgabel
    Consider the followng situation: MacFont.h struct MacFont : Font { // ... NSFont* font; }; MacFont will be implemented in MacFont.mm FontEngine.cpp: #if defined(OS_MAC) #include "MacFont.h" #elif // ... #endif //... In order to make it compiling, I should rename FontEngine.cpp to FontEngine.mm but I'm not allowed to. So what now?

    Read the article

  • How to access a (shadowed) global function in ruby.

    - by yngvedh
    Hi, I was wondering how to access a global function fn in ruby from a class which also defined a method fn. I have made a workaround by aliasing the function like so: def fn end class Bar alias global_fn fn def fn # how to access the global fn here without the alias global_fn end end I'm looking for something along the lines of c++'s :: to access global scope but I can't seem to locate any information about it. I guess I don't know specifically what I'm looking for.

    Read the article

  • Calling a Factory in AngularJS

    - by Kohjah Breese
    How do you call a factory? As defined below. angular.module('fb.services', []).factory('getQueryString', function () { return { call: function () { var result = {}, queryString = qs.substring(1), re = /([^&=]+)=([^&]*)/g, m; while (m = re.exec(queryString)) result[decodeURIComponent(m[1])] = decodeURIComponent(m[2]); return result; } } }); alert(getQueryString.call('this=that&me=you'));

    Read the article

  • There's @interface in my @implementation — why is that?

    - by Mark McDonald
    This is a pretty noobish question – I'm looking at some Cocoa sample code and there's @interface blocks in the .m files as well as the headers. For instance, in the AppDelegate class header, a UIWindow and UI navigation are defined as instance variables, but the @property declarations are actually made in the implementation file. Is there a functional reason for this, is it a stylistic choice, or… ?

    Read the article

  • This is a valid C code but not a valid C++ code?

    - by claws
    In some library I'm using (written in C) its StorePGM(image, width, height, filename) char *image; int width, height; char *filename; { // something something } All functions are defined this way. I never seen such function definitions in my life. They seem to be valid to MSVC but when I compile it as C++ it gives errors. What is it? some kind of old version C?

    Read the article

  • [Linq & Dictionary (.NET)] A problem with compare item value

    - by Tony
    Hi, I have defined my class: public class Host { public string Name; } then a strobgly-typed dictionary: Dictionary<string, Host> HostsTable; then I try to compare a value: if (HostsTable.Values.Where(s => s.Name == "myhostname") != null) { doSomething } and the problem is, nothing is found, even I'm sure the item is on the list. What I'm doing wrong ?

    Read the article

  • Javascript Function Definitions

    - by Pierreten
    I was wondering why the Vector variable defined within this self executing javascript function doesn't require a var before it? Is this just some other type of syntax for creating a named function? Does this make it so we can't pass Vector as an argument to other functions? (function() { Vector = function(x, y) { this.x = x; this.y = y; return this; }; //...snip })()

    Read the article

  • How can I customize my layout.xml from code before calling setContentView(View) function?

    - by Marton_hun
    I would like to customize my layout definition (declared in my_layout.xml file) from code. Unfortunately I can use findViewById() function to find the specific views (defined in my_layout.xml file) and customize them from code only after I called setContentView(R.layout.my_layout). But what if I want to customize my layout first, before calling setContentView()? How can I access the specific views before calling setContentView()?

    Read the article

  • Getting all rows from a Table where the column contains only 0

    - by Auro
    I got a little problem i need a sql query that gives all rows back that only contains 0 in it. the column is defined as varchar2(6) the values in the column looks like this: 0 00 00 100 bc00 000000 00000 my first solution would be like this: Oracle: substr('000000' || COLUMN_NAME, -6) = '000000' SQL Server: right('000000' + COLUMN_NAME, 6) = '000000' is there an other way? (it needs to work on both systems)

    Read the article

  • Where namespace does operator<< (stream) go to?

    - by aaa
    If I have have some overloaded ostream operators, defined for library local objects, is its okay for them to go to std namespace? If I do not declare them in std namespace, then I must use using ns:: operator <<. As a possible follow-up question, are there any operators which should go to standard or global namespace?

    Read the article

  • How to change the header height in jQuery grid?

    - by rockers
    Hello Friends, I have a jquery grid,, with columns 5..but my column name is too large so defined somethign like this in my jquery grid.. Informatoin about <br/> customers bioData In my jquery column I am seeing Information about I am not able to see Customers BioData.. how to set the header height? thanks

    Read the article

  • Problem with C++ classes

    - by Mike
    I have a class defined called extBlock. I then make an instance of that class with this extBlock mainBlock = new extBlock(1, 1024); I get this error: error C2440: 'initializing' : cannot convert from 'extBlock *' to 'extBlock' Can anyone help me with why I am getting this error. I have seen examples online of declaring it like this with a pointer extBlock *mainBlock = new extBlock(1, 1024); But if I do it this way it does not let me call the functions of mainBlock

    Read the article

  • Can I use accepts_nested_attributes_for with checkboxes in a _form to select potential 'links' from a list

    - by Ryan
    In Rails 3: I have the following models: class System has_many :input_modes # name of the table with the join in it has_many :imodes, :through => :input_modes, :source => 'mode', :class_name => "Mode" has_many :output_modes has_many :omodes, :through => :output_modes, :source => 'mode', :class_name => 'Mode' end class InputMode # OutputMode is identical belongs_to :mode belongs_to :system end class Mode ... fields, i.e. name ... end That works nicely and I can assign lists of Modes to imodes and omodes as intended. What I'd like to do is use accepts_nested_attributes_for or some other such magic in the System model and build a view with a set of checkboxes. The set of valid Modes for a given System is defined elsewhere. I'm using checkboxes in the _form view to select which of the valid modes is actually set in imodes and omodes . I don't want to create new Modes from this view, just select from a list of pre-defined Modes. Below is what I'm currently using in my _form view. It generates a list of checkboxes, one for each allowed Mode for the System being edited. If the checkbox is ticked then that Mode is to be included in the imodes list. <% @allowed_modes.each do |mode| %> <li> <%= check_box_tag :imode_ids, mode.id, @system.imodes.include?(modifier), :name => 'imode_ids[]' %> <%= mode.name %> </li> <% end %> Which passes this into the controller in params: { ..., "imode_ids"=>["2", "14"], ... } In the controller#create I extract and assign the Modes that had their corresponding checkboxes ticked and add them to imodes with the following code: @system = System.new(params[:system]) # Note the the empty list that makes sure we clear the # list if none of the checkboxes are ticked if params.has_key?(:imode_ids) imodes = Mode.find(params[:imode_ids]) else imodes = [] end @system.imodes = imodes Once again that all works nicely but I'll have to copy that cludgey code into the other methods in the controller and I'd much prefer to use something more magical if possible. I feel like I've passed off the path of nice clean rails code and into the forest of "hacking around" rails; it works but I don't like it. What should I have done?

    Read the article

  • jQuery if and logic

    - by danit
    I have a simple jQuery toolbar, the basic functionality is: Hover: Background change to defined value & add .active class OnClick: Move the icon down 4px, and change background of the toolbar to that of the element What I would like to do move the icon down 4px when it has the class 'active' applied, however also remove the onclick event? Somehow I need an 'IF' statement in my jQuery for the Onclick event.

    Read the article

  • BYTE typedef in VC++ and windows.h

    - by jules
    Hi, I am using Visual C++, and I am trying to include a file that uses BYTE (as well as DOUBLE, LPCONTEXT...) , which by default is not a defined type. If I include windows.h, it works fine, but windows.h also defines GetClassName wich I don't need. I am looking for an alternative to windows.h include, that would work with VC++ and would define most of the types like BYTE, DOUBLE ... Thanks

    Read the article

  • Why is there no Sum() extension for IEnumerable<uint>

    - by dss539
    It seems that Sum not defined for IEnumerable<uint> (and other unsigned integers, for that matter) var s = new int[] { 1, 2, 3 }; s.Sum(); //works fine var us = new uint[] { 1, 2, 3 }; us.Sum(); //missing method I would like to know: Have I done something fundamentally wrong/misunderstood the situation? What design decisions might cause the omission of IEnumerable<uint>.Sum()? MSDN: Enumerable.Sum

    Read the article

  • Restrict a generic type

    - by Water Cooler v2
    I want to restrict the generic type parameter to: 1) either that of a certain user defined reference type; OR 2) any of the primitive types in the CLR; How do I say something to the effect of: interface IDataManager<T>: IDataManager where T: IDataObject, T: ValueType

    Read the article

  • Eclipse/Aptana Subprojects

    - by TPorteus
    I've been using a eclipse with the aptana plugin and have all my projects neatly defined. However one project is a main corporate website lets say http://sun.com and it's set up nicely for FTP transfers. However i was wondering if there was a way to define directories of that as subprojects or projects in there own right without messing up the file transfer stuff. Any ideas?

    Read the article

  • iphone view-based app

    - by ms
    I've created a view based application and have connected all of my buttons through Interface Builder (and saved)...however upon launch all I have is a white screen on the simulator. I've uncommented the viewDidLoad, and my header file has IBOutlet UIlabels defined. I'm kind of baffled.

    Read the article

  • Search a full text index for 'c#'

    - by KKirk
    Hi I have a table (lets say it has one column called 'colLanguage') that contains a list of skills and has a full text index defined on it. One of the entries in the table is 'c#' but when I search for 'c#' (using the following SQL) I get no results back. select * from FREETEXTTABLE(tblList, colLanguage, 'c#') Can anyone help? Thanks K

    Read the article

< Previous Page | 112 113 114 115 116 117 118 119 120 121 122 123  | Next Page >