Search Results

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

Page 45/613 | < Previous Page | 41 42 43 44 45 46 47 48 49 50 51 52  | Next Page >

  • How might I wrap the FindXFile-style APIs to the STL-style Iterator Pattern in C++?

    - by BillyONeal
    Hello everyone :) I'm working on wrapping up the ugly innards of the FindFirstFile/FindNextFile loop (though my question applies to other similar APIs, such as RegEnumKeyEx or RegEnumValue, etc.) inside iterators that work in a manner similar to the Standard Template Library's istream_iterators. I have two problems here. The first is with the termination condition of most "foreach" style loops. STL style iterators typically use operator!= inside the exit condition of the for, i.e. std::vector<int> test; for(std::vector<int>::iterator it = test.begin(); it != test.end(); it++) { //Do stuff } My problem is I'm unsure how to implement operator!= with such a directory enumeration, because I do not know when the enumeration is complete until I've actually finished with it. I have sort of a hack together solution in place now that enumerates the entire directory at once, where each iterator simply tracks a reference counted vector, but this seems like a kludge which can be done a better way. The second problem I have is that there are multiple pieces of data returned by the FindXFile APIs. For that reason, there's no obvious way to overload operator* as required for iterator semantics. When I overload that item, do I return the file name? The size? The modified date? How might I convey the multiple pieces of data to which such an iterator must refer to later in an ideomatic way? I've tried ripping off the C# style MoveNext design but I'm concerned about not following the standard idioms here. class SomeIterator { public: bool next(); //Advances the iterator and returns true if successful, false if the iterator is at the end. std::wstring fileName() const; //other kinds of data.... }; EDIT: And the caller would look like: SomeIterator x = ??; //Construct somehow while(x.next()) { //Do stuff } Thanks! Billy3

    Read the article

  • Unmanaged DLL (exporting Dialog) + Class Library (DLL) + no Windows Style/Themes

    - by Gohlool
    Hi, I have a managed application TestApplication.exe in C# and Application.EnableVisualStyles() is allready called. I have a Class Library MySharedCode.dll also in C# which uses [DLLImport()] to import some External dialogs out of an unmanaged dll. Well, now I am using (add reference) MySharedCode.dll in my TestApplication.exe and call a function MyTestConfigDlg() out of it. TestClass.MyTestConfigDlg(); OK, everything works fine and I get my dialog, but the dialog has NO XP style/themes? I just wanted to see if it's general problem with managed/unmanged modules, so I used the [DLLImport()] to call the same MyTestConfigDlg() dialog but this time directly in my TestApplication.exe! WOW! Worked as I expected. The Dialog was in XP Style/Themes! so, anybody here who can help me out? FYI: I also tried (just for test) to call MessageBoxA() API call in my Class Library Dll which later called by my TestApplication.exe and the MessageBoxA() had also no Style/Themes! Thanks in advance!

    Read the article

  • Eclipse BIRT - Unnecessary inline style with external CSS when rendering HTML

    - by Etienne
    Hello! I am designing a report using external CSS with BIRT 2.5. When BIRT renders the html report, it creates copies of each external style to inline styles (name style_x) in the resulting html. The report.design contains: <list-property name="cssStyleSheets"> <structure> <property name="fileName">… mycss.css</property> <property name="externalCssURI"> http://.../mycss.css </property> </structure> </list-property> The resulting html contains: <style type="text/css"> .style_0 {…} .style_1 {…} …. </style> <link rel="stylesheet" type="text/css" href="http://.../mycss.css"></link> For each reference of my styles, the rendered html elements use both styles usually like this: <div class="style_x myclass" …. > …. </div> Is there any way to get rid of the useless inline styles when rendering html?

    Read the article

  • Use AttachedProperty in Style in ControlTemplate

    - by Andrey
    Here is my simple app: <Window x:Class="WpfApplication1.Window1" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:app="clr-namespace:WpfApplication1" Title="Window1" Height="300" Width="300"> <Window.Resources> <Style x:Key="Test"> <Setter Property="Button.Template"> <Setter.Value> <ControlTemplate> <Border BorderBrush="Blue" BorderThickness="3" Background="Black" CornerRadius="{Binding app:Extras.CornerRadius}" > </Border> </ControlTemplate> </Setter.Value> </Setter> </Style> </Window.Resources> <Grid> <Button Height="23" HorizontalAlignment="Left" Margin="29,26,0,0" Name="button1" VerticalAlignment="Top" Width="75" app:Extras.CornerRadius="10" Style="{StaticResource Test}" >Button</Button> </Grid> </Window> Here is my AttachedPropery: namespace WpfApplication1 { public class Extras { public static readonly DependencyProperty CornerRadiusProperty = DependencyProperty.RegisterAttached( "CornerRadius", typeof(double), typeof(Button), new FrameworkPropertyMetadata(1.0d, FrameworkPropertyMetadataOptions.AffectsRender) ); public static void SetCornerRadius(UIElement element, double value) { element.SetValue(CornerRadiusProperty, value); } public static double GetCornerRadius(UIElement element) { return (double)element.GetValue(CornerRadiusProperty); } } } CornerRadius="{Binding app:Extras.CornerRadius}" this of course doesn't work. so how can I get value from here app:Extras.CornerRadius="10" thanks in advance!

    Read the article

  • Overriding CSS style 'display:none' in javascript

    - by jsarma
    I'm trying to add a checkbox toggle that hides and shows list elements by changing their style display attribute from "none" to "inline", but it's not working. I'm setting the attribute's style to "display:none" in the CSS file. Then I set it to "display:inline" in javascript when someone checks a box. The javascript is successfully changing the element's property to inline, but for some reason the element remains invisible. If I do the opposite, by setting the display to inline in the CSS and overriding it to none in the javascript, it works fine. I don't see why this would work one way but not the other. I'm using chrome. Here is the code. Any feedback is appreciated. CSS file: #tabmenu li[status='disabled'] a, a.active, #disabled { color: #777777; background: #DDDDDD; font: normal 1em Arial; border: 1px solid black; border-radius: inherit; padding: 0px 5px 0px 5px; margin: 0px; text-decoration: none; cursor:hand; display:none; } HTML: <ul id="tabmenu"> <li name='tab' id='tab1' selected='no' status='disabled'></li> </ul> JAVASCRIPT (from command line, or onchange of a checkbox) tab = document.getElementById('tab1'); tab.style.display = 'inline';

    Read the article

  • CSS Style Firefox/Safari/Chrome

    - by patrick
    hi, i have a problem with css differences between browsers. i have a simple input textfield an a submit button. the should be arranged. with webkit (safari/webkit) everything looks fine but firefox doesnt do it. does anyone have an idea whats wrong? i have written a little test html page: <html> <head> <style type="text/css"> #input { background: none repeat scroll 0 0 white; border-color: #DCDCDC; border-style: solid; border-width: 1px 0 1px 1px; font: 13px "Lucida Grande",Arial,Sans-serif; margin: 0; padding: 5px 5px 5px 15px; width: 220px; outline-width: 0; height: 30px; } #submit { background: none repeat scroll 0 0 white; border: 1px solid #DCDCDC; font: 13px "Lucida Grande",Arial,Sans-serif; margin: 0; outline-width: 0; height: 30px; padding: 5px 10px; } </style> </head> <body> <input id="input" type="text" value="" /><input id="submit" type="button" value="Add" /> </body> </html>

    Read the article

  • Collapsed Visibility Within a WPF ComboBoxItem

    - by user832747
    I used a Style setter to stretch out my ComboBoxItem (and button) so that it spans the entire length of the ComboBox like so: <ComboBox > <ComboBox.Resources> <Style TargetType="ComboBoxItem"> <Setter Property="HorizontalContentAlignment" Value="Stretch" /> </Style> </ComboBox.Resources> <ComboBoxItem > <DockPanel > <Button Content="My Button" /> </DockPanel> </ComboBoxItem> </ComboBox> This works fine. Now, I add an additional button within the same ComboBoxItem, but have it set to Visibility Collapsed. <ComboBox > <ComboBox.Resources> <Style TargetType="ComboBoxItem"> <Setter Property="HorizontalContentAlignment" Value="Stretch" /> </Style> </ComboBox.Resources> <ComboBoxItem > <DockPanel > <Button Content="My Button" /> <Button Content="My Collapsed Button" Visibility="Collapsed" /> </DockPanel> </ComboBoxItem> </ComboBox> Now, the new button is invisible, but I expected my original button to still stretch the entire ComboBox, like it does with the above code. However, it does not. Why is this so? Is there a solution for this? I am using DataTriggers to edit the Visibility property. NOTE: I also get the same thing if I just set HorizontalContentAlignment="Stretch" in the ComboBox. UPDATE: Ok, this actually has something to do with the DockPanel. I changed it to a StackPanel, and it works as desired. However, I suppose I'm still curious as to why my first button would not stretch the entire DockPanel if the second button is collapsed?

    Read the article

  • Stand-alone Java code formatter/beautifier/pretty printer?

    - by Greg Mattes
    I'm interested in learning about the available choices of high-quality, stand-alone source code formatters for Java. The formatter must be stand-alone, that is, it must support a "batch" mode that is decoupled from any particular development environment. Ideally it should be independent of any particular operating system as well. So, a built-in formatter for the IDE du jour is of little interest here (unless that IDE supports batch mode formatter invocation, perhaps from the command line). A formatter written in closed-source C/C++ that only runs on, say, Windows is not ideal, but is somewhat interesting. To be clear, a "formatter" (or "beautifier") is not the same as a "style checker." A formatter accepts source code as input, applies styling rules, and produces styled source code that is semantically equivalent to the original source code. A style checker also applies styling rules, but it simply reports rule violations without producing modified source code as output. So the picture looks like this: Formatter (produces modified source code that conforms to styling rules) Read Source Code → Apply Styling Rules → Write Styled Source Code Style Checker (does not produce modified source code) Read Source Code → Apply Styling Rules → Write Rule Violations Further Clarifications Solutions must be highly configurable. I want to be able to specify my own style, not simply select from a canned list. Also, I'm not looking for a general purpose pretty-printer written in Java that can pretty-print many things. I want to style Java code. I'm also not necessarily interested in a grand-unified formatter for many languages. I suppose it might be nice for a solution to have support for languages other than Java, but that is not a requirement. Furthermore, tools that only perform code highlighting are right out. I'm also not interested in a web service. I want a tool that I can run locally. Finally, solutions need not be restricted to open source, public domain, shareware, free software, commercial, or anything else. All forms of licensing are acceptable.

    Read the article

  • Is the “jQuery programming style” a kind of Reactive programming?

    - by Peter Krauss
    jQuery is a Javascript library and framework, but when we are programming with jQuery into DOM problems/solutions, we can practice a style quite different of programming... We can read about jQuery at Wikipedia, The set of jQuery core features — DOM element selections, traversal and manipulation —, enabled by its selector engine (...), created a new "programming style", fusing algorithms and DOM-data-structures This question is similar to the "subquestion-3" of this question but not so generic. The focus here is about this new kind of "programming style"... So, the question: Is the "jQuery programming style in DOM context" a new paradign? Or it is more one example of reactive programming (not "cell-oriented" but "DOM-node oriented") or another one? We have no "standard taxonomy of paradigms", so, please, in your answer, indicate also your "best choice for Wikipedia Paradign". Example: if you understand that "jQuery programming DOM" is like "awk filtering data", your choice can be event-driven.

    Read the article

  • Oracle Linux Events in December

    - by Zeynep Koch
    December will be a busy month for Oracle Linux team. We will be showcasing Oracle Linux and Oracle VM in conferences all around the world. Here's a list of December events we will showcase Oracle Linux: Gartner Data Center – North America Oracle will have a session and booth - Register today Dec 3-6, Las Vegas, USA 0 0 1 66 377 Oracle Corporation 3 1 442 14.0 96 Normal 0 false false false EN-US JA X-NONE /* Style Definitions */ table.MsoNormalTable {mso-style-name:"Table Normal"; mso-tstyle-rowband-size:0; mso-tstyle-colband-size:0; mso-style-noshow:yes; mso-style-priority:99; mso-style-parent:""; mso-padding-alt:0in 5.4pt 0in 5.4pt; mso-para-margin:0in; mso-para-margin-bottom:.0001pt; mso-pagination:widow-orphan; font-size:10.0pt; font-family:"Times New Roman";} Oracle Open World Latin America Oracle OpenWorld Latin America December 4–6, Sao Paulo, Brazil 0 0 1 25 145 Oracle Corporation 1 1 169 14.0 96 Normal 0 false false false EN-US JA X-NONE /* Style Definitions */ table.MsoNormalTable {mso-style-name:"Table Normal"; mso-tstyle-rowband-size:0; mso-tstyle-colband-size:0; mso-style-noshow:yes; mso-style-priority:99; mso-style-parent:""; mso-padding-alt:0in 5.4pt 0in 5.4pt; mso-para-margin:0in; mso-para-margin-bottom:.0001pt; mso-pagination:widow-orphan; font-size:10.0pt; font-family:"Times New Roman";} HP Discover EMEA HP Discover – EMEA December 4 – 6, Messe Frankfurt, Germany (Oracle Platinum sponsor) 0 0 1 41 239 Oracle Corporation 1 1 279 14.0 96 Normal 0 false false false EN-US JA X-NONE /* Style Definitions */ table.MsoNormalTable {mso-style-name:"Table Normal"; mso-tstyle-rowband-size:0; mso-tstyle-colband-size:0; mso-style-noshow:yes; mso-style-priority:99; mso-style-parent:""; mso-padding-alt:0in 5.4pt 0in 5.4pt; mso-para-margin:0in; mso-para-margin-bottom:.0001pt; mso-pagination:widow-orphan; font-size:10.0pt; font-family:"Times New Roman";} Oracle Superior Solutions and Cost Savings with Oracle Linux and Oracle VM See Location Details and register Dec 4 Kansas City and Tampa Dec 6 Milwaukee and Miami Dec 11 Washington, DC Dec 13 Raleigh Visit our booth and you can grab an Oracle Linux/Oracle VM DVD Kit and talk to Oracle Linux experts.

    Read the article

  • Blogger Template: How is inline style tag getting attached to img? [migrated]

    - by john Smith
    Examining a blogger template's img tag (data:post.thumbnailUrl) i've approached a mystery. An inline style tag controlling the width, margin and heigh perimeters are getting added to my img element. They are auto adjusting the images ratio to fit a smaller size. But I can't figure-out where this style tag script lives and how it's happening in my template. My template has no special javascript or jquery scripts. The full size images in the single posts page don't have this style tag. Is this a css or xml feature? element.style { margin-top: 0px; width: 301.0033444816054px; height: 200px; margin-left: -0.5016722408026908px; }

    Read the article

  • WPF - Centering a checkbox in a GridViewColumn?

    - by Sonny Boy
    Hey all, I'm currently struggling on getting my checkboxes to property center within my GridViewColumns. I've defined a style for my checkboxes like so: <Style TargetType="{x:Type CheckBox}" x:Key="DataGridCheckBox"> <Setter Property="HorizontalAlignment" Value="Center" /> <Setter Property="HorizontalContentAlignment" Value="Center" /> <Setter Property="IsEnabled" Value="False" /> <Setter Property="Margin" Value="4" /> <Setter Property="VerticalAlignment" Value="Center" /> <Setter Property="VerticalContentAlignment" Value="Center" /> <Setter Property="Width" Value="{Binding RelativeSource={RelativeSource FindAncestor,AncestorType={x:Type GridViewColumn}},Path=ActualWidth}" /> </Style> And my checkboxes are added into the GridViewColumn using a DataTemplate like this: <GridViewColumn Header="Comment"> <GridViewColumn.CellTemplate> <DataTemplate> <CheckBox Style="{StaticResource DataGridCheckBox}" IsChecked="{Binding PropertyItem.Comment, Converter={StaticResource booleanConverter}, ConverterParameter='string'}"/> </DataTemplate> </GridViewColumn.CellTemplate> </GridViewColumn> But the problem I have is that the checkboxes remain left-aligned (even when resizing the column). Any ideas? Thanks in advance, Sonny

    Read the article

  • Arguments, local variables, and global variables in Python

    - by prosseek
    In python, there is no way to differentiate between arguments, local variables, and global variables. The easy way to do so might be have some coding convention such as Global variables start with _ and capital letter arguments end with with _ _Global variable = 10 def hello(x_, y_): z = x_ + y_ Is this a Pythonian way to go? I mean, is there well established/agreed coding-standards to differentiate them in python?

    Read the article

  • Need for prefixing a function with (void)...

    - by puffadder
    Hi All, I recently came across a rather unusual coding convention wherein the call for a function returning "void" is prefixed with (void). e.g. (void) MyFunction(); Is it any different from the function call like: MyFunction(); Has it got any advantage or is it yet another needless but there coding convention of some sort?

    Read the article

  • Why would var be a bad thing?

    - by Spoike
    I've been chatting with my colleagues the other day and heard that their coding standard explicitly forbids them to use the var keyword in C#. They had no idea why it was so and I've always found implicit declaration to be incredibly useful when coding. I've never had any problems finding out what type the variable was (you only hover over the variable in VS and you'll get the type that way). Does anyone know why it would be a bad idea to use the var keyword in C#?

    Read the article

  • Return statements for all functions

    - by emddudley
    How common is it for coding style guidelines to include a requirement that all functions include a return statement (including functions which return void)? To avoid being subjective or argumentative, I'd like answers which can name specific companies or open-source projects which have this requirement. If you haven't ever come across this coding style guideline, or you have a resource (book, online article) which discusses it, that would be useful as well. Thanks!

    Read the article

  • NPOI set cell style "HSSFFont.BOLDWEIGHT_BOLD" is not working

    - by vandana sharma
    I'm using NPOI to output excel from Asp.Net. I want to set bold and normal style to my cell but it is working for few cell and not for remaining cell.Please have look on following example: Dim hssfworkbook As New HSSFWorkbook() Dim sheetOne As HSSFSheet = hssfworkbook.CreateSheet("Sheet1") hssfworkbook.CreateSheet("Sheet2") hssfworkbook.CreateSheet("Sheet3") Dim cellStyle As HSSFCellStyle = hssfworkbook.CreateCellStyle cellStyle.Alignment = HSSFCellStyle.ALIGN_CENTER Dim font As HSSFFont = _hssfworkbook.CreateFont() font.Boldweight = HSSFFont.BOLDWEIGHT_BOLD cellStyle.SetFont(font) For i = 0 To 9 Step 1 'I want to add cell style to these cells If i Mod 2 = 0 Then Sheet1.CreateRow(i).CreateCell(1).SetCellValue(i) font.Boldweight = HSSFFont.BOLDWEIGHT_BOLD cellStyle.SetFont(font) Sheet1.GetRow(i).GetCell(1).CellStyle = cellStyle Else Sheet1.CreateRow(i).CreateCell(1).SetCellValue(i) font.Boldweight = HSSFFont.BOLDWEIGHT_NORMAL cellStyle.SetFont(font) Sheet1.GetRow(i).GetCell(1).CellStyle = cellStyle End If Next Actually code is working fine but i don't know the particular situation from where and why its stops working for remaining few rows. Its not working properly for all cells and from that particular cell the bold and normal property stops working on whole sheet like sheet2 and sheet3.

    Read the article

  • wpf toolkit (Feb 2010) datagrid with MVVM - style reveals name of view model on 'spare column'

    - by Andy Clarke
    Hi, I've just updated my app with the latest WPF toolkit and I've now got an issue with my styling. When I bind some data with, for example, two columns to the grid, the spare area at the right shows the name of the ViewModel in the header. I can understand why, because the data grids data context is the ViewModel and I'm defining my header style as follows ... <WpfToolkit:DataGridHeaderBorder <Border BorderBrush="Blue" BorderThickness="0,1,0,0"> <TextBlock Text="{Binding}" Margin="4,0,4,0" /> </Border> </WpfToolkit:DataGridHeaderBorder> Do I now need a separate style for the 'spare column' or something? Can anyone assist please? Cheers, Andy

    Read the article

  • Android: Make application background behave like homescreen background

    - by Mannaz
    Hi, I have a big background image for my views's background, which also can be tiled (it's repeadable). When switching from one Activity to another i want the background to behave like on the homescreen (the background moves only a bit, but the foreground moves one screen with). Is this possible and how? Here is my current background definition: Manifest.xml: <application android:icon="@drawable/icon" android:label="@string/app_name" android:theme="@style/MyAppStyle"> styles.xml: <style name="MyAppStyle" parent="@android:style/Theme.NoTitleBar"> <item name="android:windowBackground">@drawable/window_background_descriptor</item> window_background_descriptor.xml: <?xml version="1.0" encoding="utf-8"?> <bitmap xmlns:android="http://schemas.android.com/apk/res/android" android:src="@drawable/window_background" android:tileMode="repeat" />

    Read the article

  • NSDictionary with key => String and Value => c-Style array

    - by Gautam Borad
    I need an NSDictionary which has key in the form of string (@"key1", @"key2") and value in the form of a C-style two-dimentional array (valueArray1,valueArray2) where valueArray1 is defined as : int valueArray1[8][3] = { {25,10,65},{50,30,75},{60,45,80},{75,60,10}, {10,70,80},{90,30,80},{20,15,90},{20,20,15} }; And same for valueArray2. My aim is given an NSString i need to fetch the corresponding two-dimentional array. I guess using an NSArray, instead of c-style array, will work but then i cannot initialize the arrays as done above (i have many such arrays). If, however, that is doable please let me know how. Currently the following is giving a warning "Passing argument 1 of 'dictionaryWithObjectsAndKeys:' from incompatible pointer type" : NSDictionary *myDict = [NSDictionary dictionaryWithObjectsAndKeys:valueArray1,@"key1", valueArray2,@"key2",nil];

    Read the article

  • $('<style></style>').text('css').appendTo('head') does not work in IE?

    - by powerboy
    It works fine in Firefox and Chrome, but does not work in IE8. Here is the html structure: <!DOCTYPE html> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js"></script> <script type="text/javascript"> $(function() { // this does not work in the stupid IE $('<style type="text/css"></style>').text('body {margin: 0;}').appendTo('head'); }); </script> </head> <body> </body> </html> And what' s the alternative to do this in IE?

    Read the article

  • Using IDataErrorInfo and setting Validation.HasError style

    - by Gaurav
    In WPF using IDataErrorInfo and Style I want to create form where I can provide end user three different status while validating data To make the scenario more clear 1) I have textbox next to it I have icon which provides end user what kind of input textbox expects - Initial status with information icon 2) As soon as user enter data it validates it and decides whether it is valid or not - most of the time it will show cross (X) icon saying invalid data 3) As it is validating on UpdateSourceTrigger="PropertyChanged" it will turn cross icon to green check mark as soon as it gets validated i.e [ ] i (tooltip- Any valid user name ) [Ga ] X (tooltip- Invalid user name. Must be 5 char long) [Gaurav ] * (it will show only correct icon, meaning valid value) How can I achieve this using IDataErrorInfo and Style, I tried doing that but as soon as my form gets loaded it invalidates all the data and shows cross icon at the first time. I want to show different tooltip and different icon for three states (Initial info, Invalid data, Valid data)

    Read the article

  • GWT PagingScrollTable ( set a style on a particular cell of the header table )

    - by Mario
    I have a column Definition for each colume that extends AbstractColumnDefinition these columns are put in a DefaultTableDefinition PART OF a PagingScrollTable example: NAME | SIZE | RES | DELETE | this style (AT THE END OF THE PAGE ) is added to the column names if you notice all of them are with a cursor pointer , meaning a hand shows up when i hover above each one. I want to remove the cursor for some cells in the header like delete. HOW DO YOU set/add/remove a style on a particular cell of the header table of a PagingScrollTable? THANK YOU .gwt-ScrollTable .headerTable td { border-left: 1px solid #CCCCCC; border-right: 1px solid #CCCCCC; border-bottom: 1px solid black; vertical-align: bottom; cursor: pointer; }

    Read the article

< Previous Page | 41 42 43 44 45 46 47 48 49 50 51 52  | Next Page >