Search Results

Search found 2954 results on 119 pages for 'rick green turbo'.

Page 35/119 | < Previous Page | 31 32 33 34 35 36 37 38 39 40 41 42  | Next Page >

  • Information Driven Value Chains: Achieving Supply Chain Excellence in the 21st Century With Oracle -

    World-class supply chains can help companies achieve top line and bottom line results in today’s complex,global world.Tune into this conversation with Rick Jewell,SVP,Oracle Supply Chain Development,to hear about Oracle’s vision for world class SCM,and the latest and greatest on Oracle Supply Chain Management solutions.You will learn about Oracle’s complete,best-in-class,open and integrated solutions,which are helping companies drive profitability,achieve operational excellence,streamline innovation,and manage risk and compliance in today’s complex,global world.

    Read the article

  • Information Driven Value Chains: Achieving Supply Chain Excellence in the 21st Century With Oracle -

    World-class supply chains can help companies achieve top line and bottom line results in today’s complex,global world.Tune into this conversation with Rick Jewell,SVP,Oracle Supply Chain Development,to hear about Oracle’s vision for world class SCM,and the latest and greatest on Oracle Supply Chain Management solutions.You will learn about Oracle’s complete,best-in-class,open and integrated solutions,which are helping companies drive profitability,achieve operational excellence,streamline innovation,and manage risk and compliance in today’s complex,global world.

    Read the article

  • A Small Blog About Huge Pages

    - by rickramsey
    Video Interview: What Are Linux Huge Pages?, by Ed Whalen, Oracle ACE Blog: There's Been a Change In How Huge Pages Are Allocated, by Tanel Poder, Oracle ACE Director Blog: Performance Issues with Transparent Huge Pages (thank you, Bjoern Rost!) Web: About the Car, by Smart Ridez LLC, of Woodland Hills, California - Rick Follow me on: Blog | Facebook | Twitter | Personal Twitter | YouTube | The Great Peruvian Novel

    Read the article

  • Focus On Systems Admins and Developers

    - by rickramsey
    Even if you're not going to Oracle Open World, you might find it interesting to hear what the different technology groups at Oracle are going to be talking about. And if you are going, here's your Systems schedule: Note: all links go to PDF files. Focus On: Oracle Linux Focus On: Oracle Solaris Focus On: Oracle Solaris Cluster Focus On: Oracle Solaris Studio Focus On: Desktop Virtualization Focus On: Oracle VM Server Virtualization Focus On: SPARC Servers Focus On: Storage Focus On: SPARC Supercluster - Rick Website Newsletter Facebook Twitter

    Read the article

  • Sender's Sendmail says "stat=Sent" but recipent doesn't receive the message

    - by user44774
    Guys, I am trying to figure out why sendmail is saying that it sends out an email but I actually never get it. This is from the logs when the email is being sent out: I have replaced the email address with some fake address and I have also replaced the name of the server with a fake hostname. The most significant point of this information from the logs is that it shows that the "Message was accepted for delivery". Do you guys have any suggestions as to why it seems like the message goes out but I never get the actual email? Jun 2 14:34:40 server sendmail[9668]: o52IYeSi009668: --- 250 2.0.0 o52IYeSi009668 Message accepted for delivery Jun 2 14:34:40 server sendmail[9667]: o52IYe9I009667: [email protected], ctladdr=rick (500/500), delay=00:00:00, xdelay=00:00:00, mailer=relay, pri=30058, relay=[127.0.0.1] [127.0.0.1], dsn=2.0.0, stat=Sent (o52IYeSi009668 Message accepted for delivery) Jun 2 14:34:40 server sendmail[9668]: o52IYeSj009668: <-- QUIT Jun 2 14:34:40 server sendmail[9668]: o52IYeSj009668: --- 221 2.0.0 server.server.com closing connection Jun 2 14:34:41 server sendmail[9670]: o52IYeSi009668: SMTP outgoing connect on [192.168.1.9] Jun 2 14:34:41 server sendmail[9670]: o52IYeSi009668: to=<[email protected]>, ctladdr=<[email protected]> (500/500), delay=00:00:01, xdelay=00:00:01, mailer=relay, pri=120368, relay=mailhost.worldnet.att.net. [207.115.11.17], dsn=5.1.1, stat=User unknown Jun 2 14:34:42 server sendmail[9670]: o52IYeSi009668: o52IYgSi009670: DSN: User unknown Jun 2 14:34:42 server sendmail[9670]: o52IYgSi009670: to=<[email protected]>, **delay=00:00:00, xdelay=00:00:00, mailer=local, pri=31625, dsn=2.0.0,** ***stat=Sent*****

    Read the article

  • Beginner Scoring program button development in Java [migrated]

    - by A.G.
    I'm trying to add a "green team" to an example scoring GUI I found online. For some reason, the code compiles, but it runs with only the original two teams. I've tried playing around with the sizes/locations somewhat clumsily, and since no change was observed with these modications (NO change at ALL), I admit that I must be missing some necessary property or something. Any help? Here's the code: import javax.swing.*; import java.awt.Color; import java.awt.event.ActionListener; import java.awt.event.ActionEvent; public class ButtonDemo_Extended3 implements ActionListener{ // Definition of global values and items that are part of the GUI. int redScoreAmount = 0; int blueScoreAmount = 0; int greenScoreAmount = 0; JPanel titlePanel, scorePanel, buttonPanel; JLabel redLabel, blueLabel,greenLabel, redScore, blueScore, greenScore; JButton redButton, blueButton, greenButton,resetButton; public JPanel createContentPane (){ // We create a bottom JPanel to place everything on. JPanel totalGUI = new JPanel(); totalGUI.setLayout(null); // Creation of a Panel to contain the title labels titlePanel = new JPanel(); titlePanel.setLayout(null); titlePanel.setLocation(0, 0); titlePanel.setSize(500, 500); totalGUI.add(titlePanel); redLabel = new JLabel("Red Team"); redLabel.setLocation(300, 0); redLabel.setSize(100, 30); redLabel.setHorizontalAlignment(0); redLabel.setForeground(Color.red); titlePanel.add(redLabel); blueLabel = new JLabel("Blue Team"); blueLabel.setLocation(900, 0); blueLabel.setSize(100, 30); blueLabel.setHorizontalAlignment(0); blueLabel.setForeground(Color.blue); titlePanel.add(blueLabel); greenLabel = new JLabel("Green Team"); greenLabel.setLocation(600, 0); greenLabel.setSize(100, 30); greenLabel.setHorizontalAlignment(0); greenLabel.setForeground(Color.green); titlePanel.add(greenLabel); // Creation of a Panel to contain the score labels. scorePanel = new JPanel(); scorePanel.setLayout(null); scorePanel.setLocation(10, 40); scorePanel.setSize(500, 30); totalGUI.add(scorePanel); redScore = new JLabel(""+redScoreAmount); redScore.setLocation(0, 0); redScore.setSize(40, 30); redScore.setHorizontalAlignment(0); scorePanel.add(redScore); greenScore = new JLabel(""+greenScoreAmount); greenScore.setLocation(60, 0); greenScore.setSize(40, 30); greenScore.setHorizontalAlignment(0); scorePanel.add(greenScore); blueScore = new JLabel(""+blueScoreAmount); blueScore.setLocation(130, 0); blueScore.setSize(40, 30); blueScore.setHorizontalAlignment(0); scorePanel.add(blueScore); // Creation of a Panel to contain all the JButtons. buttonPanel = new JPanel(); buttonPanel.setLayout(null); buttonPanel.setLocation(10, 80); buttonPanel.setSize(2600, 70); totalGUI.add(buttonPanel); // We create a button and manipulate it using the syntax we have // used before. Now each button has an ActionListener which posts // its action out when the button is pressed. redButton = new JButton("Red Score!"); redButton.setLocation(0, 0); redButton.setSize(30, 30); redButton.addActionListener(this); buttonPanel.add(redButton); blueButton = new JButton("Blue Score!"); blueButton.setLocation(150, 0); blueButton.setSize(30, 30); blueButton.addActionListener(this); buttonPanel.add(blueButton); greenButton = new JButton("Green Score!"); greenButton.setLocation(250, 0); greenButton.setSize(30, 30); greenButton.addActionListener(this); buttonPanel.add(greenButton); resetButton = new JButton("Reset Score"); resetButton.setLocation(0, 100); resetButton.setSize(50, 30); resetButton.addActionListener(this); buttonPanel.add(resetButton); totalGUI.setOpaque(true); return totalGUI; } // This is the new ActionPerformed Method. // It catches any events with an ActionListener attached. // Using an if statement, we can determine which button was pressed // and change the appropriate values in our GUI. public void actionPerformed(ActionEvent e) { if(e.getSource() == redButton) { redScoreAmount = redScoreAmount + 1; redScore.setText(""+redScoreAmount); } else if(e.getSource() == blueButton) { blueScoreAmount = blueScoreAmount + 1; blueScore.setText(""+blueScoreAmount); } else if(e.getSource() == greenButton) { greenScoreAmount = greenScoreAmount + 1; greenScore.setText(""+greenScoreAmount); } else if(e.getSource() == resetButton) { redScoreAmount = 0; blueScoreAmount = 0; greenScoreAmount = 0; redScore.setText(""+redScoreAmount); blueScore.setText(""+blueScoreAmount); greenScore.setText(""+greenScoreAmount); } } private static void createAndShowGUI() { JFrame.setDefaultLookAndFeelDecorated(true); JFrame frame = new JFrame("[=] JButton Scores! [=]"); //Create and set up the content pane. ButtonDemo_Extended demo = new ButtonDemo_Extended(); frame.setContentPane(demo.createContentPane()); frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); frame.setSize(1024, 768); frame.setVisible(true); } public static void main(String[] args) { //Schedule a job for the event-dispatching thread: //creating and showing this application's GUI. SwingUtilities.invokeLater(new Runnable() { public void run() { createAndShowGUI(); } }); } }

    Read the article

  • Oredev 2011 Trip Report

    - by arungupta
    Oredev had its seventh annual conference in the city of Malmo, Sweden last week. The name "Oredev" signifies to the part that Malmo is connected with Copenhagen with Oresund bridge. There were about 1000 attendees with several speakers from all over the world. The first two days were hands-on workshops and the next three days were sessions. There were different tracks such as Java, Windows 8, .NET, Smart Phones, Architecture, Collaboration, and Entrepreneurship. And then there was Xtra(ck) which had interesting sessions not directly related to technology. I gave two slide-free talks in the Java track. The first one showed how to build an end-to-end Java EE 6 application using NetBeans and GlassFish. The complete instructions to build the application are explained in detail here. This 3-tier application used Java Persistence API, Enterprsie Java Beans, Servlet, Contexts and Dependency Injection, JavaServer Faces, and Java API for RESTful Services. The source code built during the application can be downloaded here (LINK TBD). The second session, slide-free again, showed how to take a Java EE 6 application into production using GlassFish cluster. It explained: Create a 2-instance GlassFish cluster Front-end with a Web server and a load balancer Demonstrate session replication and fail over Monitor the application using JavaScript The complete instructions for this session are available here. Oredev has an interesting way of collecting attendee feedback. The attendees drop a green, yellow, or red card in a bucket as they walk out of the session. Not everybody votes but most do. Other than the instantaneous feedback provided on twitter, this mechanism provides a more coarse grained feedback loop as well. The first talk had about 67 attendees (with 23 green and 7 yellow) and the second one had 22 (11 green and 11 yellow). The speakers' dinner is a good highlight of the conference. It is arranged in the historic city hall and the mayor welcomed all the speakers. As you can see in the pictures, it is a very royal building with lots of history behind it. Fortunately the dinner was a buffet with a much better variety unlike last year where only black soup and geese were served, which was quite cultural BTW ;-) The sauna in 85F, skinny dipping in 35F ocean and alternating between them at Kallbadhus is always very Swedish. Also spent a short evening at a friend's house socializing with other speaker/attendees, drinking Glogg, and eating Pepperkakor.  The welcome packet at the hotel also included cinnamon rolls, recommended to drink with cold milk, for a little more taste of Swedish culture. Something different at this conference was how artists from Image Think were visually capturing all the keynote speakers using images on whiteboards. Here are the images captured for Alexis Ohanian (Reddit co-founder and now running Hipmunk): Unfortunately I could not spend much time engaging with other speakers or attendees because was busy preparing a new hands-on lab material. But was able to spend some time with Matthew Mccullough, Micahel Tiberg, Magnus Martensson, Mattias Karlsson, Corey Haines, Patrick Kua, Charles Nutter, Tushara, Pradeep, Shmuel, and several other folks. Here are a few pictures captured from the event: And the complete album here: Thank you Matthias, Emily, and Kathy for putting up a great show and giving me an opportunity to speak at Oredev. I hope to be back next year with a more vibrant representation of Java - the language and the ecosystem!

    Read the article

  • Oredev 2011 Trip Report

    - by arungupta
    Oredev had its seventh annual conference in the city of Malmo, Sweden last week. The name "Oredev" signifies to the part that Malmo is connected with Copenhagen with Oresund bridge. There were about 1000 attendees with several speakers from all over the world. The first two days were hands-on workshops and the next three days were sessions. There were different tracks such as Java, Windows 8, .NET, Smart Phones, Architecture, Collaboration, and Entrepreneurship. And then there was Xtra(ck) which had interesting sessions not directly related to technology. I gave two slide-free talks in the Java track. The first one showed how to build an end-to-end Java EE 6 application using NetBeans and GlassFish. The complete instructions to build the application are explained in detail here. This 3-tier application used Java Persistence API, Enterprsie Java Beans, Servlet, Contexts and Dependency Injection, JavaServer Faces, and Java API for RESTful Services. The source code built during the application can be downloaded here (LINK TBD). The second session, slide-free again, showed how to take a Java EE 6 application into production using GlassFish cluster. It explained: Create a 2-instance GlassFish cluster Front-end with a Web server and a load balancer Demonstrate session replication and fail over Monitor the application using JavaScript The complete instructions for this session are available here. Oredev has an interesting way of collecting attendee feedback. The attendees drop a green, yellow, or red card in a bucket as they walk out of the session. Not everybody votes but most do. Other than the instantaneous feedback provided on twitter, this mechanism provides a more coarse grained feedback loop as well. The first talk had about 67 attendees (with 23 green and 7 yellow) and the second one had 22 (11 green and 11 yellow). The speakers' dinner is a good highlight of the conference. It is arranged in the historic city hall and the mayor welcomed all the speakers. As you can see in the pictures, it is a very royal building with lots of history behind it. Fortunately the dinner was a buffet with a much better variety unlike last year where only black soup and geese were served, which was quite cultural BTW ;-) The sauna in 85F, skinny dipping in 35F ocean and alternating between them at Kallbadhus is always very Swedish. Also spent a short evening at a friend's house socializing with other speaker/attendees, drinking Glogg, and eating Pepperkakor.  The welcome packet at the hotel also included cinnamon rolls, recommended to drink with cold milk, for a little more taste of Swedish culture. Something different at this conference was how artists from Image Think were visually capturing all the keynote speakers using images on whiteboards. Here are the images captured for Alexis Ohanian (Reddit co-founder and now running Hipmunk): Unfortunately I could not spend much time engaging with other speakers or attendees because was busy preparing a new hands-on lab material. But was able to spend some time with Matthew Mccullough, Micahel Tiberg, Magnus Martensson, Mattias Karlsson, Corey Haines, Patrick Kua, Charles Nutter, Tushara, Pradeep, Shmuel, and several other folks. Here are a few pictures captured from the event: And the complete album here: Thank you Matthias, Emily, and Kathy for putting up a great show and giving me an opportunity to speak at Oredev. I hope to be back next year with a more vibrant representation of Java - the language and the ecosystem!

    Read the article

  • How to define template directives (from an API perspective)?

    - by Ralph
    Preface I'm writing a template language (don't bother trying to talk me out of it), and in it, there are two kinds of user-extensible nodes. TemplateTags and TemplateDirectives. A TemplateTag closely relates to an HTML tag -- it might look something like div(class="green") { "content" } And it'll be rendered as <div class="green">content</div> i.e., it takes a bunch of attributes, plus some content, and spits out some HTML. TemplateDirectives are a little more complicated. They can be things like for loops, ifs, includes, and other such things. They look a lot like a TemplateTag, but they need to be processed differently. For example, @for($i in $items) { div(class="green") { $i } } Would loop over $items and output the content with the variable $i substituted in each time. So.... I'm trying to decide on a way to define these directives now. Template Tags The TemplateTags are pretty easy to write. They look something like this: [TemplateTag] static string div(string content = null, object attrs = null) { return HtmlTag("div", content, attrs); } Where content gets the stuff between the curly braces (pre-rendered if there are variables in it and such), and attrs is either a Dictionary<string,object> of attributes, or an anonymous type used like a dictionary. It just returns the HTML which gets plunked into its place. Simple! You can write tags in basically 1 line. Template Directives The way I've defined them now looks like this: [TemplateDirective] static string @for(string @params, string content) { var tokens = Regex.Split(@params, @"\sin\s").Select(s => s.Trim()).ToArray(); string itemName = tokens[0].Substring(1); string enumName = tokens[1].Substring(1); var enumerable = data[enumName] as IEnumerable; var sb = new StringBuilder(); var template = new Template(content); foreach (var item in enumerable) { var templateVars = new Dictionary<string, object>(data) { { itemName, item } }; sb.Append(template.Render(templateVars)); } return sb.ToString(); } (Working example). Basically, the stuff between the ( and ) is not split into arguments automatically (like the template tags do), and the content isn't pre-rendered either. The reason it isn't pre-rendered is because you might want to add or remove some template variables or something first. In this case, we add the $i variable to the template variables, var templateVars = new Dictionary<string, object>(data) { { itemName, item } }; And then render the content manually, sb.Append(template.Render(templateVars)); Question I'm wondering if this is the best approach to defining custom Template Directives. I want to make it as easy as possible. What if the user doesn't know how to render templates, or doesn't know that he's supposed to? Maybe I should pass in a Template instance pre-filled with the content instead? Or maybe only let him tamper w/ the template variables, and then automatically render the content at the end? OTOH, for things like "if" if the condition fails, then the template wouldn't need to be rendered at all. So there's a lot of flexibility I need to allow in here. Thoughts?

    Read the article

  • Oracle Excellence Award

    - by Hartmut Wiese
    CALL FOR NOMINATIONS 2014 Oracle Excellence Award: Sustainability Innovation Is your organization using an Oracle product to help with a sustainability initiative while reducing costs? Saving energy? Saving gas? Saving paper? For example, you may use Oracle’s Agile Product Lifecycle Management to design more eco-friendly products, Oracle Transportation Management to reduce fleet emissions, Oracle Exadata Database Machine to decrease power and cooling needs while increasing database performance, Oracle Business Intelligence to measure environmental impacts, or one of many other Oracle products. Your organization may be eligible for the 2014 Oracle Excellence Award: Sustainability Innovation. Submit a nomination form located here by Friday June 20 if your company is using any Oracle product to take an environmental lead as well as to reduce costs and improve business efficiencies by using green business practices. These awards will be presented during Oracle OpenWorld 2014 (September 28-October 2) in San Francisco.  Normal 0 false false false EN-US X-NONE X-NONE MicrosoftInternetExplorer4 About the Award • Winners will be selected from the customer and/or partner nominations. Either a customer, their partner, or Oracle representative can submit the nomination form on behalf of the customer.• There is a nomination form here to discuss your use of Oracle products and how they have helped your sustainability efforts and reduced costs. • Winners will be selected based on the extent of the environmental impact they have had as well as the business efficiencies they have achieved through their combined use of Oracle products. Normal 0 false false false EN-US X-NONE X-NONE MicrosoftInternetExplorer4 Nomination Eligibility • Your company uses at least one component of Oracle products, whether it's the Oracle database, business applications, Fusion Middleware, or Sun servers/storage. • This solution should be in production or in active development. • Nomination deadline: Friday June 20, 2014. Benefits to Award Winners • Award presented to winners during Oracle OpenWorld by Jeff Henley, Oracle Chairman of the Board • Free Oracle OpenWorld registration pass for each winning customer • 2014 Oracle Excellence Award: Sustainability Innovation award logo for inclusion on your own website &/or press release • Possible placement in Oracle Profit Magazine &/or Oracle Magazine • ‘Enable the Eco-Enterprise’ podcast opportunity See last year's winners here Normal 0 false false false EN-US X-NONE X-NONE MicrosoftInternetExplorer4 ______________________________________________________________________________________ Normal 0 false false false EN-US X-NONE X-NONE MicrosoftInternetExplorer4 /* Style Definitions */ table.MsoNormalTable {mso-style-name:"Table Normal"; mso-tstyle-rowband-size:0; mso-tstyle-colband-size:0; mso-style-noshow:yes; mso-style-priority:99; mso-style-qformat:yes; mso-style-parent:""; mso-padding-alt:0cm 5.4pt 0cm 5.4pt; mso-para-margin:0cm; mso-para-margin-bottom:.0001pt; mso-pagination:widow-orphan; font-size:11.0pt; font-family:"Calibri","sans-serif"; mso-ascii-font-family:Calibri; mso-ascii-theme-font:minor-latin; mso-fareast-font-family:"Times New Roman"; mso-fareast-theme-font:minor-fareast; mso-hansi-font-family:Calibri; mso-hansi-theme-font:minor-latin; mso-bidi-font-family:"Times New Roman"; mso-bidi-theme-font:minor-bidi;} Questions? Send an email to: [email protected] Follow Oracle’s Sustainability Solutions on Twitter, LinkedIn, YouTube, and the Sustainability Matters blog Web page with award details:  http://www.oracle.com/us/products/applications/green/call-for-nominations-185050.html  

    Read the article

  • Z axis trouble with glTranslatef(...) - LWJGL

    - by Zarkopafilis
    Here is the code: private static boolean up = true , down = false , left = false , right = false, reset = false, in = false , out = false; public void start() { try { Display.setDisplayMode(new DisplayMode(800,600)); Display.create(); } catch (LWJGLException e) { e.printStackTrace(); System.exit(0); } GL11.glMatrixMode(GL11.GL_PROJECTION); GL11.glLoadIdentity(); GL11.glOrtho(0, 800, 0, 600, 0.00001f, 1000); GL11.glMatrixMode(GL11.GL_MODELVIEW); Keyboard.enableRepeatEvents(true); while (!Display.isCloseRequested()) { GL11.glClear(GL11.GL_COLOR_BUFFER_BIT); input(); if(up){ GL11.glTranslatef(0,0.1f,0); } if(down){ GL11.glTranslatef(0,-0.1f,0); } if(left){ GL11.glTranslatef(-0.1f,0,0); } if(right){ GL11.glTranslatef(0.1f,0,0); } if(in){ GL11.glTranslatef(0, 0, 1f); } if(out){ GL11.glTranslatef(0, 0, -1f); } if(reset){ GL11.glLoadIdentity(); } GL11.glBegin(GL11.GL_QUADS); GL11.glColor3f(255, 255, 255); GL11.glVertex3f(800/2, 600/2, 0); GL11.glVertex3f(800/2 + 200, 600/2, 0); GL11.glVertex3f(800/2 + 200, 600/2 + 200, 0); GL11.glVertex3f(800/2, 600/2 + 200, 0); GL11.glColor3f(0, 255, 0); GL11.glVertex3f(800/2, 600/2, 1); GL11.glVertex3f(800/2 + 200, 600/2, 1); GL11.glVertex3f(800/2 + 200, 600/2 + 200, 1); GL11.glVertex3f(800/2, 600/2 + 200, 1); GL11.glEnd(); Display.update(); } Display.destroy(); } public static void main(String[] argv){ new main().start(); } public void input(){ up = false; down = false; left = false; right = false; reset = false; in = false; out = false; if(Keyboard.isKeyDown(Keyboard.KEY_SPACE)){ reset = true; } if(Keyboard.isKeyDown(Keyboard.KEY_W)){ up = true; } if(Keyboard.isKeyDown(Keyboard.KEY_S)){ down = true; } if(Keyboard.isKeyDown(Keyboard.KEY_A)){ left = true; } if(Keyboard.isKeyDown(Keyboard.KEY_D)){ right = true; } if(Keyboard.isKeyDown(Keyboard.KEY_Q)){ in = true; } if(Keyboard.isKeyDown(Keyboard.KEY_E)){ out = true; } } As you can see I am creating 2 quads , a white one at z 0 and a green one at z 1. WASD keys function correctly. Also when I hit SPACEBAR the white quad is being shown. If I then press E , I can see the green quad. But if I press Q afterwards , I dont see the white one again!(Space Works everytime). Also if I render the green one at Z = -1 everything works perfectly BUT you may need up to 3 key presses Q/E to see the other quad. Why is that happening?

    Read the article

  • Writing a method to 'transform' an immutable object: how should I approach this?

    - by Prog
    (While this question has to do with a concrete coding dilemma, it's mostly about what's the best way to design a function.) I'm writing a method that should take two Color objects, and gradually transform the first Color into the second one, creating an animation. The method will be in a utility class. My problem is that Color is an immutable object. That means that I can't do color.setRGB or color.setBlue inside a loop in the method. What I can do, is instantiate a new Color and return it from the method. But then I won't be able to gradually change the color. So I thought of three possible solutions: 1- The client code includes the method call inside a loop. For example: int duration = 1500; // duration of the animation in milliseconds int steps = 20; // how many 'cycles' the animation will take for(int i=0; i<steps; i++) color = transformColor(color, targetColor, duration, steps); And the method would look like this: Color transformColor(Color original, Color target, int duration, int steps){ int redDiff = target.getRed() - original.getRed(); int redAddition = redDiff / steps; int newRed = original.getRed() + redAddition; // same for green and blue .. Thread.sleep(duration / STEPS); // exception handling omitted return new Color(newRed, newGreen, newBlue); } The disadvantage of this approach is that the client code has to "do part of the method's job" and include a for loop. The method doesn't do it's work entirely on it's own, which I don't like. 2- Make a mutable Color subclass with methods such as setRed, and pass objects of this class into transformColor. Then it could look something like this: void transformColor(MutableColor original, Color target, int duration){ final int STEPS = 20; int redDiff = target.getRed() - original.getRed(); int redAddition = redDiff / steps; int newRed = original.getRed() + redAddition; // same for green and blue .. for(int i=0; i<STEPS; i++){ original.setRed(original.getRed() + redAddition); // same for green and blue .. Thread.sleep(duration / STEPS); // exception handling omitted } } Then the calling code would usually look something like this: // The method will usually transform colors of JComponents JComponent someComponent = ... ; // setting the Color in JComponent to be a MutableColor Color mutableColor = new MutableColor(someComponent.getForeground()); someComponent.setForeground(mutableColor); // later, transforming the Color in the JComponent transformColor((MutableColor)someComponent.getForeground(), new Color(200,100,150), 2000); The disadvantage is - the need to create a new class MutableColor, and also the need to do casting. 3- Pass into the method the actual mutable object that holds the color. Then the method could do object.setColor or similar every iteration of the loop. Two disadvantages: A- Not so elegant. Passing in the object that holds the color just to transform the color feels unnatural. B- While most of the time this method will be used to transform colors inside JComponent objects, other kinds of objects may have colors too. So the method would need to be overloaded to receive other types, or receive Objects and have instanceof checks inside.. Not optimal. Right now I think I like solution #2 the most, than solution #1 and solution #3 the least. However I'd like to hear your opinions and suggestions regarding this.

    Read the article

  • No Program Entry Point TASM Error

    - by Nathan Campos
    I'm trying to develop a simple kernel using TASM, using this code: ; beroset.asm ; ; This is a primitive operating system. ; ;********************************************************************** code segment para public use16 '_CODE' .386 assume cs:code, ds:code, es:code, ss:code org 0 Start: mov ax,cs mov ds,ax mov es,ax mov si,offset err_msg call DisplayMsg spin: jmp spin ;**************************************************************************** ; DisplayMsg ; ; displays the ASCIIZ message to the screen using int 10h calls ; ; Entry: ; ds:si ==> ASCII string ; ; Exit: ; ; Destroyed: ; none ; ; ;**************************************************************************** DisplayMsg proc push ax bx si cld nextchar: lodsb or al,al jz alldone mov bx,0007h mov ah,0eh int 10h jmp nextchar alldone: pop si bx ax ret DisplayMsg endp err_msg db "Operating system found and loaded.",0 code ends END Then I compile it like this: C:\DOCUME~1\Nathan\Desktop tasm /la /m2 beroset.asm Turbo Assembler Version 4.1 Copyright (c) 1988, 1996 Borland International Assembling file: beroset.asm Error messages: None Warning messages: None Passes: 2 Remaining memory: 406k C:\DOCUME~1\Nathan\Desktop tlink beroset, loader.bin Turbo Link Version 7.1.30.1. Copyright (c) 1987, 1996 Borland International Fatal: No program entry point C:\DOCUME~1\Nathan\Desktop What can I to correct this error?

    Read the article

  • CSS: Style applied to a combination of classes?

    - by Eli
    Hi All, I'm not sure this is possible, but is there a syntax to be used in CSS when you want to style an element based on the combination of classes applied to it? I understand that I can check an element with jQuery or something and change it's style based on the classes it has, but is there a pure CSS way to do this? For example, if I have a class for bold and green: .bold_green { color:green; font-weight:bold; } And a class for bold and blue: .bold_blue { color:green; font-weight:bold. } Now, say I am using jQuery to add and remove classes dynamically and want any element that has both classes to turn italic pink. Something like: .bold_green AND .bold_blue { color:pink; font-style:italic; } Or, if I want to style an element that has aclass, and is a descendant of another element that has another class? Something like: .bold_green HAS_CHILD .bold_blue { color:black; background-color:yellow; } Thanks!

    Read the article

  • Reading bmp file for steganography

    - by Shantanu Gupta
    I am trying to read a bmp file in C++(Turbo). But i m not able to print binary stream. I want to encode txt file into it and decrypt it. How can i do this. I read that bmp file header is of 54 byte. But how and where should i append txt file in bmp file. ? I know only Turbo C++, so it would be helpfull for me if u provide solution or suggestion related to topic for the same. int main() { ifstream fr; //reads ofstream fw; // wrrites to file char c; int random; clrscr(); char file[2][100]={"s.bmp","s.txt"}; fr.open(file[0],ios::binary);//file name, mode of open, here input mode i.e. read only if(!fr) cout<<"File can not be opened."; fw.open(file[1],ios::app);//file will be appended if(!fw) cout<<"File can not be opened"; while(!fr) cout<<fr.get(); // error should be here. but not able to find out what error is it fr.close(); fw.close(); getch(); } This code is running fine when i pass txt file in binary mode

    Read the article

  • setAnimationRepeatAutoreverses not behaved as I expected

    - by danielkwan
    I am starting to learn to use UIView animation. So I wrote the following lines: [UIView beginAnimations:nil context:NULL]; [UIView setAnimationDuration:2.0]; [UIView setAnimationRepeatCount:2]; [UIView setAnimationRepeatAutoreverses:YES]; CGPoint position = greenView.center; position.y = position.y + 100.0f; position.x = position.x + 100.0f; greenView.center = position; [UIView commitAnimations]; In this case, the UIView (a green box) moved back and fore 2 times. So far so good, BUT I found out that after the moving twice, the green box ended up jumped to the "new position" (position.x + 100.0f, position.y + 100.0f) instead of going back to the original position (position.x, position.y). That makes the animation look pretty odd (like after the box swing back to the original position caused by setAnimationRepeatAutoreverses, it jumps back to the new position in the last microsecond!) What is the best way to make the green box NOT jump to the new position at the very last minute?

    Read the article

  • Jquery with multi level json data array

    - by coder
    var data = [{"Address":{"Address":"4 Selby Road\nHowden","AddressId":"1414449","AddressLine1":"4 Selby Road","AddressLine2":"Howden","ContactId":"14248844","County":"North Humberside","Country":"UK","Postcode":"DN14 7JW","Town":"GOOLE","FullAddress":"4 Selby Road\nHowden\r\nGOOLE\r\nNorth Humberside\r\nDN14 7JW\r\nUnited Kingdom"},"ContactId":14248844,"Title":"Mrs","FirstName":"","Surname":"Neild","FullName":" Neild","PostCode":"DN14 7JW"},{"Address":{"Address":"466 Manchester Road\nBlackrod","AddressId":"1669615","AddressLine1":"466 Manchester Road","AddressLine2":"Blackrod","ContactId":"16721687","County":"","Country":"UK","Postcode":"BL6 5SU","Town":"BOLTON","FullAddress":"466 Manchester Road\nBlackrod\r\nBOLTON\r\nBL6 5SU\r\nUnited Kingdom"},"ContactId":16721687,"Title":"Miss","FirstName":"Andrea","Surname":"Neild","FullName":"Andrea Neild","PostCode":"BL6 5SU"},{"Address":{"Address":"5 Prospect Vale\nHeald Green","AddressId":"2127294","AddressLine1":"5 Prospect Vale","AddressLine2":"Heald Green","ContactId":"21178752","County":"Cheshire","Country":"UK","Postcode":"SK8 3RJ","Town":"CHEADLE","FullAddress":"5 Prospect Vale\nHeald Green\r\nCHEADLE\r\nCheshire\r\nSK8 3RJ\r\nUnited Kingdom"},"ContactId":21178752,"Title":"Mrs","FirstName":"","Surname":"Neild","FullName":" Neild","PostCode":"SK8 3RJ"}]; I'm tring to retrieve above json fommated data in jquery as below: var source = { localdata: data, sort: customsortfunc, datafields: [ { name: 'Surname', type: 'string' }, { name: 'FirstName', type: 'string' }, { name: 'Title', type: 'string' }, { name: 'Address.Address', type: 'string' } ], datatype: "array" }; var dataAdapter = new $.jqx.dataAdapter(source); $("#jqxgrid").jqxGrid( { width: 670, source: dataAdapter, theme: theme, sortable: true, pageable: true, autoheight: true, ready: function () { //$("#jqxgrid").jqxGrid('sortby', 'firstname', 'asc'); $("#jqxgrid").jqxGrid('sortby', 'FirstName', 'asc'); }, columns: [ { text: 'Title', datafield: 'Title', width: 100 }, { text: 'First Name', datafield: 'FirstName', width: 100 }, { text: 'Last Name', datafield: 'Surname', width: 100 }, { text: 'Address', datafield: 'Address.Address', width: 100 }, ] }); The only issue is there is no display for "Address.Adress". Can anyone advise me ?

    Read the article

  • Filter entities that match all pairs

    - by Jon
    I have an entity (let's say Person) with a set of arbitrary attributes with a known subset of values. I need to search for all of these entities that match all my filter conditions. For example, my table structures look like this: Person: id | name 1 | John Doe 2 | Jane Roe 3 | John Smith Attribute: id | attr_name 1 | Sex 2 | Eye Color ValidValue: id | attr_id | value_name 1 | 1 | Male 2 | 1 | Female 3 | 2 | Blue 4 | 2 | Green 5 | 2 | Brown PersonAttributes id | person_id | attr_id | value_id 1 | 1 | 1 | 1 2 | 1 | 2 | 3 3 | 2 | 1 | 2 4 | 2 | 2 | 4 5 | 3 | 1 | 1 6 | 3 | 2 | 4 In JPA, I have entities built for all of these tables. What I'd like to do is perform a search for all entities matching a given set of attribute-value pairs. For instance, I'd like to be able to find all males (John Doe and John Smith), all people with green eyes (Jane Roe or John Smith), or all females with green eyes (Jane Roe). I see that I can already take advantage of the fact that I only really need to match on value_id, since that's already unique and tied to the attr_id. But where can I go from there?

    Read the article

  • How do I display grouped XML data in a Flex pie chart?

    - by mclaughlinj
    I've looked into grouping XML data with GroupingCollections and AdvancedDataGrids, but I can't figure out how to display that data in a chart. Basically, what I want to do is group the data by the category field, which should give me two rows under red, one under blue, and one under green. When inputting this data into the pie chart, it should take up the right amount of space (1/2 for red, 1/4 each for blue and green). I don't need the other_data field, as I'd like to use the group name (category in this case) as the callout. Any suggestions? Sample data: <row> <category>red</category> <other_data>this shouldn't really matter</other_data> </row> <row> <category>blue</category> <other_data>this shouldn't really matter</other_data> </row> <row> <category>red</category> <other_data>this shouldn't really matter</other_data> </row> <row> <category>green</category> <other_data>this shouldn't really matter</other_data> </row>

    Read the article

  • Using multiple aggregate functions in an (ANSI) SQL statement

    - by morpheous
    I have aggregate functions foo(), foobar(), fredstats(), barneystats() I want to create a domain specific query language (DSQL) above my DB, to facilitate using a domain language to query the DB. The 'language' comprises of algebraic expressions (or more specifically SQL like criteria) which I use to generate (ANSI) SQL statements which are sent to the db engine. The following lines are examples of what the language statements will look like, and hopefully, it will help further clarify the concept: **Example 1** DQL statement: foobar('yellow') between 1 and 3 and fredstats('weight') > 42 Translation: fetch all rows in an underlying table where computed values for aggregate function foobar() is between 1 and 3 AND computed value for AGG FUNC fredstats() is greater than 42 **Example 2** DQL statement: fredstats('weight') < barneystats('weight') AND foo('fighter') in (9,10,11) AND foobar('green') <> 42 Translation: Fetch all rows where the specified criteria matches **Example 3** DQL statement: foobar('green') / foobar('red') <> 42 Translation: Fetch all rows where the specified criteria matches **Example 4** DQL statement: foobar('green') - foobar('red') >= 42 Translation: Fetch all rows where the specified criteria matches Given the following information: The table upon which the queries above are being executed is called 'tbl' table 'tbl' has the following structure (id int, name varchar(32), weight float) The result set returns only the tbl.id, tbl.name and the names of the aggregate functions as columns in the result set - so for example the foobar() AGG FUNC column will be called foobar in the result set. So for example, the first DQL query will return a result set with the following columns: id, name, foobar, fredstats Given the above, my questions then are: What would be the underlying SQL required for Example1 ? What would be the underlying SQL required for Example3 ? Given an algebraic equation comprising of AGGREGATE functions, Is there a way of generalizing the algorithm needed to generate the required ANSI SQL statement(s)? I am using PostgreSQL as the db, but I would prefer to use ANSI SQL wherever possible.

    Read the article

  • Where can I find a quick reference for standard Basic?

    - by Steve314
    The reason? Pure nostalgia. Anyway, there was a standard for Basic that was published in the late 80s or early 90s. It was probably ISO/IEC 10279:1991, but I don't have access to that and cannot be sure. Whatever this standard was, some of the syntax made its way into Borlands Turbo Basic and Microsofts Visual Basic. I never learned any significant amount of VB, but Turbo Basic is one of those things I played with in my mis-spent youth. At one time, my main reference was an article published in one of the main programming periodicals - maybe Personal Computer World, maybe Byte. A scan of that article (if anyone can even identify it) would be great, but all I really want is a few pages quick reference of that standard syntax. Must be free (I'm not that nostalgic), but it must describe the standard syntax - the whole point is to sort out what is standard as opposed to VB or whatever. EDIT The more I think about this, the more convinced I am that this standard was available around 1987 or 1988. Maybe it was the earlier non-full version of the standard above, or maybe it was pre-acceptance of the standard.

    Read the article

  • Rewrite arrays using collections

    - by owca
    I have a task, which I was able to do with the use of simplest methods - arrays. Now I'd like to go further and redo it using some more complicated java features like collections, but I've never used anything more complicated than 2d matrix. What should I look at and how to start with it. Should Tower become a Collection ? And here's the task : We have two classes - Tower and Block. Towers are built from Blocks. Ande here's sample code for testing: Block k1=new Block("yellow",1,5,4); Block k2=new Block("blue",2,2,6); Block k3=new Block("green",3,4,2); Block k4=new Block("yellow",1,5,4); Tower tower=new Tower(); tower.add(k1,k2,k3); "Added 3 blocks." System.out.println(tower); "block: green, base: 4cm x 3cm, thicknes: 2 cm block: blue, base: 6cm x 2cm, thicknes: 2 cm block: yellow, base: 5cm x 4cm, thicknes: 1 cm" tower.add(k2); "Tower already contains this block." tower.add(k4); "Added 1 block." System.out.println(tower); "block: green, base: 4cm x 3cm, thicknes: 2 cm block: blue, base: 6cm x 2cm, thicknes: 2 cm block: yellow, base: 5cm x 4cm, thicknes: 1 cm block: yellow, base: 5cm x 4cm, thicknes: 1 cm" tower.delete(k1); "Deleted 1 block" tower.delete(k1); "Block not in tower" System.out.println(tower); "block: blue, base: 6cm x 2cm, thicknes: 2 cm block: yellow, base: 5cm x 4cm, thicknes: 1 cm block: yellow, base: 5cm x 4cm, thicknes: 1 cm" Let's say I will treat Tower as a collection of blocks. How to perform search for specific block among whole collection ? Or should I use other interface ?

    Read the article

  • CSS: Margin-top when parent's got no border

    - by Manny
    Hi, As you can see in this picture, I've got an orange div inside a green div with no top border. The orange div has a 30px top margin, but it's also pushing the green div down. Of course, adding a top border will fix the issue, but I need the green div to be top borderless. What could I do? html: <div class="header">Top</div> <div class="body"> <div class="container">Box</div> </div> <div class="foot">Bottom</div> css: .body { border: 1px solid black; border-top: none; border-bottom: none; width: 120px; height: 112px; background-color: lightgreen; } .body .container { background-color: orange; height: 50px; width: 50%; margin-top: 30px; } Thanks

    Read the article

< Previous Page | 31 32 33 34 35 36 37 38 39 40 41 42  | Next Page >