Daily Archives

Articles indexed Friday April 9 2010

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

  • Why do Unicode characters show up properly in database, but as ? when printed in Java via Hibernate?

    - by lupefiasco
    I'm writing a webapp, and interfacing with MySQL using Hibernate 3.5. Using "?????? ?????????" as my test string, I can input the string and see that it is properly persisted into the database. However, when I later pull the value out of the database and print to the console as a String, I see "?????? ?????????". If I use new OutputStreamWriter(System.out,"UTF-8"); then I get "„Éá„Çp„ÇØ„Éà„ÉÉ„Éó ·Éò·Éú·Éí·Éö·Éò·É°·É£·É†·Éò"". Why don't I see the original string? These are my hibernate.cfg.xml settings: <property name="hibernate.connection.useUnicode"> true </property> <property name="hibernate.connection.characterEncoding"> UTF-8 </property> <property name="hibernate.connection.charSet"> UTF-8 </property> and this is my database connection string: hibernate.connection.url = jdbc:mysql://localhost/mydatabase?autoReconnect=true&amp;useUnicode=true&amp;characterEncoding=UTF-8

    Read the article

  • How to create a dynamic Linq Join extension method

    - by Royd Brayshay
    There was a library of dynamic Linq extensions methods released as a sample with VS2008. I'd like to extend it with a Join method. The code below fails with a parameter miss match exception at run time. Can anyone find the problem? public static IQueryable Join(this IQueryable outer, IEnumerable inner, string outerSelector, string innerSelector, string resultsSelector, params object[] values) { if (inner == null) throw new ArgumentNullException("inner"); if (outerSelector == null) throw new ArgumentNullException("outerSelector"); if (innerSelector == null) throw new ArgumentNullException("innerSelector"); if (resultsSelector == null) throw new ArgumentNullException("resultsSelctor"); LambdaExpression outerSelectorLambda = DynamicExpression.ParseLambda(outer.ElementType, null, outerSelector, values); LambdaExpression innerSelectorLambda = DynamicExpression.ParseLambda(inner.AsQueryable().ElementType, null, innerSelector, values); ParameterExpression[] parameters = new ParameterExpression[] { Expression.Parameter(outer.ElementType, "outer"), Expression.Parameter(inner.AsQueryable().ElementType, "inner") }; LambdaExpression resultsSelectorLambda = DynamicExpression.ParseLambda(parameters, null, resultsSelector, values); return outer.Provider.CreateQuery( Expression.Call( typeof(Queryable), "Join", new Type[] { outer.ElementType, inner.AsQueryable().ElementType, outerSelectorLambda.Body.Type, innerSelectorLambda.Body.Type, resultsSelectorLambda.Body.Type }, outer.Expression, inner.AsQueryable().Expression, Expression.Quote(outerSelectorLambda), Expression.Quote(innerSelectorLambda), Expression.Quote(resultsSelectorLambda))); } I've now fixed it myself, here's the answer. Please vote it up or add a better one.

    Read the article

  • How can I browse source code on an iPhone?

    - by Bill
    I have a lot of downtime on the subway each morning and evening, and I'd like to be able to review source code for various projects I'm working on. Are there any apps that can help with this? I'd like something that lets me browse a hierarchical tree of source files and that does syntax highlighting.

    Read the article

  • Difference between weblogic and websphere?

    - by Abhishek Jain
    I do not find actual difference between these two J2EE server. From my past experience, I found out following: WL is evolving more faster than WAS. WL is more user friendly than WAS. To simply deploy a application in WAS, we need to go in deep and its difficult to find if u are new to it. I found out that WAS is slower in some machine than WL. I found out that Classloading is easier to understand and effective in WL than WAS Above all are my experiences but not actual facts. I want to know more in this respect. Please clear my doubts. If possible please provide each J2EE server's pros and cons. -Abhishek

    Read the article

  • How to create a route that catch all pdf file?

    - by VinnyG
    I want to have my pdf files sent this way to my users : public ActionResult GetPDF( string filename ) { return File( filename, "application/pdf", Server.HtmlEncode( filename ) ); } But I don't know how to create a route that will catch all the different pdf file in my site? Thanks a lot for the help!

    Read the article

  • Android ImageButton with a selected state?

    - by Joren
    If I was using an ImageButton with a selector for its background, is there a state I can change which will make it change its appearance? Right now I can get it to change images when pressed, but there seems to be no "highlighted" or "selected" or similar state which lets me toggle it's appearance at will. Here's my XML, it only changes appearance when pressed. <selector xmlns:android="http://schemas.android.com/apk/res/android"> <item android:state_focused="true" android:state_pressed="false" android:drawable="@drawable/map_toolbar_details_selected" /> <item android:state_focused="true" android:state_pressed="true" android:drawable="@drawable/map_toolbar_details_selected" /> <item android:state_focused="false" android:state_pressed="true" android:drawable="@drawable/map_toolbar_details_selected" /> <item android:drawable="@drawable/map_toolbar_details" />

    Read the article

  • ASP.NET MVC View ReRenders Part of Itself

    - by Jason
    In all my years of .NET programming I have not run across a bug as weird as this one. I discovered the problem because some elements on the page were getting double-bound by jQuery. After some (ridiculous) debugging, I finally discovered that once the view is completely done rendering itself and all its children partial views, it goes back to an arbitrary yet consistent location and re-renders itself. I have been pulling my hair out about this for two days now and I simply cannot get it to render itself only once! For lack of any better debugging idea, I've painstakingly added logging tracers throughout the HTML just so I can pin down what may be causing this. For instance, this code ($log just logs to the console): ... <script type="text/javascript">var x = 0; $log('1');</script> <div id="new-ad-form"> <script type="text/javascript">x++;$log('1.5', x);</script> ... will yield ... <--- this happens before this snippet 1 1.5 1 ... 10 <--- bottom of my form, after snippet 1.5 2 <--- beginning of part that runs again! ... 9 <--- this happens after this snippet I've searched my codebase high and low, but there is NOTHING that says that it should re-render part of a page. I'm wondering if the jQueryUI has anything to do with it, as #new-ad-form is the container for a jQueryUI dialog box. If this is potentially the case, here's my init code for that: $('#new-ad-form').dialog({ autoOpen: false, modal: true, width: 470, title: 'Create A New Ad', position: ['center', 35], close: AdEditor.reset });

    Read the article

  • seeing C# windows forms project code from F#

    - by Pessimist
    I have a C# Windows Forms project open with some C# code in it. Question: How can I have an F# file that I can write F# code in but still referencing all the C# code I have on Form1.cs (including the GUI). I can successfully do this: - Create a C# Windows Forms project - Create a F# Library project - Reference the F# Library DLL from my C# project - That way I can call F# functions from C# But I still can't see my buttons and textboxes from F# I understand that that is because it's a library and it can't reference System.Windows.Forms So how do I fix this? I don't want it to be a library or this or that, I just want it to be a file that will allow me to write F# code while being able to reference my C# Form and code. I guess you can say I want an F# file that is also a "partial class Form1" so that I can continue writing code for the same Project, but using F# instead. How do I do that?

    Read the article

  • Why does MSBuild fail from the command line where VS2008 succeeds?

    - by sundeep
    I have an ASP.NET solution that builds just fine from within VS2008. However , it fails when i do this : MSBUILD.exe c:\path-to-sln It fails with a CS0006 error ("Metadata file 'dll_name' could not be found"). It also fails when I try with a .csproj of a project within the solution. What is VS2008 doing that MSBuild is missing ? It is my understanding that VS knows about inter assembly dependencies that MSBuild cant. Is there any way I can inform MSBuild of these? (I need MSBuild to work from the command line because I am calling it from an MSBuild-Task from within CruiseControl.Net.) Thanks in Advance. :3) (I have looked at http://stackoverflow.com/questions/280559/how-to-get-cmd-line-build-command-for-vs-solution , but still dont get it)

    Read the article

  • No events are fired from an imagebrush via ImageOpened/ImageFailed

    - by umlgorithm
    A canvas is received from the server, and an image brush is extracted from the canvas via searching for a bunch of pathes. In summary, Canvas - Path - Path.Fill - ImageBrush. Now, I want to take a snapshot of the ImageBrush using WriteableBitmap when it is loaded and here is what I did var imageBrushes = VisualTreeUtility.FindVisualChildren<Path>(canvas) .Where(i => i.Fill.GetType() == typeof(ImageBrush)) .Select(p => p.Fill); foreach(var image in imageBrushes) { image.ImageOpened += delegate { //never gets here }; image.ImageFailed += delegate { //never gets here either }; // if the image is already loaded if (((BitmapSource)image.ImageSource).PixelWidth != 0) { // never gets here either } } As you can see the comments in the code above, no matter what I try, I can't seem to catch an event from the image. Any suggestions?

    Read the article

  • How to Watch Youtube Videos on PSP with iMoviesoft FLV Converter

    - by user312417
    Do you have worried about it? You can not watch Youtube videos anytime, anywhere.It is so boring on the way to work and home.How you want to be able to enjoy the wonderful Youtube Video on PSP that you can watch them on the way to home, home on bus. This artice will tell you about how to convert Youtube VIdeos to PSP Player, take "Alice.in.Wonderland" as an example, We can use iMoviesoft FLV Converter to convert it to PSP video file. iMoviesoft FLV Converter is a powerful FLV Converter which can convert FLV and YouTube Videos to almost any video formats, with excellent conversion speed and quality, such as converting FLV to MP4, FLV to AVI, FLV to WMV, FLV to MPEG etc. Furthermore, it can also easily convert video files to some popular audio formats, such as WMA, MP3, M4A, AAC, etc. You can convert FLV and YouTube videos to PSP, iPod, iPhone, Zune video player and other portable video players. After easy and wonderful conversion, you can fully enjoy videos on your PSP, iPod, iPhone and some other portable video players. Besides, you can also use it to join videos. Merge several videos into one output PSP video and enjoy them conveniently. You can also trim your favarite clips or remove the video black edges by [iMoviesoft FLV Converter. Hope to help every Video Enthusiasts.

    Read the article

  • Declare two classes from eachother.

    - by tumba25
    I'm writing a app in NetBeans. I have two classes MyApp_View and MyApp_Functions. The MyApp_View class starts like this public class MyApp_View extends FrameView { MyApp_Functions My_functions = new MyApp_Functions(); public MyApp_View(SingleFrameApplication app) { super(app); In MyApp_Functions I have MyApp_View my_view = new MyApp_View(null); I want to access the public variables in MyApp_View from MyApp_Functions and the public methods in functions from view, but have no success with this. Is this doable? And how?

    Read the article

  • Gnu Emacs indenting of my typedef

    - by Kinopiko
    Gnu Emacs is insisting on indenting my typedef as follows: typedef enum { horizontal, vertical, } shapes; I want it to indent as follows: typedef enum { horizontal, vertical, } shapes; What switch can I use to get that?

    Read the article

  • Registering custom webcontrol inside mvc view?

    - by kastermester
    I am in the middle of a project where I am migrating some code for a website from WebForms to MVC - unfortunatly there's not enough time to do it all at once, so I will have to do some... not so pretty solutions. I am though facing a problems with a custom control I have written that inherits from the standard GridView control namespace Controls { public class MyGridView : GridView { ... } } I have added to the web.config file as usual: <configuration> ... <system.web> ... <pages> ... <controls> ... <add tagPrefix="Xui" namespace="Controls"/> </controls> </pages> </system.web> </configuration> Then on the MVC View: <Xui:MyGridView ID="GridView1" runat="server" ...>...</Xui:MyGgridView> However I am getting a parser error stating that the control cannot be found. I am suspecting this has to do with the mix up of MVC and WebForms, however I am/was under the impression that such mixup should be possible, is there any kind of tweak for this? I realise this solution is far from ideal, however there's no time to "do the right thing". Thanks

    Read the article

  • Why is WMDC/ActiveSync so flaky?

    - by Ira Rainey
    I'm developing a Windows Mobile app using the .NET Compact Framework 3.5 and VS2008, and for debugging using the Device Emulator V3, on Win7, and seem to have constant problems with Windows Mobile Device Centre (6.1) connecting. Using the Emulator Manager (9.0.21022.8) I cradle the device using DMA in WMDC. The problem is it's so flaky at actually connecting that it's becoming a pain. I find that when I turn my computer on, before I can get it to connect I have to open up WMDC, disable Connect over DMA, close WMDC down, reopen it again, and then it might cradle. Often I have to do this twice before it will cradle. Once it's cradled it's generally fine, but nothing seems consistent in getting it to connect. Connecting with physical devices is often better, although not always. If I plug a PDA into a USB socket other than the one it was originally plugged into then it won't connect at all. Often the best/most reliable connection method seems to be over Bluetooth, but that's quite slow. Anybody got any tips or advice?

    Read the article

  • How to get cursor to follow text when reading a web page?

    - by Jack BeNimble
    I know this isn't strictly program related, but I think I've seen this answer on SO before and lost track of it. The specific question has to do with reading an electronic document. I find it helpful to move the cursor across the words as I'm reading them. This works great with Word documents, but I'm unable to do it with web pages. Is there a way to make a web page see and respond to cursor movement?

    Read the article

  • Android/Java Beginner: Overriding ArrayAdapter's getView

    - by Preformed Cone
    Firstly I am new to android and Java so this is a beginners question. I have some code that overrides the ArrayAdapter's getView method. Here is the code public View getView(int position, View convertView, ViewGroup parent) { TextView label = (TextView)convertView; if (convertView == null) { convertView = new TextView(ctxt); label = (TextView)convertView; } label.setText(items[position]); return (convertView); } My question is: why does label.setText(items[position]); affect the convertView return value? How are they related / linked?

    Read the article

  • functional-style datatypes in Python

    - by Danny Roberts
    For anyone who's spent some time with sml, ocaml, haskell, etc. when you go back to using C, Python, Java, etc. you start to notice things you never knew were missing. I'm doing some stuff in Python and I realized what I really want is a functional-style datatype like (for example) datatype phoneme = Vowel of string | Consonant of voice * place * manner datatype voice = Voiced | Voiceless datatype place = Labial | Dental | Retroflex | Palatal | Velar | Glottal datatype manner = Stop | Affricate | Fricative | Nasal | Lateral type syllable = phoneme list Does anyone have a particular way that they like to simulate this in Python?

    Read the article

  • can you load multiple jsf wars in one classloader?

    - by Venu
    i have 3 war files with JSF installed, 3 faces config, when i make them all load into one class loader that is part of the EAR, it fails on initialization errors. like below. seems like JSF does not like to load multiple times in one classloader, has anyone tried this? to load a EAR with 3 JSF wars? java.lang.NullPointerException at com.sun.faces.config.processor.ManagedBeanConfigProcessor.process(ManagedBeanConfigProcessor.java:241) at com.sun.faces.config.processor.AbstractConfigProcessor.invokeNext(AbstractConfigProcessor.java:108)

    Read the article

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