Search Results

Search found 3504 results on 141 pages for 'chris holmes'.

Page 92/141 | < Previous Page | 88 89 90 91 92 93 94 95 96 97 98 99  | Next Page >

  • C# implicit conversions

    - by Chris Boden
    Hello, I'm currently working on an application where I need to load data from an SQL database and then assign the retrieved values into the properties of an object. I'm doing this by using reflection since the property names and column names are the same. However, many of the properties are using a custom struct type that is basically a currency wrapper for the decimal type. I have defined an implicit conversion in my struct: public static implicit operator Currency(decimal d) { return new Currency(d); } This works fine when I use it in code. However, when I have this: foreach (PropertyInfo p in props) { p.SetValue(this, table.Rows[0][p.Name], null); } It throws an ArgumentException stating that it cannot convert from System.Decimal to Currency. I'm confused since it works fine in any other circumstance.

    Read the article

  • Every 3rd Insert Is Slow On Ms Sql 2008

    - by Chris
    I have a function that writes 3 lines into a empty table like so: INSERT [dbo].[yaf_ForumAccess] ([GroupID], [ForumID], [AccessMaskID]) VALUES (1, 8, 1) INSERT [dbo].[yaf_ForumAccess] ([GroupID], [ForumID], [AccessMaskID]) VALUES (2, 8, 4) INSERT [dbo].[yaf_ForumAccess] ([GroupID], [ForumID], [AccessMaskID]) VALUES (3, 8, 3) For some reason only the third query takes a long time to execute - and with each insert it grows longer. Profiler Image I have tried disabling all constraints on the table - same result. I just can't figure out why the first two would run so fast - and the last one would take so long. Any help would be greatly appreciated. Here is the statistics for a query ran MSSMS: Query: ALTER TABLE [dbo].[yaf_ForumAccess] NOCHECK CONSTRAINT ALL INSERT [dbo].[yaf_ForumAccess] ([GroupID], [ForumID], [AccessMaskID]) VALUES (1, 9, 1) INSERT [dbo].[yaf_ForumAccess] ([GroupID], [ForumID], [AccessMaskID]) VALUES (2, 9, 4) INSERT [dbo].[yaf_ForumAccess] ([GroupID], [ForumID], [AccessMaskID]) VALUES (3, 9, 3) ALTER TABLE [dbo].[yaf_ForumAccess] CHECK CONSTRAINT ALL Stats: Stats

    Read the article

  • Can I get a bitmap of an arbitrary window in another application process?

    - by Chris Farmer
    I am trying to automate a third-party Win32 application where I want to capture the graphics content of a particular window at defined time intervals. I am in the early phases of this, and I'm currently trying to use the Microsoft UI Automation API via C# to do most of the interaction between my client app and the external app. I can now get the external app to do what I want it to do, but now I want to capture the graphics from a specific window that seems to be some third-party owner-drawn control. How can I do this? The window I want to capture is the one marked by the red rectangle in this image: I have an implementation that sort of works, but it's dependent on the external app's UI being on top, and that's not guaranteed for me, so I'd prefer to find something more general. var p = Process.Start("c:\myapp.exe"); var mainForm = AutomationElement.FromHandle(p.MainWindowHandle); // "workspace" below is the window whose content I want to capture. var workspace = mainForm.FindFirst(TreeScope.Descendents, new PropertyCondition(AutomationElement.ClassNameProperty, "AfxFrameOrView70u")); var rect = (Rect) workspace.GetCurrentPropertyValue(AutomationElement.BoundingRectangleProperty); using (var bmp = new Bitmap((int)rect.Width, (int)rect.Height)) { using (var g = Graphics.FromImage(bmp)) { g.CopyFromScreen((int)rect.Left, (int)rect.Top, 0, 0, new Size((int)rect.Width, (int)rect.Height)); bmp.Save(@"c:\screenshot.png", ImageFormat.Png); } } The above works well enough when the automated app is on top, but it just blindly copies the screen in the rectangle, so my code is at the mercy of whatever happens to be running on the machine and might cover my app's window. I have read some suggestions to send the WM_PRINT message to the window. This question/answer from a few months back seemed promising, but when I use this code, I just get a white rectangle with none of my control's actual contents. var prop = (int)workspace.GetCurrentPropertyValue(AutomationElement.NativeWindowHandleProperty); var hwnd = new IntPtr(prop); using ( var bmp2 = new Bitmap((int)rect.Width, (int)rect.Height)) { using (Graphics g = Graphics.FromImage(bmp2)) { g.FillRectangle(SystemBrushes.Control, 0, 0, (int)rect.Width, (int)rect.Height); try { SendMessage(hwnd, WM_PRINT, g.GetHdc().ToInt32(), (int)(DrawingOptions.PRF_CHILDREN | DrawingOptions.PRF_CLIENT | DrawingOptions.PRF_OWNED)); } finally { g.ReleaseHdc(); } bmp2.Save(@"c:\screenshot.bmp"); } } So, first, is it even possible for me to reliably save a bitmap of a window's contents? If so, what is the best way, and what is wrong with my WM_PRINT with SendMessage attempt?

    Read the article

  • ScriptManager emits ScriptReferences after ClientScriptIncludes. Why?

    - by Chris F
    I have an application that uses a lot of javascript in a lot of different .js files. Each page can have any number and combination of different controls and each control can use a different set of js files. Instead of including all possible js files as <script src="xxx.js"> in the head of my master page, I thought I would reduce the amount of included files by getting each control to call ScriptManager.Scripts.Add(new ScriptReference("xxx.js")) - thus only the scripts that are actually needed by the page will be included. Well that bit works fine. But...the controls also use ScriptManager.RegisterClientScriptBlock fairly extensively too. (There are scenarios where the controls are inside update panels). I was disappointed to see that the ScriptManager emits the client script includes before the ScriptReferences. For example - see the test file and output at the end (this results in a JS error because $ is not defined). Am I being dumb or is this to be expected? I would have thought that a sensible thing for the ScriptManger to do would be to emit the ScriptReferences first and then the other stuff. Short of rolling my own ScriptManager like object to manage static JS file references, does anyone have any suggestions as to get the behaviour that I want from ScriptManager?? Thanks in advance. Example File <%@ Page Language="C#" AutoEventWireup="true" %> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" > <head runat="server"> <script runat="server"> protected void Page_Load(object sender, EventArgs e) { ScriptManager.RegisterClientScriptBlock(Page, Page.GetType(), "Test", "$(function() {alert('hello');});", true); } </script> </head> <body> <form id="form1" runat="server"> <asp:ScriptManager runat="server" > <Scripts> <asp:ScriptReference Path="~/jquery/jquery.js" /> </Scripts> </asp:ScriptManager> </form> </body> </html> Output <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" > ... boring stuff removed .... <script src="/js/WebResource.axd?d=-nOHbla bla " type="text/javascript"></script> <script type="text/javascript"> //<![CDATA[ $(function() {alert('hello');});//]]> </script> ... boring stuff removed .... <script src="/js/ScriptResource.axd?d=qgCbla bla bla" type="text/javascript"></script> <script src="jquery/jquery.js" type="text/javascript"></script> ... boring stuff removed .... </form> </body> </html>

    Read the article

  • typeInteger undeclared in EyeTunes framework

    - by Chris
    I copied the EyeTunes framework into my project and it says that is not declared. In the original project I go to definition and it takes me to AEDataModel.h where it is defined. However in my project it doesn't do that and it's not found. How do I add AEDataModel to my project? Thanks

    Read the article

  • Can't connect to Sunspot server in Ubuntu server

    - by Chris Benseler
    I followed the steps in https://github.com/outoftime/sunspot/wiki/Adding-Sunspot-search-to-Rails-in-5-minutes-or-less to install & set up Sunspot search in Rails in a Mac OS and it is ok. In a Ubuntu server, there's connection refused error. When I run rake sunspot:solr:start and the proccess starts. The file sunspot-solr-development.pid is created in /tmp/pids But when I try to reindex rake sunspot:reindex ... rake aborted! Connection refused - connect(2) I tried to run the commands with sudo and gave permission 777 to the project files, but there's still error. Rails 3.0.8 Don't know where else to search for a solution...

    Read the article

  • Active Directory public key use

    - by Chris Meadows
    I have a client who has a requirement to validate users logging into my web application against his active directory using LDAP. In trying to connect using the DirectoryEntry and DirectorySearcher .NET classes, I can connect to his AD Server but not access it. The client's AD server has an SSL Certificate for which he has given me a public key file but I don't know how to use this public key file in my C# code. When I issue the connect command through code, I see, via Wireshark, my application sending the connection request. I then see the server responding with "Server Hello, Certificate, Certificate Request, Server Hello Done". Then my application never responds after that. In using another application, written by somebody else for which I do not have code, I see the same request from the server and then see the application respond with "Certificate, Client Key Exchange" and then the application connects and runs. With that said, my question then becomes, how can I get my C# application to load and send the key file I got from the client?

    Read the article

  • Why are my Flex resource bundles not being loaded?

    - by Chris R
    I have an Actionscript module in the flex source folder filterModules, which is one of two additional source folders in my project (the main source folder is reports, but I'm not dealing with anything in there right now). Here's the MXML content that references the resources. ... This array is assigned to the dataProvider field of a ComboBox. It's not bound using the bindings, presumably for reasons that made sense to the original developer, and it'd be nontrivial to change the class to make that happen. I additionally have a resource property file in a folder resources/en_US and I have the source folder resources/{locale} in the project source settings. My additional compiler options are -locale en_US. The resource property file is resources/en_US/labels.properties (All paths are relative to the flash builder project root) and contains (amongst other things) these keys: metric.q3 = Overall Satisfaction metric.q5 = Personnel metric.q9a = Issue Resolution metric.q42 = Visit Duration Sat metric.q34 = Visit Duration I have written some FlexUnit tests that run in my local Flash Player that exercise these resources -- they check that every label is represented in the metrics array, for example, so I know that the resource file is loaded when run locally. However, when I copy the module .swf file over to my server, the combo box to which the array is assigned is empty. I copy the .swf like so, if it matters: rsync -rlDv --inplace -T /tmp ~/projects/flex_reports/bin-debug/rankingFilter.swf HOSTNAME:WEBROOT/flashPath/ Why is this? I am not able to debug the remote module because our surrounding site sets up a lot of context and makes some database calls to determine which module to load. I'm hoping to get some pointers on why resource bundles might not show up. I'd understand it if the array was present with wrong labels, but the array is instead completely empty, which is pretty odd.

    Read the article

  • Sources for news about network security

    - by chris.nullptr
    I am a software developer that wants to stay up-to-date on network security news. What are some of the best sources online for not only keeping tabs on newly discovered security vulnerabilities that may affect projects I'm working on, but also best-practices when developing network software. Please keep in mind that I am looking for sources that cater to the software developer not IT administration.

    Read the article

  • SMTP to HTTP Post service

    - by Chris Wallace
    I am looking for a SMTP to HTTP Post service. I have tried smtp2web.com but although I can register and set up forwarding, emails bounce. Any ideas suggestions for an alternative service or current experience of using this one?

    Read the article

  • iPhone - didPopItem ? Is this supposed to work?

    - by Chris
    I have a simple UITableView setup. I am trying to use - (void)navigationBar:(UINavigationBar *)navigationBar didPopItem:(UINavigationItem *)item I put a NSLog inside this method, but it is apparently not getting called when I "pop" back to the screen. I am not finding much information about this function, has it been replaced?

    Read the article

  • Isn't the C++ standard library backward-compatible?

    - by Chris Metzler
    Hi. I'm working on a 64-bit Linux system, trying to build some code that depends on third-party libraries for which I have binaries. During linking, I get a stream of undefined reference errors for one of the libraries, indicating that the linker couldn't resolve references to standard C++ functions/classes, e.g.: librxio.a(EphReader.o): In function `gpstk::EphReader::read_fic_data(std::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)': EphReader.cpp:(.text+0x27c): undefined reference to `std::basic_ostream<char, std::char_traits<char> >& std::__ostream_insert<char, std::char_traits<char> >(std::basic_ostream<char, std::char_traits<char> >&, char const*, long)' EphReader.cpp:(.text+0x4e8): undefined reference to `std::basic_ostream<char, std::char_traits<char> >& std::__ostream_insert<char, std::char_traits<char> >(std::basic_ostream<char, std::char_traits<char> >&, char const*, long)' I'm not really a C++ programmer, but this looks to me like it can't find the standard library. Doing some more research, I got the following when I looked at librxio's dependency for the standard library: $ ldd librxio.so.16.0 ./librxio.so.16.0: /usr/lib64/libstdc++.so.6: version `GLIBCXX_3.4.9' not found (required by ./librxio.so.16.0) libm.so.6 => /lib64/libm.so.6 (0x00002aaaaad45000) libstdc++.so.6 => /usr/lib64/libstdc++.so.6 (0x00002aaaaafc8000) libgcc_s.so.1 => /lib64/libgcc_s.so.1 (0x00002aaaab2c8000) libc.so.6 => /lib64/libc.so.6 (0x00002aaaab4d7000) /lib64/ld-linux-x86-64.so.2 (0x0000555555554000) So I read that as saying that librxio (one of the third-party libraries) requires at least v3.4.9 of the standard library. But the version I have installed is 4.1.2: $ rpm -qa | grep libstdc compat-libstdc++-33-3.2.3-61.x86_64 libstdc++-devel-4.1.2-14.el5.i386 libstdc++-devel-4.1.2-14.el5.x86_64 libstdc++-4.1.2-14.el5.x86_64 libstdc++-4.1.2-14.el5.i386 Shouldn't this work? The shared object major number is 6, same as for v3.4.9. At this level, shouldn't this be backward compatible? It seems like the third-party library is looking for an earlier version of the standard library than what I have installed; but isn't there backward compatibility between versions with the same major number for the shared library? Again, I'm not really a C++ programmer; but I don't see what the problem is. Any advice greatly appreciated. Thanks.

    Read the article

  • Scapy install issues. Nothing seems to actually be installed?

    - by Chris
    I have an apple computer running Leopard with python 2.6. I downloaded the latest version of scapy and ran "python setup.py install". All went according to plan. Now, when I try to run it in interactive mode by just typing "scapy", it throws a bunch of errors. What gives! Just in case, here is the FULL error message.. INFO: Can't import python gnuplot wrapper . Won't be able to plot. INFO: Can't import PyX. Won't be able to use psdump() or pdfdump(). ERROR: Unable to import pcap module: No module named pcap/No module named pcapy ERROR: Unable to import dnet module: No module named dnet Traceback (most recent call last): File "/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/runpy.py", line 122, in _run_module_as_main "__main__", fname, loader, pkg_name) File "/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/runpy.py", line 34, in _run_code exec code in run_globals File "/Users/owner1/Downloads/scapy-2.1.0/scapy/__init__.py", line 10, in <module> interact() File "scapy/main.py", line 245, in interact scapy_builtins = __import__("all",globals(),locals(),".").__dict__ File "scapy/all.py", line 25, in <module> from route6 import * File "scapy/route6.py", line 264, in <module> conf.route6 = Route6() File "scapy/route6.py", line 26, in __init__ self.resync() File "scapy/route6.py", line 39, in resync self.routes = read_routes6() File "scapy/arch/unix.py", line 147, in read_routes6 lifaddr = in6_getifaddr() File "scapy/arch/unix.py", line 123, in in6_getifaddr i = dnet.intf() NameError: global name 'dnet' is not defined

    Read the article

  • PL/SQL Logical Operators evaluate whole function

    - by Chris
    I know in C like languages logical operators are evaluated one at a time so: false && really_expensive_function() is doesn't result in the function being called (I can't remember the CS name for this). Does the same happen in PL/SQL or do I need to break the IF parts out to separate blocks?

    Read the article

  • Why will show() only work for fields that are hidden using inline css?

    - by Chris
    I am hiding an element using inline css, like so: <span class="hidden-nojs" style="display:none">Some text</span> Next I use jQuery to show the element, like so: $(".hidden-nojs").show(); This works great. As soon as I remove the inline css and put display:none on the external css stylesheet for the hidden-nojs class, it stops working. This is what I wrote in the external stylesheet: .hidden-nojs { display: none; } I'm assuming that the external stylesheet loads after the jQuery has already run? This is somewhat annoying as I would like to hide multiple elements with css and would like to avoid using inline css. Why will show() only work for fields that are hidden using inline css? How can I fix this problem?

    Read the article

  • BigDecimal to_s does not match to_f

    - by Chris Bisignani
    Is the BigDecimal class broken? It seems like the following should never, ever occur: Note that a.to_f != a.to_s.to_f a.class = BigDecimal a.to_f = 18658.1072928 a.to_s = "10865.81072928" b.class = BigDecimal b.to_f = 10000.0 b.to_s = "10000.0" (a - b).to_f = 865.81072928 a.to_f - b.to_f = 8658.1072928 Any ideas as to what might be going wrong?

    Read the article

  • Twitter and Facebook status in

    - by Chris S
    Are there any C# libraries for integrating Facebook status updates and twitter updates (preferably with url shortening) in Monotouch without too much heavy lifting? I know there is a Facebook kit already for objective-C, I really only need status updating however.

    Read the article

  • How is 'processing credit card data' defined (PCI)?

    - by Chris
    If i have a web application and i receive credit card data transmitted via a POST request by a web browser over HTTPS and instantly open a socket (SSL) to a remote PCI compilant card processor to forward the data and wait for a response, am i allowed to do that? or is this receiving the data with my application and forwarding it already subject of "processing credit card data"? if i create an iframe that is displayed in a client browser to enter cc data and this iframe posts the data via HTTPS to remote card processor (directly!) is this already a case of processing credit card data? even if my application code 'doesnt touch' the entered data with any event handlers? i'm interested in the definition "credit card data processing". when does it start to be a cc data processing application? can somebody maybe point me to that section in PCI-DSS standard that clearly defines when you start to 'be a processing application'? Thanks,

    Read the article

  • C# Lambda Problem

    - by Chris Klepeis
    Probably something simple, but as I'm new to lambda expressions, the problem evades me: m => m.contactID == contactID && m.primaryAddress == true && (m.addressTypeID == 2 || m.addressTypeID == 3) I tried to use that lambda expression but I receive an invalid operator. Is there a way to simplify this so that it would work? Edit: The equivolent sql query would be: SELECT * FROM Contact WHERE contactID = 3 AND primaryAddress = 1 AND (addressTypeID = 2 OR addressTypeID = 3) I have a repository function defined like so: public E Single(Expression<Func<E, bool>> where) { return objectSet.Single<E>(where); } I'm passing the lambda expression above into this function. Invalid operator error.

    Read the article

  • UITextfield is becoming focused after UIButton pressed

    - by Chris
    I have a UITextfield for entering text. A button triggers a functionality. After completion of the IBAction the UITextfield is getting focused again. After the IBAction I want to keyboard to disappear. What happends now is that due to the IBAction of the button, the keyboards disappears (I'm showing a UIAlert) and after the IBAction the keyboards pop's up again together with the focus in the UITextfield. Is it possible to prevent the UITextfield to be focused after the IBAction?

    Read the article

  • Change classloader

    - by Chris
    I'm trying to switch the class loader at runtime: public class Test { public static void main(String[] args) throws Exception { final InjectingClassLoader classLoader = new InjectingClassLoader(); Thread.currentThread().setContextClassLoader(classLoader); Thread thread = new Thread("test") { public void run() { System.out.println("running..."); // approach 1 ClassLoader cl = TestProxy.class.getClassLoader(); try { Class c = classLoader.loadClass("classloader.TestProxy"); Object o = c.newInstance(); c.getMethod("test", new Class[] {}).invoke(o); } catch (Exception e) { e.printStackTrace(); } // approach 2 new TestProxy().test(); }; }; thread.setContextClassLoader(classLoader); thread.start(); } } and: public class TestProxy { public void test() { ClassLoader tcl = Thread.currentThread().getContextClassLoader(); ClassLoader ccl = ClassToLoad.class.getClassLoader(); ClassToLoad classToLoad = new ClassToLoad(); } } (it is not relevant what the InjectingClassLoader is) I'd like to make the result of "approach 1" and "approach 2" exactly same, but it looks like thread.setContextClassLoader(classLoader) does nothing and the "approach 2" always uses the system classloader (can be determined by comparing tcl and ccl variables while debugging). Is it possible to make all classes loaded by new thread use given classloader?

    Read the article

< Previous Page | 88 89 90 91 92 93 94 95 96 97 98 99  | Next Page >