Search Results

Search found 3180 results on 128 pages for 'david sauter'.

Page 82/128 | < Previous Page | 78 79 80 81 82 83 84 85 86 87 88 89  | Next Page >

  • getting the "this" that a function's caller was called with in JavaScript

    - by David Morrissey
    Is it possible to get the this that a function's caller was called with in JavaScript without passing this to the arguments in a way which supports IE as well as Firefox/Chrome et al? For example: var ob = { callme: function() { doSomething() } } function doSomething() { alert(doSomething.caller.this === ob) // how can I make this work? } ob.callme() I'm starting to suspect it's not, but I thought I may as well ask as it'd make my code much shorter and easier to read. Thanks for any information!

    Read the article

  • Project management: Implementing custom errors in VS compilation process

    - by David Lively
    Like many architects, I've developed coding standards through years of experience to which I expect my developers to adhere. This is especially a problem with the crowd that believes that three or four years of experience makes you a senior-level developer.Approaching this as a training and code review issue has generated limited success. So, I was thinking that it would be great to be able to add custom compile-time errors to the build process to more strictly enforce this and other guidelines. For instance, we use stored procedures for ALL database access, which provides procedure-level security, db encapsulation (table structure is hidden from the app), and other benefits. (Note: I am not interested in starting a debate about this.) Some developers prefer inline SQL or parametrized queries, and that's fine - on their own time and own projects. I'd like a way to add a compilation check that finds, say, anything that looks like string sql = "insert into some_table (col1,col2) values (@col1, @col2);" and generates an error or, in certain circumstances, a warning, with a message like Inline SQL and parametrized queries are not permitted. Or, if they use the var keyword var x = new MyClass(); Variable definitions must be explicitly typed. Do Visual Studio and MSBuild provide a way to add this functionality? I'm thinking that I could use a regular expression to find unacceptable code and generate the correct error, but I'm not sure what, from a performance standpoint, is the best way to to integrate this into the build process. We could add a pre- or post-build step to run a custom EXE, but how can I return line- and file-specifc errors? Also, I'd like this to run after compilation of each file, rather than post-link. Is a regex the best way to perform this type of pattern matching, or should I go crazy and run the code through a C# parser, which would allow node-level validation via the parse tree? I'd appreciate suggestions and tales of prior experience.

    Read the article

  • Representing complex scheduled reoccurance in a database

    - by David Pfeffer
    I have the interesting problem of representing complex schedule data in a database. As a guideline, I need to be able to represent the entirety of what the iCalendar -- ics -- format can represent, but in a database. I'm not actually implementing anything relating to ics, but it gives a good scope of the type of rules I need to be able to model. I need to allow allow representation of a single event or a reoccurring event based on multiple times per day, days of the week, week of a month, month, year, or some combination of those. For example, the third Thursday in November annually, or the 25th of December annually, or every two weeks starting November 2 and continuing until September 8 the following year. I don't care about insertion efficiency but query efficiency is critical. The operation I will be doing most often is providing either a single date/time or a date/time range, and trying to determine if the defined schedule matches any part of the date/time range. Other operations can be slower. For example, given January 15, 2010 at 10:00 AM through January 15, 2010 at 11:00 AM, find all schedules that match at least part of that time. (i.e. a schedule that covers 10:30 - 11:00 still matches.) Any suggestions? I looked at http://stackoverflow.com/questions/1016170/how-would-one-represent-scheduled-events-in-an-rdbms but it doesn't cover the scope of the type of reoccurance rules I'd like to model.

    Read the article

  • What's A Good Real Time Html Editing Extension?

    - by David
    Hi, i always like to real-time edit a web page source in the browser and updated as i type, but firebug really sucks, i can't insert scripts in the current page, some times the changes i type aren't updated at all, Is there any robust firefox/chrome extension for that? i try to temporarely edit/add code to an existing web page in the internet, not a local one Thanks

    Read the article

  • Problem with LINQ in C#

    - by David Bonnici
    I am encountering a problem when using LINQ in C#, I am constantly getting "Specified cast is not valid". This is what I am trying to do. I create a class in which I declare all the columns of the table. [Table(Name="tbl_Aff")] public class Affiliate { [Column] public string name; [Column] public string firstname; [Column] public string surname; [Column] public string title; } I then declare a strongly typed DataContext in which I declare all Table collections as members of the context. public partial class Database : DataContext { public Table affiliate; public Database() : base(Settings.getConnectionString()) { } //This method gets the connection string by reading from an XML file. } public partial class Default : System.Web.UI.Page { protected void Page_Load(object sender, EventArgs e) { Database database = new Database(); try { var q = from a in database.affiliate select a; foreach (var aff in q) // Here I get the error "Specified cast is not valid" { lblMessage.InnerHtml += aff.name + ""; } } catch (Exception ex) { System.Console.WriteLine(ex.Message); } } }

    Read the article

  • WPF Application - Role Management Recommendations

    - by David Ward
    I have a WPF application with a WCF service layer and a SQL database. I now want to restrict elements of the application so that certain functions are only available to those users with a particular role. For example, you will only be able to navigate to the settings screen if you are an administrator. I would like a user to be a member of 1 or more authorisation groups and each authorisation group to have 1 or more roles associated. A long time ago I used AzMan (Authorisation Manager) to do a similar thing. Does anyone think that there are better approaches? Is AzMan "old news"? Alternatives? Thanks.

    Read the article

  • SQL 2005 w/ C# optimal "Paging"

    - by David Murdoch
    When creating a record "grid" with custom paging what is the best/optimal way to query the total number of records as well as the records start-end using C#? SQL to return paged record set: SELECT Some, Columns, Here FROM ( SELECT ROW_NUMBER() OVER (ORDER BY Column ASC) AS RowId, * FROM Records WHERE (...) ) AS tbl WHERE ((RowId > @Offset) AND (RowId <= (@Offset + @PageSize)) ) SQL to count total number of records: SELECT COUNT(*) FROM Records WHERE (...) Right now, I make two trips to the server: one for getting the records, and the other for counting the total number of records. What is/are the best way(s) to combine these queries to avoid multiple DB trips?

    Read the article

  • Writing SDK documentation, need useful beginner tutorials

    - by David Rutten
    I'm currently writing SDK documentation for one of our products, but for obvious reasons I don't want to talk about the essentials of OOP. Does anyone know any good online teaching material that explain (aimed at absolute beginners) concepts such as classes, inheritance, constructors, instances etc.? Preferably urls that are likely to survive for a couple of years to come... It's a DotNET SDK and we're including only VB and C# samples, so C++ or Delphi or Lisp material is not that useful.

    Read the article

  • Is my objective possible using WCF (and is it the right way to do things?)

    - by David
    I'm writing some software that modifies a Windows Server's configuration (things like MS-DNS, IIS, parts of the filesystem). My design has a server process that builds an in-memory object graph of the server configuration state and a client which requests this object graph. The server would then serialize the graph, send it to the client (presumably using WCF), the server then makes changes to this graph and sends it back to the server. The server receives the graph and proceeds to make modifications to the server. However I've learned that object-graph serialisation in WCF isn't as simple as I first thought. My objects have a hierarchy and many have parametrised-constructors and immutable properties/fields. There are also numerous collections, arrays, and dictionaries. My understanding of WCF serialisation is that it requires use of either the XmlSerializer or DataContractSerializer, but DCS places restrictions on the design of my object-graph (immutable data seems right-out, it also requires parameter-less constructors). I understand XmlSerializer lets me use my own classes provided they implement ISerializable and have the de-serializer constructor. That is fine by me. I spoke to a friend of mine about this, and he advocates going for a Data Transport Object-only route, where I'd have to maintain a separate DataContract object-graph for the transport of data and re-implement my server objects on the client. Another friend of mine said that because my service only has two operations ("GetServerConfiguration" and "PutServerConfiguration") it might be worthwhile just skipping WCF entirely and implementing my own server that uses Sockets. So my questions are: Has anyone faced a similar problem before and if so, are there better approaches? Is it wise to send an entire object graph to the client for processing? Should I instead break it down so that the client requests a part of the object graph as it needs it and sends only bits that have changed (thus reducing concurrency-related risks?)? If sending the object-graph down is the right way, is WCF the right tool? And if WCF is right, what's the best way to get WCF to serialise my object graph?

    Read the article

  • How to code a batch file to copy and rename the most recently dated file?

    - by david.murtagh.keltie.com
    I'm trying to code a batch file to copy only the most recently dated file in a given folder to another directory on the local machine, and simultaneously rename it as it does. I've found a very similar question here http://stackoverflow.com/questions/97371/batch-script-to-copy-newest-file and have managed to cobble together the below code from other forums too, but have hit a brick wall as it only results in the batch file itself being copied to the destination folder. It doesn't matter to me where the batch file itself sits in order for this to run. The source folder is C:! BATCH and the destination folder is C:\DROP The code is below, apologies if this is a glaringly obvious answer but it's literally the first foray into coding batch files for me... Thanks! @echo off setLocal EnableDelayedExpansion pushd C:\! BATCH for /f "tokens=* delims= " %%G in ('dir/b/od') do (set newest=%%G) copy "!newest!" C:\DROP\ PAUSE

    Read the article

  • How to validate a domain name using Regex & Php?

    - by David
    Hi, I want a solution to validate only domain names not full urls, The following example is what i'm looking for: domain.com -> true domain.net/org/biz... -> true domain.co.uk -> true sub.domain.com -> true domain.com/folder -> false domµ*$ain.com -> false Thank you

    Read the article

  • How to use boost normal distribution classes?

    - by David Alfonso
    Hi all, I'm trying to use boost::normal_distribution in order to generate a normal distribution with mean 0 and sigma 1. The following code uses boost normal classes. Am I using them correctly? #include <boost/random.hpp> #include <boost/random/normal_distribution.hpp> int main() { boost::mt19937 rng; // I don't seed it on purpouse (it's not relevant) boost::normal_distribution<> nd(0.0, 1.0); boost::variate_generator<boost::mt19937&, boost::normal_distribution<> > var_nor(rng, nd); int i = 0; for (; i < 10; ++i) { double d = var_nor(); std::cout << d << std::endl; } } The result on my machine is: 0.213436 -0.49558 1.57538 -1.0592 1.83927 1.88577 0.604675 -0.365983 -0.578264 -0.634376 As you can see all values are not between -1 and 1. Thank you all in advance!

    Read the article

  • asp.net: Where can I put my source files.

    - by David Sykes
    I am developing a web form using Visual Web Developer Currently I have class source files in the same directory as the web form, or in the App_Code folder. I'd like to organise the files into folders within the web form folder, but I can't find a way of adding a reference to the folders, and they don't seem to be being picked up automatically. These are files that are under constant development. What is the asp.net/c#'s equivalent concept to c++'s #include?

    Read the article

  • PHP Doesn't Display Errors or Warnings.

    - by David
    I don't know how php.ini was configured since I don't have access to it. But on top of my php code file I have error_reporting(E_ALL); ini_set('display_errors', '1'); But still, if there is an error, e.g. missing a ")", the page is blank. It is so painful to debug without error message. Why were the errors not shown?

    Read the article

  • Are there any reasons for why you would include JavaScript using document.writeln

    - by David Johnstone
    Are there any good reasons for why you would include JavaScript like this: <script type="text/javascript">document.writeln('<script src="http://example.com/javascript/MyJavaScript.js" type="text/javascript"><' + '/script>');</script> (Sorry for the long scrolling line. This is in the head of a HTML document.) I've been looking at some HTML recently and I've noticed this a few times (all on the one site). I can't think of any reasons why you would do it like this, but I can hardly claim to be a web developer. It's likely that these lines of code are automatically generated, but still, someone somewhere must have thought this was a good idea.

    Read the article

  • Differences between WPF Custom Control Library and plain Class Library?

    - by David Veeneman
    I posted a question a few months ago about sharing resource dictionaries across assemblies. It turns out you can do that using the Component Resource Key markup extension. At the time, I could only get it working with a WPF Custom Control project, not with a plain Class Library project. Now I need to use an existing plain Class Library project to host a shared resource dictionary. That means I need to retrofit the Class Library project to support the Component Resource Key markup extension. I have added a Themes folder and a Generic.xaml resource dictionary document to the Class Library project, as well as references to PresentationCore, PresentationFramework, and WindowsBase. Unfortunately, that doesn't seem to do the trick. So, here is my question: Other than the above, what does a WPF Custom Control Library project have that a plain Class Library project doesn't? Or, to put it another way, what else could I add to my class library project to get this feature working? Thanks.

    Read the article

  • Use string value to create new instance

    - by Brian David Berman
    I have a few classes: SomeClass1, SomeClass2. How can I create a new instance of one of these classes by using the class name from a string? Normally, I would do: var someClass1 = new SomeClass1(); How can I create this instance from the following: var className = "SomeClass1"; I am assuming I should use Type.GetType() or something but I can't figure it out. Thanks.

    Read the article

  • Why GLatLng() doesn't receive variables?

    - by David
    Hi, i have the following code to update a google map: function updateit(c1,c2){ alert(c1+"-"+c2); // This works map.setCenter(new GLatLng(c1, c2), 13); // But this doesn't } updateit(37.4419, -122.1419); The alert is working and show the two coordinations, but i think the GLatLng() doesn't receive them, so the map is not updated unless i directly declare them as strings : function updateit(c1,c2){ map.setCenter(new GLatLng(37.4419, -122.1419), 13); // This works } How to fix this problem? Thanks

    Read the article

  • multi-dimension array value sorting in php

    - by David
    Another potentially interesting (or n00b, whatever comes first) question. I am building up an array with a set of database fields with information about table, actual field name and descriptive field name as a multi-dimensional array. Here is what it currently looks like: $Fields['User']['ID'] = "User ID"; $Fields['User']['FirstName'] = "First Name"; $Fields['Stats']['FavouriteOrder'] = "Favourite Item Ordered"; $Fields['Geographic']['Location'] = "Current Location"; $Fields['Geographic']['LocationCode'] = "Current Location Code"; Okay, this is fine, but I am piping this into a system that allows exporting of selected fields, and in the end I want to foreach() through the different levels, extract the data and then ultimately have all the descriptive fields to be displayed sorted alphabetically using their descriptive name. So ultimately in the order: Current Location, Current Location Code, Favourite Item Ordered, First Name then User ID - obviously keeping index associations. I can't use usort() and I can't use array_multisort()... or maybe I can and I just don't know how. usort() seems to need a key to sort by, but I have variable keys. array_multisort() just seems to do the same as sort() really. Any ideas?

    Read the article

  • JavaScript "confirm" on SelectedIndexChange of RadioButtonList

    - by Brian David Berman
    I have a RadioButtonList control and I would like to do a Javascript "confirm" when a user tries to change the index. Currently AutoPostBack is set to TRUE. I can, of course, just call __doPostBack from within a javascript function, etc. I tried a few things with jQuery but you have to worry about mousedown vs. click and then there is always the fact that you can click the checkbox label to select it, etc. Anyone have a nice solution for this? To be clear, I am looking for a way to prompt the user with a confirm box prior to their selection being made and triggering a postback.

    Read the article

  • How can I have MySQL write outfiles as a different user?

    - by David Locke
    I'm working with a MySQL query that writes into an outfile. I run this query once every day or two and so I want to be able to remove the outfile without having to resort to su or sudo. The only way I can think of making that happen is to have the outfile written as owned by someone other than the mysql user. Is this possible? Edit: I am not redirecting output to a file, I am using the INTO OUTFILE part of a select query to output to a file. If it helps: mysql --version mysql Ver 14.12 Distrib 5.0.32, for pc-linux-gnu (x86_64) using readline 5.2

    Read the article

  • Errors caught by WBT, but not BBT and vice versa

    - by David Relihan
    Hi Folks, Can you think of one type of error that might be found using White-Box testing, and one type using Black-Box testing. i.e. an error that would be found by one and not the other. For WBT there would null else statements, but what would you catch with BBT and not WBT??? BTW this question is just based on my own personal study - I'm not getting free marks out of this!!!! Thanks,

    Read the article

  • How to organize Enterprise scale Composite Applications (CAG)

    - by David
    All QuickStarts and RI examples in the CAG documentation are good but I lack the more Enterprise scale examples. Let's say we have 40+ modules, each containing a Proxy,Facade,PresentationModel,Model and Views. Each module also makes calls to a Module-specific WCF service which is to be hosted in IIS or in a stand-alone console host. Our approach have been to include the UI-module, service-module and related tests into one solution so they can be developed and tested separately from other modules. My problem is how the hosting of the services should be done when the services are in separate modules and how to actually run the separate module together with the rest of the application-modules when I press F5. Is there a best practise for this? I guess it has been done before?

    Read the article

  • Get table row based on radio button using prototype/javascript

    - by David Buckley
    I have an html table that has a name and a radio button like so: <table id="cars"> <thead> <tr> <th>Car Name</th> <th></th> </tr> </thead> <tbody> <tr> <td class="car">Ford Focus</td> <td><input type="radio" id="selectedCar" name="selectedCar" value="8398"></td> </tr> <tr> <td class="car">Lincoln Navigator</td> <td><input type="radio" id="selectedCar" name="selectedCar" value="2994"></td> </tr> </tbody> </table> <input type="button" value="Select Car" onclick="selectCar()"></input> I want to be able to select a radio button, then click another button and get the value of the radio button (which is a unique ID) as well as the car name text (like Ford Focus). How should I code the selectCar method? I've tried a few things like: val1 = $('tr input[name=selectedCar]:checked').parent().find('#cars').html(); val1 = $("td input[name='selectedCar']:checked").parents().find('.cars').html(); val1 = $('selectedCar').checked; but I can't get the proper values. I'm using prototype, but the solution can be plain javascript as well.

    Read the article

< Previous Page | 78 79 80 81 82 83 84 85 86 87 88 89  | Next Page >