Daily Archives

Articles indexed Friday April 23 2010

Page 22/115 | < Previous Page | 18 19 20 21 22 23 24 25 26 27 28 29  | Next Page >

  • Accessing a dialog from Another dialog MFC

    - by Isuru
    Hi, I want to open a separate dialog box when I cllick on a button on my main dialog. I used separateDialog.DoModal() to do it. It open successfully but when I try to add data to a edit control (text box) in that seperate dialog, a debug assertion failure occurs. What is the matter and how can I overcome it? Thank You!!

    Read the article

  • Getting pixel data from an image using java.

    - by Matt
    I'm trying to get the pixel rgb values from a 64 x 48 bit image. I get some values but nowhere near the 3072 (= 64 x 48) values that I'm expecting. I also get: Exception in thread "main" java.lang.ArrayIndexOutOfBoundsException: Coordinate out of bounds! at sun.awt.image.ByteInterleavedRaster.getDataElements(ByteInterleavedRaster.java:301) at java.awt.image.BufferedImage.getRGB(BufferedImage.java:871) at imagetesting.Main.getPixelData(Main.java:45) at imagetesting.Main.main(Main.java:27) I can't find the out of bounds error... Here's the code: package imagetesting; import java.io.IOException; import javax.imageio.ImageIO; import java.io.File; import java.awt.image.BufferedImage; public class Main { public static final String IMG = "matty.jpg"; public static void main(String[] args) { BufferedImage img; try { img = ImageIO.read(new File(IMG)); int[][] pixelData = new int[img.getHeight() * img.getWidth()][3]; int[] rgb; int counter = 0; for(int i = 0; i < img.getHeight(); i++){ for(int j = 0; j < img.getWidth(); j++){ rgb = getPixelData(img, i, j); for(int k = 0; k < rgb.length; k++){ pixelData[counter][k] = rgb[k]; } counter++; } } } catch (IOException e) { e.printStackTrace(); } } private static int[] getPixelData(BufferedImage img, int x, int y) { int argb = img.getRGB(x, y); int rgb[] = new int[] { (argb >> 16) & 0xff, //red (argb >> 8) & 0xff, //green (argb ) & 0xff //blue }; System.out.println("rgb: " + rgb[0] + " " + rgb[1] + " " + rgb[2]); return rgb; } }

    Read the article

  • Telerik RadGridView problem

    - by Polaris
    I am using Telerik RadGridView in my project. I want to show image in column. GridViewImageColumn col1 = new GridViewImageColumn(); col1.Width = 100; col1.DataMemberBinding = new Binding("id"); col1.Header = "PhotoByConverter"; col1.DataMemberBinding.Converter = new ThumbnailConverter(); grid.Columns.Add(col1); GridViewImageColumn col2 = new GridViewImageColumn(); col2.Width = 100; col2.DataMemberBinding = new Binding("firstName"); col2.Header = "Person name"; col2.DataMemberBinding.Converter = new ThumbnailConverter(); grid.Columns.Add(col2); Grid.ItemsSource=DataTable; First column not wokrs but second works fine. I use Converter for image shown below public class ThumbnailConverter : IValueConverter { public object Convert(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture) { IEnumerable<thumbNail> result = from n in thumbnails where n.personID == value.ToString() select n; if (result != null && result.First().thumbnail != null) { return result.First().thumbnail.file; } else { return null; } } public object ConvertBack(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture) { throw new Exception("The method or operation is not implemented."); } } I found by id thumbnail of person and set it like data for GridViewImageColumn. I checked with Debuger conveter works properly. I can't undesrtand why it doesn't work. Any ideas?

    Read the article

  • Playing around with my Java project in Eclipse... what the crap did I just do?

    - by Daddy Warbox
    I don't even remember how, but somehow I managed to make all of my project's source files hidden in Eclipse's Package and Project Explorer panels. Go figure. 'Show Filtered Children (alt+click)' temporarily reveals the files, and only in Package Explorer can I double-click to reopen them from this view. They go back into hiding after I select another item, though. Plus, now I'm getting other annoyances, such as all of the folded non-hidden items altogether expanding when I click on an item, and the entire folder tree of my project now being shown in these panels (including my .svn subversion folders... which shouldn't be any of Eclipse's business, presently). Long story short, my Package/Project Explorers' just blew up on me, and I want to know how to fix this. Thanks in advance. P.S. What's a good guide I can use to learn my way around this silly contraption, anyway?

    Read the article

  • Syntax error in INSERT INTO statement in c# oledb?

    - by sameer
    I am having a table called SubMaster_Accounts, which contains 9 fields. In which I want to insert data to some fields and i want to store some other fields as NULL. I tried to write the query using query string, The sql query works perfectly when i insert the data for all the fields, but when i insert data as NULL to some of the fields it shows syntax error in Insert command. The fields which i want to insert as NULL are not constraints. How can i do it? This is my query string. insert into SubMaster_Account ([SMcode], [MSname], [Sname], [Openbalrs], [Openbalrs1], [Openbalmet], [Openbalmet1], [Creditdays], [Sdesc]) values ('" + SMcode + "','" + MSname + "','" + Sname + "'," + Openbalrs + ",'" + Openbalrs1 + "'," + Openbalmet + ",'" + Openbalmet1 + "'," + Creditdays + ",'" + Sdesc + "')

    Read the article

  • Switch case in jquery

    - by Jasl
    Am I writing the correct switch case? var cnt = $("#div1 p").length; alert(cnt); switch (cnt) { case (cnt >= 10 && cnt <= 20): alert('10'); break; case (cnt >= 21 && cnt <= 30): alert('21'); break; case (cnt >= 31 && cnt <= 40): alert('31'); break; default: alert('>41'); } For some reason, the alert does not occur when the conditions are matched!

    Read the article

  • What is wrong with this trigger in mysql?

    - by Jimit
    Hi all, Below is trigger that I need to create but It is not getting created.Please any buddy can explain me what is wrong with this trigger ? Help me please. DELIMITER $$ CREATE TRIGGER property_history_update AFTER UPDATE ON `properties` FOR EACH ROW BEGIN IF OLD.ListPrice != NEW.ListPrice THEN INSERT INTO `property_history` SET ListingKey=OLD.ListingKey,ListPrice = NEW.ListPrice, ListingStatus = OLD.ListingStatus,LastUpdatedTime = NEW.LocalLastModifiedOn; END IF; END$$ DELIMITER ;

    Read the article

  • Maintain one to one mapping between objects

    - by Rohan West
    Hi there, i have the following two classes that provide a one to one mapping between each other. How do i handle null values, when i run the second test i get a stackoverflow exception. How can i stop this recursive cycle? Thanks [TestMethod] public void SetY() { var x = new X(); var y = new Y(); x.Y = y; Assert.AreSame(x.Y, y); Assert.AreSame(y.X, x); } [TestMethod] public void SetYToNull() { var x = new X(); var y = new Y(); x.Y = y; y.X = null; Assert.IsNull(x.Y); Assert.IsNull(y.X); } public class X { private Y _y; public Y Y { get { return _y; } set { if(_y != value) { if(_y != null) { _y.X = null; } _y = value; if(_y != null) { _y.X = this; } } } } } public class Y { private X _x; public X X { get { return _x; } set { if (_x != value) { if (_x != null) { _x.Y = null; } _x = value; if (_x != null) { _x.Y = this; } } } } }

    Read the article

  • jQuery Flow Control (if then from URL params)

    - by Ryan Max
    Strangely enough I am more familiar with jQuery than I am with javascript. I need to be able to add a class to the body tag of a document depending on what specific forum page i'm on in a phpbb forum. Due to the nature of phpbb I can't actually do this flow control in php, so I am using jquery. Here's my code (the first part is an extend that gets the url parameters like so http://www.mysite.com/viewforum.php?f=3 var forum = $.getUrlVar('f'); will make forum == 3 because of the nature of phpbb i can't really do any flow control with php. So I am using jquery. This is my code: $(document).ready(function(){ $.extend({ getUrlVars: function(){ var vars = [], hash; var hashes = window.location.href.slice(window.location.href.indexOf('?') + 1).split('&'); for(var i = 0; i < hashes.length; i++) { hash = hashes[i].split('='); vars.push(hash[0]); vars[hash[0]] = hash[1]; } return vars; }, getUrlVar: function(name){ return $.getUrlVars()[name]; } }); }); $(document).ready(function(){ var forum = $.getUrlVar('f'); if (forum == 3){ $('body').toggleClass('black'); } }); Yet this isn't working. Any idea why not?

    Read the article

  • Eclipse hangs when rebuilding after the addition of an external JAR file.

    - by celestialorb
    I'm fairly new to Eclipse so if this is something simple I apologize, however when I attempt to add an external JAR file to my build path (specifically the "rt.jar" file which contains certain tools that I require) and then rebuild my project, Eclipse will hang at the end of the Build process. It'll get to 100% then just hang there using 100% of one of my CPU cores. At first I thought it may have been due to the relatively large size of the rt.jar file, but I tried using smaller JAR files and it still hung at 100%. Any help would be greatly appreciated! If there is something wrong with using the rt.jar file does anyone know of another JAR file that contains both tools for dealing with SOAP requests as well as XML/DOM manipulation? Thanks again!

    Read the article

  • How to use prettify with blogger/blogspot?

    - by billpg
    Hi everyone. I'm using blogger.com to host some texts on programming, and I'd like to use prettify (same as stackoverflow) to nicely colour the code samples. How do I install the prettify scripts into the blog domain? Would it be better (if indeed its possible) to link to a shared copy somewhere? I have webspace on a different domain. Would that help? Many thanks.

    Read the article

  • dynamically set the control template

    - by Saboor
    hi, i am using dictionaries in WPF. i have two bitmap image in it with name something like image1 and image2 now in forms, i like to set them to single image control depending on condition, some times image1 and sometimes image2. so how i set the source dynamically, in dictonary i have UriSource="/wpf1;component/images/infobarGreen.png" / UriSource="/wpf1;component/images/infobarRed.png" /

    Read the article

  • Put text directly to the left of an <LI>

    - by Horace Loeb
    I have a list of songs, and I want to put the word "New!" to the left of the new songs like this: How can I do this so that all the songs line up? I.e., I want the names of songs that aren't new to line up with the names of songs that are new, not with the start of the word "New" Note that this is trivial if "New!" is an image. I.e., I set the image as the background-image of the <li> and give it some padding-left

    Read the article

  • Source code comparison app that doesn't require files?

    - by ZenBlender
    I'm looking for an easy-to-use, free source code comparison app for Windows, which will highlight differences side-by-side between two pieces of source code. Some apps get close to what I want, but are too restrictive by requiring you load in entire files and compare them in their entirety. Sometimes I just want to compare a section of my file, such as a single function, which may be in totally different locations in the two versions I'd be comparing, making it hard to find in both panes in large files. Basically, I'd like to be able to simply edit/copy/paste the content in both panes rather than have the restriction of using files. That way I can copy and paste one function into one pane and another into the other, editing/re-ordering as necessary. (Note that I realize there are other comparison app recommendation threads out there, but I'm having a hard time finding a free app that isn't a strict file-to-file comparison app) Thanks for any pointers or links, thanks!

    Read the article

  • Server Application Unavailable ?

    - by Surya sasidhar
    hi, i am a developer and i developed the web application(asp.net). It is working in my local server fine when i take new domain and upload the site in to that domain i am getting this error hi, After completion of my project. I placed in online the default page is coming but when i click on any link button it is giving this error can you help me. m3connect.in is url of my site and error is Server Application Unavailable The web application you are attempting to access on this web server is currently unavailable. Please hit the "Refresh" button in your web browser to retry your request. Administrator Note: An error message detailing the cause of this specific request failure can be found in the application event log of the web server. Please review this log entry to discover what caused this error to occur.

    Read the article

  • Server Migration Checklist II

    - by merrillaldrich
    Easy Breezy Login Audit for your Ol’ 2000 Server In the last post on this topic I put up the preparatory steps I’ve been using for server migrations. Here I am posting some code that has worked well for us to trace who/what is connecting to our older SQL Server 2000 machines. It’s a simple audit of login events, tracing the login name, host name, database, and last login time for connections to the server, and gave us valuable insight into who was really using the machines and which databases might...(read more)

    Read the article

  • Buffer Overrun Issues VC++

    - by sijith
    When i execute my code i am getting this error LPTSTR lpBuffer; ::GetLogicalDriveStrings(1024,lpBuffer); while(*lpBuffer != NULL) { printf("%s\n", lpBuffer); // or MessageBox(NULL, temp, "Test", 0); or whatever lpBuffer += lstrlen(lpBuffer)+1; printf("sizeof(lpBuffer) %d\n",lstrlen(lpBuffer)); } OutPut C sizeof(lpBuffer) 3 D sizeof(lpBuffer) 3 E sizeof(lpBuffer) 3 F sizeof(lpBuffer) 0

    Read the article

< Previous Page | 18 19 20 21 22 23 24 25 26 27 28 29  | Next Page >