Search Results

Search found 743 results on 30 pages for 'joshua johnson'.

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

  • Regular Expression for any number divisible by 60 using C# .Net ?

    - by Steve Johnson
    Hi there, I need to apply validation on input time intervals that are taken in as seconds. Now i am not really good at Regular expressions. So can any body help making a regular expression that can test whether a number is divisible by 60. I was wondering if i could use to test one that check that the number is divisible by 10 and then check whether the same is divisible by 6. For number divisible by 10 here [\d*0] is the expression i guess. Please correct me if i am wrong. Hope somebody solves my problem. Thanks

    Read the article

  • How to reserve a set of primary key identifiers for preloading bootstrap data

    - by Joshua
    We would like to reserve a set of primary key identifiers for all tables (e.g. 1-1000) so that we can bootstrap the system with pre-loaded system data. All our JPA entity classes have the following definition for the primary key. @Id @GeneratedValue(strategy = IDENTITY) @Column(name = "id", unique = true, nullable = false, insertable = false, updatable = false) private Integer id; is there a way to tell the database that increments should start happening from 1000 (i.e. customer specific data will start from 1000 onwards). We support (h2, mysql, postgres) in our environment and I would prefer a solution which can be driven via JPA and reverse engineering DDL tools from Hibernate. Let me know if this is the correct approach

    Read the article

  • How to access a PHP Web Service from ASP.Net?

    - by Steve Johnson
    I am trying use a web service in a C# ASP.Net Web Application. The service is built in php and is located on some remote server not under my control so i cant modify it to add meta data or something else into it. When i use the "Add Web Reference" option in Visual Studio 2008, I receive the following error: The HTML document does not contain Web service discovery information. while trying to add the following web service. https://subreg.forpsi.com/robot2/subreg_command.php?wsdl The web service functions are exposed and displayed in Visual Studio 2008. however i could not add the reference to it for use in ASP.Net Application. t3Service" Description Methods __construct ( ) create_contact ( ) get_contact ( ) get_domain_info ( ) get_last_error_code ( ) get_last_error_msg ( ) get_NSSET ( ) get_owner_mail ( ) login ( ) register_domain ( ) register_domain_with_admin_contacts ( ) renew_domain ( ) request_sendmail ( ) send_auth_info ( ) transfer_domain ( ) I also tried the wsdl.exe method by retrieving the xml and copying it to a wsdl file and generating a proxy class. But the wsdl output contains warnings and the proxy class generated skips the exposed fucntions and generates something like this: // CODEGEN: The operation binding 'create_contact' from namespace 'urn:t3' was ignored. Each message part in an use=encoded message must specify a type. // CODEGEN: The operation binding 'get_contact' from namespace 'urn:t3' was ignored. Each message part in an use=encoded message must specify a type. // CODEGEN: The operation binding 'get_domain_info' from namespace 'urn:t3' was ignored. Each message part in an use=encoded message must specify a type. // CODEGEN: The operation binding 'get_last_error_code' from namespace 'urn:t3' was ignored. Each message part in an use=encoded message must specify a type. // CODEGEN: The operation binding 'get_last_error_msg' from namespace 'urn:t3' was ignored. Each message part in an use=encoded message must specify a type. // CODEGEN: The operation binding 'get_NSSET' from namespace 'urn:t3' was ignored. Each message part in an use=encoded message must specify a type. // CODEGEN: The operation binding 'get_owner_mail' from namespace 'urn:t3' was ignored. Each message part in an use=encoded message must specify a type. // CODEGEN: The operation binding 'send_auth_info' from namespace 'urn:t3' was ignored. Each message part in an use=encoded message must specify a type. // CODEGEN: The operation binding 'transfer_domain' from namespace 'urn:t3' was ignored. Each message part in an use=encoded message must specify a type. // CODEGEN: The operation binding 'request_sendmail' from namespace 'urn:t3' was ignored. Each message part in an use=encoded message must specify a type. // CODEGEN: The operation binding 'login' from namespace 'urn:t3' was ignored. Each message part in an use=encoded message must specify a type. // CODEGEN: The operation binding 'register_domain' from namespace 'urn:t3' was ignored. Each message part in an use=encoded message must specify a type. // CODEGEN: The operation binding 'register_domain_with_admin_contacts' from namespace 'urn:t3' was ignored. Each message part in an use=encoded message must specify a type. // CODEGEN: The operation binding 'renew_domain' from namespace 'urn:t3' was ignored. Each message part in an use=encoded message must specify a type. Any help in this regard will be highly appreciated. Regards

    Read the article

  • Help me convert this PHP SOAP code to C#

    - by Andrew G. Johnson
    Hi, I am trying to do some C# SOAP calls and can't seem to get any good examples on how to do it. I read an old question of mine about a SOAP call in PHP and thought maybe asking you guys to rewrite it in C# would be a good place to start. Here is the PHP code: $client = new SoapClient('http://www.hotelscombined.com/api/LiveRates.asmx?WSDL'); $client->__soapCall('HotelSearch', array( array('request' => array( 'ApiKey' => 'THE_API_KEY_GOES_HERE', // note that in the actual code I put the API key in... 'UserID' => session_id(), 'UserAgent' => $_SERVER['HTTP_USER_AGENT'], 'UserIPAddress' => $_SERVER['REMOTE_ADDR'], 'HotelID' => '50563', 'Checkin' => '07/02/2009', 'Checkout' => '07/03/2009', 'Guests' => '2', 'Rooms' => '1', 'LanguageCode' => 'en', 'DisplayCurrency' => 'usd', 'TimeOutInSeconds' => '90' ) ) ) );

    Read the article

  • JButton Layout Issue

    - by Tom Johnson
    I'm putting together the basic layout for a contacts book, and I want to know how I can make the 3 test buttons span from edge to edge just as the arrow buttons do. private static class ButtonHandler implements ActionListener { public void actionPerformed(ActionEvent e) { System.out.println("Code Placeholder"); } } public static void main(String[] args) { //down button ImageIcon downArrow = new ImageIcon("down.png"); JButton downButton = new JButton(downArrow); ButtonHandler downListener = new ButtonHandler(); downButton.addActionListener(downListener); //up button ImageIcon upArrow = new ImageIcon("up.png"); JButton upButton = new JButton(upArrow); ButtonHandler upListener = new ButtonHandler(); upButton.addActionListener(upListener); //contacts JButton test1Button = new JButton("Code Placeholder"); JButton test2Button = new JButton("Code Placeholder"); JButton test3Button = new JButton("Code Placeholder"); Box box = Box.createVerticalBox(); box.add(test1Button); box.add(test2Button); box.add(test3Button); JPanel content = new JPanel(); content.setLayout(new BorderLayout()); content.add(box, BorderLayout.CENTER); content.add(downButton, BorderLayout.SOUTH); content.add(upButton, BorderLayout.NORTH); JFrame window = new JFrame("Contacts"); window.setContentPane(content); window.setSize(400, 600); window.setLocation(100, 100); window.setVisible(true); }

    Read the article

  • Unable to verify body hash for DKIM

    - by Joshua
    I'm writing a C# DKIM validator and have come across a problem that I cannot solve. Right now I am working on calculating the body hash, as described in Section 3.7 Computing the Message Hashes. I am working with emails that I have dumped using a modified version of EdgeTransportAsyncLogging sample in the Exchange 2010 Transport Agent SDK. Instead of converting the emails when saving, it just opens a file based on the MessageID and dumps the raw data to disk. I am able to successfully compute the body hash of the sample email provided in Section A.2 using the following code: SHA256Managed hasher = new SHA256Managed(); ASCIIEncoding asciiEncoding = new ASCIIEncoding(); string rawFullMessage = File.ReadAllText(@"C:\Repositories\Sample-A.2.txt"); string headerDelimiter = "\r\n\r\n"; int headerEnd = rawFullMessage.IndexOf(headerDelimiter); string header = rawFullMessage.Substring(0, headerEnd); string body = rawFullMessage.Substring(headerEnd + headerDelimiter.Length); byte[] bodyBytes = asciiEncoding.GetBytes(body); byte[] bodyHash = hasher.ComputeHash(bodyBytes); string bodyBase64 = Convert.ToBase64String(bodyHash); string expectedBase64 = "2jUSOH9NhtVGCQWNr9BrIAPreKQjO6Sn7XIkfJVOzv8="; Console.WriteLine("Expected hash: {1}{0}Computed hash: {2}{0}Are equal: {3}", Environment.NewLine, expectedBase64, bodyBase64, expectedBase64 == bodyBase64); The output from the above code is: Expected hash: 2jUSOH9NhtVGCQWNr9BrIAPreKQjO6Sn7XIkfJVOzv8= Computed hash: 2jUSOH9NhtVGCQWNr9BrIAPreKQjO6Sn7XIkfJVOzv8= Are equal: True Now, most emails come across with the c=relaxed/relaxed setting, which requires you to do some work on the body and header before hashing and verifying. And while I was working on it (failing to get it to work) I finally came across a message with c=simple/simple which means that you process the whole body as is minus any empty CRLF at the end of the body. (Really, the rules for Body Canonicalization are quite ... simple.) Here is the real DKIM email with a signature using the simple algorithm (with only unneeded headers cleaned up). Now, using the above code and updating the expectedBase64 hash I get the following results: Expected hash: VnGg12/s7xH3BraeN5LiiN+I2Ul/db5/jZYYgt4wEIw= Computed hash: ISNNtgnFZxmW6iuey/3Qql5u6nflKPTke4sMXWMxNUw= Are equal: False The expected hash is the value from the bh= field of the DKIM-Signature header. Now, the file used in the second test is a direct raw output from the Exchange 2010 Transport Agent. If so inclined, you can view the modified EdgeTransportLogging.txt. At this point, no matter how I modify the second email, changing the start position or number of CRLF at the end of the file I cannot get the files to match. What worries me is that I have been unable to validate any body hash so far (simple or relaxed) and that it may not be feasible to process DKIM through Exchange 2010.

    Read the article

  • SSD and programming

    - by Simon Johnson
    I'm trying to put together a business case for getting every developer in our company an Intel SSD drive. The main codebase contains roughly 400,000 lines of code. My theory is that since the code is scattered about in maybe 1500 files, an SSD drive would be substantially faster for compiles. The logic being that many small reads really punishes the seak-time bottle-neck of a traditional hard-drive. Am I right? Is SSD worth the money in productivity gains by reducing the edit/compile cycle time?

    Read the article

  • map xml element to xsd complexType based on attribute

    - by Joshua Johnson
    Assume there exists an XML instance document that looks like this: <root> <object type="foo"> <!-- ... --> </object> <object type="bar"> <!-- ... --> </object> </root> My goal is to have a small (static) schema that verifies proper <element type="xxx" /> syntax for objects, and another schema (more prone to change) that verifies the contents of each object element against a complexType that matches the type attribute: <complexType name="foo"><!--should match object with type="foo"--></complexType> <complexType name="bar"><!--should match object with type="bar"--></complexType> What is the best way to accomplish this (or something similar)?

    Read the article

  • How does Facebook chat avoid continuous polling of the server?

    - by Chad Johnson
    I am trying to understand how Facebook's chat feature receives messages without continuously poling the server. Firebug shows me a single GET XmlHttpRequest continuously sitting there, waiting for a response from the server. After 5 minutes, this never timed out. How are they preventing timeout? An AJAX request can just sit there like that indefinitely, waiting for a response? Can I do this with JSONRequest? I see this at json.org: JSONRequest is designed to support duplex connections. This permits applications in which the server can asynchronously initiate transmissions. This is done by using two simultaneous requests: one to send and the other to receive. By using the timeout parameter, a POST request can be left pending until the server determines that it has timely data to send. Or is there another way to let an AJAX call just sit there, waiting, besides using JSONRequest?

    Read the article

  • CSS semantics; selecting elements directly or via order

    - by Joshua Cody
    Perhaps this question has been asked elsewhere, but I'm unable to find it. With HTML5 and CSS3 modules inching closer, I'm getting interested in a discussion about the way we write CSS. Something like this where selection is done via element order and type is particularly fascinating. The big advantage to this method seems to be complete modularization of HTML and CSS to make tweaks and redesigns simpler. At the same time, semantic IDs and classes seem advantageous for sundry reasons. Particularly, direct linking, JS targeting, and shorter CSS selectors. Also, it seems selector length might be an issue. For instance, I just wrote the following, which would be admittedly easier using some semantic HTML5 elements: body>div:nth-child(2)>div:nth-child(2)>ul:nth-child(2)>li:last-child So what say you, Stack Overflow? Is the future of CSS writing focused on element order and type? Or are IDs and classes and the current ways here to stay? (I'm well aware the IDs and classes have their place, although I am interested to hear more ways you think they'll continue to be necessary. The discussion I'm interested in is bigger-picture and the ways writing CSS is changing.)

    Read the article

  • Symlinking (ln) faster than moving (mv)?

    - by Chad Johnson
    When we build web software releases, we prepare the release in a temporary directory and then replace the release directory with the temporary one just prepared: # Move and replace existing release directory. mv /path/to/httpdocs /path/to/httpdocs.before mv /path/to/$newReleaseName /path/to/httpdocs Under this scheme, it happens that with about 1 in every 15 releases, a user was using a file in the original release directory exactly at the time the commands above are run, and a fatal error occurs for that user. I am wondering if using symlinking like follows would be significantly faster, in terms of processing time, thereby helping to lessen the likelihood of this problem: # Remove and replace existing release symlink. ln -sf /path/to/$newReleaseName path/to/httpdocs

    Read the article

  • Using Scala structural types with abstract types

    - by Joshua Hartman
    I'm trying to define a structural type defining anything that has an "add" method (for instance, a java collection or a java map). Using this, I want to define a few higher order functions that operate on a certain collection object GenericTypes { type GenericCollection[T] = { def add(value: T): java.lang.Boolean} } import GenericTypes._ trait HigherOrderFunctions[T, CollectionType[X] <: GenericCollection[X]] { def map[V](fn: (T) => V): CollectionType[V] .... } class RichJList[T](list: List[T]) extends HigherOrderFunctions[T, java.util.List] This does not compile with the following error error: Parameter type in structural refinement may not refer to abstract type defined outside that same refinement I tried removing the parameter on GenericCollection and putting it on the method: object GenericTypes { type GenericCollection = { def add[T](value: T): java.lang.Boolean} } import GenericTypes._ trait HigherOrderFunctions[T, CollectionType[X] <: GenericCollection] class RichJList[T](list: List[T]) extends HigherOrderFunctions[T, java.util.List] but I get another error: error: type arguments [T,java.util.List] do not conform to trait HigherOrderFunctions's type parameter bounds [T,CollectionType[X] <: org.scala_tools.javautils.j2s.GenericTypes.GenericCollection] Can anyone give me some advice on how to use structural typing with abstract typed parameters in Scala? Or how to achieve what I'm looking to accomplish? Thanks so much!

    Read the article

  • Is this a good centralized DVCS workflow?

    - by Chad Johnson
    I'm leaning toward using Mercurial, coming from Subversion, and I'd like to maintain a centralized workflow like I had with Subversion. Here is what I am thinking: stable (clone on server) default (branch) development (clone on server) default (branch) bugs (branch) developer1 (clone on local machine) developer2 (clone on local machine) developer3 (clone on local machine) feature1 (branch) developer3 (clone on local machine) feature2 (branch) developer1 (clone on local machine) developer2 (clone on local machine) As far as branches vs. clones is concerned, does this workflow sense? Do I have things straight? Also, the 'stable' clone IS the release. Does it make sense for the 'default' branch to be the release and what all other branches are ultimately merged into?

    Read the article

  • Algorithm for parsing a flat tree into a non-flat tree

    - by Chad Johnson
    I have the following flat tree: id name parent_id is_directory =========================================================== 50 app 0 1 31 controllers 50 1 11 application_controller.rb 31 0 46 models 50 1 12 test_controller.rb 31 0 31 test.rb 46 0 and I am trying to figure out an algorithm for getting this into the following tree structuree: [{ id: 50, name: app, is_directory: true children: [{ id: 31, name: controllers, is_directory: true, children: [{ id: 11, name: application_controller.rb is_directory: false },{ id: 12, name: test_controller.rb, is_directory: false }], },{ id: 46, name: models, is_directory: true, children: [{ id: 31, name: test.rb, is_directory: false }] }] }] Can someone point me in the right direction? I'm looking for steps (eg. build an associative array; loop through the array looking for x; etc.).

    Read the article

  • Secondary Domain Adds Extra Folder in URL during Postbacks

    - by Joshua
    My ASP.NET Website (C#, 3.5 framework, IIS7) is hosted at GoDaddy. There are multiple sites on the account. Currently when I perform postbacks or Response.Redirects on a secondary web site, the following URL appears in the address bar: www.mywebsite.com/webfolder/default.aspx Where the "webfolder" is the sub-directory on the server where the web site is hosted (i.e. SeverRoot/webfolder). The site seems to work with or without the folder in the URL. Is there a way to remove the folder from the URLs during postback? I think I have to use URL Rewriting (which GoDaddy supports using Microsoft's Rewrite Module) but I'm not sure how.

    Read the article

  • Robust fault tolerant MySQL replication

    - by Joshua
    Is there any way to get a fault tolerant MySQL replication? I am in an environment that has many networking issues. It appears that replication gets an error and just stops. I need it to continue to work and recover from these faults. There is some wrapper software that checks the state of replication and restarts it in the case of losing its log position. Is there an alternative? Note: Replication is done from an embedded computer with MySQL 4.1 to a external computer that has MySQL 5.0.45

    Read the article

  • Why would some POST data go missing when using Uploadify?

    - by Chad Johnson
    I have been using Uploadify in my PHP application for the last couple months, and I've been trying to track down an elusive bug. I receive emails when fatal errors occur, and they provide me a good amount of details. I've received dozens of them. I have not, however, been able to reproduce the problem myself. Some users (like myself) experience no problem, while others do. Before I give details of the problem, here is the flow. User visits edit screen for a page in the CMS I am using. Record id for the page is put into a form as a hidden value. User clicks the Uploadify browse button and selects a file (only single file selection is allowed). User clicks Submit button for my form. jQuery intercepts the form submit action, triggers Uploadify to start uploading, and returns false for the submit action (manually cancelling the form submit event so that Uploadify can take over). Uploadify uploads to a custom process script. Uploadify finishes uploading and triggers the Javascript completion callback. The Javascript callback calls $('#myForm').submit() to submit the form. Now that's what SHOULD happen. I've received reports of the upload freezing at 100% and also others where "I/O Error" is displayed. What's happening is, the form is submitting with the completion callback, but some post parameters present in the form are simply not in the post data. The id for the page, which earlier I said is added to the form as a hidden field, is simply not there in the post data ($_POST)--there is no item for 'id' in the $_POST array. The strange thing is, the post data DOES contain values for some fields. For instance, I have an input of type text called "name" which is for the record name, and it does show up in the post data. Here is what I've gathered: This has been happening on Mac OSX 10.5 and 10.6, Windows XP, and Windows 7. I can post exact user agent strings if that helps. Users must use Flash 10.0.12 or later. We've made it so the form reverts to using a normal "file" field if they have < 10.0.12. Does anyone have ANY ideas at all what the cause of this could be?

    Read the article

  • Having trouble using 'AND' in CONTAINSTABLE SQL SERVER FULL TEXT SEARCH

    - by Joshua
    I've been using FULL-TEXT for awhile but I cannot seem to get the most relevant results sometimes. If I have an field with something like "An Overview of Pain Medicine 5/12/2006" and a user types "An Overview 5/12/2006" So we create a search like: '"An" AND "Overview" AND "5/12/2006"' - 0 results (bad) '"Overview" AND "5/12/2006"' - 1 result (good) The CONTAINSTABLE portion of my query: FROM ce_Activity A INNER JOIN CONTAINSTABLE(View_Activities,(Searchable), @Search) AS KeyTbl ON A.ActivityID = KeyTbl.[KEY] "Searchable" is a field contains the activity title, and start date(converted to string) in one field so it's all search friendly. Why would this happen?

    Read the article

  • Help with SSh Tunnel [closed]

    - by Andrew Johnson
    I am running a Django instance locally and doing some Facebook development. So, I set up a port on a remote machine to forward to my local machine, so that Facebook can hit the web server, and have the requests forwarded to my local machine. Unfortunately, I'm getting the following error in my browser when I try and access the page: http://dev.thegreathive.com/ Any idea what I'm doing wrong? I think the problem is on my local machine, since if I kill the SSH tunnel, the error message changes.

    Read the article

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