Search Results

Search found 343 results on 14 pages for 'sheldon ross'.

Page 12/14 | < Previous Page | 8 9 10 11 12 13 14  | Next Page >

  • IEnumerator: Is it normal to have an empty Dispose method?

    - by C. Ross
    I'm writing an IEnumerator<T> class to iterate over a COM collection I'm wrappering. I've noticed that IEnumerator<T> extends IDisposable, so I'm required to implement the Dispose method. However, I can't think of anything I would put there, as I only have a reference to the collection (which I wouldn't want being disposed at the end of a foreach), and an int for the index. Is it normal to leave the Dispose method empty?

    Read the article

  • Create a string with n characters.

    - by C. Ross
    Is there a way in java to create a string with a specified number of a specified character? In my case I would need to create a string with 10 spaces. My current code is: StringBuffer outputBuffer = new StringBuffer(length); for (int i = 0; i < length; i++){ outputBuffer.append(" "); } return outputBuffer.toString(); Is there a better way to accomplish the same thing. In particular I'd like something that is fast (in terms of execution).

    Read the article

  • Property trigger in XAML for IsMouseOver fails to set Border.Background

    - by Mal Ross
    I'm currently trying to create a ControlTemplate for the Button class in WPF, replacing the usual visual tree with something that makes the button look similar to the little (X) close icon on Google Chrome's tabs. I decided to use a Path object in XAML to achieve the effect. Using a property trigger, the control responds to a change in the IsMouseOver property by setting the icon's red background. Here's the XAML from a test app: <Window x:Class="Widgets.Window1" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" Title="Window1" Height="300" Width="300"> <Window.Resources> <Style x:Key="borderStyle" TargetType="Border"> <Style.Triggers> <Trigger Property="IsMouseOver" Value="True"> <Setter Property="Background"> <Setter.Value> <SolidColorBrush Color="#CC0000"/> </Setter.Value> </Setter> </Trigger> </Style.Triggers> </Style> <ControlTemplate x:Key="closeButtonTemplate" TargetType="Button"> <Border Width="12" Height="12" CornerRadius="6" BorderBrush="#AAAAAA" Background="Transparent" Style="{StaticResource borderStyle}" ToolTip="Close"> <Viewbox Margin="2.75"> <Path Data="M 0,0 L 10,10 M 0,10 L 10,0" Stroke="{Binding BorderBrush, RelativeSource={RelativeSource FindAncestor, AncestorType=Border, AncestorLevel=1}}" StrokeThickness="1.8"/> </Viewbox> </Border> </ControlTemplate> </Window.Resources> <Grid Background="White"> <Button Template="{StaticResource closeButtonTemplate}"/> </Grid> </Window> Note that the circular background is always there - it's just transparent when the mouse isn't over it. The problem with this is that the trigger just isn't working. Nothing changes in the button's appearance. However, if I remove the Background="Transparent" value from the Border object in the ControlTemplate, the trigger does work (albeit only when over the 'X'). I really can't explain this. Setters for any other properties placed in the borderStyle resource work fine, but the Background setter fails as soon as the default background is specified in the ControlTemplate. Any ideas why it's happening and how I can fix it? I know I could easily replace this code with, for example, a .PNG-based image, but I want to understand why the current implementation isn't working. Thanks! :)

    Read the article

  • Marking "example usage" in code documentation

    - by Ross
    What the best practice of placing example usage in code documentation? Is there a standardised way? With an @usage or @notes? For example: /** * My Function * @param object id anObject * @usage a code example here... */ function foo(id) { } or /** * My Function * @param object id anObject * @notes a code example here, maybe? */ function foo(id) { } I know this question should dependent on the documentation generator, but any heads up appreciated... I'm trying to get into the habit of using proper style. When time allow I'll get more into the generators. (I've experimented with Doxygen.) I often use AS3, JS, Obj-C, C++. Thanks

    Read the article

  • scaling background and min size

    - by ross Hulford
    Hi I have big background images 1200 by 1200, what i would like to do is expand the images when the user resizes the browser but constrain it so they never scale any smaller than the original size. There all lots of scalable bg images out there but none I can find that do this, any help would be appreciated.

    Read the article

  • iPhone: Going from transformed layers to jpeg

    - by Devin Ross
    I have a bunch of images that are transformed (using touch gestures). I want to take the transformations the user does to the images and create a jpeg from it. (ie. if a user rotates a photo to the right, I want to get a jpeg of the photo rotate to the right just as the looks on screen). This takes into account that the photo could be bigger than whats displayed on screen too (no screenshots). I'm trying to use CGContext (CGContextRotateCTM specifically) but its not been too successful. Thanks for the help.

    Read the article

  • Is there a faster way to access a property member of a class using reflection?

    - by Ross Goddard
    I am currently using the following code to access the property of an object using reflection: Dim propInfo As Reflection.PropertyInfo = myType.GetProperty(propName) Dim objValue As Object = propInfo.GetValue(myObject, Nothing) I am having some issues with the speed since this type of code is being called many times and is causing some slowdown. I have been looking into using Refelction.Emit or dynamic methods, but I am not sure exactly how to make use of them. Background Information: I am creating a list of a subset of the properties of the object, associating then with some meta information (such as if they can be loaded from the database or xml, if they are editable, can the user see them). This is for later consumption so we can write code such as : foreach prop as BaseWrapper in graphNode.NodeProperties prop.LoadFromDataRow(dr) next The application makes heavy use of having access to this list. The problem is that on the initial load of a project, a larger number of objects are being created that make use of this, so for each object created it is looping through this code a number of times. I initially tried adding each property to the list manually, but this ran into problems with not everything being initialized at the correct time and some other issues. If there is no other good way, then I may have to rethink some of the design and see what else can be done to improve the performance.

    Read the article

  • How to gather arbitrary length list data in ASP.NET MVC.

    - by C. Ross
    I need to gather a list of items associated with another item from my user in a ASP.NET MVC project. I would like to have a controller action like bellow. [AcceptVerbs(HttpVerbs.Post)] public ActionResult Create(int x, int y, IEnumerable<int> zKeys) { //Do stuff here } How can I setup my form to pass data in this way? If data of this particular form can't be provided, what's the next best way to pass this type of information in ASP.NET MVC?

    Read the article

  • Unable to `submit()` an html form after intercepting the submit with javascript.

    - by Ross Rogers
    I'm trying to intercept the submission of a form in order to change the value of my keywords label. I have the following code: <HTML> <FORM name="searchForm" method="get" action="tmp.html" > <input type="label" name="keywords" /> <input type="button" name="submit" value="submit" onclick="formIntercept();"/> </FORM> <SCRIPT language="JavaScript"> document.searchForm.keywords.focus(); function formIntercept( ) { var f = document.forms['searchForm']; f.keywords.value = 'boo'; f.submit(); }; </SCRIPT> </HTML> When I run this in chrome and click the submit button the keywords label changes to boo, but the javascript console says: Uncaught TypeError: Property 'submit' of object <#an HtmlFormElement> is not a function. How can I submit the form with the manipulated keywords?

    Read the article

  • Tool for sql refactoring?

    - by C. Ross
    Is there a refactoring tool available for SQL (TSQL in particular). Is there any tool that can do automatic simplification of SQL? I have a set of views where only the top two are used, and I'd like to refactor this into only two views, hence 10+ queries into two queries.

    Read the article

  • New records added to DataGridView aren't displayed

    - by Ross
    I have a custom Order class, groups of which are stored in List<Order> and a DataGridView. I think the problem is in my implementation so here's how I'm using it: In the form enclosing DataGridView (as OrdersDataGrid): public partial class MainForm : Form { public static List<Order> Orders; public MainForm() { // code to populate Orders with values, otherwise sets Orders to new List<Order>(); OrdersDataGrid.DataSource = Orders; } Then in another form that adds an Order: // Save event public void Save(object sender, EventArgs e) { Order order = BuildOrder(); // method that constructs an order object from form data MainForm.Orders.Add(order); } From what I can tell from the console this is added successfully. I thought the DataGrid would be updated automatically after this since Orders has changed - is there something I'm missing? The DataGrid accepts the class since it generates columns from the members.

    Read the article

  • Pushing to an array not working as expected

    - by Ross Attrill
    When I execute the code below, my array 'tasks' ends up with the same last row from the dbi call repeated for each row in the database. require 'dbi' require 'PP' dbh = DBI.connect('DBI:ODBC:Driver={SQL Server Native Client 10.0};Server=localhost,1433;Database=db;Uid=db;Pwd=mypass', 'db', 'mypass') sth = dbh.prepare('select * from TASK') sth.execute tasks = Array.new while row=sth.fetch do p row tasks.push(row) end pp(tasks) sth.finish So if I have two rows in my TASK table, then instead of getting this in the tasks array: [[1, "Task 1"], [2, "Task 2"]] I get this [[2, "Task 2"], [2, "Task 2"]] What am I doing wrong?

    Read the article

  • many-to-many relationship in CI (not using ORM)

    - by Ross
    I'm implementing a categories system in my CI app and trying to work out the best way of working with many to many relationships. I'm not using an ORM at this stage, but could use say Doctrine if necessary. Each entry may have multiple categories. I have three tables (simplified) Entries: entryID, entryName Categories: categoryID, categoryname Entry_Category: entryID, categoryID my CI code returns a record set like this: entryID, entryName, categoryID, categoryName but, as expected with Many-to-Many relationships, each "entry" is repeated for each "category". What would the best way to "group" the categories so that when I output the results, I am left with something like: Entry Name Appears in Category: Foo, Bar rather than: Entry Name Appears in Category: Foo Entry Name Appears in Category: Bar I believe the option is to track if the post ID matches a previous entry, and if so, store the respective category, and output it as one, rather than several, but am unsure of how to do this in CI. thanks for any pointers (I appreciate this is may be a vague/complex question without a better knowledge of the system).

    Read the article

  • Data Conversion in SQL Server

    Most of the time, you do not have to worry about implicit conversion in SQL expressions, or when assigning a value to a column. Just occasionally, though, you'll find that data gets truncated, queries run slowly, or comparisons just seem plain wrong. Robert Sheldon explains why you sometimes need to be very careful if you mix data types when manipulating values. Free trial of SQL Backup™“SQL Backup was able to cut down my backup time significantly AND achieved a 90% compression at the same time!” Joe Cheng. Download a free trial now.

    Read the article

  • Report Builder 3.0: Adding Matrices to Your Reports

    It is easy to create a basic matrix in Report Builder. However, it takes some practice in order to format and dispay the matrix exactly how you want it. There are a large number of options available to enhance the matrix and Robert Sheldon provides enough information to get you the point where you can experiment easily. Make working with SQL a breezeSQL Prompt 5.3 is the effortless way to write, edit, and explore SQL. It's packed with features such as code completion, script summaries, and SQL reformatting, that make working with SQL a breeze. Try it now.

    Read the article

  • SQL Server SQLCMD Basics

    Sqlcmd makes many SQL Server tasks, such as automating test runs and maintenance tasks, easier and quicker. The sqlcmd command-line utility is valuable to any database developer or DBA as the prime means of executing batches of SQL Statements to SQL servers, and saving results to file. Rob Sheldon gives you the basic facts about this great utility. Get your SQL Server database under version control now!Version control is standard for applications, but databases haven’t caught up. So how can you bring database development up to speed? Why should you start? Find out…

    Read the article

  • Getting Started with the SSAS Tabular Model

    SSAS Tabular models are in-memory databases that model data with relational constructs such as tables and relationships, in order to provide a rapid and powerful way of providing self-service BI to client applications such as Microsoft Excel and Microsoft Power View. You’ve deployed SSAS in tabular mode, and deployed Adventureworks into it. What next? Rob Sheldon explains all. 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

  • mtl, transformers, monads-fd, monadLib, and the paradox of choice

    - by yairchu
    Hackage has several packages for monad transformers: mtl: Monad transformer library transformers: Concrete functor and monad transformers monads-fd: Monad classes, using functional dependencies monads-tf: Monad classes, using type families monadLib: A collection of monad transformers. mtl-tf: Monad transformer library using type families mmtl: Modular Monad transformer library mtlx: Monad transformer library with type indexes, providing 'free' copies. compose-trans: Composable monad transformers (and maybe I missed some) Which one shall we use? mtl is the one in the Haskell Platform, but I keep hearing on reddit that it's uncool. But what's bad about choice anyway, isn't it just a good thing? Well, I saw how for example the authors of data-accessor had to make all these to cater to just the popular choices: data-accessor-monadLib library: Accessor functions for monadLib's monads data-accessor-monads-fd library: Use Accessor to access state in monads-fd State monad class data-accessor-monads-tf library: Use Accessor to access state in monads-tf State monad type family data-accessor-mtl library: Use Accessor to access state in mtl State monad class data-accessor-transformers library: Use Accessor to access state in transformers State monad I imagine that if this goes on and for example several competing Arrow packages evolve, we might see something like: spoonklink-arrows-transformers, spoonklink-arrows-monadLib, spoonklink-tfArrows-transformers, spoonklink-tfArrows-monadLib, ... And then I worry that if spoonklink gets forked, Hackage will run out of disk space. :) Questions: Why are there so many monad transformer packages? Why is mtl [considered] uncool? What are the key differences? Most of these seemingly competing packages were written by Andy Gill and are maintained by Ross Paterson. Does this mean that these packages are not competing but rather work together in some way? And do Andy and Ross consider any of their own packages as obsolete? Which one should me and you use?

    Read the article

  • Python DictReader - Skipping rows with missing columns?

    - by victorhooi
    heya, I have a Excel .CSV file I'm attempting to read in with DictReader. All seems to be well, except it seems to omit rows, specifically those with missing columns. Our input looks like: mail,givenName,sn,lorem,ipsum,dolor,telephoneNumber [email protected],ian,bay,3424,8403,2535,+65(2)34523534545 [email protected],mike,gibson,3424,8403,2535,+65(2)34523534545 ross[email protected],ross,martin,,,,+65(2)34523534545 [email protected],david,connor,,,,+65(2)34523534545 [email protected],chris,call,3424,8403,2535,+65(2)34523534545 So some of the rows have missing lorem/ipsum/dolor columns, and it's just a string of commas for those. We're reading it in with: def read_gd_dump(input_file="blah 20100423.csv"): gd_extract = csv.DictReader(open('blah 20100423.csv'), restval='missing', dialect='excel') return dict([(row['something'], row) for row in gd_extract]) And I checked that "something" (the key for our dict) isn't one of the missing columns, I had originally suspected it might be that. It's one of the columns after that. However, DictReader seems to completely skip over the rows. I tried setting restval to something, didn't seem to make any difference. I can't seem to find anything in Python's CSV docs (http://docs.python.org/library/csv.html) that would explain this behaviour, but I may have misread something. Any ideas? Thanks, Victor

    Read the article

< Previous Page | 8 9 10 11 12 13 14  | Next Page >