Daily Archives

Articles indexed Sunday May 9 2010

Page 13/80 | < Previous Page | 9 10 11 12 13 14 15 16 17 18 19 20  | Next Page >

  • Struts 2 TypeConversion problem

    - by Parhs
    Hello... i have a big problem... i have this map HashMap<Long, String> examValues; It gets populated by textboxes automatically with name="examValues[id]" Although i explicily defined the element as String , it doesnt care!!! I want everything to be a String... The result is to get a java.lang.ClassCastException: java.lang.Long cannot be cast to java.lang.String when i try to System.out.print(examValues.get(examValue.getExam().getId()).getClass().getName()); INFO: java.lang.ClassCastException: java.lang.Long cannot be cast to java.lang.String at gr.medilab.logic.action.exams.Exams.fill_edit(Exams.java:204) at gr.medilab.logic.action.exams.Exams.fill(Exams.java:95) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:597) at com.opensymphony.xwork2.DefaultActionInvocation.invokeAction(DefaultActionInvocation.java:441) at com.opensymphony.xwork2.DefaultActionInvocation.invokeActionOnly(DefaultActionInvocation.java:280) at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:243) at com.opensymphony.xwork2.interceptor.DefaultWorkflowInterceptor.doIntercept(DefaultWorkflowInterceptor.java:165) at com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:87) at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:237) at com.opensymphony.xwork2.validator.ValidationInterceptor.doIntercept(ValidationInterceptor.java:252) at org.apache.struts2.interceptor.validation.AnnotationValidationInterceptor.doIntercept(AnnotationValidationInterceptor.java:68) at com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:87) at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:237) at com.opensymphony.xwork2.interceptor.ConversionErrorInterceptor.intercept(ConversionErrorInterceptor.java:122) at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:237) at com.opensymphony.xwork2.interceptor.ParametersInterceptor.doIntercept(ParametersInterceptor.java:195) at com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:87) at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:237) at com.opensymphony.xwork2.interceptor.ParametersInterceptor.doIntercept(ParametersInterceptor.java:195) at com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:87) at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:237) at com.opensymphony.xwork2.interceptor.StaticParametersInterceptor.intercept(StaticParametersInterceptor.java:179) at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:237) at org.apache.struts2.interceptor.MultiselectInterceptor.intercept(MultiselectInterceptor.java:75) at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:237) at org.apache.struts2.interceptor.CheckboxInterceptor.intercept(CheckboxInterceptor.java:94) at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:237) at org.apache.struts2.interceptor.FileUploadInterceptor.intercept(FileUploadInterceptor.java:235) at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:237) at com.opensymphony.xwork2.interceptor.ModelDrivenInterceptor.intercept(ModelDrivenInterceptor.java:89) at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:237) at com.opensymphony.xwork2.interceptor.ScopedModelDrivenInterceptor.intercept(ScopedModelDrivenInterceptor.java:130) at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:237) at org.apache.struts2.interceptor.debugging.DebuggingInterceptor.intercept(DebuggingInterceptor.java:267) at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:237) at com.opensymphony.xwork2.interceptor.ChainingInterceptor.intercept(ChainingInterceptor.java:126) at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:237) at com.opensymphony.xwork2.interceptor.PrepareInterceptor.doIntercept(PrepareInterceptor.java:138) at com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:87) at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:237) at com.opensymphony.xwork2.interceptor.I18nInterceptor.intercept(I18nInterceptor.java:165) at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:237) at org.apache.struts2.interceptor.ServletConfigInterceptor.intercept(ServletConfigInterceptor.java:164) at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:237) at com.opensymphony.xwork2.interceptor.AliasInterceptor.intercept(AliasInterceptor.java:179) at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:237) at com.opensymphony.xwork2.interceptor.ExceptionMappingInterceptor.intercept(ExceptionMappingInterceptor.java:176) at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:237) at org.apache.struts2.impl.StrutsActionProxy.execute(StrutsActionProxy.java:52) at org.apache.struts2.dispatcher.Dispatcher.serviceAction(Dispatcher.java:488) at org.apache.struts2.dispatcher.ng.ExecuteOperations.executeAction(ExecuteOperations.java:77) at org.apache.struts2.dispatcher.ng.filter.StrutsPrepareAndExecuteFilter.doFilter(StrutsPrepareAndExecuteFilter.java:91) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:256) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:215) at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:277) at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:188) at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:641) at com.sun.enterprise.web.WebPipeline.invoke(WebPipeline.java:97) at com.sun.enterprise.web.PESessionLockingStandardPipeline.invoke(PESessionLockingStandardPipeline.java:85) at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:185) at org.apache.catalina.connector.CoyoteAdapter.doService(CoyoteAdapter.java:332) at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:233) at com.sun.enterprise.v3.services.impl.ContainerMapper.service(ContainerMapper.java:165) at com.sun.grizzly.http.ProcessorTask.invokeAdapter(ProcessorTask.java:791) at com.sun.grizzly.http.ProcessorTask.doProcess(ProcessorTask.java:693) at com.sun.grizzly.http.ProcessorTask.process(ProcessorTask.java:954) at com.sun.grizzly.http.DefaultProtocolFilter.execute(DefaultProtocolFilter.java:170) at com.sun.grizzly.DefaultProtocolChain.executeProtocolFilter(DefaultProtocolChain.java:135) at com.sun.grizzly.DefaultProtocolChain.execute(DefaultProtocolChain.java:102) at com.sun.grizzly.DefaultProtocolChain.execute(DefaultProtocolChain.java:88) at com.sun.grizzly.http.HttpProtocolChain.execute(HttpProtocolChain.java:76) at com.sun.grizzly.ProtocolChainContextTask.doCall(ProtocolChainContextTask.java:53) at com.sun.grizzly.SelectionKeyContextTask.call(SelectionKeyContextTask.java:57) at com.sun.grizzly.ContextTask.run(ContextTask.java:69) at com.sun.grizzly.util.AbstractThreadPool$Worker.doWork(AbstractThreadPool.java:330) at com.sun.grizzly.util.AbstractThreadPool$Worker.run(AbstractThreadPool.java:309) at java.lang.Thread.run(Thread.java:619) Any idea?

    Read the article

  • Stored Procedure Parameters Not Available After Declared

    - by SidC
    Hi All, Pasted below is a stored procedure written in SQL Server 2005. My intent is to call this sproc from my ASP.NEt web application through the use of a wizard control. I am new to SQL Server and especially to stored procedures. I'm unsure why my parameters are not available to the web application and not visible in SSMS treeview as a parameter under my sproc name. Can you help me correct the sproc below so that the parameters are correctly instantiated and available for use in my web application? Thanks, Sid Stored Procedure syntax: USE [Diel_inventory] GO /****** Object: StoredProcedure [dbo].[AddQuote] Script Date: 05/09/2010 00:31:10 ******/ SET ANSI_NULLS ON GO SET QUOTED_IDENTIFIER ON GO ALTER procedure [dbo].[AddQuote] as Declare @CustID int, @CompanyName nvarchar(50), @Address nvarchar(50), @City nvarchar(50), @State nvarchar(2), @ZipCode nvarchar(5), @Phone nvarchar(12), @FAX nvarchar(12), @Email nvarchar(50), @ContactName nvarchar(50), @QuoteID int, @QuoteDate datetime, @NeedbyDate datetime, @QuoteAmt decimal, @ID int, @QuoteDetailPartID int, @PartNumber float, @Quantity int begin Insert into dbo.Customers (CompanyName, Address, City, State, ZipCode, OfficePhone, OfficeFAX, Email, PrimaryContactName) Values (@CompanyName, @Address, @City, @State, @ZipCode, @Phone, @FAX, @Email, @ContactName) set @CustID = scope_identity() Insert into dbo.Quotes (fkCustomerID,NeedbyDate,QuoteAmt) Values(@CustID,@NeedbyDate,@QuoteAmt) set @QuoteID = scope_identity() Insert into dbo.QuoteDetail (ID) values(@ID) set @ID=scope_identity() Insert into dbo.QuoteDetailParts (QuoteDetailPartID, QuoteDetailID, PartNumber, Quantity) values (@ID, @QuoteDetailPartID, @PartNumber, @Quantity) END

    Read the article

  • Portable way of finding total disk size in Java (pre java 6)

    - by Wouter Lievens
    I need to find the total size of a drive in Java 5 (or 1.5, whatever). I know that Java 6 has a new method in java.io.File, but I need it to work in Java 5. Apache Commons IO has org.apache.commons.io.FileSystemUtils to provide the free disk space, but not the total disk space. I realize this is OS dependant and will need to depend on messy command line invocation. I'm fine with it working on "most" systems, i.e. windows/linux/macosx. Preferably I'd like to use an existing library rather than write my own variants. Any thoughts? Thanks.

    Read the article

  • MySQL Many to Many with Unique keys and Update/Select if Exists otherwise Insert

    - by Jayrox
    In my goal to have a Many-to-Many relationship in my MySQL database I have arrived at another bridge to build. Current Tables: Users (id, name) Tags (id, name) User_Tags (user_id, tag_id) Here is the goal: I would like to have the ability to take a tag i.e: #fb and insert it into my Tags database which has a unique constraint on name and if the tag exists I would like to return it's id I would like to insert the tag.id and the current user's user.id into User_Tags. I do not have any unique constraints on the User_Tags table because I would like to be able to track the user's most commonly used tags and present them in a list ordered by frequency of use. I am currently developing this project in PHP using prepared statements. Additionally, performance is not currently an issue as my user count is still fairly small, but it is steadily growing and may be an issue in the future.

    Read the article

  • What are the real-world applications of huffman coding?

    - by jcyang
    I am told that Huffman coding is used as loseless data compression algorithm but also am told that real data compress software do not employ huffman coding,cause if the keys are not distributed decentralized enough,the compressed file could be even larger than the orignal file. This leave me wondering are there any real-world application of huffman coding? thanks.

    Read the article

  • Condensing multiple else if statements, referencing them from a table?

    - by Haskella
    Hi I'm about to type some 500 else if statements into my code (PHP) which have the exact same coding each: if (color=White); rgb = 255-255-255; print rgb; else if (color=Black); rgb = 0-0-0; print rgb; else if (color=Red); rgb = 255-0-0; print rgb; else if (color=Blue); rgb = 0-0-255; print rgb; [the list keeps going] I also (luckily) have a table that displays the color in the first column and rgb value in the next column for 500 of them... how do I use this to save time typing all those else if statements? Some how I have to reference the table file (made in excel, I'm guessing I'll have to save it as .csv?)

    Read the article

  • Implementation of ceil function in C.

    - by RBA
    Hi, I have two doubts regarding ceil function.. 1. The ceil() function is implemented in C. if i use ceil(3/2), it works fine.. But when i use ceil(count/2)-if value of count is 3, then it gives compile time error.. /tmp/ccA4Yj7p.o(.text+0x364): In function FrontBackSplit': : undefined reference toceil' collect2: ld returned 1 exit status How to use the ceil function in second case?? Please suggest.. 2. How can i implement my own ceil function in C. Please give some basic guidelines. Thanks.

    Read the article

  • Why am I getting this error?

    - by Doug
    function changeSize( fontsize ) { var body = document.getElementById("body"); var font = fontsize + "-font"; body.className = font; } <input type="button" onclick="changeSize(small)" value="Small" /> Firefox console keeps saying that small is undefined. What am I doing wrong?

    Read the article

  • Query Parameter Value Is Null When Enum Item 0 is Cast to Int32

    - by Timothy
    When I use the first item in a zero-based Enum cast to Int32 as a query parameter, the parameter value is null. I've worked around it by simply setting the first item to a value of 1, but I was wondering though what's really going on here? This one has me scratching my head. Why does the parameter regarded the value as null, instead of 0? Enum LogEventType : int { SignIn, SignInFailure, SignOut, ... } private static DataTable QueryEventLogSession(DateTime start, DateTime stop) { DataTable entries = new DataTable(); using (FbConnection conn = new FbConnection(DSN)) { using (FbDataAdapter adapter = new FbDataAdapter( "SELECT event_type, event_timestamp, event_details FROM event_log " + "WHERE event_timestamp BETWEEN @start AND @stop " + "AND event_type IN (@signIn, @signInFailure, @signOut) " + "ORDER BY event_timestamp ASC", conn)) { adapter.SelectCommand.Parameters.AddRange(new Object[] { new FbParameter("@start", start), new FbParameter("@stop", stop), new FbParameter("@signIn", (Int32)LogEventType.SignIn), new FbParameter("@signInFailure", (Int32)LogEventType.SignInFailure), new FbParameter("@signOut", (Int32)LogEventType.SignOut)}); Trace.WriteLine(adapter.SelectCommand.CommandText); foreach (FbParameter p in adapter.SelectCommand.Parameters) { Trace.WriteLine(p.Value.ToString()); } adapter.Fill(entries); } } return entries; }

    Read the article

  • Misc. Naming: Can I place underscores instead of camel casing in modern languages?

    - by Bubba88
    Hi! I would like to ask some kind of permission (I hope that doesn't sound strange) from the people who have influence on the naming conventions in modern languages like F#, Scala, etc. My problem is - I just can't read camelCased code and wish I could write underscored_names at least in my internal implementations (not in API interface). This applies to just everything - local var names, method names, params.. (Not class names I think) It seems that now the camel-casing is preferred for example for the names of object methods, but could that be not the only way? What would you say; Can I go with underscored names in languages like I mentioned (F#, Scala)?

    Read the article

  • Retrieving & Displaying data from csv files using AJAX

    - by JJ
    I need to provide a feature such that the user is able to upload a csv file.Once the uploading is done I need to retrieve each value and show it on a grid which is implemented using far point(http://www.fpoint.com/products/spread/spread.aspx).But all this has to be done without the page being refreshed.I use asp.net 2.0 & Ajax Pro.Remember I cannot use the inbuilt AJAX feature provided by microsoft .To be precise I need something similar to the lines of attaching a file using gmail. Thanks & Regards Bikram

    Read the article

  • Super Cam iphone app how do they make it possible?

    - by Silent
    there is an iphone app called supercam and you can get it through the app store free. This app features a way to connect your webcam or dv cam that is connected on the internet, you could set up the ip address and enter the data on the app and it will connect to your online camera. the thing is that they have the video stream and it looks like they embedded the video in a uiview or webview at the bottom they have buttons to choose from all the cameras you have set up. so this is different from other video streaming apps because it does not play the video from the full screen mode (MPMediaPlayer API) would there be any tutorials about this or somehow take reverse engineer this?

    Read the article

  • How do I programmatically create a bootable CD?

    - by Nicholas Flynt
    I'm using a barebones tutorial as the basis for an OS I'm working on, and it seems to be an older tutorial: it has be compiling the kernel down to a floppy image, and then loading it with GRUB. Basically, I still want to use GRUB, but I'd like to have my OS run from a CD instead. The main reason is that I don't actually have a real floppy drive available (I'm testing in VirtualBox currently) and I thus have no way to test my OS on real hardware. I've been poking around on the net, and I can find lots of utilities that create a bootable CD from a floppy image, but these all seem to require an actual floppy drive, plus it's not really what I'm looking for. I'd like to be able to end up with a bootable CD during my make step ideally, without needing to first place the image on a floppy, which seems rather pointless. I guess the easy way to answer this: How do I set up GRUB to read my kernel image from a CD? Will I need a special utility to do this from Windows? (The kernel can't compile itself yet, that's not for a looong while) Thanks!

    Read the article

  • MSDeploy, MSBuild and Continuous Integration

    - by stacker
    What steps need to be taken to deploy a website using Continuous Integration and NAnt. If I understand it correctly, this is the basic steps: Build the solution (.sln) with MSBuild. (I don't sure if this steps is required, I think that MSdeploy can build the project itself, but it's good step to be sure that the project is compile). Deploy the website. First we need to create the "build deployment package" files. Then we can deploy them. The question is how to get step #2 done.

    Read the article

  • Saving an xml file without

    - by little
    Hi, How do I work with an xml file that when updating it, after saving the commented lines would still be present. Here's my code snippet for saving the file: public static void WriteSettings(Settings settings, string path) { XmlSerializer serializer = new XmlSerializer(typeof(Settings)); TextWriter writer = new StreamWriter(path); serializer.Serialize(writer, settings); writer.Close(); }

    Read the article

  • OT: US Banks: Bank Routing Number and BIC/SWIFT

    - by Konerak
    I know it is a bit offtopic, but I've been having a hard time finding more information to this question, and since this site is visited by a lot of people from the United States, you guys might know/find the answer more easily. Banks in europe each have a SWIFT Number, while US Banks use Routing Numbers. This leads to following questions: Does each bank in the US also carry a BIC number? (SWIFT) Is there a 1-1 relationship between BIC and SWIFT? Is there a list of these numbers somewhere? (background information: we're adding international payments to our bookkeeping application. Users can add international suppliers, but my boss prefered not to change the current supplier table but to have the ROUTING NUMBER in another table, with as PK the BIC. I'm wondering if BIC is a valid choice, or if it should just be BANK ACCOUNT NUMBER.)

    Read the article

  • lib to read a DVD FS (data disc)

    - by acidzombie24
    I am thinking i might want to port a lib to read a DVD filesystem. I am not talking about movies but datadisc. Theres existing code for me to do raw reads from the disc. I need code that request this data and allow me to browse files on the disc. What lib can i use for this? -edit- NOTE: I am using an OSless hardware. Ppl seem to miss that but Alnitak caught it and gave me a great answer :)

    Read the article

  • SSRS code variable resetting on new page

    - by edmicman
    In SSRS 2008 I am trying to maintain a SUM of SUMs on a group using custom Code. The reason is that I have a table of data, grouped and returning SUMs of the data. I have a filter on the group to remove lines where group sums are zero. Everything works except I'm running into problems with the group totals - it should be summing the visible group totals but is instead summing the entire dataset. There's tons of articles about how to work around this, usually using custom code. I've made custom functions and variables to maintain a counter: Public Dim GroupMedTotal as Integer Public Dim GrandMedTotal as Integer Public Function CalcMedTotal(ThisValue as Integer) as Integer GroupMedTotal = GroupMedTotal + ThisValue GrandMedTotal = GrandMedTotal + ThisValue Return ThisValue End Function Public Function ReturnMedSubtotal() as Integer Dim ThisValue as Integer = GroupMedTotal GroupMedTotal = 0 Return ThisValue End Function Basically CalcMedTotal is fed a SUM of a group, and maintains a running total of that sum. Then in the group total line I output ReturnMedSubtotal which is supposed to give me the accumulated total and reset it for the next group. This actually works great, EXCEPT - it is resetting the GroupMedTotal value on each page break. I don't have page breaks explicitly set, it's just the natural break in the SSRS viewer. And if I export the results to Excel everything works and looks correctly. If I output Code.GroupMedTotal on each group row, I see it count correctly, and then if a group spans multiple pages on the next page GroupMedTotal is reset and begins counting from zero again. Any help in what's going on or how to work around this? Thanks!

    Read the article

  • Unique DVD info?

    - by acidzombie24
    I was wondering, is there some type of disc ID i can use to search in my database to see if that disc is has been scanned or not? All disc were created by me typically burnt on windows. -edit- I could compare write time and volume label to see if the disc has been scanned but i notice if i put in certain commercial disc that fields are blank or wrong causing many false positives (i once had the time set to the future, i dont know if people want to archive the contents of files on a commercial disc in my app).

    Read the article

  • The cleaner way to upgrading a Mac

    - by AngryHacker
    This page list a way to do a clean install of Snow Leopard without loosing any of your settings. This sounds pretty darn good since my mac did get a bit slower over time. The method basically involves copying your existing drive to an external one, then doing an Erase and Install from the installation DVD. After the installation, supposedly, I'll be presented with an option to migrate settings from another Mac. I am not all that familiar with the Mac, hence what is probably a simple question. With this migration option, will I be able to copy over all my applications or will I have to reinstall them from scratch?

    Read the article

  • Storing apostrophes, exclamation marks, etc. in mysql database

    - by rein
    I changed from latin1 to utf8. Although all sorts of text was displaying fine I noticed non-english characters were stored in the database as weird symbols. I spent a day trying to fix that and finally now non-english characters display as non-english characters in the database and display the same on the browser. However I noticed that I see apostrophes stored as &#39; and exclamation marks stored as &#33;. Is this normal, or should they be appearing as ' and ! in the database instead? If so, what would I need to do in order to fix that?

    Read the article

< Previous Page | 9 10 11 12 13 14 15 16 17 18 19 20  | Next Page >