Daily Archives

Articles indexed Thursday April 8 2010

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

  • how to parse a Date string to java.Date

    - by hguser
    Hi: I have a date string and I wang to parse it to normal date use the java Date API,the following is my code: public static void main(String[] args) { String date="2010-10-02T12:23:23Z"; String pattern="yyyy-MM-ddThh:mm:ssZ"; SimpleDateFormat sdf=new SimpleDateFormat(pattern); try { Date d=sdf.parse(date); System.out.println(d.getYear()); } catch (ParseException e) { // TODO Auto-generated catch block e.printStackTrace(); } } However I got a exception:java.lang.IllegalArgumentException: Illegal pattern character 'T' So I wonder if i have to split the string and parse it manually? BTW, I have tried to add a single quote character on either side of the T: String pattern="yyyy-MM-dd'T'hh:mm:ssZ"; It also does not work.

    Read the article

  • SOAP UI Pro vs Fitnesse, has anybody used SOAP UI Pro?

    - by Miral
    We are using Fitnesse for subsystem testing i.e. WCF & RESTful services. Now as writing Fitnesse test requires lot of effort, we are thinking of using SOAP UI Pro which gives this sort of facility. We are not 100% sure how much this is useful? Can anyone give suggestion of using SOAP UI against Fitnesse or if somebody has Pros & Cons regarding either of the thing ??

    Read the article

  • MPMoviePlayerContentPreloadDidFinishNotification does not fire [iPhone]

    - by JOKe
    I'm running into a problem with the MPMoviePlayerContentPreloadDidFinishNotification notification. I've regisered to recieve the MPMoviePlayerContentPreloadDidFinishNotification notification and MPMoviePlayerPlaybackDidFinishNotification but the first one never fires. Is this bug in Firmware OS 3.0 ? maybe fixed in 3.1 ? or ? Because my divice and similator is 3.0 maybe this is a bug ? My code : ... [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(MovieDidLoad:) name:MPMoviePlayerContentPreloadDidFinishNotification object:nil]; [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(MovieDidLoad:) name:MPMoviePlayerPlaybackDidFinishNotification object:nil]; ... -(void)MovieDidLoad:(NSNotification*)notification { UIAlertView *alert = [[UIAlertView alloc] initWithTitle:@"Notification Listener" message:@"Notification Listener invoked" cancelButtonTitle:@"Ok dude!" otherButtonTitles:nil]; [alert show]; [alert release]; } The MPMoviePlayerPlaybackDidFinishNotification is always fired but MPMoviePlayerContentPreloadDidFinishNotification is never fired. Any ideas ?

    Read the article

  • Ajax call to parent window after form submission

    - by David
    Hi all, Pardon the complicated title. Here's my situation: I'm working on a Grails app, and using jQuery for some of the more complex UI stuff. The way the system is set up, I have an item, which can have various files (user-supplied) associated with it. On my Item/show view, there is a link to add a file. This link pops up a jQuery modal dialog, which displays my file upload form (a remote .gsp). So, the user selects the file and enters a comment, and when the form is submitted, the dialog gets closed, and the list of files on the Item/show view is refreshed. I was initially accomplishing this by adding onclick="javascript:window.parent.$('#myDialog').dialog('close');" to my submit button. This worked fine, but when submitting some larger files, I end up with a race condition where the dialog closes and the file list is refreshed before the new file is saved, and so the list of files is out of date (the file still gets saved properly). So my question is, what is the best way to ensure that the dialog is not closed until after the form submit operation completes? I've tried using the <g:formRemote tag in Grails, and closing the dialog in the "after" attribute (according to the Grails docs, the script is called after form submission), but I receive an error (taken from FireBug) stating that window.parent.$('#myDialog').dialog is not a function Is this a simple JavaScript/Grails syntax issue that I'm missing here, or am I going about this entirely wrong? Thanks so much for your time and assistance!

    Read the article

  • How to refresh DataGrid and DropDown on main page after hiding modal popup

    - by James
    Hi, I am adding records to a database from a modal popup. After hiding the modal popup, the page has not been refreshed even though I have Rebound the controls. I have reviewed a few postings on the web about this but the solution still evades me. I have attached my code after removing some of the extra detail... It seems I need to cause a postback but I don't know what needs to be changed. Some posts have talked about the extender being misplaced. Anyway, thank you James <asp:Content ID="Content1" ContentPlaceHolderID="Head" Runat="Server"> <div class="divBorder"> <asp:DataGrid id="dgrSessionFolders" runat="server" BorderWidth="2px" BorderStyle="Solid" BorderColor="#C0C0FF" Font-Names="Arial" Font-Bold="True" Font-Size="8pt" GridLines="Horizontal" AutoGenerateColumns="False" PageSize="9999" AllowPaging="False" OnItemCommand="dgrSessionFolders_Command" OnItemDataBound="CheckSessionFolderStatus" HorizontalAlign="Left" ForeColor="Blue" ShowFooter="True" CellPadding="2" OnSortCommand="dgrSessionFolders_Sort" AllowSorting="True"> </asp:DataGrid> </div> &nbsp;&nbsp;&nbsp; <asp:Label ID="Errormsg" runat="server" ForeColor="#CC0000"></asp:Label> <asp:UpdatePanel ID="UpdatePanel1" runat="server" RenderMode="Inline" ChildrenAsTriggers="false" UpdateMode="Conditional"> <Triggers> <asp:AsyncPostBackTrigger ControlID="btnEditTopic" /> <asp:AsyncPostBackTrigger ControlID="btnAdd" /> <asp:AsyncPostBackTrigger ControlID="btnUpdate" /> <asp:AsyncPostBackTrigger ControlID="btnDelete" /> <asp:AsyncPostBackTrigger ControlID="btnClear" /> <asp:AsyncPostBackTrigger ControlID="btnAddTopic" /> <asp:AsyncPostBackTrigger ControlID="btnUpdateTopic" /> <asp:AsyncPostBackTrigger ControlID="btnDeleteTopic" /> </Triggers> <ContentTemplate> <asp:panel id="pnl" runat="server" HorizontalAlign="Center" Height="48px" Width="100%" > &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <asp:ImageButton ID="btnEditTopic" runat="server" AlternateText="Edit Topic" ImageUrl="~/App_Themes/Common/images/BtnEditTopic.jpg" Height="28px"> </asp:ImageButton> <cc1:ModalPopupExtender ID="btnEditTopic_ModalPopupExtender" runat="server" BackgroundCssClass="modalBackground" DropShadow="true" Enabled="true" PopupControlID="pnlEditTopic" TargetControlID="btnEditTopicHidden" CancelControlID="btnEditTopicClose"> </cc1:ModalPopupExtender> <asp:ImageButton ID="btnAdd" runat="server" AlternateText="Add Folder" ImageUrl="~/App_Themes/Common/images/BtnAddFolder.jpg" Height="28px"> </asp:ImageButton> <asp:ImageButton ID="btnUpdate" runat="server" AlternateText="Update Folder" ImageUrl="~/App_Themes/Common/images/BtnUpdateFolder.jpg" Height="28px"> </asp:ImageButton> <asp:ImageButton ID="btnDelete" runat="server" AlternateText="Delete Folder" ImageUrl="~/App_Themes/Common/images/BtnDeleteFolder.jpg" Height="28px"> </asp:ImageButton> <asp:ImageButton ID="BtnClear" runat="server" AlternateText="Clear Screen Input Fields" ImageUrl="~/App_Themes/Common/images/BtnAddMode.jpg" Height="28px"> </asp:ImageButton> <asp:Button ID="btnEditTopicHidden" runat="server" Enabled="false" Text="" Style="visibility: hidden" /> </asp:panel> <asp:Panel ID="pnlEditTopic" runat="server" CssClass="modalPopupEditTopic" Style="display: none;" > <table cellspacing="0" class="borderTable0" width="100%" style=""> <tr> <td colspan="10" class="Subhdr" align="center" style="width:100%"> <asp:label id="lblTopicScreenHdr" Cssclass="ScreenHdr" runat="server">Topic Maintenance</asp:label> </td> </tr> <tr> <td colspan="6"> <asp:Label ID="TopicPopErrorMsg" runat="server" ForeColor="#CC0000">&nbsp;</asp:Label> </td> </tr> <tr style="height:4px"> <td colspan="6" align="center"> <asp:ImageButton ID="btnAddTopic" runat="server" AlternateText="Add Topic" ImageUrl="~/App_Themes/Common/images/BtnApply.jpg" Height="28px"> </asp:ImageButton> <asp:ImageButton ID="btnUpdateTopic" runat="server" AlternateText="Update Topic" ImageUrl="~/App_Themes/Common/images/BtnApply.jpg" Height="28px"> </asp:ImageButton> <asp:ImageButton ID="btnDeleteTopic" runat="server" AlternateText="Delete Topic" ImageUrl="~/App_Themes/Common/images/BtnDelete.jpg" Height="28px"> </asp:ImageButton> <asp:ImageButton ID="btnEditTopicClose" runat="server" AlternateText="Close Edit Topic Popup" ImageUrl="~/App_Themes/Common/images/BtnCancel.jpg" Height="28px"> </asp:ImageButton> </td> </tr> </table> </asp:Panel> </ContentTemplate> </asp:UpdatePanel> Private Sub btnAddTopic_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnAddTopic.Click 'Add the Topic table entry AddTopic() 'Display an informational message Errormsg.Text = "The Topic has been successfully added, thank you! " Errormsg.ForeColor = Drawing.Color.Blue 'Rebind the Topic Drop Down and set to added Topic ddlSessionTopic.DataBind() ddlSessionTopic.SelectedValue = drTopic("TOPC_ID") 'Rebind the Session Folders grid RebindGrid() 'Hide the Topic Popup btnEditTopic_ModalPopupExtender.Hide() End Sub Private Sub RebindGrid() cnnSQL = New SqlConnection(strConnection) cmdSQL = New SqlCommand("GetSessionFoldersForGrid", cnnSQL) cmdSQL.CommandType = CommandType.StoredProcedure cmdSQL.Parameters.Clear() cnnSQL.Open() dadSQL = New SqlDataAdapter(cmdSQL) dadSQL.SelectCommand = cmdSQL dadSQL.Fill(dtSessionFolderGrid) cnnSQL.Close() dvSessionFolderGrid = dtSessionFolderGrid.DefaultView dvSessionFolderGrid.Sort = String.Format("{0} {1}{2}", so.Sortfield, so.SortDirection, so.SortSuffix) dgrSessionFolders.DataSource = dvSessionFolderGrid dgrSessionFolders.DataBind() End Sub

    Read the article

  • Regex to parse youtube yid

    - by novaurora
    Example URLs http://www.youtube.com/user/Scobleizer#p/u/1/1p3vcRhsYGo http://www.youtube.com/watch?v=cKZDdG9FTKY&feature=channel http://www.youtube.com/watch?v=yZ-K7nCVnBI&playnext_from=TL&videos=osPknwzXEas&feature=sub Any regex that will pull the correct YID from all 3 of these use cases? The first case is especially odd. Thank you.

    Read the article

  • PHP - Database schema: version control, branching, migrations.

    - by Billiam
    I'm trying to come up with (or find) a reusable system for database schema versioning in php projects. There are a number of Rails-style migration projects available for php. http://code.google.com/p/mysql-php-migrations/ is a good example. It uses timestamps for migration files, which helps with conflicts between branches. General problem with this kind of system: When development branch A is checked out, and you want to check out branch B instead, B may have new migration files. This is fine, migrating to newer content is straight forward. If branch A has newer migration files, you would need to migrate downwards to the nearest shared patch. If branch A and B have significantly different code bases, you may have to migrate down even further. This may mean: Check out B, determine shared patch number, check out A, migrate downwards to this patch. This must be done from A since the actual applied patches are not available in B. Then, checkout branch B, and migrate to newest B patch. Reverse process again when going from B to A. Proposed system: When migrating upwards, instead of just storing the patch version, serialize the whole patch in database for later use, though I'd probably only need the down() method. When changing branches, compare patches that have been run to patches that are available in the destination branch. Determine nearest shared patch (or oldest difference, maybe) between db table of run patches and patches in destination branch by ID or hash. Could also look for new or missing patches that are buried under a number of shared patches between the two branches. Automatically merge down to the nearest shared patch, using the db table stored down() methods, and then merge up to the branche's latest patch. My question is: Is this system too crazy and/or fraught with consequences to bother developing? My experience with database schema versioning is limited to PHP autopatch, which is an up()-only system requiring filenames with sequential IDs.

    Read the article

  • Entity Framework, what's so bad and what's so good?

    - by AverageJoe719
    Hi all, I am curious as to what your opinions are in Entity Framework? I have read some things like the first version of it is super horrible because it doesn't handle many to many relationships (though many ORMs don't and I've never seen the issue with just making a linking table). Also is LINQ to Entities the same as Entity Framework? I think it is, but it seems like one term is used or the other. I have used Linq to SQL before, what are the advantages of it compared to that? In terms of coding preference I like to build everything from the ground up so I can fully understand it/be in control of the code I write. So I have heard that Entity Framework is harder and I know LinqToSQL handles a lot of stuff automatically, but specifically what are the differences? I appreciate your responses, Thanks =)

    Read the article

  • Commands to compile programs on Windows

    - by Arjun Vasudevan
    In case I have .NET framework installed in my computer + all the necessary other language support (Perl Interpreter, etc) What are the commands I should give in the console to compile programs in the following languages: 1. C 2. C++ 3. Java 4. Python 5. VB 6. C# 7. Perl 8. Ruby Like we have for VB- *vbc program_name.vb*, what are the commands to compile programs in other languages?

    Read the article

  • Specify Search Path for .net assembly binding/Fusion in app.config?

    - by Michael Stum
    I have an application that depends on other .net assemblies. When I start the application, I get an error that an assembly or one of its dependencies cannot be loaded. I do not want to put the assemblies into the GAC or into the Directory of the application. Is there a way (app.config?) to tell .net to look into a given path when trying to load assemblies? I believe I can use assembly binding for a single assembly, but I'm looking for a wildcard solution to add a path to the "search paths"

    Read the article

  • Oracle Sequences

    - by jkrebsbach
    Reminder to myself - SQL Server has nice index columns directly tied to their tables. Oracle has sequences that are islands to themselves. select seq_name.currval from dual; select seq_name.nextval from dual; currval - return current number at top of sequence nextval - increment sequence by 1, return new number   therefore - to create functionality in oracle similar to an index column - OPTION A) - Create insert trigger: CREATE OR REPLACE TRIGGER dept_bir BEFORE INSERT ON departments FOR EACH ROW WHEN (new.id IS NULL) BEGIN SELECT dept_seq.NEXTVAL INTO :new.id FROM dual; END; This will handle creating a unique identity, but will not necessarily inform process flow of identity without additional logic. OPTION B) - Select indentity into temp variable, insert whole item into tab **** When attemptint to query currval, the below error was being thrown - SELECT seq_name.currval from dual; ERROR : TABLE OR VIEW DOES NOT EXIST *** Although Oracle sys tables may have access to the sequences, that isn't to say the Oracle user may have access to those sequences - verify permissions when the system can't see object that are being reported in the object explorer.

    Read the article

  • Philly.NET Code Camp

    - by Steve Michelotti
    This Saturday I will be at the Philly.NET Code Camp presenting C# 4.0.  The code camp is currently registered to capacity (800 attendees) but you will be able to view certain presentations on a Live Meeting simulcast (and later on Channel 9).  You can tune it at 3:30PM Eastern time to view my presentation. The attendee URL is here.

    Read the article

  • Piping Mail with Exim: Only Works Locally

    - by John
    Whenever I send an email to my catchall alias via SSH (i.e., locally), Exim successfully pipes the e-mail to a PHP script, as I told it to do. However, when I try to send an e-mail to my catchall alias via my e-mail client (i.e., remotely), Exim won't pipe the e-mail. Any ideas?

    Read the article

  • sendmail: how can I restrict access to clients that only have a valid certificate?

    - by lxg
    I want to reject all connections that don't present a valid SSL/TLS certificate. First of all is the access db file the correct one to be changing? I have already tried using the basic rule given in the documentation CertIssuer:/C=US/ST=California/O=endmail.org/OU=private/CN= Darth+20Mail+20+28Cert+29/[email protected] RELAY This will obviously need a rule afterward to filter and reject all that don't present the cert? Does anyone have any pointers as to what syntax I should use? wildcards? lxg

    Read the article

  • WinXP Movie Maker Codec Error

    - by Bob Rivers
    Hi, I'm trying to use Windows XP Movie Maker, but when I try to import an AVI video, it shows an error telling me that it wasn't import due to an the fact that the codec wasn't available (I'm able to see the video using the windows media player) First, the error message suggested to enable the option "download codecs automatically" under "tools options general". I did it. But know the error tells me that the codec wasn't available and, if I already installed it, I should reinitialize movie maker. I also already did it... The error msg is: The file D:\movie1.avi cannot be imported because the codec required to play the file is not installed on your computer. If you have already tried to download and install the codec, close and restart Windows Movie Maker, and then try to import the file again. Any hint? TIA, Bob

    Read the article

  • Windows with putty via USB serial cable to Linux serial port - output ok, input isn't

    - by Aharon Robbins
    I am trying to get two way serial communications going between a Windows XP system and a Linux system (RHEL 5). I have /sbin/agetty -L 9600 ttyS0 in /etc/inittab. I am using a generic USB to serial adaptor on Windows (Unitek) and a null modem cable. I have putty configured for 9600 baud, 8 bits, no parity, one stop bit, no flow control. I get the login prompt from agetty in the putty window but input does not work; I see weird characters in the putty screen. I can echo output into the device from windows and see it, but cat < /dev/ttyS0 just prints out weird characters from what I type. Any and all suggestions will be welcome. Thanks!

    Read the article

  • MS Access 2003 - Format a Number with Commas AND Auto-Decimal

    - by Emtucifor
    On a report I have a control which is bound to a column which can have up to 3 decimal places. I want the number to format with commas separating thousands and millions, but I also want the number of decimal places to be automatic, so that if there is no decimal portion then no decimal at all is shown. 1234.567 -> 1,234.567 1234.560 -> 1,234.56 1234.500 -> 1,234.5 1234.000 -> 1,234 General format will give me the auto decimal places but no commas. Standard format gives the comma but is fixed to 2 decimal places. Doing my own =Format(Number, "#,##0.#") leaves the decimal point in and doesn't align properly, with extra space on the right of the number. Do I have to write my own VB function to give the format I want? It seems silly that Access (apparently) can't do this out of the box. This also seems really horrible: =Replace(Replace(Replace(Replace(Replace( _ Format(Number, "#,##0.000") & "x", "0x", ""), "0x", ""), "0x, ""), ".x", ""), "x", "")

    Read the article

  • What is the difference between using MD5.Create and MD5CryptoServiceProvider?

    - by byte
    In the .NET framework there are a couple of ways to calculate an MD5 hash it seems, however there is something I don't understand; What is the distinction between the following? What sets them apart from eachother? They seem to product identical results: public static string GetMD5Hash(string str) { MD5CryptoServiceProvider md5 = new MD5CryptoServiceProvider(); byte[] bytes = ASCIIEncoding.Default.GetBytes(str); byte[] encoded = md5.ComputeHash(bytes); StringBuilder sb = new StringBuilder(); for (int i = 0; i < encoded.Length; i++) sb.Append(encoded[i].ToString("x2")); return sb.ToString(); } public static string GetMD5Hash2(string str) { System.Security.Cryptography.MD5 md5 = System.Security.Cryptography.MD5.Create(); byte[] bytes = Encoding.Default.GetBytes(str); byte[] encoded = md5.ComputeHash(bytes); StringBuilder sb = new StringBuilder(); for (int i = 0; i < encoded.Length; i++) sb.Append(encoded[i].ToString("x2")); return sb.ToString(); }

    Read the article

  • Adding Google Map to Contact Info Page in Drupal

    - by clang1234
    I'm trying to display a Google Map inside a drupal page. The map will only have the business location marker on it, with no need for a user to submitted their own markers. So far I've loaded the Gmap, Location, and CCK modules. I've attempted to enable a location field for Page content types, which allows me to input an address, but this doesn't display the actual map. I'm sure I'm missing something simple here. Any help?

    Read the article

  • Is extending a base class with non-virtual destructor dangerous in C++

    - by Akusete
    Take the following code class A { }; class B : public A { }; class C : public A { int x; }; int main (int argc, char** argv) { A* b = new B(); A* c = new C(); //in both cases, only ~A() is called, not ~B() or ~C() delete b; //is this ok? delete c; //does this line leak memory? return 0; } when calling delete on a class with a non-virtual destructor with member functions (like class C), can the memory allocator tell what the proper size of the object is? If not, is memory leaked? Secondly, if the class has no member functions, and no explicit destructor behaviour (like class B), is everything ok? I ask this because I wanted to create a class to extend std::string, (which I know is not recommended, but for the sake of the discussion just bear with it), and overload the +=,+ operator. -Weffc++ gives me a warning because std::string has a non virtual destructor, but does it matter if the sub-class has no members and does not need to do anything in its destructor? -- FYI the += overload was to do proper file path formatting, so the path class could be used like class path : public std::string { //... overload, +=, + //... add last_path_component, remove_path_component, ext, etc... }; path foo = "/some/file/path"; foo = foo + "filename.txt"; //and so on... I just wanted to make sure someone doing this path* foo = new path(); std::string* bar = foo; delete bar; would not cause any problems with memory allocation

    Read the article

  • Cannot run file_get_contents() on PHP 5.2.9-2

    - by Obay
    Hello, I am having the same problem as described below. http://marc.info/?l=php-general&m=124104032703506 The guy answered his own question by: "Sorry, didn't pay attention to the registered streams :-( You need to install a PHP package with ssl or compile it with --with-openssl." What does that mean? I'm fairly new to all this stuff and I don't quite understand what he was talking about, (e.g. registered streams, ssl). We have another server that has SSL. Does he mean that if I just transfer to that server, problem solved? Or is there anything else I need to consider? Can you please help me out? Any help is much appreciated :)

    Read the article

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