Search Results

Search found 11 results on 1 pages for 'stephano'.

Page 1/1 | 1 

  • Strange "INavigatorContent" error compiling in 4.0

    - by Stephano
    I've recently decided to try an upgrade to 4.0. The only error I still can't work out is this one: "The children of Halo navigators must implement INavigatorContent" I seem to be getting it on all my ViewStacks that have validators. <mx:ViewStack xmlns:mx="http://www.adobe.com/2006/mxml"> <mx:NumberValidator id="systolicValidator" source="{systolic}" required="true" property="text" minValue="10" maxValue="300" domain="int"/> <mx:NumberValidator id="diastolicValidator" source="{diastolic}" required="true" property="text" minValue="10" maxValue="200" domain="int"/> <mx:TextInput id="systolic"/> <mx:TextInput id="diastolic"/> ... The error gets thrown on the validator tags. My compiler is set to "flex 3 compatibility mode" and my theme is set to Halo (default). This seems like it should be a really straight forward fix, so I hate to spin my wheels on it for too long. Any ideas what I might be missing?

    Read the article

  • Hibernate - on the stack or on the heap?

    - by Stephano
    As a Java programmer, you usually keep two truths in your pocket: Instance variables and Objects lie on Heap. Local variables and methods lie on the Stack. Now that I use Hibernate in just about everything, I realize I'm not as sure of myself. Are there some good rules of thumb for using hibernate and knowing where your memory lives?

    Read the article

  • Understanding Hibernate saveOrUpdate

    - by Stephano
    The books that I've read regarding hibernate are, at best, reference tomes. They very seldom have good code examples, so I tend to use online resources for those needs. However, I've always had a problem understanding the basic idea of hibernate persistence. I've read the books and understand the concepts, but in practice, I often see results that I don't understand. Perhaps you all can help, as you have in the past. Let's look at a simple example of a dog and a cat that are friends. This isn't a rare occurrence. It also has the benefit of being much more interesting than my business case. We want a function called "saveFriends" that takes a dog name and a cat name. We'll save the Dog and then the Cat. For this example to work, the cat is going to have a reference back to the dog. I understand this isn't an ideal example, but it's cute and works for our purposes. FriendService.java public int saveFriends(String dogName, String catName) { Dog fido = new Dog(); Cat felix = new Cat(); fido.name = dogName; fido = animalDao.saveDog(fido); felix.name = catName; [ex.A]felix.friend = fido; [ex.B]felix.friend = animalDao.getDogByName(dogName); animalDao.saveCat(felix); } AnimalDao.java (extends HibernateDaoSupport) public Dog saveDog(Dog dog) { getHibernateTemplate().saveOrUpdate(dog); return dog } public Cat saveCat(Cat cat) { getHibernateTemplate().saveOrUpdate(cat); return cat; } public Dog getDogByName(String name) { return (Dog) getHibernateTemplate().find("from Dog where name=?", name).get(0); } Now, assume for a minute that I would like to use either example A or example B to save my friend. Is one better than the other to use? I'll understand if neither of those examples work, but please explain why.

    Read the article

  • What does 'postMessage()' do when called on an object tag?

    - by Stephano
    I was recently searching for a way to call the print function on a PDF I was displaying in adobe air. I solved this problem with a little help from this fellow, and by calling postMessage on my PDF like so: //this is the HTML I use to view my PDF <object id="PDFObj" data="test.pdf" type="application/pdf"/> ... //this actionscript lives in my air app var pdfObj:Object = htmlLoader.window.document.getElementById("PDFObj"); pdfObj.postMessage([message]); I've tried this in JavaScript as well, just to be sure it wasn't adobe sneaking in and helping me out... var obj = document.getElementById("PDFObj"); obj.postMessage([message]); Works well in JavaScript and in ActionScript. I looked up what the MDC had to say about postMessage, but all I found was window.postMessage. Now, the code works like a charm, and postMessage magically sends my message to my PDF's embedded JavaScript. However, I'm still not sure how I'm doing this. Any ideas?

    Read the article

  • Can I print an HTMLLoader (pdf) in Adobe Air?

    - by Stephano
    I'm using AlivePDF to create a PDF file, then save it to the desktop. I can then use an HTMLLoader to display my lovely PDF file. Now, the print button in Adobe Reader works fine. However, there will be young children using the app, so I'd like to have a big "Print" button right above it. I figured I could just start up a print job and feed it my HTMLLoader. Am I doing something wrong here, cause I can't seem to get any output? note: variable "stuff" below is my HTMLLoader. I also have access to the PDF file if that comes in handy. private function print():void { var myPrintJob:PrintJob=new PrintJob(); var result:Boolean=myPrintJob.start(); if (result && stuff != null) { var rect:Rectangle=new Rectangle(0, 0, 2550, 3300); var opt:PrintJobOptions=new PrintJobOptions(true); myPrintJob.addPage(stuff, rect, opt); myPrintJob.send(); } else { //User does not have printer or user canceled print action } }

    Read the article

  • Can I print an HTMLLoader (pdf) in Adobe Air?

    - by Stephano
    I'm using AlivePDF to create a PDF file, then save it to the desktop. I can then use an HTMLLoader to display my lovely PDF file. Now, the print button in Adobe Reader works fine. However, there will be young children using the app, so I'd like to have a big "Print" button right above it. I figured I could just start up a print job and feed it my HTMLLoader. Am I doing something wrong here, cause I can't seem to get any output? note: variable "stuff" below is my HTMLLoader. I also have access to the PDF file if that comes in handy. private function print():void { var myPrintJob:PrintJob=new PrintJob(); var result:Boolean=myPrintJob.start(); if (result && stuff != null) { var rect:Rectangle=new Rectangle(0, 0, 2550, 3300); var opt:PrintJobOptions=new PrintJobOptions(true); myPrintJob.addPage(stuff, rect, opt); myPrintJob.send(); } else { //User does not have printer or user canceled print action } }

    Read the article

  • What does the JS function 'postMessage()' do when called on an html object tag?

    - by Stephano
    I was recently searching for a way to call the print function on a PDF I was displaying in adobe air. I solved this problem with a little help from this fellow, and by calling postMessage on my PDF like so: //this is the HTML I use to view my PDF <object id="PDFObj" data="test.pdf" type="application/pdf"/> ... //this actionscript lives in my air app var pdfObj:Object = htmlLoader.window.document.getElementById("PDFObj"); pdfObj.postMessage([message]); I've tried this in JavaScript as well, just to be sure it wasn't adobe sneaking in and helping me out... var obj = document.getElementById("PDFObj"); obj.postMessage([message]); Works well in JavaScript and in ActionScript. I looked up what the MDC had to say about postMessage, but all I found was window.postMessage. Now, the code works like a charm, and postMessage magically sends my message to my PDF's embedded JavaScript. However, I'm still not sure how I'm doing this. I found adobe talking about this method, but not really explaining it: HTML-PDF communication basics JavaScript in an HTML page can send a message to JavaScript in PDF content by calling the postMessage() method of the DOM object representing the PDF content. Any ideas how this is accomplished?

    Read the article

  • What is the difference between NULL in C++ and null in Java?

    - by Stephano
    I've been trying to figure out why C++ is making me crazy typing NULL. Suddenly it hits me the other day; I've been typing null (lower case) in Java for years. Now suddenly I'm programming in C++ and that little chunk of muscle memory is making me crazy. Wikiperipatetic defines C++ NULL as part of the stddef: A macro that expands to a null pointer constant. It may be defined as ((void*)0), 0 or 0L depending on the compiler and the language. Sun's docs tells me this about Java's "null literal": The null type has one value, the null reference, represented by the literal null, which is formed from ASCII characters. A null literal is always of the null type. So this is all very nice. I know what a null pointer reference is, and thank you for the compiler notes. Now I'm a little fuzzy on the idea of a literal in Java so I read on... A literal is the source code representation of a fixed value; literals are represented directly in your code without requiring computation. There's also a special null literal that can be used as a value for any reference type. null may be assigned to any variable, except variables of primitive types. There's little you can do with a null value beyond testing for its presence. Therefore, null is often used in programs as a marker to indicate that some object is unavailable. Ok, so I think I get it now. In C++ NULL is a macro that, when compiled, defines the null pointer constant. In Java, null is a fixed value that any non-primitive can be assigned too; great for testing in a handy if statement. Java does not have pointers, so I can see why they kept null a simple value rather than anything fancy. But why did java decide to change the all caps NULL to null? Furthermore, am I missing anything here?

    Read the article

  • Understanding Hibernate saveOrUpdate and the Persistence Life Cycle

    - by Stephano
    The books that I've read regarding hibernate are, at best, reference tomes. They very seldom have good code examples, so I tend to use online resources for those needs. However, I've always had a problem understanding the basic idea of hibernate persistence. I've read the books and understand the concepts, but in practice, I often see results that I don't understand. Perhaps you all can help, as you have in the past. Let's look at a simple example of a dog and a cat that are friends. This isn't a rare occurrence. It also has the benefit of being much more interesting than my business case. We want a function called "saveFriends" that takes a dog name and a cat name. We'll save the Dog and then the Cat. For this example to work, the cat is going to have a reference back to the dog. I understand this isn't an ideal example, but it's cute and works for our purposes. FriendService.java public int saveFriends(String dogName, String catName) { Dog fido = new Dog(); Cat felix = new Cat(); fido.name = dogName; fido = animalDao.saveDog(fido); felix.name = catName; [ex.A]felix.friend = fido; [ex.B]felix.friend = animalDao.getDogByName(dogName); animalDao.saveCat(felix); } AnimalDao.java (extends HibernateDaoSupport) public Dog saveDog(Dog dog) { getHibernateTemplate().saveOrUpdate(dog); return dog } public Cat saveCat(Cat cat) { getHibernateTemplate().saveOrUpdate(cat); return cat; } public Dog getDogByName(String name) { return (Dog) getHibernateTemplate().find("from Dog where name=?", name).get(0); } Now, assume for a minute that I would like to use either example A or example B to save my friend. Is one better than the other to use? I'll understand if neither of those examples work, but please explain why.

    Read the article

  • Why should pop() take an argument?

    - by Stephano
    Quick background I'm a Java developer who's been playing around with C++ in my free/bored time. Preface In C++, you often see pop taking an argument by reference: void pop(Item& removed); I understand that it is nice to "fill in" the parameter with what you removed. That totally makes sense to me. This way, the person who asked to remove the top item can have a look at what was removed. However, if I were to do this in Java, I'd do something like this: Item pop() throws StackException; This way, after the pop we return either: NULL as a result, an Item, or an exception would be thrown. My C++ text book shows me the example above, but I see plenty of stack implimentations taking no arguments (stl stack for example). The Qustion How should one implement the pop function in C++? The Bonus Why?

    Read the article

  • Understanding C++ pointers (when they point to a pointer)

    - by Stephano
    I think I understand references and pointers pretty well. Here is what I (think I) know: int i = 5; //i is a primitive type, the value is 5, i do not know the address. int *ptr; //a pointer to an int. i have no way if knowing the value yet. ptr = &i; //now i have an address for the value of i (called ptr) *ptr = 10; //go get the value stored at ptr and change it to 10 Please feel free to comment or correct these statements. Now I'm trying to make the jump to arrays of pointers. Here is what I do not know: char **char_ptrs = new char *[50]; Node **node_ptrs = new Node *[50]; My understanding is that I have 2 arrays of pointers, one set of pointers to chars and one to nodes. So if I wanted to set the values, I would do something like this: char_ptrs[0] = new char[20]; node_ptrs[0] = new Node; Now I have a pointer, in the 0 position of my array, in each respective array. Again, feel free to comment here if I'm confused. So, what does the ** operator do? Likewise, what is putting a single * next to the instantiation doing (*[50])? (what is that called exactly, instantiation?)

    Read the article

1