Search Results

Search found 344 results on 14 pages for 'sarah boyd'.

Page 6/14 | < Previous Page | 2 3 4 5 6 7 8 9 10 11 12 13  | Next Page >

  • Fix common library functions, or abandon then?

    - by Ian Boyd
    Imagine i have a function with a bug in it: Boolean MakeLocation(String City, String State) { //Given "Springfield", "MO" //return "Springfield, MO" return City+", "+State; } So the call: MakeLocation("Springfield", "MO"); would return "Springfield, MO" Now there's a slight problem, what if the user called: MakeLocation("Springfield, MO", "OH"); The called it wrong, obviously. But the function would return "Springfield, MO, OH". The system was functioning like this for many years, until i noticed the function being used wrong, and i corrected it. And i also updated the original function to catch such an obvious mistake - in case it's happening elsewhere: Boolean MakeLocation(String City, String State) { //Given "Springfield", "MO" //return "Springfield, MO" if (City.Contains, ",") throw new EMakeLocationException("City name contains a comma. You probably didn't mean that"); return City+", "+State; } And testing showed the problem fixed. Except we missed an edge case, and the customer found it. So now the moral dillema. Do you ever add new sanity checks, safety checks, assertions to exising code? Or do you call the old function abandoned, and have a new one: Boolean MakeLocation(String City, String State) { //Given "Springfield", "MO" //return "Springfield, MO" return City+", "+State; } Boolean MakeLocation2(String City, String State) { //Given "Springfield", "MO" //return "Springfield, MO" if (City.Contains, ",") throw new EMakeLocationException("City name contains a comma. You probably didn't mean that"); return City+", "+State; } The same can apply for anything: Question FetchQuestion(Int id) { if (id == 0) throw new EFetchQuestionException("No question ID specified"); ... } Do you risk breaking existing code, at the expense of existing code being wrong?

    Read the article

  • SQL Profiler: Read/Write units

    - by Ian Boyd
    i've picked a query out of SQL Server Profiler that says it took 1,497 reads: EventClass: SQL:BatchCompleted TextData: SELECT Transactions.... CPU: 406 Reads: 1497 Writes: 0 Duration: 406 So i've taken this query into Query Analyzer, so i may try to reduce the number of reads. But when i turn on SET STATISTICS IO ON to see the IO activity for the query, i get nowhere close to one thousand reads: Table Scan Count Logical Reads =================== ========== ============= FintracTransactions 4 20 LCDs 2 4 LCTs 2 4 FintracTransacti... 0 0 Users 1 2 MALs 0 0 Patrons 0 0 Shifts 1 2 Cages 1 1 Windows 1 3 Logins 1 3 Sessions 1 6 Transactions 1 7 Which if i do my math right, there is a total of 51 reads; not 1,497. So i assume Reads in SQL Profiler is an arbitrary metric. Does anyone know the conversion of SQL Server Profiler Reads to IO Reads? See also SQL Profiler CPU / duration unit Query Analyzer VS. Query Profiler Reads, Writes, and Duration Discrepencies

    Read the article

  • Color Theory: How to convert Munsell HVC to RGB/HSB/HSL

    - by Ian Boyd
    I'm looking at at document that describes the standard colors used in dentistry to describe the color of a tooth. They quote hue, value, chroma values, and indicate they are from the 1905 Munsell description of color: The system of colour notation developed by A. H. Munsell in 1905 identifies colour in terms of three attributes: HUE, VALUE (Brightness) and CHROMA (saturation) [15] HUE (H): Munsell defined hue as the quality by which we distinguish one colour from another. He selected five principle colours: red, yellow, green, blue, and purple; and five intermediate colours: yellow-red, green-yellow, blue-green, purple-blue, and red-purple. These were placed around a colour circle at equal points and the colours in between these points are a mixture of the two, in favour of the nearer point/colour (see Fig 1.). VALUE (V): This notation indicates the lightness or darkness of a colour in relation to a neutral grey scale, which extends from absolute black (value symbol 0) to absolute white (value symbol 10). This is essentially how ‘bright’ the colour is. CHROMA (C): This indicates the degree of divergence of a given hue from a neutral grey of the same value. The scale of chroma extends from 0 for a neutral grey to 10, 12, 14 or farther, depending upon the strength (saturation) of the sample to be evaluated. There are various systems for categorising colour, the Vita system is most commonly used in Dentistry. This uses the letters A, B, C and D to notate the hue (colour) of the tooth. The chroma and value are both indicated by a value from 1 to 4. A1 being lighter than A4, but A4 being more saturated than A1. If placed in order of value, i.e. brightness, the order from brightest to darkest would be: A1, B1, B2, A2, A3, D2, C1, B3, D3, D4, A3.5, B4, C2, A4, C3, C4 The exact values of Hue, Value and Chroma for each of the shades is shown below (16) So my question is, can anyone convert Munsell HVC into RGB, HSB or HSL? Hue Value (Brightness) Chroma(Saturation) === ================== ================== 4.5 7.80 1.7 2.4 7.45 2.6 1.3 7.40 2.9 1.6 7.05 3.2 1.6 6.70 3.1 5.1 7.75 1.6 4.3 7.50 2.2 2.3 7.25 3.2 2.4 7.00 3.2 4.3 7.30 1.6 2.8 6.90 2.3 2.6 6.70 2.3 1.6 6.30 2.9 3.0 7.35 1.8 1.8 7.10 2.3 3.7 7.05 2.4 They say that Value(Brightness) varies from 0..10, which is fine. So i take 7.05 to mean 70.5%. But what is Hue measured in? i'm used to hue being measured in degrees (0..360). But the values i see would all be red - when they should be more yellow, or brown. Finally, it says that Choma/Saturation can range from 0..10 ...or even higher - which makes it sound like an arbitrary scale. So can anyone convert Munsell HVC to HSB or HSL, or better yet, RGB?

    Read the article

  • WPF: How to specify units in Dialog Units?

    - by Ian Boyd
    i'm trying to figure out how to layout a simple dialog in WPF using the proper dialog units (DLUs). i spent about two hours dimensioning this sample dialog box from Windows Vista with the various dlu measurements. Can someone please give the corresponding XAML markup that generates this dialog box? (Image Link) Now admittedly i know almost nothing about WPF XAML. Every time i start, i get stymied because i cannot figure out how to place any control. It seems that everything in WPF must be contained on a panel of some kind. There's StackPanels, FlowPanels, DockPanel, Grid, etc. If you don't have one of these then it won't compile. The only XAML i've been able to come up with (uing XAMLPad) so far: <DockPanel xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"> <Image Width="23" /> <Label>Are you sure you want to move this file to the Recycle Bin?</Label> <Image Width="60" /> <Label>117__6.jpg</Label> <Label>Type: ACDSee JPG Image</Label> <Label>Rating: Unrated</Label> <Label>Dimensions: 1072 × 712</Label> <Button Content="Yes" Width="50" Height="14"/> <Button Content="Cancel" Width="50" Height="14"/> </DockPanel> Which renders as a gaudy monstrosity. None of the controls are placed or sized right. i cannot figure out how to position controls in a window, nor size them properly. Can someone turn that screenshot into XAML? Note: You're not allowed to measure the screenshot. All the Dialog Unit (dlu) widths and heights are specified. Note: 1 horizontal DLU != 1 vertical DLU. Horizontal and vertical DLUs are different sizes. Links Microsoft User Experience Guidelines: Recommended sizing and spacing Microsoft User Experience Guidelines: Layout Metrics Bump: 2011/05/14 (15 months later)

    Read the article

  • How to show validation messages in MVC?

    - by Ian Boyd
    When a user tries to click:        Save and they have entered in some invalid data, i want to notify them. This can be with methods such as: directing their attention to the thing that needs their attention with a balloon hint automatically dropping down a combo-box triggering an animation showing a modal dialog box etc What is the mechanism where a controller tells the view to show a validation message for some controls, given that different views have different notification methods? p.s. the controller doesn't know the order that controls are physically arranged in the view (e.g. LTR locale wants to notify the user in a top-down-left-to-right visual order, while RTL locale wants to notify the user in a bottom-up-right-to-left order)

    Read the article

  • How do I get the member to which my custom attribute was applied?

    - by Sarah Vessels
    I'm creating a custom attribute in C# and I want to do different things based on whether the attribute is applied to a method versus a property. At first I was going to do new StackTrace().GetFrame(1).GetMethod() in my custom attribute constructor to see what method called the attribute constructor, but now I'm unsure what that will give me. What if the attribute was applied to a property? Would GetMethod() return a MethodBase instance for that property? Is there a different way of getting the member to which an attribute was applied in C#? [AttributeUsage(AttributeTargets.Method | AttributeTargets.Property, AllowMultiple = true)] public class MyCustomAttribute : Attribute Update: okay, I might have been asking the wrong question. From within a custom attribute class, how do I get the member (or the class containing the member) to which my custom attribute was applied? Aaronaught suggested against walking up the stack to find the class member to which my attribute was applied, but how else would I get this information from within the constructor of my attribute?

    Read the article

  • DUnit: How to run tests?

    - by Ian Boyd
    How do i run TestCase's from the IDE? i created a new project, with a single, simple, form: unit Unit1; interface uses Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs, StdCtrls; type TForm1 = class(TForm) private public end; var Form1: TForm1; implementation {$R *.DFM} end. Now i'll add a test case to check that pushing Button1 does what it should: unit Unit1; interface uses Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs, StdCtrls; type TForm1 = class(TForm) Button1: TButton; procedure Button1Click(Sender: TObject); private public end; var Form1: TForm1; implementation {$R *.DFM} uses TestFramework; type TForm1Tests = class(TTestCase) private f: TForm1; protected procedure SetUp; override; procedure TearDown; override; published procedure TestButton1Click; end; procedure TForm1.Button1Click(Sender: TObject); begin //todo end; { TForm1Tests } procedure TForm1Tests.SetUp; begin inherited; f := TForm1.Create(nil); end; procedure TForm1Tests.TearDown; begin f.Free; inherited; end; procedure TForm1Tests.TestButton1Click; begin f.Button1Click(nil); Self.CheckEqualsString('Hello, world!', f.Caption); end; end. Given what i've done (test code in the GUI project), how do i now trigger a run of the tests? If i push F9 then the form simply appears: Ideally there would be a button, or menu option, in the IDE saying Run DUnit Tests: Am i living in a dream-world? A fantasy land, living in a gumdrop house on lollipop lane?

    Read the article

  • I18N: Does Time always come after Date?

    - by Ian Boyd
    Does the time always come after the date, with a space in between, in every culture on earth? i see that Microsoft FCL assumes that it does: public string get_FullDateTimePattern() { if (this.fullDateTimePattern == null) { this.fullDateTimePattern = this.LongDatePattern + " " + this.LongTimePattern; } return this.fullDateTimePattern; } Is this an assumption i can make in every development language for every culture?

    Read the article

  • WinQual: Why would WER not accept code-signing certificates?

    - by Ian Boyd
    In 2005 i tried to establish a WinQual account with Microsoft, so i could pick up our (if any) crash dump files submitted automatically through Windows Error Reporting (WER). i was not allowed to have my crash dumps, because i don't have a Verisign certificate. Instead i have a cheaper one, generated by a Verisign subsidiary: Thawte. The method in which you join is: you digitally sign a sample exe they provide. This proves that you are the same signer that signed apps that they got crash dumps from in the wild. Cryptographically, the private key is needed to generate a digital signature on an executable. Only the holder of that private key can create a signature with for the matching public key. It doesn't matter who generated that private key. That includes certificates that are generated from: self-signing Wells Fargo DigiCert SecureTrust Trustware QuoVadis GoDaddy Entrust Cybertrust GeoTrust GlobalSign Comodo Thawte Verisign Yet Microsof's WinQual only accepts digital certificates generated by Verisign. Not even Verisign's subsidiaries are good enough (Thawte). Can anyone think of any technical, legal or ethical reason why Microsoft doesn't want to accept code-signing certificates? The WinQual site says: Why Is a Digital Certificate Required for Winqual Membership? A digital certificate helps protect your company from individuals who seek to impersonate members of your staff or who would otherwise commit acts of fraud against your company. Using a digital certificate enables proof of an identity for a user or an organization. Is somehow a Thawte digital certificate not secure? Two years later, i sent a reminder notice to WinQual that i've been waiting to be able to get at my crash dumps. The response from WinQual team was: Hello, Thanks for the reminder. We have notified the appropriate people that this is still a request. In 2008 i asked this question in a Microsoft support forum, and the response was: We are only setup to accept VeriSign Certificates at this point. We have not had an overwhelming demand to support other types of certificates. What can it possibly mean to not be "setup" to accept other kinds of certificates? If the thumbprint of the key that signed the WinQual.exe test app is the same as the thumbprint that signed the executable who's crash dump you got in the wild: it is proven - they are my crash dumps, give them to me. And it's not like there's a special API to check if a Verisign digital signature is valid, as opposed to all other digital signatures. A valid signature is valid no matter who generated the key. Microsoft is free to not trust the signer, but that's not the same as identity. So that is my question, can anyone think of any practical reason why WinQual isn't setup to support digital signatures? One person theorized that the answer is that they're just lazy: Not that I know but I would assume that the team running the winQual system is a live team and not a dev team - as in, personality and skillset geared towards maintenance of existing systems. I could be wrong though. They don't want to do work to change it. But can anyone think of anything that would need to be changed? It's the same logic no matter what generated the key: "does the thumbprint match". What am i missing?

    Read the article

  • Where to ask practical unit-testing questions?

    - by Ian Boyd
    Before i can understand unit testing, i have to see real world examples. Every book, blog, article, or answer i've seen gives hypothetical examples that don't apply to the/my real world. i really don't want to flood StackOverflow with hundreds of questions all titled "How do i unit-test this?" There must be another place i can go to ask for real solutions. Where can i go to get practical answers to unit-testing questions? Note: i would give an example question, but then people would get grumpy when i asked the 200 follow-up questions.

    Read the article

  • Composite key syntax in Boost MultiIndex

    - by Sarah
    Even after studying the examples, I'm having trouble figuring out how to extract ranges using a composite key on a MultiIndex container. typedef multi_index_container< boost::shared_ptr< Host >, indexed_by< hashed_unique< const_mem_fun<Host,int,&Host::getID> >, // ID index ordered_non_unique< const_mem_fun<Host,int,&Host::getAgeInY> >, // Age index ordered_non_unique< const_mem_fun<Host,int,&Host::getHousehold> >, // Household index ordered_non_unique< // Age & eligibility status index composite_key< Host, const_mem_fun<Host,int,&Host::getAgeInY>, const_mem_fun<Host,bool,&Host::isPaired> > > > // end indexed_by > HostContainer; My goal is to get an iterator pointing to the first of the subset of elements in HostContainer hmap that has age partnerAge and returns false to Host::isPaired(): std::pair< hmap::iterator,hmap::iterator > pit = hmap.equal_range(boost::make_tuple( partnerAge, false ) ); I think this is very wrong. How/Where do I specify the iterator index (which should be 3 for age & eligibility)? I will include other composite keys in the future. What exactly are the two iterators in std::pair? (I'm copying syntax from an example that I don't understand.) I would ideally use std::count to calculate the number of elements of age partnerAge that are eligible (return false to Host::isPaired()). What is the syntax for extracting the sorted index that meets these requirements? I'm obviously still learning C++ syntax. Thanks in advance for any help.

    Read the article

  • Delphi: Alternative to using Assign/ReadLn for text file reading

    - by Ian Boyd
    i want to process a text file line by line. In the olden days i loaded the file into a StringList: slFile := TStringList.Create(); slFile.LoadFromFile(filename); for i := 0 to slFile.Count-1 do begin oneLine := slFile.Strings[i]; //process the line end; Problem with that is once the file gets to be a few hundred megabytes, i have to allocate a huge chunk of memory; when really i only need enough memory to hold one line at a time. (Plus, you can't really indicate progress when you the system is locked up loading the file in step 1). The i tried using the native, and recommended, file I/O routines provided by Delphi: var f: TextFile; begin Assign(filename, f); while ReadLn(f, oneLine) do begin //process the line end; Problem withAssign is that there is no option to read the file without locking (i.e. fmShareDenyNone). The former stringlist example doesn't support no-lock either, unless you change it to LoadFromStream: slFile := TStringList.Create; stream := TFileStream.Create(filename, fmOpenRead or fmShareDenyNone); slFile.LoadFromStream(stream); stream.Free; for i := 0 to slFile.Count-1 do begin oneLine := slFile.Strings[i]; //process the line end; So now even though i've gained no locks being held, i'm back to loading the entire file into memory. Is there some alternative to Assign/ReadLn, where i can read a file line-by-line, without taking a sharing lock? i'd rather not get directly into Win32 CreateFile/ReadFile, and having to deal with allocating buffers and detecting CR, LF, CRLF's. i thought about memory mapped files, but there's the difficulty if the entire file doesn't fit (map) into virtual memory, and having to maps views (pieces) of the file at a time. Starts to get ugly. i just want Assign with fmShareDenyNone!

    Read the article

  • Erasing and modifying elements in Boost MultiIndex Container

    - by Sarah
    I'm trying to use a Boost MultiIndex container in my simulation. My knowledge of C++ syntax is very weak, and I'm concerned I'm not properly removing an element from the container or deleting it from memory. I also need to modify elements, and I was hoping to confirm the syntax and basic philosophy here too. // main.cpp ... #include <boost/multi_index_container.hpp> #include <boost/multi_index/hashed_index.hpp> #include <boost/multi_index/member.hpp> #include <boost/multi_index/ordered_index.hpp> #include <boost/multi_index/mem_fun.hpp> #include <boost/tokenizer.hpp> #include <boost/shared_ptr.hpp> ... #include "Host.h" // class Host, all members private, using get fxns to access using boost::multi_index_container; using namespace boost::multi_index; typedef multi_index_container< boost::shared_ptr< Host >, indexed_by< hashed_unique< const_mem_fun<Host,int,&Host::getID> > // ordered_non_unique< BOOST_MULTI_INDEX_MEM_FUN(Host,int,&Host::getAge) > > // end indexed_by > HostContainer; typedef HostContainer::nth_index<0>::type HostsByID; int main() { ... HostContainer allHosts; Host * newHostPtr; newHostPtr = new Host( t, DOB, idCtr, 0, currentEvents ); allHosts.insert( boost::shared_ptr<Host>(newHostPtr) ); // allHosts gets filled up int randomHostID = 4; int newAge = 50; modifyHost( randomHostID, allHosts, newAge ); killHost( randomHostID, allHosts ); } void killHost( int id, HostContainer & hmap ){ HostsByID::iterator it = hmap.find( id ); cout << "Found host id " << (*it)->getID() << "Attempting to kill. hmap.size() before is " << hmap.size() << " and "; hmap.erase( it ); // Is this really erasing (freeing from mem) the underlying Host object? cout << hmap.size() << " after." << endl; } void modifyHost( int id, HostContainer & hmap, int newAge ){ HostsByID::iterator it = hmap.find( id ); (*it) -> setAge( newAge ); // Not actually the "modify" function for MultiIndex... } My questions are In the MultiIndex container allHosts of shared_ptrs to Host objects, is calling allHosts.erase( it ) on an iterator to the object's shared_ptr enough to delete the object permanently and free it from memory? It appears to be removing the shared_ptr from the container. The allhosts container currently has one functioning index that relies on the host's ID. If I introduce an ordered second index that calls on a member function (Host::getAge()), where the age changes over the course of the simulation, is the index always going to be updated when I refer to it? What is the difference between using the MultiIndex's modify to modify the age of the underlying object versus the approach I show above? I'm vaguely confused about what is assumed/required to be constant in MultiIndex. Thanks in advance. Update Here's my attempt to get the modify syntax working, based on what I see in a related Boost example. struct update_age { update_age():(){} // have no idea what this really does... elicits error void operator() (boost::shared_ptr<Host> ptr) { ptr->incrementAge(); // incrementAge() is a member function of class Host } }; and then in modifyHost, I'd have hmap.modify(it,update_age). Even if by some miracle this turns out to be right, I'd love some kind of explanation of what's going on.

    Read the article

  • Why touching "d_name" makes calls to readdir() fail?

    - by Sarah Mani
    Hi, I'm trying to write a little helper for Windows which eventually will accept a file extension as an argument and return the number of files of that kind in the current directory. To do so, I'm reading the file entries in the directories and after getting the extension I'd like to convert it to lowercase to compare it with the yet-to-add specified argument. When converting the extension to lowercase I found that touching even a duplicate string of the d_name variable will cause a strange behaviour, like no more calls to readdir are called. Here is the code I'm using right now (the commented code is preliminary) and outputs for a given directory: #include <ctype.h> #include <dirent.h> #include <stdio.h> #include <string.h> char * strrch(char *string, size_t elements, char character) { char *reverse = string + elements; while (--reverse != string) if (*reverse == character) return reverse; return NULL; } void test(char *string) { // Even being a duplicate will make it fail: char *str = strdup(string); printf("Strings: %s %s\n", string, str); *str = 'a'; printf("Strings: %s %s\n", string, str); //unsigned short int i = 0; //for (; str[i] != '\0', str++; i++) // str[i] = tolower((unsigned char) str[i]); //puts(str); } int main(int argc, char **argv) { DIR *directory; struct dirent *element; if (directory = opendir(".")) { while (element = readdir(directory)) test(strrch(element->d_name, element->d_namlen, '.')); closedir(directory); puts(NULL); } else puts("Couldn't open the directory.\n"); } Output without modifying the duplicate (modification and the second printf call commented): Strings: (null) (null) Strings: . . Strings: .exe .exe Strings: .pdf .pdf Strings: .c .c Strings: .ini .ini Strings: .pdf .pdf Strings: .pdf .pdf Strings: .pdf .pdf Strings: .flac .flac Strings: .FLAC .FLAC Strings: .lnk .lnk Strings: .URL .URL Output of the same directory (with the code above, with the 2 printfs): Strings: (null) (null) Is there anything wrong? Is it a compiler issue? I'm using GCC 4.4.3 in Windows (MinGW) right now. Thank you very much for your help. By the way, is there any other way to work with files and directories in a Windows environment not using the POSIX functions?

    Read the article

  • Value object getter

    - by sarah xia
    Hi, I've got a value object, which stores info for example amount. The getAmount() getter returns amount in cents. However in various places, we need to get amount in dollar. There are 2 approaches I can think of: write a convert method and place it in a utility class. add a getAmountInDollar() getter in the value object. I prefer the second approach. What do you think? What are pros and cons of both approaches?

    Read the article

  • IIS: How to get the Metabase path?

    - by Ian Boyd
    i'm trying to get the list of mime types known to an IIS server (which you can see was asked and and answered by me 2 years ago). The copy-pasted answer involves: GetObject("IIS://LocalHost/MimeMap") msdn GetObject("IIS://localhost/mimemap") KB246068 GetObject("IIS://localhost/MimeMap") Scott Hanselman's Blog new DirectoryEntry("IIS://Localhost/MimeMap")) Stack Overflow new DirectoryEntry("IIS://Localhost/MimeMap")) Stack Overflow New DirectoryServices.DirectoryEntry("IIS://localhost/MimeMap") Velocity Reviews You get the idea. Everyone agrees that you use a magical path iis://localhost/mimemap. And this works great, except for the times when it doesn't. The only clue i can find as to why it fails, is from an IIS MVP, Chris Crowe's, blog: string ServerName = "LocalHost"; string MetabasePath = "IIS://" + ServerName + "/MimeMap"; // Note: This could also be something like // string MetabasePath = "IIS://" + ServerName + "/w3svc/1/root"; DirectoryEntry MimeMap = new DirectoryEntry(MetabasePath); There are two clues here: He calls iis://localhost/mimemap the Metabase Path. Which sounds to me like it is some sort of "path" to a "metabase". He says that the path to the metabase could be something else; and he gives an example of what it could be like. Right now i, and the entire planet, are hardcoding the "MetabasePath" as iis://localhost/MimeMap What should it really be? What should the code be doing to construct a valid MetabasePath? Note: i'm not getting an access denied error, the error is the same when you have an invalid MetabasePath, e.g. iis://localhost/SoTiredOfThis

    Read the article

  • How do I fix the python installer's 'missing dependencies' error?

    - by Trevor Boyd Smith
    Background: running ubuntu So I downloaded the python "install from source" tarball. I ran make and got this error message: Python build finished, but the necessary bits to build these modules were not found: _aaa _bbb _ccc ... _jjj _kkk I google'd and found one solution is to: MANUALLY map all the string names from the error message to something in the apt-get repo MANUALLY call "sudo apt-get AAA BBB ... JJJ KKK" to get all the libraries I can easily do all of that. But I have no way of knowing what is the right version libraries I need to get! How in the world am I supposed to fix the missing dependencies if I don't know what the exact missing dependency is?

    Read the article

  • COM: How to handle a specific exception?

    - by Ian Boyd
    i'm talking to a COM object (Microsoft ADO Recordset object). In a certain case the recordset will return a failed (i.e. negative) HRESULT, with the message: Item cannot be found in the collection corresponding to the requested name or ordinal i know what this error message means, know why it happened, and i how to fix it. But i know these things because i read the message, which fortunately was in a language i understand. Now i would like to handle this exception specially. The COM object threw an HRESULT of 0x800A0CC1 In an ideal world Microsoft would have documented what errors can be returned when i try to access: records.Fields.Items( index ) with an invalid index. But they do not; they most they say is that an error can occur, i.e.: If Item cannot find an object in the collection corresponding to the Index argument, an error occurs. Given that the returned error code is not documented, is it correct to handle a specific return code of `0x800A0CC1' when i'm trying to trap the exception: Item cannot be found in the collection corresponding to the requested name or ordinal ? Since Microsoft didn't document the error code, they technically change it in the future.

    Read the article

  • organize using directives, re-run tests?

    - by Sarah Vessels
    Before making a commit, I prefer to run all hundred-something unit tests in my C# Solution, since they only take a couple minutes to run. However, if I've already run them all, all is well, and then I decide to organize the using directives in my Solution, is it really necessary to re-run the unit tests? I have a macro that goes through all files in the Solution and runs Visual Studio's 'Remove and Sort' command on each. In my understanding, so long as all projects still build after using directives are changed around, things should be fine at runtime, too. Is this correct thinking?

    Read the article

  • Source control products that support linked/shared files?

    - by Ian Boyd
    We're interested in moving from a source control system that supports the concept of shared or linked files. A shared file means: a file modified in one project, is automatically updated changed in every other project that uses that same file. It does this without a developer having to request it, reverse-integrate it, ask for it, or even want it. We're trying to see if any other commonly used source-control systems can meet our needs, and include linked or shared files. My limited research shows that: Team Foundation Server doesn't support sharing files Subversion doesn't support sharing files (including Externals) CVS doesn't support sharing files (including Modules) Anything else? (besides our current source control product, obviously) References Subversion and shared files across repositories/projects? How to share files between CVS projects? Will TFS ever support shared files for projects under source control?

    Read the article

  • Win32: IProgressDialog will not disappear until you mouse over it.

    - by Ian Boyd
    i'm using the Win32 progress dialog. The damnest thing is that when i call: progressDialog.StopProgressDialog(); it doesn't disappear. It stays on screen until the user moves her mouse over it - then it suddenly disappers. The call to StopProgressDialog returns right away (i.e. it's not a synchronous call). i can prove this by doing things after the call has returned: private void button1_Click(object sender, EventArgs e) { //Force red background to prove we've started this.BackColor = Color.Red; this.Refresh(); //Start a progress dialog IProgressDialog pd = (IProgressDialog)new ProgressDialog(); pd.StartProgressDialog(this.Handle, null, PROGDLG.Normal, IntPtr.Zero); //The long running operation System.Threading.Thread.Sleep(10000); //Stop the progress dialog pd.SetLine(1, "Stopping Progress Dialog", false, IntPtr.Zero); pd.StopProgressDialog(); pd = null; //Return form to normal color to prove we've stopped. this.BackColor = SystemColors.Control; this.Refresh(); } The form: starts gray turns red to show we've stared turns back to gray color to show we've called stop So the call to StopProgressDialog has returned, except the progress dialog is still sitting there, mocking me, showing the message: Stopping Progress Dialog Doesn't Appear for 10 seconds Additionally, the progress dialog does not appear on screen until the System.Threading.Thread.Sleep(10000); ten second sleep is over. Not limited to .NET WinForms The same code also fails in Delphi, which is also an object wrapper around Window's windows: procedure TForm1.Button1Click(Sender: TObject); var pd: IProgressDialog; begin Self.Color := clRed; Self.Repaint; pd := CoProgressDialog.Create; pd.StartProgressDialog(Self.Handle, nil, PROGDLG_NORMAL, nil); Sleep(10000); pd.SetLine(1, StringToOleStr('Stopping Progress Dialog'), False, nil); pd.StopProgressDialog; pd := nil; Self.Color := clBtnFace; Self.Repaint; end; PreserveSig An exception would be thrown if StopProgressDialog was failing. Most of the methods in IProgressDialog, when translated into C# (or into Delphi), use the compiler's automatic mechanism of converting failed COM HRESULTS into a native language exception. In other words the following two signatures will throw an exception if the COM call returned an error HRESULT (i.e. a value less than zero): //C# void StopProgressDialog(); //Delphi procedure StopProgressDialog; safecall; Whereas the following lets you see the HRESULT's and react yourself: //C# [PreserveSig] int StopProgressDialog(); //Delphi function StopProgressDialog: HRESULT; stdcall; HRESULT is a 32-bit value. If the high-bit is set (or the value is negative) it is an error. i am using the former syntax. So if StopProgressDialog is returning an error it will be automatically converted to a language exception. Note: Just for SaG i used the [PreserveSig] syntax, the returned HRESULT is zero; MsgWait? The symptom is similar to what Raymond Chen described once, which has to do with the incorrect use of PeekMessage followed by MsgWaitForMultipleObjects: "Sometimes my program gets stuck and reports one fewer record than it should. I have to jiggle the mouse to get the value to update. After a while longer, it falls two behind, then three..." But that would mean that the failure is in IProgressDialog, since it fails equally well on CLR .NET WinForms and native Win32 code.

    Read the article

  • Datatype query on datetime and tinyint

    - by sarah
    Hi , I have Mysql column type has datetime what should be the corresponding datatype in entity bean class for the same column ,as well for tinyint what would be the corresponding datatype in entity bean class for the same column ?

    Read the article

  • SQL Server: Must numbers all be specified with latin numeral digits?

    - by Ian Boyd
    Does SQL server expect numbers to be specified with digits from the latin alphabet, e.g.: 0123456789 Is it valid to give SQL Server digits in other alphabets? Rosetta Stone: Latin: 01234567890 Arabic: ?????????? Bengali: ?????????? i know that the client (ADO) will convert 8-bit strings to 16-bit unicode strings using the current culture. But the client is also converting numbers to strings using their current culture, e.g.: SELECT * FROM Inventory WHERE Quantity > ???,?? Which throws SQL Server for fits. i know that the server/database has it's defined code page and locale, but that is for strings. Will SQL Server interpret numbers using the active (or per-login specified) locale, or must all numeric values be specifid with latin numeral digits?

    Read the article

< Previous Page | 2 3 4 5 6 7 8 9 10 11 12 13  | Next Page >