Search Results

Search found 15316 results on 613 pages for 'coding style'.

Page 59/613 | < Previous Page | 55 56 57 58 59 60 61 62 63 64 65 66  | Next Page >

  • High level programming logic, design, pattern

    - by Muhammad Shahzad
    I have been doing programming from last 7 years, getting better and better, but still i think that am lacking something. I have been doing work in JOOMLA, MAGENTO, WP, Custom PHP, Opencart, laravel, codeignitor. Sometimes i need to design logic for a huge database application, in the applications we need nesting loops and queries, although i follow OOPS standards, ORM etc, still i feel i need more robust coding designs. I need to know how can i improve these things, so that code remain neat, efficient and faster. Also how big webapps like facebook twitter tests there code speed? How high level programmers choose design patterns. If you can help me find something useful with examples?

    Read the article

  • Forced naming of parameters in python

    - by Mark Mayo
    In python you may have a function definition: def info(object, spacing=10, collapse=1) which could be called in any of the following ways: info(odbchelper) info(odbchelper, 12) info(odbchelper, collapse=0) info(spacing=15, object=odbchelper) thanks to python's allowing of any-order arguments, so long as they're named. The problem we're having is as some of our larger functions grow, people might be adding parameters between spacing and collapse, meaning that the wrong values may be going to parameters that aren't named. In addition sometimes it's not always clear as to what needs to go in. We're after a way to force people to name certain parameters - not just a coding standard, but ideally a flag or pydev plugin? so that in the above 4 examples, only the last would pass the check as all the parameters are named. Odds are we'll only turn it on for certain functions, but any suggestions as to how to implement this - or if it's even possible would be appreciated.

    Read the article

  • Why do so many mathematicians format code so poorly? [closed]

    - by marcog
    I have done a fair amount of programming together with mathematicians. Now I am even teaching some high school kids coming from a mathematics background how to program. Most of these people format their code so hideously it's hard to believe. I've even worked with and taught mathematicians who will fight the auto-indenter! Why is this so common amongst mathematicians? BTW, this is one reason I have started teaching Python. Yet still they find ways other than indentation to produce whacked coding styles!

    Read the article

  • Should every class have its own namespace?

    - by thehouse
    Something that has been troubling me for a while: The current wisdom is that types should be kept in a namespace that only contains functions which are part of the type's non-member interface (see C++ Coding Standards Sutter and Alexandrescu or here) to prevent ADL pulling in unrelated definitions. Does this imply that all classes must have a namespace of their own? If we assume that a class may be augmented in the future by the addition of non-member functions, then it can never be safe to put two types in the same namespace as either one of them may introduce non-member functions that could interfere with the other. The reason I ask is that namespaces are becoming cumbersome for me. I'm writing a header-only library and I find myself using classes names such as project::component::class_name::class_name. Their implementations call helper functions but as these can't be in the same namespace they also have to be fully qualified!

    Read the article

  • int vs const int&

    - by Valdo
    I've noticed that I usually use constant references as return values or arguments. I think the reason is that it works almost the same as using non-reference in the code. But it definitely takes more space and function declarations become longer. I'm OK with such code but I think some people my find it a bad programming style. What do you think? Is it worth writing const int& over int? I think it's optimized by the compiler anyway, so maybe I'm just wasting my time coding it, a?

    Read the article

  • including .h files.

    - by Max
    Suppose I have two .h files: A.h and B.h. Moreover, A.h includes B.h itself: B.h - declares class B. class B { ... }; A.h - declares class A, which uses class B. #include B.h class A { void SomeFunction(const B& b); }; Now, I have some .cpp file, that uses both A and B classes (B class maybe used not only in A::SomeFunction(B)) What are the pluses to include both A.h and B.h (instead of only A.h) from the perspective of design-patterns and coding style.

    Read the article

  • International multi-OS keyboard layout for both coding and surfing?

    - by rassie
    So yes, the problem has been raised in parts multiple times already. Still I'm looking for a keyboard layout that has the following features: Easy on fingers (Dvorak-like layouts welcome) Easy for coding Includes german characters (typing ä with AltGr-p is not ok). Works well with web-browsing (Ctrl-t and Ctrl-w on one hand, left one very much preferred, since that's where my ex-CapsLock, now Ctrl lies) Works well with default Emacs bindings Works on both Windows and Linux (at least easily installable) I've looked at Dvorak and Neo, they both have a "shortcut problem", i.e. web-browsing and most frequent Emacs combinations use both parts of the keyboard. Using right Ctrl is usually not an option, since it'll give me RSI much faster than keeping QWERTY/Z. Funnily enough, mirroring the default Neo layout would probably be enough for me. So, any ideas?

    Read the article

  • What's the best platform for blogging about coding? [closed]

    - by timday
    I'm toying with starting an occasional blog for posting odd bits of coding related stuff (mainly C++, probably). Are there any platforms which can be recommended as providing exceptionally good support (e.g syntax highlighting) for posting snippets of code ? (Or any to avoid because posting mono-spaced font blocks of text is a pain). Outcome: I accepted Josh K's answer because what I actually ended up doing was realizing I was more interested in articles than a blog style, getting back into LaTeX (after almost 20 years away from it), using the "listings" package for code, and pushing the HTML/PDF results to my ISP's static-hosting pages. (HTML generated using tex4ht). Kudos to the answers mentioning Wordpress, Tumblr and Jekyll; I spent some time looking into all of them.

    Read the article

  • International multi-OS keyboard layout for both coding and surfing?

    - by Nikolai Prokoschenko
    So yes, the problem has been raised in parts multiple times already. Still I'm looking for a keyboard layout that has the following features: Easy on fingers (Dvorak-like layouts welcome) Easy for coding Includes German characters (typing ä with AltGr-p is not ok). Works well with web-browsing (Ctrl-t and Ctrl-w on one hand, left one very much preferred, since that's where my ex-CapsLock, now Ctrl lies) Works well with default Emacs bindings Works on both Windows and Linux (at least easily installable) I've looked at Dvorak and Neo, they both have a "shortcut problem", i.e. web-browsing and most frequent Emacs combinations use both parts of the keyboard. Using right Ctrl is usually not an option, since it'll give me RSI much faster than keeping QWERTY/Z. Funnily enough, mirroring the default Neo layout would probably be enough for me. So, any ideas?

    Read the article

  • Microsoft réunit plus de 2500 développeurs autour de Windows 8 dans un coding marathon de 18h qui entre dans le record Guinness

    Microsoft réunit plus de 2500 développeurs autour de Windows 8 dans un coding marathon de 18h qui entre dans le record Guinness Windows 8 est la prochaine mise à jour majeure de l'OS de Microsoft. Entièrement repensé, il est en rupture totale avec les versions antérieures et permettra à Microsoft de faire son entrée sur le marché des tablettes. Il représente donc une nouvelle opportunité pour les développeurs qui seraient déjà assez enthousiastes face à l'OS. [IMG]http://ftp-developpez.com/gordon-fowler/Logos%20Windows/Logo%20Windows%208%20Small.jpg[/IMG] C'est en tout cas ce que laisse penser un marathon de codage de 18 heures organisé par Micros...

    Read the article

  • Silverlight 3 Dynamic DataGrid RowStyle Ignored

    - by antoinne85
    I subclassed the standard DataGrid into SpecialDataGrid so I could override the KeyDown/KeyUp events. Other than that SpecialDataGrid is exactly the same as DataGrid. At run-time I dynamically create a bunch of these SpecialDataGrids. When a user clicks a row in the grid it hightlights, which is fine, but when that grid loses focus, it leaves a residual gray highlight on the last-selected row, which is not fine. I've heavily edited the RowStyle and CellStyle I'm applying to these Grids to more-or-less remove all formatting. I even added a static SpecialDataGrid to the app with test data so I could see if the RowStyle was somehow incorrect, applying the same RowStyle and CellStyle that I'm applying to the dynamically generated one (you'll see it in the code below). What I saw was that the "test grid" showed up exactly as I wanted, and the real grid is ignoring part of the RowStyle! Has anyone run into this issue or have any ideas of how to correct it? Some source and images follow. Creating the SpecialDataGrid: //Set up a datagrid. SpecialDataGrid radio_datagrid = new SpecialDataGrid(); radio_datagrid.ItemsSource = radios; radio_datagrid.AutoGenerateColumns = false; radio_datagrid.HeadersVisibility = DataGridHeadersVisibility.None; radio_datagrid.BorderThickness = new Thickness(0); radio_datagrid.HorizontalAlignment = HorizontalAlignment.Stretch; radio_datagrid.IsReadOnly = true; radio_datagrid.MouseLeftButtonUp += new MouseButtonEventHandler(option_datagrid_MouseLeftButtonUp); radio_datagrid.KeyDown += new KeyEventHandler(radio_datagrid_KeyDown); radio_datagrid.KeyUp += new KeyEventHandler(radio_datagrid_KeyUp); //Radio column. DataGridTemplateColumn temp_col = new DataGridTemplateColumn(); temp_col.CellTemplate = (DataTemplate)this.Resources["RadioColumnTemplate"]; temp_col.Width = new DataGridLength(20); radio_datagrid.Columns.Add(temp_col); //Description column. DataGridTextColumn txt_col = new DataGridTextColumn(); txt_col.Binding = new Binding("optionlabel"); txt_col.Width = new DataGridLength(350); radio_datagrid.Columns.Add(txt_col); //Product code column. txt_col = new DataGridTextColumn(); txt_col.Binding = new Binding("optioncode"); txt_col.Width = new DataGridLength(80); radio_datagrid.Columns.Add(txt_col); //Price column. txt_col = new DataGridTextColumn(); txt_col.Binding = new Binding("optionprice"); txt_col.Width = new DataGridLength(80); radio_datagrid.Columns.Add(txt_col); //View column. temp_col = new DataGridTemplateColumn(); temp_col.CellTemplate = (DataTemplate)this.Resources["HyperlinkButtonColumnTemplate"]; temp_col.Width = new DataGridLength(30); radio_datagrid.Columns.Add(temp_col); radio_datagrid.RowStyle = (Style)this.Resources["StyleDataGridRowNoAlternating"]; radio_datagrid.CellStyle = (Style)this.Resources["Style_DataGridCell_NoHighlight"]; Example Image: The lower DataGrid appears that way regardless of what you do to it. No highlighting of any sort and certainly no residual highlights. Any idea what's keeping this from being applied to the first?

    Read the article

  • how to customize the listbox selected item style in silverlight 4

    - by Phani Kumar PV
    I am having a silverlight listbox in which a list item contains an image, its name and its price. the layout of the list item will be as follows: Under the image the image name will be shown, under the image name the price will be shown. Now the problem is when i select an list item all the three items(image, image name and its price ) are selected. this is the default behavior. Now the requirement is when i select a list item only the image should be selected. please let me know if there is a way to do this..

    Read the article

  • Custom Tabcontrol in silverlight 4

    - by Archie
    Hello, I'm trying to design a tab control which will have a tabs on left hane hand side, and will have a text displayed vertically besides it. And will have the Page displayed in the main tab control. For reference you can visit : http://www.nseindia.com/ and click on any tab in the main menu. How can it be designed? I have created a style in App.xaml since it would be applicable to all tabs. But I'm not sure how to get the control's name in the page I would be using. Thanks.

    Read the article

  • iPhone/iPad SDK: homescreen/Photos style grid view?

    - by igul222
    I'm building an iPad app, and would like to use a "tiled" display with objects arranged in a grid, similar to the iPhone/iPad home screen and the iPad photos app. More examples of this interface: http://itunes.apple.com/us/app/flipside-hd/id364916273?mt=8 http://itunes.apple.com/us/app/evernote/id281796108?mt=8 Is there any pre-built way in the SDK to do this? If not, how should I go about creating my own?

    Read the article

  • System Tray Popup Windows 7 Style

    - by Mason Blier
    Hey All, I want something like this: http://cybernetnews.com/wp-content/uploads/2008/10/windows-7-wireless.jpg This window is not resizable, and aligns itself above the system tray icon which it is related to. I have this: http://i.imgur.com/79FZi.png Which is resizeable, and it goes wherever it feels like. If you click the volume control in Win 7, it always pops up directly above the icon. This is ideal. I've found this reference which I think is trying to solve the same problem (can't tell though as the images are dead), http://stackoverflow.com/questions/2169006/create-a-system-tray-styled-box-in-winforms-c but I'm using WPF and I'm not sure how to get these Form objects they refer to from my Window object. This is the XAML declaration of my window atm, <Window xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" x:Class="WirelessControl.Window1" x:Name="Window" Title="Window1" Width="260" Height="370" mc:Ignorable="d" WindowStyle="None"></Window> I feel like based on how common this is in Windows that there must be a fairly easy way to do this. ResizeMode="NoResize" causes my window border to disappear, so that's no help. Thanks guys, I hope I was comprehensive enough.

    Read the article

  • Vertical-centering and overflow Excel-style in CSS?

    - by Eric Grange
    Is there a way to perform a vertical centering of a variable-sized multi-line content within a fixed-size div, with hidden overflow? The aim would be to reproduce what you can see in Excel cells: when the content fits the container, it should be vertically centered, when it is larger, the parts that overflow should be hidden (and the content still vertically aligned), like in an Excel cell whose neighbours aren't empty. I know how to vertically center using CSS, I know how to hide overflow when the content isn't vertically centered, but I've no idea how to do both at the same time... Is Javascript the only answer? The trick is that CSS positioning approaches don't work with variable-sized content (my content is dynamic text), and when you use display:table-cell, it effectively disables CSS overflow control (and the container grows to accomodate the content).

    Read the article

  • jquery ui tabs major style change

    - by Jonah
    I am using jquery UI tabs and I need to majorly change the styling on it. I need to rempve the background image, the borders, almost everything. I need it to look minimal, and not like it's self contained. What's the best way to do this? I need to use the default UI styling for the calendar widget however, which is on the same page. I've done a lot of research and everyone seems to point to the theme-roller. However, i do not just want to change the colors and border radii. I need to delete crap. theme-roller seems to be just change things like colors (not really useful for the real world) Is it even worth using jquery UI for my tabs?

    Read the article

  • Starter question of declarative style SQLAlchemy relation()

    - by jfding
    I am quite new to SQLAlchemy, or even database programming, maybe my question is too simple. Now I have two class/table: class User(Base): __tablename__ = 'users' id = Column(Integer, primary_key=True) name = Column(String(40)) ... class Computer(Base): __tablename__ = 'comps' id = Column(Integer, primary_key=True) buyer_id = Column(None, ForeignKey('users.id')) user_id = Column(None, ForeignKey('users.id')) buyer = relation(User, backref=backref('buys', order_by=id)) user = relation(User, backref=backref('usings', order_by=id)) Of course, it cannot run. This is the backtrace: File "/Library/Python/2.6/site-packages/SQLAlchemy-0.5.8-py2.6.egg/sqlalchemy/orm/state.py", line 71, in initialize_instance fn(self, instance, args, kwargs) File "/Library/Python/2.6/site-packages/SQLAlchemy-0.5.8-py2.6.egg/sqlalchemy/orm/mapper.py", line 1829, in _event_on_init instrumenting_mapper.compile() File "/Library/Python/2.6/site-packages/SQLAlchemy-0.5.8-py2.6.egg/sqlalchemy/orm/mapper.py", line 687, in compile mapper._post_configure_properties() File "/Library/Python/2.6/site-packages/SQLAlchemy-0.5.8-py2.6.egg/sqlalchemy/orm/mapper.py", line 716, in _post_configure_properties prop.init() File "/Library/Python/2.6/site-packages/SQLAlchemy-0.5.8-py2.6.egg/sqlalchemy/orm/interfaces.py", line 408, in init self.do_init() File "/Library/Python/2.6/site-packages/SQLAlchemy-0.5.8-py2.6.egg/sqlalchemy/orm/properties.py", line 716, in do_init self._determine_joins() File "/Library/Python/2.6/site-packages/SQLAlchemy-0.5.8-py2.6.egg/sqlalchemy/orm/properties.py", line 806, in _determine_joins "many-to-many relation, 'secondaryjoin' is needed as well." % (self)) sqlalchemy.exc.ArgumentError: Could not determine join condition between parent/child tables on relation Package.maintainer. Specify a 'primaryjoin' expression. If this is a many-to-many relation, 'secondaryjoin' is needed as well. There's two foreign keys in class Computer, so the relation() callings cannot determine which one should be used. I think I must use extra arguments to specify it, right? And howto? Thanks

    Read the article

  • CSS style guide question

    - by Vasu
    What are the best practices with respect to styling HTML elements using CSS? What's the preferred granularity for styling HTML elements? i.e., do you have lots of div.searchbox input div.searchbox p div.searchbox p.help OR input.searchbox p.searchbox p.searchboxhelp Which css code is considered easy to maintain? Is using grid frameworks and reset considered best practice? Thanks

    Read the article

  • Simple list based output instead of style and javascript ridden ASP.net webforms menu

    - by Mike
    Hi All, Is there a way (or component i could use) to output a simple menu. I just need it output as a list, like you would use for a simple superfish menu. I've looked at the menu control and cssadapters (css friendly) which kind of works, except there is a lot of styles and javascript output with the menu which is destroying the look. If I can't find something that outputs a clean list, my next option is to craft some jquery to delete these styles. This is not my preferred option. If you have a better idea, please let me know. Just something that looks like this: <ul> Main Menu <li> hi </li> <li> second menu <ul> <li> <a href="hi.aspx"> in second menu </a></li> <li> <a href="rabbits.aspx"> hi there </a></li> </ul> </li> </ul> Thanks.

    Read the article

  • generalizing the pumping lemma for UNIX-style regular expressions

    - by Avi
    Most UNIX regular expressions have, besides the usual *,+,? operators a backslash operator where \1,\2,... match whatever's in the last parentheses, so for example L=(a)b\1* matches the (non regular) language a^n b a^n On one hand, this seems to be pretty powerful since you can create (a*)b\1b\1 to match the language a^n b a^n b a^n which can't even be recognized by a stack automaton. On the other hand, I'm pretty sure a^n b^n cannot be expressed this way. Two questions: 1. Is there any literature on this family of languages (UNIX-y regular). In particular, is there a version of the pumping lemma for these? 2. Can someone prove (or perhaps disprove) that a^n b^n cannot be expressed this way? Thanks

    Read the article

< Previous Page | 55 56 57 58 59 60 61 62 63 64 65 66  | Next Page >