Search Results

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

Page 195/332 | < Previous Page | 191 192 193 194 195 196 197 198 199 200 201 202  | Next Page >

  • How to Execute Base Class's Method Before Implementors's Method?

    - by DaveDev
    I have the following page public partial class GenericOfflineCommentary : OfflineFactsheetBase { } where OfflineFactsheetBase is defined as public class OfflineFactsheetBase : System.Web.UI.Page { public OfflineFactsheetBase() { this.Load += new EventHandler(this.Page_Load); this.PreInit += new EventHandler(this.Page_PreInit); } protected void Page_PreInit(object sender, EventArgs e) { if (Request.QueryString["data"] != null) { this.PageData = StringCompressor.DecompressString(Request.QueryString["data"]); this.ExtractPageData(); } } } OfflineFactsheetBase has the following virtual method: public virtual void ExtractPageData() { // get stuff relevant to all pages that impmement OfflineFactsheetBase } which is implemented in all pages that impmement OfflineFactsheetBase as follows: public partial class GenericOfflineCommentary : OfflineFactsheetBase { public override void ExtractPageData() { // get stuff relevant to an OfflineCommentary page. } } Currently, only GenericOfflineCommentary's ExtractPageData() is firing. How can I modify this to first run OfflineFactsheetBase's ExtractPageData() and then GenericOfflineCommentary's? edit: I'm trying to avoid having to call base.ExtractPageData() in every implementor. Is this possible?

    Read the article

  • Can't access variables from dynamically loaded javascript

    - by Menno
    I'm using a fairly simple system to load javascript dynamically: include = function (url) { var e = document.createElement("script"); e.src = url; e.type="text/javascript"; document.getElementsByTagName("head")[0].appendChild(e); }; Let's say I have a file test.js which has the following contents: var foo = 4; Now, in my original script, I want to use include(test.js); console.log(foo); However, I get a 'foo has not been defined' error on this. I'm guessing it has to do with the dynamic script being included as the last child of the <head> tag. How can I get this to work?

    Read the article

  • How to I count key collisions when using boost::unordered_map?

    - by Nikhil
    I have a data structure with 15 unsigned longs, I have defined a hash function using hash_combine as follows: friend std::size_t hash_value(const TUPLE15& given) { std::size_t seed = 0; boost::hash_combine(seed, val1); boost::hash_combine(seed, val2); ... return seed; } I insert a large number of values into a boost::unordered_map but the performance is not good enough. Probably, I could do better with an alternative hashing function. To confirm this, I need to check how many collisions I am getting. How do I do this?

    Read the article

  • Ternary operators and variable reassignment in PHP

    - by TomcatExodus
    I've perused the questions on ternary operators vs. if/else structures, and while I understand that under normal circumstances there is no performance loss/gain in using ternary operators over if/else structures, I've not seen any mention of this situation. Language specific to PHP (but any language agnostic details are welcome) does the interpreter reassign values in situations like this: $foo = 'bar' $foo = strlen($foo) > 3 ? substr($foo, 0, 3) : $foo; Since this would evaluate to $foo = $foo; is this inefficient, or does the interpreter simply overlook/discard this evaluation? On a side note, what about: !defined('SECURE') ? exit : null;

    Read the article

  • i have problem to get new inserted columnID using sql

    - by newBie
    hi I have an identity column defined as int in sql . I use SCPOE_IDENTITY () to get the new inserted column id. this is sample of my code: Dim sql As String = "insert into infoHotel (nameHotel, knownAs1, knownAs2, knownAs3, knownAs4, streetAddress) values (N" & _ FormatSqlParam(hotel) & ",N" & _ FormatSqlParam(KnownAs(0)) & ",N" & _ FormatSqlParam(KnownAs(1)) & ",N" & _ FormatSqlParam(KnownAs(2)) & ",N" & _ FormatSqlParam(KnownAs(3)) & ",N" & _ FormatSqlParam(StreetAddress) & _ "SELECT CAST(scope_identity() AS int)")" Dim objCommand1 As New SqlCommand(sql, conn) Dim infoID As Integer = objCommand1.ExecuteScalar() my problem here is, i cant get the infoID's value..is my code wrong?..some help plzz.. im using vb.net n sql

    Read the article

  • Android how do I wait until a service is actually connected?

    - by Ryan
    I have an Activity calling a Service defined in IDownloaderService.aidl: public class Downloader extends Activity { IDownloaderService downloader = null; // ... In Downloader.onCreate(Bundle) I tried to bindService Intent serviceIntent = new Intent(this, DownloaderService.class); if (bindService(serviceIntent, sc, BIND_AUTO_CREATE)) { // ... and within the ServiceConnection object sc I did this public void onServiceConnected(ComponentName name, IBinder service) { Log.w("XXX", "onServiceConnected"); downloader = IDownloaderService.Stub.asInterface(service); // ... By adding all kinds of Log.xx I found that the code after if(bindService(...)) actually goes BEFORE ServiceConnection.onServiceConnected is being called - that is, when downloader is still null - which gets me into trouble. All the samples in ApiDemos avoid this timing problem by only calling services when triggered by user actions. But what should I do to right use this service after bindService succeeds? How can I wait for ServiceConnection.onServiceConnected being called reliably?

    Read the article

  • Getting count() of class static array

    - by xylar
    Is it possible to get the count of a class defined static array? For example: class Model_Example { const VALUE_1 = 1; const VALUE_2 = 2; const VALUE_3 = 3; public static $value_array = array( self::VALUE_1 => 'boing', self::VALUE_2 => 'boingboing', self::VALUE_3 => 'boingboingboing', ); public function countit() { // count number $total = count(self::$value_array ); echo ': '; die($total); } } At the moment calling the countit() method returns :

    Read the article

  • How to decide if a parameter is the click event

    - by sameold
    I have a function which can be called by either a click event or directly. When I call it directly, I need pass it a data parameter, so I've defined the function to accept a parameter to account for the direct call with the parameter. function myFunc(param){ } Within the function, I need to differentiate whether the function was called directly or from the click event, so what I thought I could simply check if param is set. If it's set, then the function is called directly. If it's not set, then it's called from the click event. The problem is that a click event by default passes an event object. So even when the function is called by the click event, param won't be null. So is there a way to check whether the param passed is the click event?

    Read the article

  • What's the best way to return a subset of a list

    - by Pikrass
    I have a list of tasks. A task is defined by a name, a due date and a duration. My TaskManager class handles a std::list<Task> sorted by due date. It has to provide a way to get the tasks due for a specific date. How would you implement that ? I think a good way (from API point of view) would be to provide a std::list<Task>::iterator pair. So I would have a TaskManager::begin(date) method. Do you think this method should get the iterator by iterating from the start of the list until it finds the first task due on that date, or by getting it from a std::map<date, std::list<Task>::iterator> (but then we have to keep it up-to-date when adding or removing tasks) ? And then, how could I implement the TaskManager::end(date) method ?

    Read the article

  • I tried installing Ubuntu 10.04 and I got this message - any ideas on what to do?

    - by vette982
    No root file system defined. Please correct this from the partition menu. This message shows up when I first boot into Ubuntu after the installation. I installed it by mounting the ISO with Daemon Tools, and I just did the default Wubi installation. I keep reading everywhere that I need to choose my installation directory, but I don't get any option to do that. These are all the options I get for installation directory. I have a C and D partition on my drive, and I tried installing it on both and no luck either way. Any ideas?

    Read the article

  • WPF: Creating instances of resources?

    - by oakskc
    I'm brand spanking new to WPF and am trying to play around with projects to better understand what I'm reading. My understanding of a resource is that it is the instance, you can't use it like a factory and create instances of it. For example, a XAML-defined rectangle. You can reference it, but you can't have numerous instances of it all over the surface. In WPF, what would be the way to do that? If I define a Rectangle as a resource with specific properties and wanted to have multiple instances of that within a dynamically-generated grid, how should I be going about it? Or is there a different way I should be trying to do this? Purely academic exercise with no real-world application.

    Read the article

  • how to display CFStringType? Like kABHomeLabel

    - by xiaozi
    I know that NSString and CFString are toll-bridge, they can convert in such a way. CFStringRef cfStr; NSString* anStr=(NSString*)cfStr; however,when I convert string in such a case when dealing addressbook NSString* homeLabel=(NSString*)kABWorkLabel; then homeLabel is "$!!$"; the other pre-defined CFStringRef in the addressbook property is the same. in my program,I want to get both the label and the label item's info. NSString* label=ABMultiValueCopyLabelAtIndex(multi,i); so how to correctly get the string of the label? Thanks!

    Read the article

  • What are the steps to upgrade maven/grails from 1.2.0 to 1.2.1?

    - by Brice
    I have recently started a new project using the maven grails archetype - at the time, (a few weeks ago), Grails 1.2.0 was the most recent release. Now that there's a newer release, what are the steps to upgrade? I would assume that since Grails dependencies are defined in the POM, that the POM will need to be updated? Are there any instructions on doing this? Does the maven-grails-plugin handle this? Is this documented anywhere? Appreciate any pointers. Thanks!

    Read the article

  • I am attempting to pull all years and terms from database except the last term

    - by Jonathan Moriarty
    I have a logic problem: We have a database that has a donations table with name, address, last donation year, and last donation term (Spring and Fall). We want to pull all donors unless they donated in the last term (Spring or Fall). I have been trying to figure out the logic of pulling all years up to the current year while omitting the last term. So for example this year is 2012 and we are in the Spring term (I defined the spring term between 1/1 and 6/30) so I only want to display donors before and including spring 2011 (we will exclude the current term which is spring 12 and the last term which is fall 2011). The problem is I want to pull sprig 2011, fall 2010, spring 2010 etc, but only omit the current term and last term donated.

    Read the article

  • Rails Variable across all controller actions

    - by bob
    Hello, This should be a very simple rails question. I have a variable like the following. @administration = Administration.first I want this variable to be accessible through every controller action across all my controllers so for example if I have a Product controller and inside of it I have the usual CRUD actions, I want the @administration variable as defined above to be put into all the CRUD actions. (It would not be needed in destroy or create or update). I have many controllers throughout my project and I was wondering if there is an easier way than adding it manually through all of the actions that I want it in. I tried a global variable $administration = Administration.first but I run into an issue where it is not updated when I update the actual content of the Administration.first table. Also, I would like to avoid global variables. Any help would be much appreciated. Thanks! :)

    Read the article

  • Which .NET data provider?

    - by worlds-apart89
    I am new to database programming, so I'd like help getting on the right track. I have read that there are Microsoft-defined and third-party data providers for data access. MSDN has information on data providers for SQL Server, OLE DB, ODBC, Oracle, as well as the EntityClient provider (Entity Framework). Which data provider is today's hottest, most-widely used model? Which one is the future? Also, I have seen Linq to SQL tutorials, but what category does L2S fall into?

    Read the article

  • Breaking from for loop in MATLAB GUI

    - by Nick
    I have a for loop in the opening function of a GUI in MATLAB and I'm trying to use a callback button to break the loop. I'm new to MATLAB. Here's the code I have: %In the opening function of the GUI handles.stop_now = 0; for i=1:inf if handles.stop_now==1 break; end end % Executes on button press function pushbutton_Callback(hObject, eventdata, handles) % hObject handle to end_segmenting_button (see GCBO) % eventdata reserved - to be defined in a future version of MATLAB % handles structure with handles and user data (see GUIDATA) handles.stop_now=1; guidata(hObject, handles); For some reason, despite defining the variables with handles, the loop doesn't break upon pressing the button. Anyone know what's going on? Thanks.

    Read the article

  • Where does one enter the JavaScript code in CRM Dynamics?

    - by Konrad Viltersten
    I've started to play with CRM Dynamics yesterday so this question should be seen as a very basic one. I've been coding for many years but CRM D is news to me. Apparently, one is supposed to be able to enter JavaScript code to customize the behavior of the application. I've understood that there's an API for that and that touching DOM directly or playing with jQuery is a no-no. Question: Where is the JS-code supposed to be entered? I've gone through all the menus but as far I can see, there's no spot where I could plug-in my custom code. E.g.: Where do I get to define a validation for the last name of a contact currently being defined?

    Read the article

  • Are volatile data members trivially copyable?

    - by Lightness Races in Orbit
    Whilst writing this answer I realised that I'm not as confident about my conclusions as I usually would ensure before hitting Post Your Answer. I can find a couple of reasonably convincing citations for the argument that the trivial-copyability of volatile data members is either implementation defined or flat-out false: https://groups.google.com/forum/?fromgroups=#!topic/comp.std.c++/5cWxmw71ktI http://gcc.gnu.org/bugzilla/show_bug.cgi?id=48118 http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2010/n3159.html#496 But I haven't been able to back this up in the standard1 itself. Particularly "worrying" is that there's no sign of the proposed wording change from that n3159 issues list in the actual standard's final wording. So, what gives? Are volatile data members trivially copyable, or not? 1   C++11

    Read the article

  • How can I refer to a binding converter in another namespace in Silverlight XAML?

    - by Mike Pateras
    Since you apparently can't create a Silverlight DataTemplate in C#, I'm trying to create one in XAML. I have a converter that I need to refer to, that I have defined in C# in another namespace. I've tried doing this: <UserControl.Resources> <DataTemplate x:Key="PriceTemplate"> <TextBlock Text="{Binding Price, Converter={Converters:PriceConverter}}" /> </DataTemplate> </UserControl.Resources> Where Converters is an xmlns that points to the correct namespace. However, I get a compilation error that says: Type 'Converters:PriceConverter' is used like a markup extension but does not derive from MarkupExtension. I tried adding System.Windows.Markup.MarkupExtension as a parent to my converter, but it apparently doesn't exist in Silverlight. How can I refer to my converter in XAML, without having to rewrite it in XAML?

    Read the article

  • Is there a design pattern for this ?

    - by ytrewq
    I have a component that needs to call a specific service depending on the input it receives. So my component has to look at the input and based on a configuration that says "for this input call this service with this data" needs to call the proper service. The services have a common signature method and a specific one (each). I thought about an abstract class that includes the signatures for all three methods. The implementation for the two services will override all three methods (throwing NotImplementedException for the methods that are not supported by current service). A component that could be initialized with a map (that for each input type will have the type of the service to be called) will also be defined. Do you have a better approach to cope this scenario ?

    Read the article

  • latex table reference

    - by Tim
    Hi, I wrote a long table with a label in a tex file and \input it into my main tex file. The reference in the main tex file to the table, however, does not show the numbering of the table but the one of the next table that are written directly in the main tex file. All long tables that are written directly in the main tex file have correct references. How to fix my problem? Must the label be defined in the same tex file as its reference? Thanks and regards! The label is \label{tab:yy}, and the reference is \ref{tab:yy}, and every table has a distinct label.

    Read the article

  • g_signal_connect error invalid use of member

    - by paultop6
    Hi Guys, More GTK questions, im trying to compile some code and im getting the following error: error: invalid use of member (did you forget the ‘&’ ?) This is comming from the g_signal_connect call: g_signal_connect ((gpointer) Drawing_Area_CPU, "expose-event", G_CALLBACK (graph_expose), NULL); Drawing_Area_CPU is a GtkWidget* and graph_expose is defined as: gboolean graph_expose(GtkWidget *widget, GdkEventExpose *event, gpointer data); So far as i can tell im doing everything right, but still i get this error. Can anyone help please? Regards Paul

    Read the article

  • Defining multiple VBA objects within one function or sub-routine?

    - by Harokitty
    I have the following VBA code: Option Explicit Private a(2) as Double Private b(2) as Double Public Function Hello(X1 As Double, X2 As Double) As Double a(1) = X1 + X2 a(2) = X1/X2 b(1) = X1 b(2) = X2^2 Hello = a(1)+a(2)+b(1)+b(2) End Function Within the function Hello I have defined a(1),a(2),b(1),b(2). However, I want to make some function or sub-routine that accepts X1 and X2 as arguments and spits out the values for a(1),a(2),b(1),b(2). This is because I use the above definitions for a(1),a(2),b(1),b(2) in about 20 functions in my module and would like to avoid having to do the following in each function that I use thesis in: a(1) = X1 + X2 a(2) = X1/X2 b(1) = X1 b(2) = X2^2

    Read the article

  • Attach to Property's setter

    - by StupidDeveloper
    I haven't found similiar post so I'm asking this. Let's say I defined somewhere an application wide available static Property (I mean it's not local) and in one class I would like to know when this property is being changed. Apart from aop (transparentproxy etc.) which I think doesn't suit me well here (and I can't add that to project anyway), what are the options here? One solution I can think of, which is probably a very nasty one, is to use some event that would be executed in the setter and just attach it in the class(es) which needs that. Something like: public static event EventHandler CurrentNumberChanged= delegate {}; public static int CurrentNumber { get { return currentNumber; } set { currentNumber = value; CurrentNumberChanged(null, EventArgs.Empty); } } I know it's really unsafe to use such events ( read here ). And since I would use it in asp.net makes it even more ugly. Do you have any advices ?

    Read the article

< Previous Page | 191 192 193 194 195 196 197 198 199 200 201 202  | Next Page >