Search Results

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

Page 207/332 | < Previous Page | 203 204 205 206 207 208 209 210 211 212 213 214  | Next Page >

  • Quickest way to compute the number of shared elements between two vectors

    - by shn
    Suppose I have two vectors of the same size vector< pair<float, NodeDataID> > v1, v2; I want to compute how many elements from both v1 and v2 have the same NodeDataID. For example if v1 = {<3.7, 22>, <2.22, 64>, <1.9, 29>, <0.8, 7>}, and v2 = {<1.66, 7>, <0.03, 9>, <5.65, 64>, <4.9, 11>}, then I want to return 2 because there are two elements from v1 and v2 that share the same NodeDataIDs: 7 and 64. What is the quickest way to do that in C++ ? Just for information, note that the type NodeDataIDs is defined as I use boost as: typedef adjacency_list<setS, setS, undirectedS, NodeData, EdgeData> myGraph; typedef myGraph::vertex_descriptor NodeDataID; But it is not important since we can compare two NodeDataID using the operator == (that is, possible to do v1[i].second == v2[j].second)

    Read the article

  • Accessing an Internal Function in setInterval

    - by Phonethics
    (function($) { $.fn.myPlugin = function(options) { var _this; var timer1; var foo = function(n) { if (timer1 != null) return; // in action timer1 = setInterval("bar("+n+")", 500); }; var bar = function(n) { ... if ( ... ) clearInterval(timer1); }; return this.each(function() { _this = $(this); _this.bind("click", function(){ foo(10); }); }); } })(jQuery); This doesn't work because "bar is not defined."

    Read the article

  • Rails 3 - Ideal way to set title of pages

    - by akfalcon
    Whats the proper way to set the page title in rails 3. Currently I'm doing the following: app/views/layouts/application.html .... <%= render_title % <%= csrf_meta_tag % .... app/helpers/application_helper.rb ... def render_title return @title if defined?(@title) "Generic Page Title" end ... app/controllers/some_controller.rb ... def show @title = "some custom page title" ... end ... Is there another/better way of doing the above?

    Read the article

  • Easiest way to keep SSRS child elements in the same relative position when the parent is re-positioned?

    - by Mac
    I am trying to revise the layout of an SSRS report where I have several textboxes that are child elements of a rectangle. When I reposition the parent rectangle down by x, all of the child textboxes maintain the same absolute position. Their "Location" (defined relative to the parent) decreases by x. I then need to reposition the child textboxes. Additionally, if any of these ever has a negative "Location" then the parent rectangle is then repositioned back up by x. What is the easiest way to move everything in unison? I can Control-click everything and then drag them or use the arrow keys, but I want to position everything with precision and the "Location" field in the Properties window disappears when selecting more than one item. Is there a way I can avoid individually computing and typing in every "Location" value every time I have a small layout change? I am using SSRS (11.0.3360.12) within the Visual Studio 2012 Shell. Thanks!

    Read the article

  • Java Scanner - next String until a | is found

    - by user1375883
    Currently I'm trying to read through some basic cells, in this format: +-------+-------+ | | | +-------+-------+ Now I need to get the string representation of the cell's contents and send it off to another method. The problem is that the cells have no pre-defined length. I'm reading these from a file, so my easiest option should be to just use the Scanner I already have set up. Problem is, I don't really know how for this case. I have a strong feeling that I need to use the pattern somehow, but I'm at a complete loss on how to do it. I could also probably just build it up somehow, but that strikes me as being painfully slow.

    Read the article

  • class T in c++ (your definition)

    - by JohnWong
    The one advantage of using class T in c++ is to reduce the time to redefine data types in a function, if those data types are defined in other function, for example, in int main. template <class T> void showabs(T number) { if (number < 0 ) number = -number; cout << number << endl; return 0; } int main() { int num1 = -4; float num2 = -4.23f; showabs(num1); showabs(num2); return 0; } So in this case, without class T, for each data type, we have to add its corresponding data-type condition, that is, another set of if statement for int, and another one for float. Am I correct?

    Read the article

  • SqlCE Flush Interval - Will the default setting lead to corruption?

    - by NormD
    SqlCE has a parameter set on the Connect String called Flush Interval. It is defined as: The interval time (in seconds) before all committed transactions are flushed to disk. If not specified, the default value is 10. I thought that a committed transaction, by definition, is a transaction that has been flushed to disk, specifically the database file. If a transaction is only stored in RAM then cannot the transaction be easily lost? I thought that transactions were first written to a log file and then applied to the database file itself, so perhaps this parameter could mean the time to wait until the transaction log is applied to the database file? I would have thought that this parameter should be 0.

    Read the article

  • How to trigger notification code TBN_TOOLBARCHANGE from inside c++ program?

    - by karikari
    Hi. How to trigger TBN_TOOLBARCHANGE from inside my c++ code? Is it the same as writing like this line below? SendMessage(m_hWndToolbar, TB_SETBUTTONINFO, m_buttonID, (LPARAM)(&inf)); Inside this project's code there is this line inside one the header file: BEGIN_MSG_MAP(CRebarHandler) NOTIFY_CODE_HANDLER(TBN_DROPDOWN, onNotifyDropDown) NOTIFY_CODE_HANDLER(TBN_TOOLBARCHANGE, onNotifyToolbarChange) NOTIFY_CODE_HANDLER(NM_CUSTOMDRAW, onNotifyCustomDraw) NOTIFY_CODE_HANDLER(TBN_ENDADJUST, onNotifyEndAdjust) MESSAGE_HANDLER(WM_SETREDRAW, onSetRedraw) END_MSG_MAP() It has already defined that for each TBN_TOOLBARCHANGE call, it will trigger the function onNotifyToolbarChange. For this example, it is triggered by IE. Inside my code, I need to trigger that particular function. And before that I need to trigger the TBN_TOOLBARCHANGE`. I just want to know how can it be done inside code, for example under a conditional statement.

    Read the article

  • discrepancy in google analytics pageview totals when tracking subdomains

    - by frabjousB
    We are using the old urchin.js and are tracking 2 subdomains under the same profile. We have a “track subdomains” advanced filter defined (as per http://www.google.com/support/googleanalytics/bin/answer.py?hl=en&answer=55524) as well as 2 segments for presenting data in the reports: hostname matches exactly subdomain1.domain-name.com and hostname matches exactly subdomain2.domain-name.com When I apply these segments to our Top Content Overview report, the All Visits total for PageViews does not correspond to the # of visits reported for each subdomain. For example: All Visits = 53 subdomain1 = 24 subdomain2 = 32 Is there any reason as to why we would be seeing this discrepancy in numbers?

    Read the article

  • Standardize word macro usage within the team

    - by user138010
    Hi, I have a team of 10 persons who work on word documents, they format them as per our defined guidlines. To complete the work fast we have created a macro that has been updated on all the machines. This macro corrects the font, size and formatting. How can I ensure and implement that nobody can change/replace or delete this macro from their system? In case this happens I should get an alert. Can something be done at the system or programme level? Thanks, PK

    Read the article

  • How to convert char to LPCTSTR (MFC)?

    - by Shark
    Is there any way to do this? This is what I am trying to do: char s[] = { 'a', 'b' }; label.SetWindowTextW(s[1]); label is CStatic typed, _UNICODE is defined. Any help would be appreciated. UPD: Tried to use CString(s[1]), it works for ASCII characters but others won't work. E. g. for the ? it returns |.

    Read the article

  • class member access specifiers

    - by pdehaan
    I understand what the typical access specifiers are, and what they mean. 'public' members are accessible anywhere, 'private' members are accessible only by the same class and friends, etc. What I'm wondering is what, if anything, this equates to in lower-level terms. Are their any post-compilation functional differences between these beyond the high-level restrictions (what can access what) imposed by the language (c++ in this case) they're used in. Another way to put it - if this were a perfect world where programmers always made good choices (like not accessing members that may change later and using only well defined members that should stay the same between implementations), would their be any reason to use these things?

    Read the article

  • Is it good to create a usercontrol for Recursive code in xaml?

    - by user281947
    <Border BorderBrush="#C4C8CC" BorderThickness="0,0,0,1"> <TextBlock x:Name="SectionTitle" FontFamily="Trebuchet MS" FontSize="14" FontWeight="Bold" Foreground="#3D3D3D" /> </Border> I have to use the same above format at many places in a single xaml page, so for this i created a usercontrol and defined the above code inside it. So my question is, What i am doing is it right approach? Will it make the page to load slower then the above code used as it is without defining it in a new user control?

    Read the article

  • what's the javascript "var _gaq = _gaq || []; " for ?

    - by parvas
    The Async Tracking in google analytics looks like this: var _gaq = _gaq || []; _gaq.push(['_setAccount', 'UA-XXXXX-X']); _gaq.push(['_trackPageview']); (function() { var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true; ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js'; var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s); })(); About The first line var _gaq = _gaq || []; I think it ensures that if _gaq is already defined we should use it otherwise we should an array. Can anybody explain what this is for ? Also, does it matter if _gaq gets renamed ? in other words does google analytics rely on a global object named _gaq ? Thanks Parvas

    Read the article

  • Sort an object by an other one.

    - by kevinb92
    Here's the deal : I have Publication objets in my application. I also have Vote objet. I can add votes on publication. A vote is defined like this, forOrAgainst, LinkedPublication, date, author etc etc... I want to sort Publication list by number of vote. What is the best way to link them ? Should i return a hashmap ? a treeset ? How do i add votes to publication. It's kinda messy in my brain now...

    Read the article

  • Generating data on unlevel background

    - by bluejay93
    I want to make an unlevel background and then generate some test data on that using Matlab. I was not clear when I asked this question earlier. So for this simple example for i = 1:10 for j = 1:10 f(i,j)=X.^2 + Y.^2 end end where X and Y have been already defined, it plots it on a flat surface. I don't want to distort the function itself, but I want the surface that it goes onto to be unlevel, changed by some degree or something. I hope that's a little clearer.

    Read the article

  • Makefile: couple syntax questions

    - by Michael
    package_version := $(version)x0d$(date) what is the x0d part between version and date vars? is it just string? What $(dotin_files:.in=) does below code dotin_files := $(shell find . -type f -name \*.in) dotin_files := $(dotin_files:.in=) what this means $(dotin_files:=.in) code $(dotin_files): $(dotin_files:=.in) $(substitute) [email protected] > $@ can target contain multiple files? what is the meaning of declaring target variable as PHONY? code .PHONY: $(dotin_files) In the regex replacement code below code substitute := perl -p -e 's/@([^@]+)@/defined $$ENV{$$1} ? $$ENV{$$1} : $$&/ge' what are $$ENV{$$1} and $$&? I guess it's Perl scope... thanks for your time

    Read the article

  • How to identify each parameter type in a C# method?

    - by user465876
    I have a C# method say: MyMethod(int num, string name, Color color, MyComplexType complex) Using reflection, how can I distinctly identify each of the parameter types of any method? I want to perform some task by parameter type. If the type is simple int, string or boolean then I do something, if it is Color, XMLDocument, etc I do something else and if it is user defined type like MyComplexType or MyCalci etc then I want to do certain task. I am able to retrieve all the parameters of a method using ParameterInfo and can loop through each parameter and get their types. But how can I identify each data type? foreach (var parameter in parameters) { //identify primitive types?? //identify value types //identify reference types } Edit: this is apart of my code to create a propert grid sort of page where I want to show the parameter list with data types for the selected method. If the parameter has any userdefined type/reference type then I want to expand it further to show all the elements under it with datatypes.

    Read the article

  • <hash_set> equality operator doesn't work in VS2010

    - by ProgramWriter
    Sample code: std::hash_set<int> hs1; // also i try std::unorded_set<int> - same effect std::hash_set<int> hs2; hs1.insert(15); hs1.insert(20); hs2.insert(20); hs2.insert(15); assert(hs1 == hs2); hash_set doesn't stores elements in some order defined by hash function... why? Please note that this code works in VS2008 using stdext::hash_set.

    Read the article

  • Where is the best place to store globals in Rails app?

    - by Nick Gorbikoff
    Hello. I was wondering if there is the best practice on where to store global settings in a rails app. What I mean by that is i.e: I have a few globals defined that may change, but not likely and it seems inappropriate to store them in DB since they are used so much. For instance I have SYSTEM_EMAIL & SYSTEM_EMAIL_SIGNATURE & SYSTEM_STORAGE_ROOT. Right now I keep them in environment.rb, but I'm not sure if this is the right palce to store them. Thank you

    Read the article

  • Team activity/game for illustrating design in a SCRUM environment

    - by njreed.myopenid.com
    I'm looking for a team building / training activity for some of my scrum teams. I want something that really illustrates the flexibility that the team has when implementing stories to define the scope and complexity of the feature themselves. Most of the teams have long-term waterfall experience and are used to having a well-defined specification. I'm looking for something that illustrates the need for the team to vary the scope of what they are building themselves, dependent on the time and resources available. I couldn't find anything at tastycupcakes.com and Google wasn't much help. Maybe someone has prepared something themselves they would care to share?

    Read the article

  • Is it good to create a usercontrol for Recurrsive code in xaml?

    - by user281947
    <Border BorderBrush="#C4C8CC" BorderThickness="0,0,0,1"> <TextBlock x:Name="SectionTitle" FontFamily="Trebuchet MS" FontSize="14" FontWeight="Bold" Foreground="#3D3D3D" /> </Border> I have to use the same above format at many places in a single xaml page, so for this i created a usercontrol and defined the above code inside it. So my question is, what i am doing is it right approach ? Will it make the page to load slower then the above code used as it is without defining it in a new user control?

    Read the article

  • including a std::map within a struct? Is it ok?

    - by user553514
    class X_class{ public: struct extra {int extra1; int extra2; int extra3; }; enum a { n,m}; struct x_struct{ char b; char c; int d; int e; std::map <int, extra> myExtraMap; }; }; in my code I define : x_struct myStruct; why do I get compile errors compiling the above class? The error either says: 1) expected ; before < on the line --- where I defined the map (above) if I eliminate std:: or 2) error: invalid use of ::; error: expected ; before < token

    Read the article

  • Javascript: Inherit method from base class and return the subclass's private variable

    - by marisbest2
    I have the following BaseClass defined: function BaseClass (arg1,arg2,arg3) { //constructor code here then - var privateVar = 7500; this.getPrivateVar = function() { return privateVar; }; } I want to have the following subclass which allows changing privateVar like so: function SubClass (arg1,arg2,arg3,privateVar) { //constructor code here then - var privateVar = privateVar; } SubClass.prototype = new BaseClass(); Now I want SubClass to inherit the getPrivateVar method. However, when I try this, it always returns 7500 which is the value in the BaseClass and not the value of privateVar. In other words, is it possible to inherit a BaseClass's public methods but have any references in them refer to the SubClass's properties? And how would I do that?

    Read the article

  • How to perform .select() on jQuery masked text input

    - by dllhell
    I'm using http://digitalbush.com/projects/masked-input-plugin/ plugin. There is an input text with defined mask: <input type="text" id="txtMyInput" class="FocusSense"/> and a script: $(document).ready(function () { jQuery(function ($) { $("#txtMyInput").mask("?9.99"); }); $(".FocusSense").focus(function () { this.select(); }); }) As you can see, I would like select all in txtMyInput on focus but but alas! On focus, mask appears and loose .select(). What should I do to preserve mask and .select()?

    Read the article

< Previous Page | 203 204 205 206 207 208 209 210 211 212 213 214  | Next Page >