Search Results

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

Page 172/332 | < Previous Page | 168 169 170 171 172 173 174 175 176 177 178 179  | Next Page >

  • Microsoft _stprintf warning

    - by mnh
    Why I get the following warning for the following code :) Code: _stprintf(m_szFileNamePath,_T("%s"),strFileName); warning C4996: '_swprintf': swprintf has been changed to conform with the ISO C standard, adding an extra character count parameter. To use traditional Microsoft swprintf, set _CRT_NON_CONFORMING_SWPRINTFS. I know _strprintf is a macro which if _UNICODE is defined will evaluate to _swprintf else it will be sprintf. Now what is this _swprintf. There is a function swprintf, but why is _stprintf evaluating to _swprintf instead of swprintf. What is the difference b/w the _xxx and xxx functions? EDIT: Okay there are two definitions for the UNICODE version of _stprintf, which one is included? The one in tchar.h or strsafe.h?

    Read the article

  • Using MSpec runner in Visual Studio 2010 and .NET 4

    - by spapaseit
    Hi Everyone, I'm a big fan of MSpec so naturally I wanted to use is right away with VS2010 as well. I have the MSpec runner defined as an external tool in Visual Studio to be able to have it always visible as a toolbar item. Anyway, whenever I try to use the MSpec runner (mspec.exe) with a .NET 4.0 solution I get the following error: Could not load file or assembly 'file:///C:\Users\[SOMEUSER]\[SOME_FOLDERS}\bin\Debug\[PROJECT].Specs.dll' or one of its dependencies. This assembly is built by a runtime newer than the currently loaded runtime and cannot be loaded. I can still run my specs with the Resharper 5 runner so it's no big drama, but I bothers me to no end :þ Do you guys have any idea what the problem could be? Is there any solution other than recompiling the whole Mspec source code as a .NET 4.0 solution, which I really, really don't want to do? Thanks in advance. Sergi

    Read the article

  • Generics and Exposing .Net Types For COM Consumers?

    - by IbrarMumtaz
    I remember seeing a question on my official MS 70-536 exam that talked about a simple class that was designed to be exposed for COM calling clients and etc. of all the members defined in the classes I chose the answer D. The one that used a generic. My question to you guys is this: If you were designing a .net custom type that was to be eventually consumed by a com caller or a com type .... of all the guidelines I have read on this subject. Generics is the one .Net topic I would not include in a class for this purpose I would omit such a data member or use something else? Am I right in thinking this. As soon as I saw this question I knew it was generics but I can't seem to prove it. Surely I did not make this up ... generics is a .net feature right?

    Read the article

  • Nested class with hidden constructor impossible in c#?

    - by luckyluke
    I' ve been doing some programming lately and faced an issue which i found weird in c#. (at least for me) public class Foo { //whatever public class FooSpecificCollection : List<Bar> { //implementation details } public FooSpecificCollection GetFoosStuff() { //return the collection } } I want the consumer of Foo to be able to obtain a reference to FooSpecificCollection, even perform some operations on it. Maybe even set it to some other property of Foo or smth like that, but not To be able to CREATE an instance of this class. (the only class that should be able to instatiate this collection should be Foo. Is my request really that far-fetched? I know that people way smarter defined c# but shouldn't there be such an option that a parent class can create a nested class instance but nobody else can't. So far I created a solution to make an abstract class, or interface available through the property and implement a concrete private class that is not available anywhere else. Is this a correct way to handle such a situation.?

    Read the article

  • List of all index & index columns in SQL Server DB

    - by Anton Gogolev
    How do I get a list of all index & index columns in SQL Server 2005+? The closest I could get is: select s.name, t.name, i.name, c.name from sys.tables t inner join sys.schemas s on t.schema_id = s.schema_id inner join sys.indexes i on i.object_id = t.object_id inner join sys.index_columns ic on ic.object_id = t.object_id inner join sys.columns c on c.object_id = t.object_id and ic.column_id = c.column_id where i.index_id > 0 and i.type in (1, 2) -- clustered & nonclustered only and i.is_primary_key = 0 -- do not include PK indexes and i.is_unique_constraint = 0 -- do not include UQ and i.is_disabled = 0 and i.is_hypothetical = 0 and ic.key_ordinal > 0 order by ic.key_ordinal which is not exactly what I want. What I want is to list all user-defined indexes (which means no indexes which support unique constraints & primary keys) with all columns (ordered by how do they apper in index definition) plus as much metadata as possible.

    Read the article

  • get xml attribute named xlink:href using xsl

    - by awe
    How can I get the value of an attribute called xlink:href of an xml node in xsl template? I have this xml node: <DCPType> <HTTP> <Get> <OnlineResource test="hello" xlink:href="http://localhost/wms/default.aspx" xmlns:xlink="http://www.w3.org/1999/xlink" xlink:type="simple" /> </Get> </HTTP> </DCPType> When I try the following xsl, I get an error saying "Prefix 'xlink' is not defined." : <xsl:value-of select="DCPType/HTTP/Get/OnlineResource/@xlink:href" /> When I try this simple attribute, it works: <xsl:value-of select="DCPType/HTTP/Get/OnlineResource/@test" />

    Read the article

  • Refreshing metadata on user functions t-SQL

    - by luckyluke
    I am doing some T-SQL programming and I have some Views defines on my database. The data model is still changing these days and I have some table functions defined. Sometimes i deliberately use select * from MYVIEW in such a table function to return all columns. If the view changes (or table) the function crashes and I need to recompile it. I know it is in general good thing so that it prevents from hell lotta errors but still... Is there a way to write such functions so the dont' blow up in my face everytime I change something on the underlying table? Or maybe I am doing something completely wrong... Thanks for help

    Read the article

  • Deleting orphans with JPA

    - by homaxto
    I have a one-to-one relation where I use CascadeType.PERSIST. This has over time build up a huge amount of child records that has not been deleted, to such an extend that it is reflected in the performance. Now I wish to add some code that cleans up the database removing all the child records that are not referenced by a parent. At the moment we are talking 400K+ records, at I need to run the code on all customer installations just to be sure they do not run into the same problem. I think the best solution would be to run a named query (because we support two databases) that deletes the necessary records, and this is where I get into problems, because how should I write it in JPQL? The result I want can be defined like the following sql statement, which unfortunaltely does not run on MySQL. DELETE FROM child c1 WHERE c1.pk NOT IN (SELECT DISTINCT p.pk FROM child c2 JOIN parent p ON p.child = c2.pk);

    Read the article

  • Upper Bound in FOR loop does not get altered in loop,Why?

    - by Vineet
    Hi ALL, I am trying to change the value of upper bound in For loop ,but the Loop is running till the upper bound which was defined in the starting. According to logic loop should go infinite, since value of v_num is always one ahead of i,But loop is executing three time.Please explain This is the code DECLARE v_num number:=3; BEGIN FOR i IN 1..v_num LOOP v_num:=v_num+1; DBMS_OUTPUT.PUT_LINE(i ||' '||v_num); END LOOP; END; Ouput Coming 1 4 2 5 3 6

    Read the article

  • How to store an enum inside a DataColum of a DataTable and show localized text in .Net

    - by SoMoS
    Hello, I have to store on one DataColum of one DataTable an Enum containing some values. De enum is defined as follow: Imports System.ComponentModel Imports System.Globalization Public Enum FirmwareUpdateStatus <Description("updateNotExecuted")> UpdateNotExecuted = 0 <Description("updateSuccess")> UpdateSuccess = 1 <Description("updateError")> UpdateError = 2 End Enum I have also a class called Enum2 that has a method called GetDescription that returns the localized text of an enum value. What I want to do is to show this text into the grid that shows the DataTable but storing the enum value, not the string. How can this be done? Thanks in advance"

    Read the article

  • Scheme procedure problem

    - by Zun
    I defined the Scheme procedure to return another procedure with 2 parameters : (define (smooth f) (?(x dx)(/ (+ (f (- x dx)) (f x) (f (+ x dx))) 3.0))) if i run this procedure with sin procedure with 2 arguments 10 and 0.0001 then it is ok ((smooth sin) 10 0.0001) ==> -0.544021109075966 if i run this procedure recursively, then it has error ((smooth (smooth sin)) 10 0.0001) ==> procedure expects 2 arguments, given 1: #<promise:temp6> So can anyone tell me where is my problem? Thank you in advance !!! PS:this is apart of exercise 1.44 in SICP

    Read the article

  • Small Python optional arguments question

    - by ooboo
    I have two functions: def f(a,b,c=g(b)): blabla def g(n): blabla c is an optional argument in function f. If the user does not specify its value, the program should compute g(b) and that would be the value of c. But the code does not compile - it says name 'b' is not defined. How to fix that? Someone suggested: def g(b): blabla def f(a,b,c=None): if c is None: c = g(b) blabla But this doesn't work, because maybe the user intended c to be None and then c will have another value.

    Read the article

  • Haskell Syntax: Parse Error On Input

    - by NuNu
    As part of a mini-haskell compiler that I'm writing, I have a function named app. What I want this function to do is take in these arguments epp (App e1 e2). The first step would be to evaluate e1 recursively (epp e1) and check if the output would be an error. If not then evaluate e2 and then call another function eppVals to evaluate the outputs of the calls on e1 and e2 which I defined as v1 and v2 respectively. epp (App e1 e2) | epp e1 /= Error = eppVals v1 v2 | otherwise = Error where v1 = epp e1 v2 = epp e2 <- parse error on input `=' Logically I believe what I have written so far works but I'm getting a parse error on input = where I stated above. Any idea why? My second try epp :: Exp -> Error Val epp (App e1 e2) = (eppVals v1 v2) where v1 = (epp e1) v2 = (epp e2) But now throws Couldn't match expected type Val with actual type Error Val

    Read the article

  • addObjectsFromArray

    - by derek.lo
    I have a question about memory management when using the addObjectsFromArray method. Basically, I have 2 arrays defined in the appDelegate. I need these 2 arrays for the duration of my application's runtime. I therefore release them in my appDelegate's dealloc method. When I go to use these two arrays in a class, I want one array to store the values from the other, so that the other can have it's contents removed, but still stick around for use. Something like this: [appDelegate.arrayTwo addObjectsFromArray:appDelegate.arrayOne]; [appDelegate.arrayOne removeAllObjects]; I'm getting the compiler error: EXC_BAD_ACCESS because of a pointer issue? retaining issue? Any help would be greatly appreciated! Thanks

    Read the article

  • STL Static-Const Member Definitions

    - by javery
    How does the following work? #include <limits> int main() { const int* const foo = &std::numeric_limits<int> ::digits; } I was under the impression that in order to take an address of a static const-ant member we had to physically define it in some translation unit in order to please the linker. That said, after looking at the preprocessed code for this TU, I couldn't find an external definition for the digits member (or any other relevant members). I tested this on two compilers (VC++ 10 and g++ 4.2.4) and got identical results (i.e., it works). Does the linker auto-magically link against an object file where this stuff is defined, or am I missing something obvious here?

    Read the article

  • Integer variables at WIX

    - by Hila
    I would like to install a feature according to the brand. So in my brand.wxi I defined: <?define brand.FeatureLevel = 1 ?> And in my wxs I wrote: <Feature Id="FF" Title="FF" Level="$(var.brand.FeatureLevel)"> <ComponentRef Id="..." /> <ComponentRef Id="..." /> </Feature> This definition works fine (wheather I've placed 0 or 1 as FeatureLevel). My only problem is a warning I get at compilation time: The 'Level' attribute is invalid - The value '$(var.brand.FeatureLevel)' is invalid according to its datatype 'http://www.w3.org/2001/XMLSchema:integer' - The string '$(var.brand.FeatureLevel)' is not a valid Integer value. Is there a way to fix this warning? Can I define integer variable? I couldn't find a way...

    Read the article

  • Problem with assigning elements of a class array to individual variables in MATLAB

    - by Marc
    This is a bit of a duplicate of this question, this question, and this question, however those solutions don't work, so I'm asking mine. I've got an array of locally defined classes and I'd like to assign it to multiple, individual variables. This pattern doesn't work: %a is 2x1 of MyClass temp = mat2cell(a); [x,y] = temp{:}; %throws: ??? Insufficient number of outputs from right hand side of equal sign to satisfy assignment. Because temp is a single cell, with my 2x1 array in one cell, rather than a 2x1 cell array with one element of each of my original array in one cell. Any ideas?

    Read the article

  • The use of IN OUT in ada..

    - by maddy
    HI all, Given below is a code in ada with TYPE_VECT_B; use TYPE_VECT_B; Package TEST01 is procedure TEST01 ( In_State : IN VECT_B ; Out_State : IN OUT VECT_B ); function TEST02 ( In_State : IN VECT_B ) return Boolean ; end TEST01; The TYPE_VECT_B package specification and body is also defined below Package TYPE_VECT_B is type VECT_B is array (INTEGER range <>) OF BOOLEAN ; rounded_data : float ; count : integer ; trace : integer ; end TYPE_VECT_B; Package BODY TYPE_VECT_B is begin null; end TYPE_VECT_B; What does the variable In_State and Out_State actually mean?I think In_State means input variable.i just get confused to what actually Out_State means? Thanks Maddy

    Read the article

  • Not able to pass multiple override parameters using nose-testconfig 0.6 plugin in nosetests

    - by Jaikit
    Hi, I am able to override multiple config parameters using nose-testconfig plugin only if i pass the overriding parameters on commandline. e.g. nosetests -c nose.cfg -s --tc=jack.env1:asl --tc=server2.env2:abc But when I define the same thing inside nose.cfg, than only the value for last parameter is modified. e.g. tc = server2.env2:abc tc = jack.env1:asl I checked the plugin code. It looks fine to me. I am pasting the part of plugin code below: parser.add_option( "--tc", action="append", dest="overrides", default = [], help="Option:Value specific overrides.") configure: if options.overrides: self.overrides = [] overrides = tolist(options.overrides) for override in overrides: keys, val = override.split(":") if options.exact: config[keys] = val else: ns = ''.join(['["%s"]' % i for i in keys.split(".") ]) # BUG: Breaks if the config value you're overriding is not # defined in the configuration file already. TBD exec('config%s = "%s"' % (ns, val)) Let me know if any one has any clue.

    Read the article

  • Cannot call external javascript function from SITE.MASTER

    - by WOPR
    I have a Site.Master in my ASP.NET project which defines a HEAD section as follows <head runat="server"> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" /> <title id="MasterTitle">MyApp</title> <link rel="icon" href="Content/icon.ico" type="image/x-icon" /> <link href="Content/mycss.css" rel="stylesheet" type="text/css" /> <script src="Content/mycode.js" type="text/javascript"></script> </head> In the mycode.js file, I have a function called GetSels(); function GetSels() { //do stuff } If the GetSels function is defined in Site.Master, GetSels is callable. If it's in mycode.js, it's not. Every code example I've see seems to says this should work. What am I doing wrong?

    Read the article

  • How to make scipy.interpolate give a an extrapolated result beyond the input range?

    - by Salim Fadhley
    I'm trying to port a program which uses a hand-rolled interpolator (developed by a mathematitian colleage) over to use the interpolators provided by scipy. I'd like to use or wrap the scipy interpolator so that it has as close as possible behavior to the old interpolator. A key difference between the two functions is that in our original interpolator - if the input value is above or below the input range, our original interpolator will extrapolate the result. If you try this with the scipy interpolator it raises a ValueError. Consider this program as an example: import numpy as np from scipy import interpolate x = np.arange(0,10) y = np.exp(-x/3.0) f = interpolate.interp1d(x, y) print f(9) print f(11) # Causes ValueError, because it's greater than max(x) Is there a sensible way to make it so that instead of crashing, the final line will simply do a linear extrapolate, continuing the gradients defined by the first and last two pouints to infinity. Note, that in the real software I'm not actually using the exp function - that's here for illustration only!

    Read the article

  • How can I tell NetBeans to use the latest available version of a JAR for a library?

    - by Freiheit
    I have a Netbeans project with a library defined which includes several JARs. These JARs are versioned like lib\blah\com.blah.wibble.jar_0.6.1.201004161543 . These are nightly builds from another project so that version changes often. I know I can point NetBeans at the specific JARs with the version name, but this means that every time I get a new version I have to update the NetBeans library. I can also strip the version name from the JARs, but this makes it hard to track down bugs. "What version of the blah JARs?" is usually the second thing we ask when we find a bug. Is it possible to tell Netbeans to use included com.blah.wibble.jar_[??????] where ???? is some sort of automatic pointer to use the latest available version?

    Read the article

  • Help with these warnings. [inheritance].

    - by sil3nt
    Hello there. I have a set of code, which mimics a basic library cataloging system. There is a base class named items, in which the the general id,title and year variables are defined and 3 other derived classes (DVD,Book and CD). Base [Items] Derived [DVD,Book,CD]. The programs runs, however I get the following warnings, I'm not sure how to fix these. "C:\Program Files\gcc\bin/g++" -Os -mconsole -g -Wall -Wshadow -fno-common mainA4.cpp -o mainA4.exe In file included from mainA4.cpp:5: a4.h: In constructor `DVD::DVD(int, std::string, int, std::string)': a4.h:28: warning: `DVD::director' will be initialized after a4.h:32: warning: base `Items' a4.h:32: warning: when initialized here a4.h: In constructor `Book::Book(int, std::string, int, std::string, int)': a4.h:48: warning: `Book::numPages' will be initialized after a4.h:52: warning: base `Items' a4.h:52: warning: when initialized here a4.h: In constructor `CD::CD(int, std::string, int, std::string, int)': a4.h:66: warning: `CD::numSongs' will be initialized after a4.h:70: warning: base `Items' a4.h:70: warning: when initialized here Exit code: 0

    Read the article

  • car and cdr in scheme is driving me crazy ...

    - by kristian Roger
    Hi Im facing a probem with the car and cdr functions for example: first I defined a list caled it x (define x (a (bc) d ( (ef) g ) )) so x now is equal to (a (bc) d ( (ef) g ) now for example I need to get the g from this list using only car and cdr (!! noshortcuts as caddr cddr !!) the correct answer is: (car(cdr(car(cdr(cdr(cdr x)))))) BUT how ? :-( I work according to the rule (the car gives the head of list and cdr gives the tail) and instead of getting the answer above I keep reaching wronge answers can any one help me in understanding this ... give me step or a way to solve it step by step thanx in advance Im really sick of scheme language.

    Read the article

  • NSDate & Memory management

    - by iFloh
    Hi, memory management still gives me grief. This time it is an NSDate iVar that I init using NSDate *myNSDate = [[NSDate date] firstDayOfMonth]; with a method call to - (NSDate *)firstDayOfMonth { NSDateComponents *tmpDateComponents = [[NSCalendar currentCalendar] components:NSYearCalendarUnit | NSMonthCalendarUnit | NSEraCalendarUnit | NSWeekCalendarUnit | NSWeekdayOrdinalCalendarUnit fromDate:self]; [tmpDateComponents setDay:1]; [tmpDateComponents setHour:0]; [tmpDateComponents setMinute:0]; [tmpDateComponents setSecond:0]; return [[NSCalendar currentCalendar] dateFromComponents:tmpDateComponents]; } At the end of the init call the retain count is at 1 (Note the iVar is not defined as a property). When I step into the viewWillAppear method the myNSDate has vanished. I tried to do an explicit retain on it, but that only lasts until I update the iVar using the above method again. I though - ok - I add the retain to the return of the function, but that makes the leak analyser throw up an error. What am I doing wrong?

    Read the article

< Previous Page | 168 169 170 171 172 173 174 175 176 177 178 179  | Next Page >