Daily Archives

Articles indexed Friday June 11 2010

Page 1/114 | 1 2 3 4 5 6 7 8 9 10 11 12  | Next Page >

  • Setting freemarker template from classpath

    - by wuntee
    I have a web application that I need to manually obtain a Freemarker template - the template is obtained via a class in a library project, but the actual tpl file is contained in the web application classpath. So, there are 2 projects, one 'taac-backend-api' and another 'taac-web'; taac-backend-api has the code to grab the template, and process it, but taac-web is where the template is stores (specifically in: WEB-INF/classes/email/vendor.tpl) - I have tried everything from using springs classpath resource to using Freemarkers setClassForTemplateLoading method. I assume this would work: freemarkerConfiguration = new Configuration(); freemarkerConfiguration.setClassForTemplateLoading(this.getClass(), ""); Template freemarkerTemplate = freemarkerConfiguration.getTemplate("/email/vendor.tpl"); yet, I always get a FileNotFoundException. Can someone explain the best way to obtain a template from the classpath? Thanks.

    Read the article

  • Contact-to-hire from the perspective of the headhunter agency?

    - by jamieb
    I operate a small IT consulting firm. One of my clients has expressed an interest in having an ASP.Net programmer on-site at their location for a six-month contract, with an option to hire. I've never really operated my company as a body shop (renting out talent for the long term) and an unfamiliar with how to price my quote. Assume I were to bring on a new developer as a 1099'ed contractor and then contract that person out to my client for the duration of the project. If I'm billing my client $X per hour for this developer's time, what should I be compensating this developer? $X/2 per hour? What's the typical ratio? If the client decides to hire this person at the end of the contract, what should I be compensated? Is it a flat finders fee, or maybe a function of the developer's annual salary? Would there be any advantage to actually hiring the person as a 1040'd employee rather than a 1099 contractor even if I can't offer him benefits? I know other body shops (like Robert Half) do this and never understood why.

    Read the article

  • java.lang.VerifyError on method that worked a minute ago

    - by Travis
    Apologies in advance but I have never seen this error before and don't know what to include. I am using NetBeans and suddenly began getting this error: Exception in thread "AWT-EventQueue-0" java.lang.VerifyError: (class: market/CostOperations, method: <init> signature: ()V) Constructor must call super() or this() at Bluebuild.Main.refreshTables(Main.java:748) at Bluebuild.Main.formComponentShown(Main.java:649) at Bluebuild.Main.access$100(Main.java:28) at Bluebuild.Main$2.componentShown(Main.java:374) at java.awt.Component.processComponentEvent(Component.java:6095) at java.awt.Component.processEvent(Component.java:6043) at java.awt.Container.processEvent(Container.java:2041) at java.awt.Window.processEvent(Window.java:1836) at java.awt.Component.dispatchEventImpl(Component.java:4630) at java.awt.Container.dispatchEventImpl(Container.java:2099) at java.awt.Window.dispatchEventImpl(Window.java:2478) at java.awt.Component.dispatchEvent(Component.java:4460) at java.awt.EventQueue.dispatchEvent(EventQueue.java:599) at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:269) at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:184) at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:174) at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:169) at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:161) at java.awt.EventDispatchThread.run(EventDispatchThread.java:122) I have not a clue what happened. I didn't even modify market/CostOperations. Here's the constructor though: public CostOperations() throws ParserConfigurationException, SAXException, IOException { //Open the xml file DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance(); DocumentBuilder builder = factory.newDocumentBuilder(); f = new File(dbName); doc = builder.parse(f); System.out.println(f.canWrite()); //Create the XPath XPathFactory xpfactory = XPathFactory.newInstance(); path = xpfactory.newXPath(); } In Debug Mode I get this: debug: Have no FileObject for C:\Program Files (x86)\Java\jdk1.6.0_20\jre\lib\sunrsasign.jar Have no FileObject for C:\Program Files (x86)\Java\jdk1.6.0_20\jre\classes I just need to know what is causing the error and how to fix it. Thanks!

    Read the article

  • Customizing Rails XML rendering to include extra properties

    - by Isaac Cambron
    Let's say I have a model like this: create_table :ninjas do |t| t.string name end And the Ninja class with an extra property: class Ninja < ActiveRecord::Base def honorific "#{name}san" end end And in my controller I just want to render it to XML: def show render :xml => Ninja.find(params[:id]) end The honorific part isn't rendered. That makes sense, since it's just a method, but is there a way of tricking it? I'm totally up for answers to the effect of, "You're doing this totally wrong." I'll just add that I really do want to calculate the honorific on the fly, and not, like, store it in the database or something.

    Read the article

  • How to use the callback method with a c++ directshow sample grabber

    - by Mr Bell
    I have a sample grabber hooked into my directshow graph, based on this example http://msdn.microsoft.com/en-us/library/dd407288(VS.85).aspx the problem is that it uses one shot and buffers. I want to continuously grab samples, and i'd rather have a callback than i guess polling for the samples. How do use the SetCallback method? SetCallback(ISampleGrabberCB *pCallback, long WhichMethodToCallback) how do I point pCallback to my own method?

    Read the article

  • Is there an analog for the VI '.' command to repeat-last-typed-text

    - by Don
    I've used emacs for decades and always wondered, but kept on coding, if there was a way to type in something, them move the cursor and insert the same text, like the VI . command. Instead what I do is to type the text, set the mark, backup, copy the region, go to the next spot (often just C-n, down one line) and then pre-arg yank, C-u C-y. It's the overhead of set mark, backup and copy region that makes me just go ahead and retype the thing.

    Read the article

  • How To Rotate An MPMoviePlayerController

    - by Dwaine Bailey
    I am building an iPhone app that plays videos on demand from a web service. The videos play in an MPMoviePlayerController, and everything works fine on the iPhone device. However, when one loads up the iPhone application on an iPad, the videos play Portrait mode (with letterboxing on the top and bottom), instead of Landscape Left like they do on the iPhone. At first the videos were not appearing at all, however I fixed this by adding the MPMoviePlayerControllers view to the view that is creating it, as a subview, and then set it to play fullscreen. -- Edit To Original: I now have it playing on the iPad in all rotations. Is there any way to stop it rotating, and just have it play LandscapeLeft? Thanks, Dwaine

    Read the article

  • How to index and search subversion repository

    - by Theo Briscoe
    I have access to a very large code base stored in a subversion repository. I would like to be able to perform Google type searched on the code base. I have done this before when I have access to the server by creating a network share and using Google desktop. I currently do not have access to this subversion server box. Any Ideas? Some more info The code base is company wide and large Don't want to download the entire code base for the entire business on my laptop My goal understand what code is available inside the company The code changes often Wondering if there are any tool that can search remote svn repositories?

    Read the article

  • Paperclip and Amazon S3 Issue

    - by Jimmy
    Hey everyone, I have a rails app running on Heroku. I am using paperclip for some simple image uploads for user avatars and some other things, I have S3 set as my backend and everything seems to be working fine except when trying to push to S3 I get the following error: The AWS Access Key Id you provided does not exist in our records. Thinking I mis-pasted my access key and secret key, I tried again, still no luck. Thinking maybe it was just a buggy key I deactivated it and generated a new one. Still no luck. Now for both keys I have used the S3 browser app on OS X and have been able to connect to each and view my current buckets and add/delete buckets. Is there something I should be looking out for? I have my application's S3 and paperclip setup like so development: bucket: (unique name) access_key_id: ENV['S3_KEY'] secret_access_key: ENV['S3_SECRET'] test: bucket: (unique name) access_key_id: ENV['S3_KEY'] secret_access_key: ENV['S3_SECRET'] production: bucket: (unique_name) access_key_id: ENV['S3_KEY'] secret_access_key: ENV['S3_SECRET'] has_attached_file :cover, :styles => { :thumb => "50x50" }, :storage => :s3, :s3_credentials => "#{RAILS_ROOT}/config/s3.yml", :path => ":class/:id/:style/:filename" Note: I just added the (unique name) bits, those aren't actually there--I have also verified bucket names, but I don't even think this is getting that far. I also have my heroku environment vars setup correctly and have them setup on dev

    Read the article

  • Any screen capture software that captures webcam, microphone inputs too ?

    - by mohanr
    I am going to conduct a user study. Apart from capturing the screen while the user is interacting with the system, I also want to capture the video/audio of the user. Is there any software that in addition to capturing the screen also overlays it with the webcam/microphone inputs. The goal is to capture the complete experience of the user: key/mouse interactions with the system along with their facial/vocal responses. I know that I can maybe run a screen-capture software and also run a software for capturing webcam audio/video alongside and try to sync/overlay both these streams with timestamps. But I am going to be dealing with probably several hundred hours of data. So I am looking for a tool that can streamline the process for me amap and help me keep my sanity at end of the process. Thanks,

    Read the article

  • Emphasized text in docbook, fo, pdf out put.

    - by Mica
    I am trying to emphasize a character of some static text to render into the footer of my pdf, but can't figure out the right combination of tags in my xsl. How can I accomplish this? Example: <!-- Footer content --> <xsl:template name="footer.content"> <xsl:param name="pageclass" select="''"/> <xsl:param name="sequence" select="''"/> <xsl:param name="position" select="''"/> <xsl:param name="gentext-key" select="''"/> <fo:block> <xsl:choose> ... <xsl:when test="$sequence = 'odd' and $position = 'left'"> <xsl:text>&#x00A9;<emphasis>My</emphasis>Company</xsl:text> </xsl:when> ... </xsl:choose> </fo:block> </xsl:template> This example generates an error in xsltproc. Help!

    Read the article

  • iphone SDK Keyboard problem

    - by Elishiah
    I have a login view controller that has a button and a UI text view that becomes the first responder. When the button is clicked it loads the forgot view controller and a new UI textview becomes the first responder. When I dissmis the modal view controller the keyboard also gets dismissed and when I load the forgot view controller again the keyboard will not pop up as the first responder. (IBAction) backBeg: (id) sender{ [self dismissModalViewControllerAnimated:YES]; }

    Read the article

  • Gnome Desktop Environment install error

    - by Barbaros
    So i moved to a new server and i want to install gnome desktop environment to access my server via vnc viewer. But, i don't remember how i managed to install last time, so i tried yum groupinstall "GNOME Desktop Environment" command and server said Warning: Group GNOME Desktop Environment does not exist. No packages in any requested group available to install or update It's a brand new server so i didn't add any repos or else yet It's a centos 5.5 server ...

    Read the article

  • Torrents: Can I protect my software by sending wrong bytes?

    - by martijn-courteaux
    Hi, It's a topic that everyone interests. How can I protect my software against stealing, hacking, reverse engineering? I was thinking: Do my best to protect the program for reverse engineering. Then people will crack it and seed it with torrents. Then I download my own cracked software with a torrent with my own torrent-software. My own torrent-software has then to seed incorrect data (bytes). Of course it has to seed critical bytes. So people who want to steal my software download my wrong bytes. Just that bytes that are important to startup, saving and loading data, etc... So if the stealer download from me (and seed it later) can't do anything with it, because it is broken. Is this idea relevant? Maybe, good torrent-clients check hashes from more peers to check if the packages (containing my broken bytes) I want to seed are correct or not? Thanks

    Read the article

  • Window 7 image in vmware will allow network connection out but not http

    - by Ormis
    I am currently trying to create a set of images to deploy on my network, but I've run in to a snag. When I create my own Windows 7 image I can successfully use NAT for connecting to the network but whenever I try to access a webpage I get nothing. To be more specific, All firewalls/iptables are disabled on my host machine, my virtual machine, and my network. I can do lookups and all addresses respond correctly (i'm even using Google's DNS). On the host OS i have full connectivity. On the virtual machine I can ping any device I want and all addresses resolve correctly. Within a browser I cannot reach any page via hostname or IP. I feel almost like port 80 is being blocked but i can't find any reason this would be the case. If anyone has had this occur before, I would love some insight to the problem. I understand this question is a bit out of the norm for stackoverflow, but I've run out of ideas. Thank you for any help you can provide.

    Read the article

  • Type of object returned by an input from a web page

    - by controlfreak123
    I'm attempting to upload a file into a jsp and then use the file in some other code. My problem is that it comes into the servlet as an Object via the request.getAttribute() call so I don't know what to cast it to. I have this code so far to try and test what it is but I'm getting a NullPointerException. PrintWriter out = response.getWriter(); out.println(request.getAttribute("file1").getClass()); Is my understanding of whats going on flawed or am I just coding it up wrong?

    Read the article

  • .NET 4 SpinLock

    - by Jon Harrop
    The following test code (F#) is not returning the result I'd expect: let safeCount() = let n = 1000000 let counter = ref 0 let spinlock = ref <| SpinLock(false) let run i0 i1 () = for i=i0 to i1-1 do let locked = ref false try (!spinlock).Enter locked if !locked then counter := !counter + 1 finally if !locked then (!spinlock).Exit() let thread = System.Threading.Thread(run 0 (n/2)) thread.Start() run (n/2) n () thread.Join() !counter I'd expect the SpinLock to mutually exclude the counter and, therefore, for it to return counts of 1,000,000 but, instead, it returns smaller values as if no mutual exclusion is occurring. Any ideas what's wrong?

    Read the article

  • Clear validation on textInput when validation is not enabled

    - by Jon
    Hi, I've created a custom textInput componenet that handles it's own validation using a private validator. The validation is enabled depending on the state of the component i.e. validation is enable when the components state is "edit". However, when the state changes from edit the internal validator is set to not enabled but the validation errors on the textbox do not clear - the textInput still has the red border and on mouseover the validation errors come up. What I want to happen is that when a validator is disabled the error formatting and error messages clear from the text input control. Does anyone have any idea how to do this I tried setting the internal validator instance to enabled = false and dispatching a new focusOutEvent as below but the validation error formatting is still applied to the textInput contrl. _validatorInstance.enabled = false; //clear the validation errors if any dispatchEvent(new FocusEvent(FocusEvent.FOCUS_OUT)); Any ideas? Thanks Jon

    Read the article

1 2 3 4 5 6 7 8 9 10 11 12  | Next Page >