Search Results

Search found 9026 results on 362 pages for 'vs extensibility'.

Page 120/362 | < Previous Page | 116 117 118 119 120 121 122 123 124 125 126 127  | Next Page >

  • Ruby on Rails: Modules vs. Classes

    - by Jack
    I'm trying to add a function that will be accessible throughout all parts of my program. I want something like: def GlobalFunctions.my_function(x,y) puts x + y end to be accessible for all models. Specifically I am trying to use a function like this in my seeds.rb file but I am most likely going to be reusing the code and don't want any redundancy. Now I know I can make a simple class, but I could also make a module. What are some reasons to go in either direction? And once I've decided on which type to use, how do I make it accessible throughout the whole program? I have tried a module, but I keep getting " Expected app/[module file] to define [ModuleName]"

    Read the article

  • Session vs singleton pattern

    - by chobo
    Hi, I have a web application where I would like to pull user settings from a database and store them for Global access. Would it make more sense to store the data in a Singleton, or a Session object? What's the difference between the two? Is it better to store the data as an object reference or break it up into value type objects (ints and strings)? Thanks!

    Read the article

  • CVS: Modules vs Subdirectories

    - by Glaxalg
    Does anyone know what is the best approach to define structure of modules/directories in CVS? Specifically what if I have big project that could possibly has many sub-projects (even not related). Is it better to define module for each sub-project or use subdirectories: Approach #1 Modules CVSROOT Main Project Platform A Sub-project1 Platform A Sub-project2 Platform B Sub-project3 ... Approach #2 subdirectories CVSROOT Project Main Platform A Sub-Project 1 Sub-Project 2 Platform B Sub-Project 3 ...

    Read the article

  • PHP Speed - Many Echos vs Building a String

    - by Chris
    Wondering if anyone knows if either of these methods would produce an output faster: Method 1 for ($i=1;$i<99999;$i++) { echo $i, '<br>'; } or Method 2 for ($i=1;$i<99999;$i++) { $string .= $i . '<br>'; } echo $string; Thanks for any input you have.

    Read the article

  • Drupal vs FatWire - Any thoughts?

    - by RadiantHex
    Hi folks, a company I am working for is considering the usage of a CMS, apparently two of the suggested CMSs are Drupal and FatWire. FatWire is proprietary and quite expensive, therefore it seems that there is a not so big community build around the product. Functionality seems to be extensive, even though a few design choices seem counter-intuitive and long-winded. Drupal instead is open source and has an big community backing the product. There are plenty of books around and usage seems more intuitive. Functionality wise I am unsure on how they compare. The main features that the company's team seem to like are team workflow features and revision control (present in FatWire, even though the implementation seems quite limited). Hopefully some of you guys have been faced with these two products before, and might have a few suggestions up their sleeve. Help would be much appreciated!

    Read the article

  • Debugging ASP.NET in VS

    - by negligible
    A lot of what I'm doing at the moment is figuring out other peoples code and adding or adapting functions, so currently I am debugging more than I am writing code of my own. I'm still new to this, Junior Developer, and I am always finding new ways to improve what I am doing. For example I recently found This Guide which had some excellent tips, such as overriding the ToString() method in your classes so children are readable from their parents. So I am looking for any other tips or tricks to make my debugging more efficient, as I recognise it as a big part of programming, that you more experienced programmers may have picked up or found. Anything appreciated, I can read websites just fine so no need to explain it yourself if you have a good link!

    Read the article

  • Usage of initialize() vs. setup() in Mootools

    - by RyOnLife
    Mootools classes have an initialize() method that's called when a new object is instantiated. It seems that setup() is a commonly used method as well. Most classes I've observed call this.setup() from initialize() and nowhere else, which has left me wondering: What's the purpose of setup()? Why not just put the setup() code in initialize()? When does it make sense to use a setup() method?

    Read the article

  • dealing with IO vs pure code in haskell

    - by Drakosha
    I'm writing a shell script (my 1st non-example in haskell) which is supposed to list a directory, get every file size, do some string manipulation (pure code) and then rename some files. I'm not sure what i'm doing wrong, so 2 questions: How should i arrange the code in such program? I have a specific issue, i get the following error, what am i doing wrong? error: Couldn't match expected type [FilePath]' against inferred typeIO [FilePath]' In the second argument of mapM', namelyfileNames' In a stmt of a 'do' expression: files <- (mapM getFileNameAndSize fileNames) In the expression: do { fileNames <- getDirectoryContents; files <- (mapM getFileNameAndSize fileNames); sortBy cmpFilesBySize files } code: getFileNameAndSize fname = do (fname, (withFile fname ReadMode hFileSize)) getFilesWithSizes = do fileNames <- getDirectoryContents files <- (mapM getFileNameAndSize fileNames) sortBy cmpFilesBySize files

    Read the article

  • performance issue: difference between select s.* vs select *

    - by kamil
    Recently I had some problem in performance of my query. The thing is described here: poor Hibernate select performance comparing to running directly - how debug? After long time of struggling, I've finally discovered that the query with select prefix like: select sth.* from Something as sth... Is 300x times slower then query started this way: select * from Something as sth.. Could somebody help me, and asnwer why is that so? Some external documents on this would be really useful. The table used for testing was: SALES_UNIT table contains some basic info abot sales unit node such as name and etc. The only association is to table SALES_UNIT_TYPE, as ManyToOne. The primary key is ID and field VALID_FROM_DTTM which is date. SALES_UNIT_RELATION contains relation PARENT-CHILD between sales unit nodes. Consists of SALES_UNIT_PARENT_ID, SALES_UNIT_CHILD_ID and VALID_TO_DTTM/VALID_FROM_DTTM. No association with any tables. The PK here is ..PARENT_ID, ..CHILD_ID and VALID_FROM_DTTM The actual query I've done was: select s.* from sales_unit s left join sales_unit_relation r on (s.sales_unit_id = r.sales_unit_child_id) where r.sales_unit_child_id is null select * from sales_unit s left join sales_unit_relation r on (s.sales_unit_id = r.sales_unit_child_id) where r.sales_unit_child_id is null Same query, both uses left join and only difference is with select.

    Read the article

  • Localizing formatting functions instead of properties in VS.NET resources

    - by LexL
    I noticed that .NET framework uses formatting functions, generated the same way localizable string are. There is a resource file Resources.resx with resource string TestString. So you may use it in code like this: string localizableValue = Resources.TestString; Now, imagine you need a formattable localizable string, to use it in string.Format function. So everytime you use it, you have to write something like this: string localizableFormattedValue = string.Format(Resources.TestFormatString, someParam1, someParam2); The observation says that in .NET framework generated resource classes already include the above construction. So instead of string property, a string function is generated. The resulting code looks like this: string localizableFormattedValue = Resources.TestFormatString(someParam1, someParam2); The question is - how do they do this? Is it some custom Microsoft feature (resx generator) or I'm missing something obvious?

    Read the article

  • Configure VS 2010 Help for a specific subject

    - by scope-creep
    Using VS2008, u could set Document Explorer to limit your search to specific subjects using the Technology dropdown, which made for finding info on a specific subject very easy, as it was limited to a subset of available subject. How is the accomplished in the new VS2010 help? The VS2010 help at the moment, is very hazy. When I search for Task, or task, or c# task. re the new Task library in .net, it returns a whole bundle of irrelevancy... Any ideas.

    Read the article

  • C/C++ Struct vs Class

    - by m00st
    After finishing my C++ class it seemed to me the structs/classes are virtually identical except with a few minor differences. I've never programmed in C before; but I do know that it has structs. In C is it possible to inherit other structs and set a modifier of public/private? If you can do this in regular C why in the world do we need C++? What makes classes different from a struct?

    Read the article

  • Icon fonts vs images

    - by Miss A
    My manager tells me not to use icon fonts on our websites, as it is another http request plus the extra kBs to download. Also because I would have to use content before for the font (I can't change the html), he prefers background images so it works in IE7. Personally I love the little things, so nice and crisp and resizeable! I get it if we only use a couple of icons on a website but if I would use, say 5 icons on a site - what do you guys think? Is it worth using an icon font or is he right thinking that it is not? I am just a sucker for anything new and exciting, and this year it is the retina display.

    Read the article

  • IS NULL vs = NULL in where clause + MSSQL

    - by Nev_Rahd
    Hello How to check a value IS NULL [or] = @param (where @param is null) Ex: Select column1 from Table1 where column2 IS NULL = works fine If I want to replace comparing value (IS NULL) with @param. How can this be done Select column1 from Table1 where column2 = @param = this works fine until @param got some value in it and if is null never finds a record. How can this achieve?

    Read the article

  • mysql_connect VS mysql_pconnect

    - by rogeriopvl
    I have this doubt, I've searched the web and the answers seem to be diversified. Is it better to use mysql_pconnect over mysql_connect when connecting to a database via PHP? I read that pconnect scales much better, but on the other hand, being a persistent connection... having 10 000 connections at the same time, all persistent, doesn't seem scalable to me. Thanks in advance.

    Read the article

  • new Integer vs valueOf

    - by LB
    Hi, I was using Sonar to make my code cleaner, and it pointed that I'm using new Integer(1) instead of Integer.valueOf(1). Because it seems that valueOf does not instantiate a new object so is more memory-friendly. How can valueOf not instantiate a new object ? How does it work ? Is this true for all integers ? thanks.

    Read the article

  • VS 2008 "Choose Data Source" wizard

    - by ELM
    Good Day, I'm using Visual Studio Professional 2008 SP 1. When I create a connection via the designer, the "Choose Data Source" dialog only lists the following data sources: Microsoft SQL Server Compact 3.5 Microsoft SQL Server Database File When I create a connection on the Server explorer the list is complete with : Microsoft SQL Server Compact 3.5, Microsoft SQL Server Database File, Microsoft SQL Server Compact, ODBC etc. Please help me out. I need to use SQL Server Compact. I have posted the same problem on the following thread with some screenshots: http://social.msdn.microsoft.com/Forums/en/vssetup/thread/906845c3-69e9-431a-ad07-7da2de684d33

    Read the article

  • int ** vs int [ROWS][COLS]

    - by user355638
    I have a 2D array declared like this: int arr[2][2]={ {1,2},{3,4}}; Now if I do: int ** ptr=(int**) arr; and: cout<<**ptr; I am getting a segmentation fault (using g++-4.0). Why so? Shouldn't it be printing the value 1 (equal to arr[0][0])?

    Read the article

  • innerText/textContent vs. retrieving each text node

    - by J-P
    I've heard that using el.innerText||el.textContent can yield unreliable results, and that's why I've always insisted on using the following function in the past: function getText(node) { if (node.nodeType === 3) { return node.data; } var txt = ''; if (node = node.firstChild) do { txt += getText(node); } while (node = node.nextSibling); return txt; } This function goes through all nodes within an element and gathers the text of all text nodes, and text within descendants: E.g. <div id="x">foo <em>foo...</em> foo</div> Result: getText(document.getElementById('x')); // => "foo foo... foo" I'm quite sure there are issues with using innerText and textContent, but I've not been able to find a definitive list anywhere and I am starting to wonder if it's just hearsay. Can anyone offer any information about the possibly lacking reliability of textContent/innerText? EDIT: Found this great answer by Kangax -- http://stackoverflow.com/questions/1359469/innertext-works-in-ie-but-not-in-firefox/1359822#1359822

    Read the article

< Previous Page | 116 117 118 119 120 121 122 123 124 125 126 127  | Next Page >