Search Results

Search found 2390 results on 96 pages for 'morten green hermansen'.

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

  • Java image conversion to RGB565

    - by Vladimir
    I try to convert image to RGB565 format. I read this image: BufferedImage bufImg = ImageIO.read(imagePathFile); sendImg = new BufferedImage(CONTROLLER_LCD_WIDTH/*320*/, CONTROLLER_LCD_HEIGHT/*240*/, BufferedImage.TYPE_USHORT_565_RGB); sendImg .getGraphics().drawImage(bufImg, 0, 0, CONTROLLER_LCD_WIDTH/*320*/, CONTROLLER_LCD_HEIGHT/*240*/, null); Here is it: Then I convert it to RGB565: int numByte=0; byte[] OutputImageArray = new byte[CONTROLLER_LCD_WIDTH*CONTROLLER_LCD_HEIGHT*2]; int i=0; int j=0; int len = OutputImageArray.length; for (i=0;i<CONTROLLER_LCD_WIDTH;i++) { for (j=0;j<CONTROLLER_LCD_HEIGHT;j++) { Color c = new Color(sendImg.getRGB(i, j)); int aRGBpix = sendImg.getRGB(i, j); int alpha; int red = c.getRed(); int green = c.getGreen(); int blue = c.getBlue(); //RGB888 red = (aRGBpix >> 16) & 0x0FF; green = (aRGBpix >> 8) & 0x0FF; blue = (aRGBpix >> 0) & 0x0FF; alpha = (aRGBpix >> 24) & 0x0FF; //RGB565 red = red >> 3; green = green >> 2; blue = blue >> 3; //A pixel is represented by a 4-byte (32 bit) integer, like so: //00000000 00000000 00000000 11111111 //^ Alpha ^Red ^Green ^Blue //Converting to RGB565 short pixel_to_send = 0; int pixel_to_send_int = 0; pixel_to_send_int = (red << 11) | (green << 5) | (blue); pixel_to_send = (short) pixel_to_send_int; //dividing into bytes byte byteH=(byte)((pixel_to_send >> 8) & 0x0FF); byte byteL=(byte)(pixel_to_send & 0x0FF); //Writing it to array - High-byte is second OutputImageArray[numByte]=byteH; OutputImageArray[numByte+1]=byteL; numByte+=2; } } Then I try to restore this from resulting array OutputImageArray: i=0; j=0; numByte=0; BufferedImage NewImg = new BufferedImage(CONTROLLER_LCD_WIDTH, CONTROLLER_LCD_HEIGHT, BufferedImage.TYPE_USHORT_565_RGB); for (i=0;i<CONTROLLER_LCD_WIDTH;i++) { for (j=0;j<CONTROLLER_LCD_HEIGHT;j++) { int curPixel=0; int alpha=0x0FF; int red; int green; int blue; byte byteL=0; byte byteH=0; byteH = OutputImageArray[numByte]; byteL = OutputImageArray[numByte+1]; curPixel= (byteH << 8) | (byteL); //RGB565 red = (curPixel >> (6+5)) & 0x01F; green = (curPixel >> 5) & 0x03F; blue = (curPixel) & 0x01F; //RGB888 red = red << 3; green = green << 2; blue = blue << 3; //aRGB curPixel = 0; curPixel = (alpha << 24) | (red << 16) | (green << 8) | (blue); NewImg.setRGB(i, j, curPixel); numByte+=2; } } I output this restored image. But I see that it looks very poor. I expected the lost of pictures quality. But as I thought, this picture has to have almost the same quality as the previous picture. - Is it right? Is my code right?

    Read the article

  • How can i get the absolute position of an SVG element inside the SVG tag using javascript?

    - by Morten
    Hi! I am trying to return the absolute position of an element in a SVG. I have tried using basic javascript functions to return the relative position but I only have access to the contentDocument since the SVG is embeded using an OBJECT tag. Because of this I cannot recurse thru the elements to find the position of the element position... Is there any native SVG functions to get the position of an element relative to the SVG element (X=0, Y=0)? Thank you, Morten!

    Read the article

  • Prototype.js: How can i return an array without all the methods Prototypes extends Array with?

    - by Morten
    Hi! Is there a way to return a new version of an array/hash that does not contain all the methods/functions that prototype extends the array object with? Example: var myArray = $A(); myArray['test'] = '1'; myArray['test2'] = '2'; var myVariableToPassToAjax = myArray; If I debug myVariableToPassToAjax it looks like this: Array ( [test] = 1 [test2] = 2 [each] = function each(iterator, context) { .......... .......... } ...and all the other extended array functions ); Is there a way to solve this? :-/ Morten

    Read the article

  • What do the FireBug DOM colors mean?

    - by André Pena
    I'm confused with these colors. I noticed there are 4 colors showing in the left hand column of FireBug DOM tree: Bold black Black Bold green Green In the right hand column: Blue Red Bold green Green Multiple color elements representing object structures. What do this colors represent? And why, e.g, I can access window.document.URL and I can't access window.document.body in Console even though they are both in the "not-bold black" category in the DOM tree? Thanks a lot

    Read the article

  • Python: For loop problem

    - by Yasmin
    I have a simple for loop problem, when i run the code below it prints out series of 'blue green' sequences then a series of 'green' sequences. I want the output to be; if row[4] is equal to 1 to print blue else print green. for row in rows: for i in `row[4]`: if i ==`1`: print 'blue ' else: print 'green ' Any help would be grateful thanks Yas

    Read the article

  • Problem with creation of scheduled task from IIS6 on SR2003

    - by Morten Louw Nielsen
    Hi, I am writing a webapplication using .NET. The webapp creates scheduled tasks using the System.Diagnostics.Process class, calling SCHTASKS.EXE with parameters. I have changed the identity on the app pool, to a specific domain user. The domain-user is local administrator on all the four webservers. From webserver01 I am creating tasks on webserver01 to webserver04. It works perfect for 3-5 days, but then it breaks. It gives me the following errormessage in a messagebox: "The application failed to initialize properly (0xc0000142). Click on OK to terminate the application." If I have the system in the broken state, and I change the identity of the app pool to Domain administrator, it works. As I change it back to my domain-user, it breaks again. If I reboot the server, it works again for the same amount of days, but will break again. It seems like a permission-related problem. I just don't understand why it works sometimes, and sometimes doesn't. I hope someone outthere has seen this problem! Looking forward to hear from you! Kind regards, Morten, Denmark

    Read the article

  • Use jQuery to find div by background color

    - by maxsilver
    I'm trying to use jQuery to find the number of divs that are both visible, and have a background color of Green. (Normally I'd just add a class to the div, style it green, and check for that class in jQuery but in this instance, I can't actually change the markup of the page itself in any way) I currently have the visible div part working as : if( // if there are more than one visible div $('div.progressContainer:visible').length > 0 ){ I'd like to throw some kind of "and background color is green" selector in there. // not legit javascript if( // if there are more than one visible div, and its color is green $('div.progressContainer:visible[background-color:green]').length > 0 ){ Is it possible to do this?

    Read the article

  • WCF configuration and ISA Proxies

    - by Morten Louw Nielsen
    Hi, I have a setup with a .NET WCF Service hosted on IIS. The client apps are connecting to the service through a set of ISA proxy's. I don't know how many and don't know about their configuration etc. In the client apps I open a client to the service and make several calls via the same client. It works great in my office, but when I deploy at the customer (using the ISAs), after some calls, the connection breaks. In a successfull case, the client will maximum live a few seconds, but is that too much? I think there might be several proxyes. Maybe it's using load ballancing. pseudo code is something like this: WcfClient myClient = new WcfClient(); foreach (WorkItem Item in WorkItemsStack) myClient.ProcessItem(Item); myClient.Close(); I am thinking whether I have to do something like this foreach (WorkItem Item in WorkItemsStack) { WcfClient myClient = new WcfClient(); myClient.ProcessItem(Item); myClient.Close(); } Any one with experience with this field? Kind Regards, Morten, Denmark

    Read the article

  • Can the customer be a SCRUM Product Owner in a project?

    - by Morten
    I just had a discussion with a colleague about the Product Owner role: In a project where a customer organization has brought in a sofware developing organization (supplier), can the role of Product Owner be successfully held by the customer organization, or should it always be held by the supplier? I always imagined, that the PO was the supplier organizations guy. The guy that ensured that the customer is happy, and continously fed with new and high-businessvalue functionality, but still an integral part of the developer organization. However, maybe I have viewed the PO role too much like the waterfall project manager. My colleague made me think: If the customer organization is mature and proffessional enough, why not let a person from their camp prioritize the backlog?? That would put the PO role much closer to the business, thus being (in theory) better to assess the business value of backlog items. To me, that is an intriguing thought. But what are the implication of such a setup??? I look forward to your input.

    Read the article

  • How to document/verify consistent layering?

    - by Morten
    I have recently moved to the dark side: I am now a CUSTOMER of software development -- mainly websites. With this new role comes new concerns. As a programmer i know how solid an application becomes when it is properly layered, and I want to use this knowledge in my new job. I don't want business logic in my presentation layer, and certainly not presentation stuff in my data layer. Thus, I want to be able to demand from my supllier that they document the level of layering, and how neat and consistent the layering is. The big question is: How is the level of layering documented to me as a customer, and is that a reasonable demmand for me to have, so I don't have to look in the code (I'm not supposed to do that anymore)?

    Read the article

  • Structuring a rails application with static data

    - by Morten
    I'm working on a rails application, and so far I've focused on the api and the functionality. But now I'm more and more reaching a point where I will want to add static content, descriptions of the software and help information. Information that is generally in a CMS system. How do I in the best way structure this so I can still work with the application. Yet maintaining the look and feel of the rails application? Do write a CMS in my app? That seems a bit far fetched. Are there any Gems that do this? What is the de facto standard for architecting this scenario?

    Read the article

  • help with boxplot needed

    - by kathy_BJ
    I am new to R, can anyone help me with boxplot for a dataset like: file1 col1 col2 col3 col4 col5 050350005 101 56.625 48.318 RED 051010002 106 50.625 46.990 GREEN 051190007 25 65.875 74.545 BLUE 051191002 246 52.875 57.070 RED 220050004 55 70 80.274 BLUE 220150008 75 67.750 62.749 RED 220170001 77 65.750 54.307 GREEN file2 col1 col2 col3 col4 col5 050350005 101 56.625 57 RED 051010002 106 50.625 77 GREEN 051190007 25 65.875 51.6 BLUE 051191002 246 52.875 55.070 RED 220050004 55 70 32 BLUE 220150008 75 67.750 32.49 RED 220170001 77 65.750 84.07 GREEN for each color (red,green and blue), I need to compare file1 and file2 by making box plot with MB and RMSE for (col4-col3) for file1 and file2 by dividing col2 in different group: if col2<20,20<=col2<50, 50 <= col2 <70, col2 =70. That is, for the boxplot, the x is (<20, 20-50,50-70, 70), while y is MB (and RMSE) of the difference of col4 and col3 I hope I didn't confuse anybody. Thank you so much.

    Read the article

  • ATI Radeon HD 5750 and lagging in games and youtube videos

    - by Morten Fjord Christensen
    I have a X-ONE W-601 desktop pc: 3,1GHz AMD QuadCore Athlon II 645 X4 8 GB DDR3 RAM 1000 GB Harddisk 7200RPM ATI Radeon HD5750 with 1GB DDR5 RAM I'm running Ubuntu 11.10 64-bit and have installed the proprietary driver, but still games lag and videos a little bit. Been googling around and seen that it has something to do with the older drivers from AMD and KMS, but no guide helped me correctly through to make my graphic card work smoothly. I don't know if this helps but "fglrxinfo" in terminal shows: display: :0 screen: 0 OpenGL vendor string: ATI Technologies Inc. OpenGL renderer string: ATI Radeon HD 5700 Series OpenGL version string: 4.1.11005 Compatibility Profile Context And the driver check command shows: [ 51.184] (II) ATI Proprietary Linux Driver Version Identifier:8.88.7 Any help appreciated :D

    Read the article

  • How should calculations be handled in a document database

    - by Morten
    Ok, so I have a program that basically logs errors into a nosql database. Right now there is just a single model for an error and its stored as a document in the nosql database. Basically I want to summarize across different errors and produce a summary of the "types" of errors that occured. Traditionally in a SQL database the this normalization would work with groupings, sums and averages but in a NoSQL database I assume I need to use mapreduce. My current model seems unfit for the task, how should I change the way I store "models" in order to make statistical analysis easy? Would a NoSQL database even be the right tool for this type of problem? I'm storing things in Google AppEngine's BigTable, so there are some limitations to think of as well.

    Read the article

  • Should I demand unit-testing from programmers?

    - by Morten
    I work at a place, where we buy a lot of IT-projects. We are currently producing a standard for systems-requirements for the requisition of future projects. In that process, We are discussing whether or not we can demand automated unit testing from our suppliers. I firmly believe, that proper automated unit-testing is the only way to document the quality and stability of the code. Everyone else seems to think that unit-testing is an optional method that concerns the supplier alone. Thus, we will make no demands of automated unit-testing, continous testing, coverage-reports, inspections of unit-tests or any of the kind. I find this policy extremely frustrating. Am I totally out of line here? Please provide me with arguments for any of the oppinions.

    Read the article

  • Zend Framework Relationships - findDependentRowset

    - by Morten Nielsen
    Hello, When I call the method findDependentRowset, the returning rowset contains all the rows in the dependent table, and not only the rowsets that matches the reference. Hoping someone could explain this, since I was of the assumption that findDependentRowset would only return rowset matching my 'rule'? I have the following DbTable Models: class Model_DbTable_Advertisement extends Zend_Db_Table_Abstract { protected $_name = 'Advertisements'; protected $_primary = 'Id'; protected $_dependentTables = array ( 'Model_DbTable_Image', ); } class Model_DbTable_Image extends Zend_Db_Table_Abstract { protected $_name = 'Images'; protected $_primary = 'Id'; protected $_referenceMap = array( 'Images' => array( 'column' => 'AdvertisementId', 'refColumn' => 'Id', 'refTableClass' => 'Model_DbTable_Advertisement', ) ); } Now when i execute the following: (Simplified for Question sake) $model = new Model_DbTable_Advertisement(); $rowSet = $model->fetchAll(); $row = $rowSet->current(); $dRow = $row->findDependentRowset('Model_DbTable_Image'); I would expect $dRow to only contain 'Images' that has the same advertisementId as $row, but instead i receive all rows in the Images table. Any help appriciated. Kind regards, Morten

    Read the article

  • How can I turn a bunch of rows into aggregated columns WITHOUT using pivot in SQL Server 2005?

    - by cdeszaq
    Here is the scenario: I have a table that records the user_id, the module_id, and the date/time the module was viewed. eg. Table: Log ------------------------------ User_ID Module_ID Date ------------------------------ 1 red 2001-01-01 1 green 2001-01-02 1 blue 2001-01-03 2 green 2001-01-04 2 blue 2001-01-05 1 red 2001-01-06 1 blue 2001-01-07 3 blue 2001-01-08 3 green 2001-01-09 3 red 2001-01-10 3 green 2001-01-11 4 white 2001-01-12 I need to get a result set that has the user_id as the 1st column, and then a column for each module. The row data is then the user_id and the count of the number of times that user viewed each module. eg. --------------------------------- User_ID red green blue white --------------------------------- 1 2 1 2 0 2 0 1 1 0 3 1 2 1 0 4 0 0 0 1 I was initially thinking that I could do this with PIVOT, but no dice; the database is a converted SQL Server 2000 DB that is running in SQL Server 2005. I'm not able to change the compatibility level, so pivot is out. How can I accomplish this?

    Read the article

  • Need new developers-laptop, with ubuntu. Multiple ext displays, ssd, dock, NO DVD [closed]

    - by Ole Morten Amundsen
    I'm having a really hard time finding a great alternative for Macbook Pro (I have a MB pro '08). I'd like to return to ubuntu and need a kick-ass laptop. If you help, you've lead me back to linux :) Req: ubuntu friendly lots of memory 8G+ ssd 160GB+ great processor (intel sandy?) connect up to three external displays. this triple display looks cool No optical drive, NO DVD 13-17" dock. In place of the ridiculous optical drive (It's like having a floppy drive IMO): extra battery? 2nd ssd? extra graphics card? your suggestion The laptop should be designed for not having dvd. I can't find many, unless they are tiny 11"... I'm exited to know your answers!

    Read the article

  • Events in Classes (VB.NET)

    - by Otaku
    I find that I write a lot of code within my classes to keep properties in sync with each other. I've read about Events in Classes, but have not been able to wrap my head around how to make them work for what I'm looking for. I could use some advice here. For example, in this one I always want to keep myColor up to date with any change whatsoever in any or all of the Red, Green or Blue properties. Class myColors Private Property Red As Byte Private Property Green As Byte Private Property Blue As Byte Private Property myColor As Color Sub New() myColor = Color.FromArgb(0, 0, 0) End Sub Sub ChangeRed(ByVal r As Byte) Red = r myColor = Color.FromArgb(Red, Green, Blue) End Sub Sub ChangeBlue(ByVal b As Byte) Blue = b myColor = Color.FromArgb(Red, Green, Blue) End Sub End Class If one or more of those changes, I want myColor to be updated. Easy enough as above, but is there a way to work with events that would automatically do this so I don't have to put myColor = Color.FromArgb(Red, Green, Blue) in every sub routine?

    Read the article

  • 12.10 shutdown/power-up issue

    - by Morten Soelling
    I have just upgraded to 12.10 on a Shuttle XPC which I use mainly for XBMC and have a problem with shut down/power up. When I shut down from within XBMC the box seems to shut down correctly, but it won't always start again. It hangs before it reaches the point where it mounts the disc's. If I disconnect power shortly and then start up again everything works as it should. It isn't quite repeatable and it does not seem to happen if I exit XBMC and then power down. During power up there seems to be an issue about timing when mounting discs. What could it be ?

    Read the article

  • Recommendation for robust, customizable, open source, Java servlet-based forum software?

    - by Erik Hermansen
    There is a lot of forum software out there, but it seems to me that a lot of the popular choices are PHP-based. And for my project, I'd like something based on Java servlets so my team can make customizations to it. Another important feature is that I can completely change the pages to hide unwanted elements without too much work. So I'm looking either for a template system or easily editable scripts (i.e. JSPs) that have a clean view separation. Just having skin changes or CSS customization is not enough. I understand that if I have open source, I can change anything I want, but my point is that it should be easy and not requiring mastery of a complex code base. Finally, I want something that has been around for at least a year and deployed on some high-traffic sites. Clustering support (one database, multiple web servers) is highly desirable. Up-time is crucial since I have an SLA to support. What do you think?

    Read the article

  • how to import csv data into django models

    - by little_fish
    i have some csv data and i want to export into django models the example of csv data 1;"02-01-101101";"Worm Gear HRF 50";"Ratio 1 : 10";"input shaft, output shaft, direction A, color dark green"; 2;"02-01-101102";"Worm Gear HRF 50";"Ratio 1 : 20";"input shaft, output shaft, direction A, color dark green"; 3;"02-01-101103";"Worm Gear HRF 50";"Ratio 1 : 30";"input shaft, output shaft, direction A, color dark green"; 4;"02-01-101104";"Worm Gear HRF 50";"Ratio 1 : 40";"input shaft, output shaft, direction A, color dark green"; 5;"02-01-101105";"Worm Gear HRF 50";"Ratio 1 : 50";"input shaft, output shaft, direction A, color dark green"; and i have some django models name Product in Product there is some fields like name, description and price and i want to something like this product=Product() product.name = "Worm Gear HRF 70(02-01-101116)" product.description = "input shaft, output shaft, direction A, color dark green" product.price = 100

    Read the article

  • Why is this simple jQuery hover event misbehaving in Internet Explorer 8?

    - by Siracuse
    I asked for help earlier on Stackoverflow involving highlighting spans with the same Class when a mouse hovers over any Span with that same Class. It is working great: http://stackoverflow.com/questions/2709686/how-can-i-add-a-border-to-all-the-elements-that-share-a-class-when-the-mouse-has $('span[class]').hover( function() { $('.' + $(this).attr('class')).css('background-color','green'); }, function() { $('.' + $(this).attr('class')).css('background-color','yellow'); } ) Here is an example of it in usage: http://dl.dropbox.com/u/638285/0utput.html However, it doesn't appear to work properly in IE8, while it DOES work in Chrome/Firefox. Here is a screenshot of it in IE8, with my mouse hovered over the " min) { min" section in the middle. As you can see, it highlighted the span that the mouse is hovering over perfectly fine. However, it has also highlighted some random spans above and below it that don't have the same class! Only the span's with the same Class as the one where the mouse is over should be highlighted green. In this screenshot, only that middle green section should be green. Here is a screenshot of it working properly in Firefox/Chrome with my mouse in the exact same position: This screenshot is correct as the span that the mouse is over (the green section) is the only one in this section that shares that class. Why is IE8 randomly green-highlighting spans when it shouldn't be (they don't share the same class) using my little jQuery snippet? Again, if you want to see it live I have it here: http://dl.dropbox.com/u/638285/0utput.html

    Read the article

  • Why doesn't this jQuery snippet work in IE8 like it does in Chrome/Firefox (live demo included)?

    - by Siracuse
    I asked for help earlier on Stackoverflow involving highlighting spans with the same Class when a mouse hovers over any Span with that same Class. It is working great: http://stackoverflow.com/questions/2709686/how-can-i-add-a-border-to-all-the-elements-that-share-a-class-when-the-mouse-has $('span[class]').hover( function() { $('.' + $(this).attr('class')).css('background-color','green'); }, function() { $('.' + $(this).attr('class')).css('background-color','yellow'); } ) Here is an example of it in usage: http://dl.dropbox.com/u/638285/0utput.html However, it doesn't appear to work properly in IE8, while it DOES work in Chrome/Firefox. Here is a screenshot of it in IE8, with my mouse hovered over the " min) { min" section in the middle. As you can see, it highlighted the span that the mouse is hovering over perfectly fine. However, it has also highlighted some random spans above and below it that don't have the same class! Only the span's with the same Class as the one where the mouse is over should be highlighted green. In this screenshot, only that middle green section should be green. Here is a screenshot of it working properly in Firefox/Chrome with my mouse in the exact same position: This screenshot is correct as the span that the mouse is over (the green section) is the only one in this section that shares that class. Why is IE8 randomly green-highlighting spans when it shouldn't be (they don't share the same class) using my little jQuery snippet? Again, if you want to see it live I have it here: http://dl.dropbox.com/u/638285/0utput.html

    Read the article

  • Why doesn't this jQuery snippet work in IE8 like it does in Firefox or Chrome (Live Demo Included) ?

    - by Siracuse
    I asked for help earlier on Stackoverflow involving highlighting spans with the same Class when a mouse hovers over any Span with that same Class. It is working great: http://stackoverflow.com/questions/2709686/how-can-i-add-a-border-to-all-the-elements-that-share-a-class-when-the-mouse-has $('span[class]').hover( function() { $('.' + $(this).attr('class')).css('background-color','green'); }, function() { $('.' + $(this).attr('class')).css('background-color','yellow'); } ) Here is an example of it in usage: http://dl.dropbox.com/u/638285/0utput.html However, it doesn't appear to work properly in IE8, while it DOES work in Chrome/Firefox. Here is a screenshot of it in IE8, with my mouse hovered over the " min) { min" section in the middle. As you can see, it highlighted the span that the mouse is hovering over perfectly fine. However, it has also highlighted some random spans above and below it that don't have the same class! Only the span's with the same Class as the one where the mouse is over should be highlighted green. In this screenshot, only that middle green section should be green. Here is a screenshot of it working properly in Firefox/Chrome with my mouse in the exact same position: This screenshot is correct as the span that the mouse is over (the green section) is the only one in this section that shares that class. Why is IE8 randomly green-highlighting spans when it shouldn't be (they don't share the same class) using my little jQuery snippet? Again, if you want to see it live I have it here: http://dl.dropbox.com/u/638285/0utput.html

    Read the article

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