Search Results

Search found 10698 results on 428 pages for 'inline functions'.

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

  • Macro vs. Static functions in Header

    - by wirrbel
    for a lot of quick tasks where one could employ a function f(x,y), in plain C, macros are used. I would like to ask specifically about these cases, that are solvable by a function call (i.e. macros used for inlining functions, not for code expansion of arbitrary code). Typically C functions are not inlined since they might be linked to from other C files. However, static C functions are only visible from within the C file they are defined in. Therefore they can be inlined by compilers. I have heard that a lot of macros should be replaced by turning them into static functions, because this produces safer code. Are there cases where this is a not good idea? Again: Not asking about Code-Production macros with ## alike constructs that cannot at all be expressed as a function.

    Read the article

  • Stairway to MDX - Level 10: “Relative” Member Functions: .CurrentMember, .PrevMember, and .NextMember

    SSAS Maestro, SQL Server MVP and Business Intelligence Architect Bill Pearson introduces three “major players” within the MDX “relative” functions. These basic, but highly employed, functions include the .CurrentMember, .PrevMember and .NextMember functions. Check SQL Server performance at a glanceWe consulted 1000 SQL Server professionals to make SQL Monitor’s UI as clear as possible. Start monitoring with a free trial.

    Read the article

  • HTML5 / CSS3 display:inline

    - by danixd
    I am looking to make a horizontal layout website but having issues with the display: inline rule acting strangely. It seems to be tailored towards inline navigational s, which is nice, but it is causing me massive problems. Here is my code: <div id="container"> About Us Project 1 Project 2 Project 3 Project 4 Project 5 Blog 1 Blog 2 Blog 3 Blog 4 Blog 5 Contact Tweets Comments Links </div> <!--container--> #container{ height: 600px; display: inline; } section{ display: inline; } article{ height: 600px; width: 300px; display: inline; } This is what it looks like: http://danixd.com/archive/html5.html The display:inline completely overwrites the height and width set for the articles in the CSS. Any ideas?

    Read the article

  • Telerik RadEditor for MOSS - How do I suppress min-width inline CSS?

    - by James
    I'm having an issue with the RadEditor for MOSS, I'm really baffled as to the source of this issue. I tried using Firebug to find where any min-* CSS settings are happening and search came up empty, but I know it's happening because the downloaded page markup does not have that inline CSS. I believe that one of the Telerik control emitted Javascripts is what is adding inline CSS style to the top level div of the editor, namely min-height, min-width. This is causing layout issues on my page. My question is why is it doing this, and more importantly how do I prevent this from happening? <div style="height: 300px; width: 100%; min-height: 300px; min-width: 1133px;" class="RadEditor Default reWrapper ms-input"> Related thread

    Read the article

  • Passing an array of data to a private function in CodeIgniter/PHP? [facepalm]

    - by Jack Webb-Heller
    So I thought this should be easy, but, I'm n00bing out here and failing epicly (as they say on teh interwebz). So here's my code: function xy() { $array['var1'] = x; $array['var2'] = y; echo $this->_z; } function _z($array) { $xy = $x.$y; return $xy; } So, why doesn't that seemingly simple code work? I know with views you can pass arrays and the variables are accessible in the views with just their array title, but, why doesn't it work in this case? Jack

    Read the article

  • How to inline a function for only release build.

    - by Benjamin
    // common.h // This is foo funtion. It has a body. __inline void foo() { /* something */ } // a.cpp #include "common.h" // for foo function // Call foo // b.cpp #include "common.h" // for foo function // Call foo I would like to inline the foo function only when I build for release. -I dont want to inline functions for Debug build. I tried it but linker errors annoyed me. In this case, foo function's body is defined in common.h header file. so if I just do //common.h #if !defined(_DEBUG) __inline #endif void foo() { /* something */ } I will be met a link error in DEBUG build. Because two modules try to include common.h. I have no idea to solve it. Is it possible?

    Read the article

  • Microsoft SQL Server 2005 Function, passing list of start and end times

    - by Kevin
    I'd like to do had a dynamic number of one start/end time pairs passed to a function as an input parameter. The function would then use the list instead of just one start, and one end time in a select statement. CREATE FUNCTION [dbo].[GetData] ( @StartTime datetime, @EndTime datetime ) RETURNS int AS BEGIN SELECT @EndTime = CASE WHEN @EndTime > CURRENT_TIMESTAMP THEN CURRENT_TIMESTAMP ELSE @EndTime END DECLARE @TempStates TABLE (StartTime datetime NOT NULL , EndTime datetime NOT NULL , StateIdentity int NOT NULL ) INSERT INTO @TempStates SELECT StartTime , EndTime , StateIdentity FROM State WHERE StartTime <= @EndTime AND EndTime >= @StartTime RETURN 0 END

    Read the article

  • SQL SERVER – New SQL Server 2012 Functions – Webinar by Rick Morelan

    - by Pinal Dave
    My friend Rick Morelan is a wonderful speaker and listening to him is very delightful. Rick is one of the speakers who can articulate a very complex subject in very simple words. Rick has attained over 30 Microsoft certifications in applications, networking, databases and .NET development, including MCDBA, MCTS, MCITP, MCAD, MOE, MCSE and MCSE+. Here is the chance for every one who has not listened Rick Morelan before as he is presenting an online webinar on New SQL Server 2012 Functions. Whether or not you’re a database developer or administrator, you love the power of SQL functions. The functions in SQL Server give you the power to accelerate your applications and database performance. Each version of SQL Server adds new functionality, so come and see Rick Morelan explain what’s new in SQL Server 2012! This webinar will focus on the new string, time and logical functions added to SQL Server 2012. Register for the webinar now to learn: SQL Server 2012 function basics String, time and logical function details Tools to accelerate the SQL coding process Tuesday June 11, 2013  7:00 AM PDT / 10:00 AM EDT 11:00 AM PDT / 2:00 PM EDT Secret Hint: Here is something I would like to tell everyone that there is a quiz coming up on SQLAuthority.com and those who will attend the webinar will find it very easy to resolve it. Register for webinar Reference: Pinal Dave (http://blog.sqlauthority.com) Filed under: Joes 2 Pros, PostADay, SQL, SQL Authority, SQL Query, SQL Server, SQL Tips and Tricks, T SQL, Technology

    Read the article

  • Using Groovy Aggregate Functions in ADF BC

    - by Sireesha Pinninti
    This article explains how groovy aggregate functions(sum, count, min, max and avg) can be used in ADF Business components and demonstrates how these can be used at entity and view level Let's consider EMP and DEPT tables and an usecase to track number of employees in each department   Entity-Level To use aggregate functions at entity level, we need to have association between entities representing master and child relationship and the destination accessor name is what we are going to use in our groovy Syntax: <Accessor>.count(Groovyexpression) - Note down the destination accessor name(EMP) in the association or AccessorAttribute name in source entity - Add a transient attribute in source entity with persistent property set to false and provide the groovy expression in the syntax provided above - Finally, Add newly added attribute to view object View-Level To use aggregate functions at view level, we need to have a view link between viewobjects representing master and child relationship and the destination accessor name is what we are going to use in our groovy Syntax: <ViewLinkAccessor>.count(Groovyexpression) - Note down the destination accessor name(EmpView) in the view link or viewLinkAccessor name in source view - Add a transient attribute in view object and provide a groovy aggregate function count as a value to it in the syntax provided above Now, If you run application module tester and execute DeptView / ViewLink, you should see employee count in EmpCount field  In similar way, one can use other groovy aggregate functions sum, avg, min and max.

    Read the article

  • Help with design structure choice: Using classes or library of functions

    - by roverred
    So I have GUI Class that will call another class called ImageProcessor that contains a bunch functions that will perform image processing algorithms like edgeDetection, gaussianblur, contourfinding, contour map generations, etc. The GUI passes an image to ImageProcessor, which performs one of those algorithm on it and it returns the image back to the GUI to display. So essentially ImageProcessor is a library of independent image processing functions right now. It is called in the GUI like so Image image = ImageProcessor.EdgeDetection(oldImage); Some of the algorithms procedures require many functions, and some can be done in a single function or even one line. All these functions for the algorithms jam packed into ImageProcessor can be pretty messy, and ImageProcessor doesn't sound it should be a library. So I was thinking about making every algorithm be a class with a shared interface say IAlgorithm. Then I pass the IAlgorithm interface from the GUI to the ImageProcessor. public interface IAlgorithm{ public Image Process(); } public class ImageProcessor{ public Image Process(IAlgorithm TheAlgorithm){ return IAlgorithm.Process(); } } Calling in the GUI like so Image image = ImageProcessor.Process(new EdgeDetection(oldImage)); I think it makes sense in an object point of view, but the problem is I'll end up with some classes that are just one function. What do you think is a better design, or are they both crap and you have a much better idea? Thanks!

    Read the article

  • T-SQL User-Defined Functions: the good, the bad, and the ugly (part 1)

    - by Hugo Kornelis
    So you thought that encapsulating code in user-defined functions for easy reuse is a good idea? Think again! SQL Server supports three types of user-defined functions. Only one of them qualifies as good. The other two – well, the title says it all, doesn’t it? The bad: scalar functions A scalar user-defined function (UDF) is very much like a stored procedure, except that it always returns a single value of a predefined data type – and because of that property, it isn’t invoked with an EXECUTE statement,...(read more)

    Read the article

  • T-SQL User-Defined Functions: the good, the bad, and the ugly (part 1)

    - by Hugo Kornelis
    So you thought that encapsulating code in user-defined functions for easy reuse is a good idea? Think again! SQL Server supports three types of user-defined functions. Only one of them qualifies as good. The other two – well, the title says it all, doesn’t it? The bad: scalar functions A scalar user-defined function (UDF) is very much like a stored procedure, except that it always returns a single value of a predefined data type – and because of that property, it isn’t invoked with an EXECUTE statement,...(read more)

    Read the article

  • Recordings Available - Features and Functions Accounting Module

    - by MHundal
    Recordings are available to provide a high-level overview of the ETPM Accounting Module.  The Accounting Module includes Financial Transactions, Adjustments, P&I, Waivers, Overpayments, General Ledger Details, etc... The following three recordings contain a presentation with the primary concepts to be covered and then a walk-thru of the application to look at the concepts being described. ETPM Functions & Features: Accounting Overview:  https://oracletalk.webex.com/oracletalk/ldr.php?AT=pb&SP=MC&rID=67367292&rKey=443823012d0fc43e ETPM Functions & Features: Accounting - P&I, Waivers:  https://oracletalk.webex.com/oracletalk/ldr.php?AT=pb&SP=MC&rID=67432777&rKey=64eb220a56d8e32f  ETPM Functions & Features - Accounting - Rates:  https://oracletalk.webex.com/oracletalk/ldr.php?AT=pb&SP=MC&rID=67370637&rKey=63ca9024ce3b4398

    Read the article

  • C++11 support for higher-order list functions

    - by Giorgio
    Most functional programming languages (e.g. Common Lisp, Scheme / Racket, Clojure, Haskell, Scala, Ocaml, SML) support some common higher-order functions on lists, such as map, filter, takeWhile, dropWhile, foldl, foldr (see e.g. Common Lisp, Scheme / Racket, Clojure side-by-side reference sheet, the Haskell, Scala, OCaml, and the SML documentation.) Does C++11 have equivalent standard methods or functions on lists? For example, consider the following Haskell snippet: let xs = [1, 2, 3, 4, 5] let ys = map (\x -> x * x) xs How can I express the second expression in modern standard C++? std::list<int> xs = ... // Initialize the list in some way. std::list<int> ys = ??? // How to translate the Haskell expression? What about the other higher-order functions mentioned above? Can they be directly expressed in C++?

    Read the article

  • C++ linkage error . What am I doing wrong ? [migrated]

    - by nashmaniac
    So, this is the first time I actually separated a single program into a header and two .cpp files . But I think I am getting an linkage error . Heres how the directory looks . (heres a link to my image I dont have enough rep to post image in the question) http://i.stack.imgur.com/sbT4V.png The main.cpp is my main source file where all the calling functions and other important stuff goes . In functions.cpp I have all my functions , in the coordin.h file I have the function prototypes and structures and Constants . Everything is ok no typo nothing I have checked everything . But I am getting an undefined reference to function error. I have included the coordin.h file too . Do you think the functions.cpp file needs to go somewhere else I mean is the compiler not looking inside that file ? Thanks !

    Read the article

  • MVC Coding Style Best practices

    - by user1378680
    I'm trying to learn how to code in MVC ... Normally what i do most times is that I write all the codes first, then break out the functions.. Have the functions into a seperate file and include it at the top of the page when I need it. 1) This method seem to work for me, although that means i require more time to make out the functions. Is this normal for learners.? 2) When I'm doing MVC : Model - contains all the functions and it's included in the view View - This has to do with the display of the whole app What is the use of Controller? Thanks for you time and patience. I most appreciate it. My language prefrence is PHP with MySQL

    Read the article

  • Testing Django Inline ModelForms: How to arrange POST data?

    - by unclaimedbaggage
    Hi folks, I have a Django 'add business' view which adds a new business with an inline 'business_contact' form. The form works fine, but I'm wondering how to write up the unit test - specifically, the 'postdata' to send to self.client.post(settings.BUSINESS_ADD_URL, postdata) I've inspected the fields in my browser and tried adding post data with corresponding names, but I still get a 'ManagementForm data is missing or has been tampered with' error when run. Anyone know of any resources for figuring out how to post inline data? Relevant models, views & forms below if it helps. Lotsa thanks. MODEL: class Contact(models.Model): """ Contact details for the representatives of each business """ first_name = models.CharField(max_length=200) surname = models.CharField(max_length=200) business = models.ForeignKey('Business') slug = models.SlugField(max_length=150, unique=True, help_text=settings.SLUG_HELPER_TEXT) created = models.DateTimeField(auto_now_add=True) updated = models.DateTimeField(auto_now=True) phone = models.CharField(max_length=100, null=True, blank=True) mobile_phone = models.CharField(max_length=100, null=True, blank=True) email = models.EmailField(null=True) deleted = models.BooleanField(default=False) class Meta: db_table='business_contact' def __unicode__(self): return '%s %s' % (self.first_name, self.surname) @models.permalink def get_absolute_url(self): return('business_contact', (), {'contact_slug': self.slug }) class Business(models.Model): """ The business clients who you are selling products/services to """ business = models.CharField(max_length=255, unique=True) slug = models.SlugField(max_length=100, unique=True, help_text=settings.SLUG_HELPER_TEXT) description = models.TextField(null=True, blank=True) primary_contact = models.ForeignKey('Contact', null=True, blank=True, related_name='primary_contact') business_type = models.ForeignKey('BusinessType') deleted = models.BooleanField(default=False) created = models.DateTimeField(auto_now_add=True) updated = models.DateTimeField(auto_now=True) address_1 = models.CharField(max_length=255, null=True, blank=True) address_2 = models.CharField(max_length=255, null=True, blank=True) suburb = models.CharField(max_length=255, null=True, blank=True) city = models.CharField(max_length=255, null=True, blank=True) state = models.CharField(max_length=255, null=True, blank=True) country = models.CharField(max_length=255, null=True, blank=True) phone = models.CharField(max_length=40, null=True, blank=True) website = models.URLField(null=True, blank=True) class Meta: db_table = 'business' def __unicode__(self): return self.business def get_absolute_url(self): return '%s%s/' % (settings.BUSINESS_URL, self.slug) VIEWS: class Contact(models.Model): """ Contact details for the representatives of each business """ first_name = models.CharField(max_length=200) surname = models.CharField(max_length=200) business = models.ForeignKey('Business') slug = models.SlugField(max_length=150, unique=True, help_text=settings.SLUG_HELPER_TEXT) created = models.DateTimeField(auto_now_add=True) updated = models.DateTimeField(auto_now=True) phone = models.CharField(max_length=100, null=True, blank=True) mobile_phone = models.CharField(max_length=100, null=True, blank=True) email = models.EmailField(null=True) deleted = models.BooleanField(default=False) class Meta: db_table='business_contact' def __unicode__(self): return '%s %s' % (self.first_name, self.surname) @models.permalink def get_absolute_url(self): return('business_contact', (), {'contact_slug': self.slug }) class Business(models.Model): """ The business clients who you are selling products/services to """ business = models.CharField(max_length=255, unique=True) slug = models.SlugField(max_length=100, unique=True, help_text=settings.SLUG_HELPER_TEXT) description = models.TextField(null=True, blank=True) primary_contact = models.ForeignKey('Contact', null=True, blank=True, related_name='primary_contact') business_type = models.ForeignKey('BusinessType') deleted = models.BooleanField(default=False) created = models.DateTimeField(auto_now_add=True) updated = models.DateTimeField(auto_now=True) address_1 = models.CharField(max_length=255, null=True, blank=True) address_2 = models.CharField(max_length=255, null=True, blank=True) suburb = models.CharField(max_length=255, null=True, blank=True) city = models.CharField(max_length=255, null=True, blank=True) state = models.CharField(max_length=255, null=True, blank=True) country = models.CharField(max_length=255, null=True, blank=True) phone = models.CharField(max_length=40, null=True, blank=True) website = models.URLField(null=True, blank=True) class Meta: db_table = 'business' def __unicode__(self): return self.business def get_absolute_url(self): return '%s%s/' % (settings.BUSINESS_URL, self.slug) FORMS: class AddBusinessForm(ModelForm): class Meta: model = Business exclude = ['deleted','primary_contact',] class ContactForm(ModelForm): class Meta: model = Contact exclude = ['deleted',] AddBusinessFormSet = inlineformset_factory(Business, Contact, can_delete=False, extra=1, form=AddBusinessForm, )

    Read the article

  • Does anyone know if WordPress has builtin PHP validation functions?

    - by racl101
    Hi everyone, I am trying to build a form in WordPress and taking advantage of all its built-in functions but I am hard pressed to find any functions that do form validation. I figure those kinds of functions have to exist in WordPress but I couldn't find any because its documentation is sparse and spread out in some respects. Would anyone have any useful links to documentation and tutorials by any chance?

    Read the article

  • SQL SERVER – Introduction to FIRST _VALUE and LAST_VALUE – Analytic Functions Introduced in SQL Server 2012

    - by pinaldave
    SQL Server 2012 introduces new analytical functions FIRST_VALUE() and LAST_VALUE(). This function returns first and last value from the list. It will be very difficult to explain this in words so I’d like to attempt to explain its function through a brief example. Instead of creating a new table, I will be using the AdventureWorks sample database as most developers use that for experiment purposes. Now let’s have fun following query: USE AdventureWorks GO SELECT s.SalesOrderID,s.SalesOrderDetailID,s.OrderQty, FIRST_VALUE(SalesOrderDetailID) OVER (ORDER BY SalesOrderDetailID) FstValue, LAST_VALUE(SalesOrderDetailID) OVER (ORDER BY SalesOrderDetailID) LstValue FROM Sales.SalesOrderDetail s WHERE SalesOrderID IN (43670, 43669, 43667, 43663) ORDER BY s.SalesOrderID,s.SalesOrderDetailID,s.OrderQty GO The above query will give us the following result: What’s the most interesting thing here is that as we go from row 1 to row 10, the value of the FIRST_VALUE() remains the same but the value of the LAST_VALUE is increasing. The reason behind this is that as we progress in every line – considering that line and all the other lines before it, the last value will be of the row where we are currently looking at. To fully understand this statement, see the following figure: This may be useful in some cases; but not always. However, when we use the same thing with PARTITION BY, the same query starts showing the result which can be easily used in analytical algorithms and needs. Let us have fun through the following query: Let us fun following query. USE AdventureWorks GO SELECT s.SalesOrderID,s.SalesOrderDetailID,s.OrderQty, FIRST_VALUE(SalesOrderDetailID) OVER (PARTITION BY SalesOrderID ORDER BY SalesOrderDetailID) FstValue, LAST_VALUE(SalesOrderDetailID) OVER (PARTITION BY SalesOrderID ORDER BY SalesOrderDetailID) LstValue FROM Sales.SalesOrderDetail s WHERE SalesOrderID IN (43670, 43669, 43667, 43663) ORDER BY s.SalesOrderID,s.SalesOrderDetailID,s.OrderQty GO The above query will give us the following result: Let us understand how PARTITION BY windows the resultset. I have used PARTITION BY SalesOrderID in my query. This will create small windows of the resultset from the original resultset and will follow the logic or FIRST_VALUE and LAST_VALUE in this resultset. Well, this is just an introduction to these functions. In the future blog posts we will go deeper to discuss the usage of these two functions. By the way, these functions can be applied over VARCHAR fields as well and are not limited to the numeric field only. Reference: Pinal Dave (http://blog.SQLAuthority.com) Filed under: Pinal Dave, PostADay, SQL, SQL Authority, SQL Function, SQL Query, SQL Scripts, SQL Server, SQL Tips and Tricks, T SQL, Technology

    Read the article

  • ODI 11g - Cleaning control characters and User Functions

    - by David Allan
    In ODI user functions have a poor name really, they should be user expressions - a way of wrapping common expressions that you may wish to reuse many times - across many different technologies is an added bonus. To illustrate look at the problem of how to remove control characters from text. Users ask these types of questions over all technologies - Microsoft SQL Server, Oracle, DB2 and for many years - how do I clean a string, how do I tokenize a string and so on. After some searching around you will find a few ways of doing this, in Oracle there is a convenient way of using the TRANSLATE and REPLACE functions. So you can convert some text using the following SQL; replace( translate('This is my string'||chr(9)||' which has a control character', chr(3)||chr(4)||chr(5)||chr(9), chr(3) ), chr(3), '' ) If you had many columns to perform this kind of transformation on, in the Oracle database the natural solution you'd go to would be to code this as a PLSQL function since you don't want the code splattered everywhere. Someone tells you that there is another control character that needs added equals a maintenance headache. Coding it as a PLSQL function will incur a context switch between SQL and PLSQL which could prove costly. In ODI user functions let you capture this expression text and reference it many times across your mappings. This will protect the expression from being copy-pasted by developers and make maintenance much simpler - change the expression definition in one place. Firstly define a name and a syntax for the user function, I am calling it UF_STRIP_BAD_CHARACTERS and it has one parameter an input string;  We then can define an implementation for each technology we will use it, I will define Oracle's using the inputString parameter and the TRANSLATE and REPLACE functions with whatever control characters I want to replace; I can then use this inside mapping expressions in ODI, below I am cleaning the ENAME column - a fabricated example but you get the gist.  Note when I use the user function the function name remains in the text of the mapping, the actual expression is not substituted until I generate the scenario. If you generate the scenario and export the scenario you can have a peak at the code that is processed in the runtime - below you can see a snippet of my export scenario;  That's all for now, hopefully a useful snippet of info.

    Read the article

  • More Advanced ASP.NET 3.5 Functions and Subroutines

    If you read the first part of this two-part series you know that functions and subroutines can help make coding programs with ASP.NET 3.5 simpler in certain ways. In this article you will be presented with a slightly more complex web application that uses functions and subroutines in ASP.NET.... Microsoft Exchange Server 2010 Simplify Administration and Deployment of Messaging - Free Download.

    Read the article

  • Learning PostgreSql: Functions and refcursors

    - by Alexander Kuznetsov
    In this post we shall create a function that returns data, and invoke it from our C# client. There are no stored procedures in PostgreSql, only functions. This is different from T-SQL, but consistent with many other languages, such as C#. Creating a function Functions can return many different types. Learning all the available options might take some time. However, for the project we are working on, we need to replicate several T-SQL stored procedures which take column list as a parameter, and use...(read more)

    Read the article

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