Daily Archives

Articles indexed Tuesday March 23 2010

Page 16/130 | < Previous Page | 12 13 14 15 16 17 18 19 20 21 22 23  | Next Page >

  • How to get keypressed, keydown events from DataGridView data cells

    - by extropy
    Hi. I need to recieve the key press events during cell editing in DataGridView control. From what I have found on the net the DataGridView is designed to pass all key events from DataGridView to the cell editing control and you cannot get these events easily. I found this peace of code http://www.codeproject.com/KB/grid/DataGridCellEvents.aspx that traps those events for DataGrid control, but that does not work for DataGridView.

    Read the article

  • How do i create an array of unequal length arrays?

    - by Faken
    Hello everyone, I need to create a sort of 2D array in which each one of the secondary arrays are of different length. I have a 1D array of known length (which defines the number of arrays to be formed) with each element having a number that denotes the length of the secondary array in that position. Each one of the arrays are fairly large so i don't want to create a one-size-fits-all "fake" 2D heap array to cover everything. How would i go about doing this? Any 2D array I have made before are always rectangular. I'm trying to do this so that i can create some code to dynamically generate threads to split up some workload. Thanks, -Faken

    Read the article

  • Simplifying Testing through design considerations while utilizing dependency injection

    - by Adam Driscoll
    We are a few months into a green-field project to rework the Logic and Business layers of our product. By utilizing MEF (dependency injection) we have achieved high levels of code coverage and I believe that we have a pretty solid product. As we have been working through some of the more complex logic I have found it increasingly difficult to unit test. We are utilizing the CompositionContainer to query for types required by these complex algorithms. My unit tests are sometimes difficult to follow due to the lengthy mock object setup process that must take place, just right, to allow for certain circumstances to be verified. My unit tests often take me longer to write than the code that I'm trying to test. I realize this is not only an issue with dependency injection but with design as a whole. Is poor method design or lack of composition to blame for my overly complex tests? I've tried base classing tests, creating commonly used mock objects and ensuring that I utilize the container as much as possible to ease this issue but my tests always end up quite complex and hard to debug. What are some tips that you've seen to keep such tests concise, readable, and effective?

    Read the article

  • Appengine JDO dataclasses to python model

    - by M.A. Cape
    Does anyone have tried to implement an app in GAE having both java and python? I have an existing app and my front end is in java. Now I want to use the existing datastore to be interfaced by python. My problem is i don't know how to define the relationships and model that would be equivalent to the one in java. I have tried the one-to-many relationship in python but when stored in the datastore, the fields are different than the one-to-many of java. My data classes are as follows. //one-to-many owned Parent Class public class Parent{ @PrimaryKey @Persistent private String unitID; //some other fields... @Persistent @Order(extensions = @Extension(vendorName="datanucleus", key="list-ordering", value="dateCreated desc")) private List <Child> child; //methods & constructors were omitted } Child public class Child{ @PrimaryKey @Persistent(valueStrategy = IdGeneratorStrategy.IDENTITY) private Key uId; @Persistent private String name; /* etc... */ }

    Read the article

  • Getting a screenshot of a page using .NET - Need help with code

    - by Ender
    I'm writing a specialized crawler and parser for internal use and I require the ability to take a screenshot of a web page in order to check what colours are being used throughout. The program will take in around ten web addresses and will save them as a bitmap image, from there I plan to use LockBits in order to create a list of the five most used colours within the image. To my knowledge it's the easiest way to get the colours used within a web page but if there is an easier way to do it please chime in with your suggestions. Anyway, I was going to use this program until I saw the price tag. I'm also fairly new to C#, having only used it for a few months. Can anyone provide me with a solution to my problem of taking a screenshot of a web page in order to extract the colour scheme? EDIT: Sorry for not getting back to this sooner, but I've been busy with some other things. Anyway, the code seems to work well, but the problem I am having right now is that I am running it within a form, and naturally with Application.Run() being called I cannot run two instances of the same form at once. It recommended Form.showDialog() but that broke everything. Can anyone give me a hand with this code? public static void buildScreenshotFromURL(string url) { int width = 800; int height = 600; using (WebBrowser browser = new WebBrowser()) { browser.Width = width; browser.Height = height; browser.ScrollBarsEnabled = true; // This will be called when the page finishes loading browser.DocumentCompleted += new System.Windows.Forms.WebBrowserDocumentCompletedEventHandler(OnDocumentCompleted); //browser.DocumentCompleted += OnDocumentCompleted; browser.Navigate(url); // This prevents the application from exiting until // Application.Exit is called // Application.Run() does not work as it cannot be called twice, recommended form.showDialog() // but still issues Application.Run(); } } public static void OnDocumentCompleted(object sender, WebBrowserDocumentCompletedEventArgs e) { // Define size of thumbnail neded int thumbSize = 50; // Now that the page is loaded, save it to a bitmap WebBrowser browser = (WebBrowser)sender; // Code edited from example below to make smaller bitmap and save as PNG using (Graphics graphics = browser.CreateGraphics()) { using (Bitmap bitmap = new Bitmap(browser.Width, browser.Height, graphics)) { Rectangle bounds = new Rectangle(0, 0, bitmap.Width, bitmap.Height); browser.DrawToBitmap(bitmap, bounds); Bitmap thumbBitmap = new Bitmap(bitmap.GetThumbnailImage(thumbSize, thumbSize, thumbCall, IntPtr.Zero)); thumbBitmap.Save("screenshot.png", ImageFormat.Png); handleImage(thumbBitmap); } }

    Read the article

  • Exchange 2003 - Keep user's mailbox but disable account and prevent new emails

    - by molecule
    Hi all, Just wanted to know what's your take on this... A user has left the company but may return in future. I would like to disable his AD account, archive all his emails, keep his mailbox and prevent new emails from being sent to him. What's the "best practice" method of doing this? Please enlighten and thanks in advance. What I would do: Reset AD password Change SMTP address - leading to NDRs if new emails are sent to his/her previous address Logon as him/her and archive emails Disable AD account Hide address from GAL

    Read the article

  • C++ string.substr() function problem

    - by VaioIsBorn
    I want to make a program that will read some number in string format and output it like this: if the number is 12345 it should then output 12 23 34 45 . I tried using the substr() function from the c++ string library, but it gives me strange results - it outputs 1 23 345 45 instead of the expected result. Why ? #include <iostream> #include <string> #include <cstdlib> using namespace std; int main(void) { string a;cin >> a; string b;int c; for(int i=0;i<a.size()-1;++i) { b = a.substr(i,i+1); c = atoi(b.c_str()); cout << c << " "; } cout << endl; return 0; }

    Read the article

  • Using the web browser control

    - by Khou
    Using the standard .NET web browser control how do you... 1)Auto POST (ie submit) a form 2) Detect form has been posted and the browser has been landed on the specified page (this is to check that the user has logged in) 3) detect form input value on a change event

    Read the article

  • How can I show the contents of a file at a specific state of a git repo?

    - by richcollins
    I want to show the contents of a file given by a path at a specific state of a git repo. I unsuccessfully tried this: git show f825334150cd4bc8f46656b2daa8fa1e92f7796d:Katana/source/Git/GitLocalBranch.h fatal: ambiguous argument 'f825334150cd4bc8f46656b2daa8fa1e92f7796d:Katana/source/Git/GitLocalBranch.h': unknown revision or path not in the working tree. Use '--' to separate paths from revisions The commit in question didn't modify the file specified. How can I show the contents of a file at a given state (specified by a commit hash) regardless of the involvement of the file in the commit?

    Read the article

  • .NET Sockets and Proxy Servers

    - by Tristan
    I'm trying to make some source code for a library I downloaded work with a proxy server. The library uses sockets to connect to a server but if the client using the library is behind a proxy server it can't connect. Does anyone know how I can modify the socket to be able to connect to the server through a proxy server? I really want to just do this with the sockets in the library without having to change too much code to use WebRequest or something similar

    Read the article

  • Continuous Progress Bar in Javascript

    - by Goro
    Hello, I am trying to find the best option to create a simple progress bar that I need to be triggered periodically from within another JavaScript script. Every few minutes, a timer would cause the progress bar to start going from 0 to 100%. Once it reaches 100%, the bar would reset to 0. I am trying to implement a smooth animated version of the bar, like this one: http://www.webappers.com/progressBar/. (I tried adapting this particular one but I could not get it to work the way I described) I am looking into the jQuery UI ProgressBar: Is it possible to use it in the manner I have described? Thank you.

    Read the article

  • Webdevelopment with Jetty & Maven

    - by Phuong Nguyen de ManCity fan
    I find it very frustrating doing web development with Maven & Jetty using Eclipse, compare with what I did using Visual Studio. Everytime I make a change, even a minor change in my view file, (*.jsp, for example), then I have to re-package the whole web - waiting for jetty to reload everything before I can see the change. Is there any better way to do that, some thing like an automatically plugin that will picked that changed files and deploy the changed files to web server?

    Read the article

  • How to return a result (startActivityForResult) from a TabHost Activity?

    - by pcm2a
    I have 3 classes in my example: Class A, the main activity. Class A calls a startActivityForResult: Intent intent = new Intent(this, ClassB.class); startActivityForResult(intent, "STRING"); Class B, this class is a TabActivity: Intent intent = new Intent(this, ClassC.class); tabHost.addTab... Class C, this class is a regular Activity: Intent intent = this.getIntent(); intent.putExtra("SOMETHING", "EXTRAS"); this.setResult(RESULT_OK, intent); finish(); onActivityResult is called in Class A, but the resultCode is RESULT_CANCELED instead of RESULT_OK and the returned intent is null. How do I return something from the Activity inside a TabHost? I realize that the problem is that my Class C is actually running inside of Class B, and Class B is what is returning the RESULT_CANCELED back to Class A. I just don't know a work around yet.

    Read the article

  • My httpd.conf was accidentally deleted, can't start apache. How do I recreate httpd.conf in Godaddy'

    - by mdm414
    Hi, I don't know if it's appropriate to ask for this but I really need to know what's the initial content of /var/www/vhosts/mydomain.com/conf/httpd.include on Godaaddy's VDS because the conf directory was accidentally deleted by somebody and now I cannot start Apache. We didn't purchase an assited service plan so Godaddy won't help me with this. So please, if you're using Godaddy's VDS plan, please help me with this. ** I also need to include in httpd.conf the lines needed for Plesk to work. Thanks a lot

    Read the article

  • How to properly remove disk from PERC 6/i RAID controller ?

    - by Stefano Borini
    I have a Dell T710, coming with PERC 6/i RAID controller. The current raid has 2x500 GB hard drives (with the OS), and 6x1000 GB hard drives (in RAID-6, currently empty). I would like to take one 1000 GB disk physically out to keep as an immediate spare in case of a crash, and configure the remaining 5x1000 GB in a single VD RAID-6. This is all nice and clean and works, until I realized that the display on the machine reports the lack of the 8th disk as an error. It's marked as error, but appears to be a warning, since the machine is fully functional. My question is: what is the best way to keep one disk as a spare out of the array? should I disassemble the disk from the cradle and insert the empty cradle in the array ? Or should I just silence the error in the display in some way (how?). I know that what I am doing sounds pretty strange, but here is academia and having a spare disk available could take weeks. Better to have one ready in my drawer for any emergency.

    Read the article

  • Ping computername - result format

    - by kamleshrao
    Hi, I am trying PING command on my Windows 7 PC after many months. While doing this, I notice the following result: Ping using computer name: D:\>ping amdwin764 Pinging AMDWIN764 [fe80::ac53:546f:a730:8bd6%11] with 32 bytes of data: Reply from fe80::ac53:546f:a730:8bd6%11: time=1ms Reply from fe80::ac53:546f:a730:8bd6%11: time=1ms Reply from fe80::ac53:546f:a730:8bd6%11: time=1ms Reply from fe80::ac53:546f:a730:8bd6%11: time=1ms Ping statistics for fe80::ac53:546f:a730:8bd6%11: Packets: Sent = 4, Received = 4, Lost = 0 (0% loss), Approximate round trip times in milli-seconds: Minimum = 1ms, Maximum = 1ms, Average = 1ms Ping using IP address: D:\>ping 192.168.1.2 Pinging 192.168.1.2 with 32 bytes of data: Reply from 192.168.1.2: bytes=32 time=75ms TTL=128 Reply from 192.168.1.2: bytes=32 time=1ms TTL=128 Reply from 192.168.1.2: bytes=32 time=1ms TTL=128 Reply from 192.168.1.2: bytes=32 time=1ms TTL=128 Ping statistics for 192.168.1.2: Packets: Sent = 4, Received = 4, Lost = 0 (0% loss), Approximate round trip times in milli-seconds: Minimum = 1ms, Maximum = 75ms, Average = 19ms Why am I not getting the Ping results with Numeric IP address in my first example? Thanks, Kamlesh

    Read the article

< Previous Page | 12 13 14 15 16 17 18 19 20 21 22 23  | Next Page >