Daily Archives

Articles indexed Thursday May 20 2010

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

  • Problem with UTF-8

    - by Pablo Fernandez
    I'm using castor as an OXM mapper, and I'm having a problem with UTF-8 encoding. The code here shows the issue: //Marshaller configuration ByteArrayOutputStream baos = new ByteArrayOutputStream(); OutputStreamWriter os = new OutputStreamWriter(baos, UTF_8); Marshaller marshaller = new Marshaller(os); marshaller.setSuppressXSIType(true); //Mappings configuration Mapping map = new Mapping(); map.loadMapping(MarshallingService.class.getResource(MAPPINGS_PATH)); marshaller.setMapping(map); //Example //BEFORE MARSHALLING: This prints correctly the UTF-8 Chars object.getName() ; marshaller.marshal(object); //AFTER MARSHALLING: This returns the characters like \435\235\654\345 return baos.toString(UTF_8);

    Read the article

  • Programming texts and reference material for my Kindle DX, creating the ultimate reference device?

    - by mwilliams
    (Revisiting this topic with the release of the Kindle DX) Having owned both generation Kindle readers and now getting a Kindle DX; I'm very excited for true PDF handling on an e-ink device! An image of _Why's book on my Kindle (from my iPhone). This gives me a device capable of storing hundreds of thousands of pages that are full text search capable in the form factor of a magazine. What references (preferably PDF to preserve things such as code samples) would you recommend? Ultimately I would like reference material for every modern and applicable programming language (C, C++, Objective-C, Python, Ruby, Java, .NET (C#, Visual Basic, ASP.NET), Erlang, SQL references) as well as general programming texts and frameworks (algorithms, design patterns, theory, Rails, Django, Cocoa, ORMs, etc) and anything else that could be thought of. With so many developers here using such a wide array of languages, as a professional in your particular field, what books or references would you recommend to me for my Kindle? Creative Commons material a plus (translate that to free) as well as the material being in the PDF file format. File size is not an issue. If this turns out to be a success, I will update with a follow-up with a compiled list generated from all of the answers. Thanks for the assistance and contributing! UPDATE I have been using the Kindle DX a lot now for technical books. Check out this blog post I did for high resolution photos of different material: http://www.matthewdavidwilliams.com/2009/06/12/technical-document-pdfs-on-the-kindle-dx/

    Read the article

  • InternetCheckConnection in VB6 returning false

    - by user191582
    Hi all, Not a VB6 expert... Trying to come up with a VB6 test app that calls InternetCheckConnection. In my test app, InternetCheckConnection always returns false regardless of the URL I use. I copied and pasted this code from a larger spaghetti-code app, but in the spaghetti-code, InternetCheckConnection seems to work fine, returns true. Is there some other function I have to call first in order for InternetCheckConnection to work?

    Read the article

  • ERROR_SEM_TIMEOUT when using WinUSB WritePipe

    - by Ted N
    I often get ERROR_SEM_TIMEOUT errors using the WinUSB WritePipe function. This would seem to indicate that there is a timeout, but if I wait a period of time and try again I'm never able to write. I'm writing in 64 byte chucks to the USB device and often don't have problems. Once I start getting the error, I may have to unplug the usb and and close my app before trying again. Has anybody experienced this problem?

    Read the article

  • Java Scanner newline parsing with regex (Bug?)

    - by SEK
    I'm developing a syntax analyzer by hand in Java, and I'd like to use regex's to parse the various token types. The problem is that I'd also like to be able to accurately report the current line number, if the input doesn't conform to the syntax. Long story short, I've run into a problem when I try to actually match a newline with the Scanner class. To be specific, when I try to match a newline with a pattern using the Scanner class, it fails. Almost always. But when I perform the same matching using a Matcher and the same source string, it retrieves the newline exactly as you'd expect it too. Is there a reason for this, that I can't seem to discover, or is this a bug, as I suspect? FYI: I was unable to find a bug in the Sun database that describes this issue, so if it is a bug, it hasn't been reported. Example Code: Pattern newLinePattern = Pattern.compile("(\\r\\n?|\\n)", Pattern.MULTILINE); String sourceString = "\r\n\n\r\r\n\n"; Scanner scan = new Scanner(sourceString); scan.useDelimiter(""); int count = 0; while (scan.hasNext(newLinePattern)) { scan.next(newLinePattern); count++; } System.out.println("found "+count+" newlines"); // finds 7 newlines Matcher match = newLinePattern.matcher(sourceString); count = 0; while (match.find()) { count++; } System.out.println("found "+count+" newlines"); // finds 5 newlines

    Read the article

  • GWT serialization issue

    - by Eddy
    I am having a heck of a time returning an ArrayList of objects that implement IsSerializable via RPC. The IsSerializable pojo contains one variable, a String, and has a 0 parameter constructor. I have removed the .gwt.rpc file from my war and still I get: com.google.gwt.user.client.rpc.SerializationException: Type 'com.test.myApp.client.model.Test' was not included in the set of types which can be serialized by this SerializationPolicy or its Class object could not be loaded. For security purposes, this type will not be serialized.: instance = com.test.myApp.client.model.Test@17a9692 at com.google.gwt.user.server.rpc.impl.ServerSerializationStreamWriter.serialize(ServerSerializationStreamWriter.java:610) I am using GWT 2.0.2 with jdk 1.6.0_18. Any ideas on what might be going on or what I am doing wrong? Here is the code for the Test class and the remote method is returning ArrayList. I even modified the code for it to just return one instance of Test with the same result: the exception above. package com.test.myApp.client.model; import com.google.gwt.user.client.rpc.IsSerializable; public class Test implements IsSerializable{ private String s; public Test() {} public Test(String s) { this.s = s; } public String getS() { return s; } public void setS(String s) { this.s = s; } } Greatly appreciate the help! Eddy

    Read the article

  • Encrypt pdf files with mcrypt and php

    - by microchasm
    I'm currently set up with a CentOS box that utilizes mcrypt to encrypt/decrypt data to/from the database. In my haste, I forgot that I also need a solution to encrypt files (primarily pdf, with a xls and txt file here and there). Is there a way to utilize mcrypt to encrypt pdf files? I understand the possibility of file_get_contents() with txt; is a similar solution available for other formats? Thanks!

    Read the article

  • Tricky MySQL Query for messaging system in Rails - Please Help

    - by ole_berlin
    Hi, I'm writing a facebook style messaging system for a Rails App and I'm having trouble selecting the Messages for the inbox (with will_paginate). The messages are organized in threads, in the inbox the most recent message of a thread will appear with a link to it's thread. The thread is organized via a parent_id 1-n relationship with itself. So far I'm using something like this: class Message < ActiveRecord::Base belongs_to :sender, :class_name => 'User', :foreign_key => "sender_id" belongs_to :recipient, :class_name => 'User', :foreign_key => "recipient_id" has_many :children, :class_name => "Message", :foreign_key => "parent_id" belongs_to :thread, :class_name => "Message", :foreign_key => "parent_id" end class MessagesController < ApplicationController def inbox @messages = current_user.received_messages.paginate :page => params[:page], :per_page => 10, :order => "created_at DESC" end end That gives me all the messages, but for one thread the thread itself and the most recent message will appear (and not only the most recent message). I can also not use the GROUP BY clause, because for the thread itself (the parent so to say) the parent_id = nil of course. Anyone got an idea on how to solve this in an elegant way? I already thought about adding the parent_id to the parent itself and then group by parent_id, but I'm not sure if that works. Thanks

    Read the article

  • How to use regular expressions to pull a substring? (screen scraping)

    - by Diego
    Hey guys, i'm really trying to understand regular expressions while scraping a site, i've been using it in my code enough to pull the following, but am stuck here. I need to quickly grab this: http://www.example.com/online/store/TitleDetail?detail&sku=123456789 from this: ('<a href="javascript:if(handleDoubleClick(this.id)){window.location=\'http://www.example.com/online/store/TitleDetail?detail&sku=123456789\';}" id="getTitleDetails_123456789">\r\n\t\t\t \tcheck store inventory\r\n\t\t\t </a>', 1) This is where I got confused. any ideas?

    Read the article

  • How can I get jQuery UI's Draggable and Sortable functions to work on the iPhone?

    - by Damovisa
    I have a page that uses JQuery UI; in particular the Sortable interaction. The page works fine for desktop web browsers with mice, however I can't get the drag-drop functionality to work on Mobile Safari on the iPhone. Any dragging action simply scrolls the page. The functionality on my page is extremely similar to the Sortable Empty-Lists demo on the JQuery UI site. This page also doesn't work on the iPhone. Is there any way to get the drag-drop functions working on the iPhone?

    Read the article

  • select rows with unidentical column values

    - by Bazon
    Hi Guys, I need to create a new data frame that excludes dams that appear in "dam1" and "dam2" columns on the same fosdate (fostering date). I tried df <- df[df$dam1!=dam2,] but did not work. Dam1 and dam2 are factors which are the ids's of mothers. my df: fosdate dam1 dam2 8/09/2009 2Z523 2Z523 30/10/2009 1W509 5C080 30/10/2009 1W509 5C640 30/10/2009 1W509 1W509 1/10/2009 1W311 63927 The new data frame that I need to get is: dfnew: fosdate dam1 dam2 30/10/2009 1W509 5C080 30/10/2009 1W509 5C640 1/10/2009 1W311 63927 Would appreciate any help! Bazon

    Read the article

  • Unit testing with JMS (ActiveMQ)

    - by larry cai
    How to do unit testing with JMS ? Is it some de-facto for this ? I googled something - Unit testing for JMS: http://activemq.apache.org/how-to-unit-test-jms-code.html - jmsTemplate: activemq.apache.org/jmstemplate-gotchas.html - mockRunner : mockrunner.sourceforge.net/ Do you have any good experience on those and suggestion for me ?

    Read the article

  • MDI and WPF Ribbon

    - by femi
    Hello, i noticed that the WPF Ribbon is bound to a XAML Usercontrol or window. Lets imagine i have a windws.xaml page with a WPF Ribbon at the top. I want to create an instance such that once i click on one of the WPF Buttons, i am taken to a different XAML UserControl or "page". How do i do this? Will this new page have the WPF Ribbon on the top? thanks

    Read the article

  • Gaining information from nodes of tree

    - by jainp
    I am working with the tree data structure and trying to come up with a way to calculate information I can gain from the nodes of the tree. I am wondering if there are any existing techniques which can assign higher numerical importance to a node which appears less frequently at lower level (Distance from the root of the tree) than the same nodes appearance at higher level and high frequency. To give an example, I want to give more significance to node Book, at level 2 appearing once, then at level 3 appearing thrice. Will appreciate any suggestions/pointers to techniques which achieve something similar. Thanks, Prateek

    Read the article

  • Virtual StringTree's hint windows are left out on the screen

    - by Edwin
    Hi, See this screenshot, in the middle it's the small hint windows that are generated by a TVirtualStringTree control and were left out on the screen, these hint windows will remain there until the application exits. the problem happens when the treeview's hint is shown and the mouse leaves quickly to the window next to it. Any idea about how to avoid this or how to clear those un-erased hint windows if it's difficult to avid this? Few days ago I asked a similar question, while the hint windows in the screenshots look the same, the are not the same problem. That problem, the hint text never shows and only that kind of uncompleted hint windows are shown; This problem, the hint text shows but the hint windows are not completely erased in a case (as I described above). Hope it's clear.

    Read the article

  • zend framework - quickstart application

    - by m gahagan
    I have been attempting to install the 'quickstart' tutorial application on my system. After a considerable amount of frustration - a) because I dont know how it all works andb) mine's a windows (wamp) set-up, I have got as far as setting up the guestbook database successfully and reaching the Checkpoint: Now browse to http://localhost/guestbook. You should see the following in your browser: I get error: Warning: include(C:\wamp\www\quickstart\application/models//GuestbookMapper.php) [function.include]: failed to open stream: No such file or directory in C:\wamp\www\quickstart\library\Zend\Loader\Autoloader\Resource.php on line 176 Warning: include() [function.include]: Failed opening 'C:\wamp\www\quickstart\application/models//GuestbookMapper.php' for inclusion (include_path='C:\wamp\www\quickstart\library;.;C:\wamp\bin\php\php5.3.0\PEAR;C:\wamp\zend\library;C:\wamp\zend\extras\library') in C:\wamp\www\quickstart\library\Zend\Loader\Autoloader\Resource.php on line 176 Fatal error: Class 'Default_Model_GuestbookMapper' not found in C:\wamp\www\quickstart\application\models\Guestbook.php on line 102 Obviously failing to link relevant files is the main issue - First, that 'C:\wamp\www\quickstart\application/models//GuestbookMapper.php' looks wrong to me, but I cant figure out what's creating it. Second, I have a very tenuous grip on the whole file path system and cant tell whether things are wrongly configured. If I could get the guestbook app to function, then I might be able to get a grip on what's going on. As it is, I seem to fix one problem only to find another round the next corner.

    Read the article

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