Search Results

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

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

  • SQL Server: How to call a UDF, if available?

    - by Ian Boyd
    Most systems will have a user-defined function (UDF) available. Some will not. i want to use the UDF if it's there: SELECT Users.*, dbo.UserGroupMembershipNames(Users.UserID) AS MemberOfGroupNames FROM Users Otherwise fallback to the acceptable alternative SELECT Users.*, (SELECT TOP 1 thing FROM Something WHERE Something.ID = Users.UserID) AS MemberGroupNames FROM Users How do? My first attempt, using the obvious solution, of course failed: SELECT Users.*, CASE WHEN (OBJECT_ID('dbo.UserGroupMembershipNames') IS NOT NULL) THEN dbo.UserGroupMembershipNames(Users.UserID) ELSE (SELECT TOP 1 thing FROM Something WHERE Something.ID = Users.UserID) END AS MemberOfGroupNames FROM Users for reasons beyond me

    Read the article

  • custom attribute changes in .NET 4

    - by Sarah Vessels
    I recently upgraded a C# project from .NET 3.5 to .NET 4. I have a method that extracts all MSTest test methods from a given list of MethodBase instances. Its body looks like this: return null == methods || methods.Count() == 0 ? null : from method in methods let testAttribute = Attribute.GetCustomAttribute(method, typeof(TestMethodAttribute)) where null != testAttribute select method; This worked in .NET 3.5, but since upgrading my projects to .NET 4, this code always returns an empty list, even when given a list of methods containing a method that is marked with [TestMethod]. Did something change with custom attributes in .NET 4? Debugging, I found that the results of GetCustomAttributesData() on the test method gives a list of two CustomAttributeData which are described in Visual Studio 2010's 'Locals' window as: Microsoft.VisualStudio.TestTools.UnitTesting.DeploymentItemAttribute("myDLL.dll") Microsoft.VisualStudio.TestTools.UnitTesting.TestMethodAttribute() -- this is what I'm looking for When I call GetType() on that second CustomAttributeData instance, however, I get {Name = "CustomAttributeData" FullName = "System.Reflection.CustomAttributeData"} System.Type {System.RuntimeType}. How can I get TestMethodAttribute out of the CustomAttributeData, so that I can extract test methods from a list of MethodBases?

    Read the article

  • C#: How to inherit constructors?

    - by Ian Boyd
    Imagine a base class with many constructors and a virtual method public class Foo { ... public Foo() {...} public Foo(int i) {...} ... public virtual void SomethingElse() {...} ... } and now I want to create a descendant class that overrides the virtual method: public class Bar : Foo { public override void SomethingElse() {...} } And another descendant that does some more stuff: public class Bah : Bar { public void DoMoreStuff() {...} } Do I really have to copy all constructors from Foo into Bar and Bah? And then if I change a constructor signature in Foo, do I have to update it in Bar and Bah? Is there no way to inherit constructors? Is there no way to encourage code reuse?

    Read the article

  • SQL Server: What locale should be used to format numeric values into SQL Server format?

    - by Ian Boyd
    It seems that SQL Server does not accept numbers formatted using any particular locale. It also doesn't support locales that have digits other than 0-9. For example, if the current locale is bengali, then the number 123456789 would come out as "?????????". And that's just the digits, nevermind what the digit grouping would be. But the same problem happens for numbers in the Invariant locale, which formats numbers as "123,456,789", which SQL Server won't accept. Is there a culture that matches what SQL Server accepts for numeric values? Or will i have to create some custom "sql server" culture, generating rules for that culture myself from lower level formatting routines? If i was in .NET (which i'm not), i could peruse the Standard Numeric Format strings. Of the format codes available in .NET: c (Currency): $123.46 d (Decimal): 1234 e (Exponentional): 1.052033E+003 f (Fixed Point): 1234.57 g (General): 123.456 n (Number): 1,234.57 p (Percent): 100.00 % r (Round Trip): 123456789.12345678 x (Hexadecimal): FF Only 6 accept all numeric types: c (Currency): $123.46 d (Decimal): 1234 e (Exponentional): 1.052033E+003 f (Fixed Point): 1234.57 g (General): 123.456 n (Number): 1,234.57 p (Percent): 100.00 % r (Round Trip): 123456789.12345678 x (Hexadecimal): FF And of those only 2 generate string representations, in the en-US locale anyway, that would be accepted by SQL Server: c (Currency): $123.46 d (Decimal): 1234 e (Exponentional): 1.052033E+003 f (Fixed Point): 1234.57 g (General): 123.456 n (Number): 1,234.57 p (Percent): 100.00 % r (Round Trip): 123456789.12345678 x (Hexadecimal): FF Of the remaining two, fixed is dependant on the locale's digits, rather than the number being used, leaving General g format: c (Currency): $123.46 d (Decimal): 1234 e (Exponentional): 1.052033E+003 f (Fixed Point): 1234.57 g (General): 123.456 n (Number): 1,234.57 p (Percent): 100.00 % r (Round Trip): 123456789.12345678 x (Hexadecimal): FF And i can't even say for certain that the g format won't add digit groupings (e.g. 1,234). Is there a locale that formats numbers in the way SQL Server expects? Is there a .NET format code? A java format code? A Delphi format code? A VB format code? A stdio format code? latin-numeral-digits

    Read the article

  • SQL Server: "Mostly-unique" index

    - by Ian Boyd
    In a table i want to ensure that only unique vales exist over the five-column key: Timestamp Account RatingDate TripHistoryKey EventAction ========= ======= ========== ============== =========== 2010511 1234 2010511 1 INSERT 2010511 1234 2010511 4 INSERT 2010511 1234 2010511 7 INSERT 2010511 1234 2010511 1 INSERT <---duplicate But i only want the unique constraint to apply between rows when EventAction is INSERT: Timestamp Account RatingDate TripHistoryKey EventAction ========= ======= ========== ============== =========== 2010511 1234 2010511 1 INSERT 2010511 1234 2010511 1 UPDATE 2010511 1234 2010511 1 UPDATE <---not duplicate 2010511 1234 2010511 1 UPDATE <---not duplicate 2010511 1234 2010511 1 DELETE <---not duplicate 2010511 1234 2010511 1 DELETE <---not duplicate 2010511 1234 2010511 1 INSERT <---DUPLICATE Possible?

    Read the article

  • dynamic drop down

    - by sarah
    Hi, i want to display a drop down dynamically that is the values should be from database,i have the list holding the values,how would i use it now ?

    Read the article

  • Why would this Lua optimization hack help?

    - by Ian Boyd
    i'm looking over a document that describes various techniques to improve performance of Lua script code, and i'm shocked that such tricks would be required. (Although i'm quoting Lua, i've seen similar hacks in Javascript). Why would this optimization be required: For instance, the code for i = 1, 1000000 do local x = math.sin(i) end runs 30% slower than this one: local sin = math.sin for i = 1, 1000000 do local x = sin(i) end They're re-declaring sin function locally. Why would this be helpful? It's the job of the compiler to do that anyway. Why is the programmer having to do the compiler's job? i've seen similar things in Javascript; and so obviously there must be a very good reason why the interpreting compiler isn't doing its job. What is it? i see it repeatedly in the Lua environment i'm fiddling in; people redeclaring variables as local: local strfind = strfind local strlen = strlen local gsub = gsub local pairs = pairs local ipairs = ipairs local type = type local tinsert = tinsert local tremove = tremove local unpack = unpack local max = max local min = min local floor = floor local ceil = ceil local loadstring = loadstring local tostring = tostring local setmetatable = setmetatable local getmetatable = getmetatable local format = format local sin = math.sin What is going on here that people have to do the work of the compiler? Is the compiler confused by how to find format? Why is this an issue that a programmer has to deal with? Why would this not have been taken care of in 1993? i also seem to have hit a logical paradox: Optimizatin should not be done without profiling Lua has no ability to be profiled Lua should not be optimized

    Read the article

  • How to capture each frame of a USB webcam using VB.net?

    - by Kevin Boyd
    While I have got some leads from an older SO post and from this site, I haven't been able to figure out how to capture each frame of a web-cam. What I would like to do is something like this capture a frame then do some image processing on it and display the output and then move on to the next frame. Can I can access to web-cam frame events or is there any efficient way to achieve this?

    Read the article

  • html:checkbox query

    - by sarah
    Hi All, i have the following code . and in Form is have property called isActive of type char ,how would i get the checked value of it ,i am getting some symbols like 'o' if checked. I am using userform.getIsActive() ,where i am going wrong .I want 'y' or 'n' values

    Read the article

  • DRYing out implementation of ICloneable in several classes

    - by Sarah Vessels
    I have several different classes that I want to be cloneable: GenericRow, GenericRows, ParticularRow, and ParticularRows. There is the following class hierarchy: GenericRow is the parent of ParticularRow, and GenericRows is the parent of ParticularRows. Each class implements ICloneable because I want to be able to create deep copies of instances of each. I find myself writing the exact same code for Clone() in each class: object ICloneable.Clone() { object clone; using (var stream = new MemoryStream()) { var formatter = new BinaryFormatter(); // Serialize this object formatter.Serialize(stream, this); stream.Position = 0; // Deserialize to another object clone = formatter.Deserialize(stream); } return clone; } I then provide a convenience wrapper method, for example in GenericRows: public GenericRows Clone() { return (GenericRows)((ICloneable)this).Clone(); } I am fine with the convenience wrapper methods looking about the same in each class because it's very little code and it does differ from class to class by return type, cast, etc. However, ICloneable.Clone() is identical in all four classes. Can I abstract this somehow so it is only defined in one place? My concern was that if I made some utility class/object extension method, it would not correctly make a deep copy of the particular instance I want copied. Is this a good idea anyway?

    Read the article

  • HTML: Include, or exclude, optional closing tags?

    - by Ian Boyd
    Some HTML1 closing tags are optional, i.e.: </HTML> </HEAD> </BODY> </P> </DT> </DD> </LI> </OPTION> </THEAD> </TH> </TBODY> </TR> </TD> </TFOOT> </COLGROUP> Note: Not to be confused with closing tags that are forbidden to be included, i.e.: </IMG> </INPUT> </BR> </HR> </FRAME> </AREA> </BASE> </BASEFONT> </COL> </ISINDEX> </LINK> </META> </PARAM> Note: xhtml is different from HTML. xhtml is a form of xml, which requires every element have a closing tag. A closing tag can be forbidden in html, yet mandatory in xhtml. Are the optional closing tags ideally included, but we'll accept them if you forgot them, or ideally not included, but we'll accept them if you put them in In other words, should i include them, or should i not include them? The HTML 4.01 spec talks about closing element tags being optional, but doesn't say if it's preferable to include them, or preferable to not include them. On the other hand, a random article on DevGuru says: The ending tag is optional. However, it is recommended that it be included. The reason i ask is because you just know it's optional for compatibility reasons; and they would have made them (mandatory | forbidden) if they could have. Put it another way: What did HTML 1, 2, 3 do with regards to these, now optional, closing tags. What does HTML 5 do? And what should i do? Footnotes 1HTML 4.01

    Read the article

  • request payload versus query string parameters

    - by Sarah Sides
    I am absolutely in the dark when it comes to this request payload that I'm seeing in my Chrome browser. A Query string will have a variable attached like session:2g0SoEE but this payload has just one long string I'm guessing is in base64. I do understand that the request payload can have whatever, but how do I use it? Can I do a post with jquery and send this request payload? For example: $.post(url, {variable: "variable"}, function(data){}); When this posts it will send &variable=variable this will be found as query string parameter in the headers sent in chrome. In this game I'm playing I see another piece of info being sending in the header called a payload request. I'm a confused as to how this is read, used, made, how I can reduplicate this? Here is something similar: Chrome is caching an HTTP PUT request and How to retrieve Request Payload

    Read the article

  • How to Detect in Windows Registry if user has .Net Framework installed?

    - by Sarah Weinberger
    How do I detect in the Windows Registry if a user has .Net Framework installed? I am not looking for a .Net based solution, as the query is from InnoSetup. I know from reading another post here on Stack Overflow that .Net Framework is an inplace upgrade to 4.0. I already know how to check if a user has version 4.0 installed on the system, namely by checking the following: function FindFramework(): Boolean; var bVer4x0: Boolean; bVer4x0Client: Boolean; bVer4x0Full: Boolean; bSuccess: Boolean; iInstalled: Cardinal; begin Result := False; bVer4x0Client := False; bVer4x0Full := False; bVer4x0 := RegKeyExists(HKLM, 'SOFTWARE\Microsoft\.NETFramework\policy\v4.0'); bSuccess := RegQueryDWordValue(HKLM, 'Software\Microsoft\NET Framework Setup\NDP\v4 \Client', 'Install', iInstalled); if (1 = iInstalled) AND (True = bSuccess) then bVer4x0Client := True; bSuccess := RegQueryDWordValue(HKLM, 'Software\Microsoft\NET Framework Setup\NDP\v4 \Full', 'Install', iInstalled); if (1 = iInstalled) AND (True = bSuccess) then bVer4x0Full := True; if (True = bVer4x0Full) then begin Result := True; end; end; I checked the registry and there is no v4.5 folder, which makes sense if .Net Framework 4.5 is an inplace upgrade. Still, the Control Panel Programs and Features includes the listing. I know that probably "issuing dotNetFx45_Full_setup.exe /q" will have no bad effect if installing on a system that already has version 4.5, but I still would like to not install the upgrade if the upgrade already exists, faster and less problems.

    Read the article

  • XSLT: Transforming into non-xml content?

    - by Ian Boyd
    Is it possible to use XSLT to transform XML into something other than XML? e.g. i want the final non-xml content: <HTML> <BODY> <IMG src="file1.png"><BR> <IMG src="file2.png"><BR> ... <IMG src="filen.png"><BR> </BODY> </HTML> You'll notice this document is HTML, because in HTML IMG and BR tags are forbidden from having a closing tag. This constrasts with xhtml, the reformulation of HTML using xml, where all elements are required from having a closing tag (because in xml every tag must be closed). Is it possible, using XSLT, to generate non-xml output? Another example of non-xml output might be: INSERT INTO Documents (Filename) VALUES ('file1.png') INSERT INTO Documents (Filename) VALUES ('file2.png') ... INSERT INTO Documents (Filename) VALUES ('file3.png') The reason i ask is that as soon as my XSLT contains an <IMG>, the stylesheet contains an error; no closing </IMG>.

    Read the article

  • sql query not executing

    - by sarah
    Hi, Not able to execute a query ,i need to check if end date is greater than today in the following query Getting an error invalid query select * from table1 where user in ('a') and END_DATE >'2010-05-22' getting an error liter string does not match

    Read the article

  • Signed and RequireAdministrator manifested executable being run from temp folder?

    - by Ian Boyd
    i manifested my executable as require administrator: <?xml version="1.0" encoding="UTF-8" standalone="yes"?> <assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0"> <!-- Disable Windows Vista UAC compatability heuristics --> <trustInfo xmlns="urn:schemas-microsoft-com:asm.v2"> <security> <requestedPrivileges> <requestedExecutionLevel level="requireAdministrator"/> </requestedPrivileges> </security> </trustInfo> </assembly> And then i digitally signed it. But then when i run the executable i noticed something odd: the name of the executable on the Consent dialog changed from PingWarning.exe to pinxxxx.tmp; as though a temp copy was made, and that is being run: i dug out Process Montior, to see if anyone is creating a *.tmp file when i launch my executable, and there is: The Application Information service inside this particular svchost container is intentionally copying my executable to the Windows temp folder, and asking for user "Consent" from there; giving an invalid filename. Once consent has been granted, the executable is run from its original location: link text The file is not copied to the temp folder if i do not digitally sign it: So my problem is the invalid filename appearing on the consent dialog when i digitally sign my executable which has been manifested as requireAdministrator. What do?

    Read the article

  • Help me clean up this crazy lambda with the out keyword

    - by Sarah Vessels
    My code looks ugly, and I know there's got to be a better way of doing what I'm doing: private delegate string doStuff( PasswordEncrypter encrypter, RSAPublicKey publicKey, string privateKey, out string salt ); private bool tryEncryptPassword( doStuff encryptPassword, out string errorMessage ) { ...get some variables... string encryptedPassword = encryptPassword(encrypter, publicKey, privateKey, out salt); ... } This stuff so far doesn't bother me. It's how I'm calling tryEncryptPassword that looks so ugly, and has duplication because I call it from two methods: public bool method1(out string errorMessage) { string rawPassword = "foo"; return tryEncryptPassword( (PasswordEncrypter encrypter, RSAPublicKey publicKey, string privateKey, out string salt) => encrypter.EncryptPasswordAndDoStuff( // Overload 1 rawPassword, publicKey, privateKey, out salt ), out errorMessage ); } public bool method2(SecureString unencryptedPassword, out string errorMessage) { return tryEncryptPassword( (PasswordEncrypter encrypter, RSAPublicKey publicKey, string privateKey, out string salt) => encrypter.EncryptPasswordAndDoStuff( // Overload 2 unencryptedPassword, publicKey, privateKey, out salt ), out errorMessage ); } Two parts to the ugliness: I have to explicitly list all the parameter types in the lambda expression because of the single out parameter. The two overloads of EncryptPasswordAndDoStuff take all the same parameters except for the first parameter, which can either be a string or a SecureString. So method1 and method2 are pretty much identical, they just call different overloads of EncryptPasswordAndDoStuff. Any suggestions? Edit: if I apply Jeff's suggestions, I do the following call in method1: return tryEncryptPassword( (encrypter, publicKey, privateKey) => { var result = new EncryptionResult(); string salt; result.EncryptedValue = encrypter.EncryptPasswordAndDoStuff( rawPassword, publicKey, privateKey, out salt ); result.Salt = salt; return result; }, out errorMessage ); Much the same call is made in method2, just with a different first value to EncryptPasswordAndDoStuff. This is an improvement, but it still seems like a lot of duplicated code.

    Read the article

  • how to deal with pdf annotation with ipad in objective c?

    - by Sarah
    Hello, I know that it may sound a silly question but i am really very confused. I am to work with one application that is having operations like PDF loading,annotation, scrolling,zooming and other such functions. Now my question is that i am little bit confused about what template i should use as i went through Quartz 2D Programming Guide and was little bit confused whether i'll be able to apply the above shown functions with the same guideline,as it displays the pdf page on the whole screen. Or is there any other way around? Please help me..Can i use UIWebView for the same functions as i listed above? I ll be grateful if you can help me. Thank you.

    Read the article

  • should I include VB macros in source control with my project?

    - by Sarah Vessels
    For a C# project, I make use of several Visual Basic macros in Visual Studio. I was just considering that these would be of use to other developers that work on the C# project. The macros so far include removing trailing whitespace on save, organizing using directives and removing unnecessary ones, and an override for Ctrl-M Ctrl-O that expands regions. Would it be reasonable for me to include this macro code with my C# project in Subversion? I don't know if it's even possible for macros to be made available/work in Visual Studio just because you open a particular Solution file, and that might be too invasive since some of the macros override existing VS behavior.

    Read the article

  • Windows Ribbon Framework: How to change font face and size?

    - by Ian Boyd
    How do you change the font face and font size used by the Windows Ribbon Framwork? Background The user can configure Windows to use their preferred font size, e.g.: 8pt 9pt 12pt and their preferred font face, e.g.: MS Sans Serif Microsoft Sans Serif Tahoma Segoe UI Calibri but the Windows Ribbon Framework by default uses a font that is not the user's preference. Additionally, the user could have specified their font preference in my application, which i want the Ribbon hosted in my application to honor.

    Read the article

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