How to convert String from input text to md5? I have no clue.  This is part of my .jsp  &lt;tr&gt; &lt;td&gt;&lt;spring:message code="password" text="default text" /&gt;&lt;/td&gt; &lt;td&gt;:&lt;/td&gt; &lt;td&gt;&lt;input type="password" name="password" required&gt;&lt;/td&gt;     and this is my controller  @RequestMapping(value="/admin/addUser.html", method=RequestMethod.POST) public ModelAndView createUserAdmin(@ModelAttribute UserAdmin useradmin, ModelMap model)throws Exception {     userService.save(useradmin);     model.addAttribute("successAdd", "true");     return listUserAdmin(model); }   Thanks for any help :)
105356
Is there any method to generate MD5 hash of a string in Java?
123258
@RestResource(urlMapping='/Merchandise/*') global with sharing class MerchandiseManager {      @HttpGet     global static Merchandise__c getMerchandiseById() {         RestRequest req = RestContext.request;                 String merchId = req.requestURI.substring(                                   req.requestURI.lastIndexOf('/')+1);         Merchandise__c result =                         [SELECT Name,Description__c,Price__c,Total_Inventory__c                         FROM Merchandise__c                          WHERE Id = :merchId];         return result;     }      @HttpPost     global static String createMerchandise(String name,         String description, Decimal price, Double inventory) {         Merchandise__c m = new Merchandise__c(             Name=name,             Description__c=description,             Price__c=price,             Total_Inventory__c=inventory);         insert m;         return m.Id;     } }   i am trying to execute these from postman,    but throwing below error,how i can authenticate,please help urgent requirement.     {       "message": "Session expired or invalid",       "errorCode": "INVALID_SESSION_ID"   }
68475
I have a a string in c# initialised as follows:  string strVal = "£2000";   However whenever I write this string out the following is written:  Â£2000  It does not do this with dollars.  An example bit of code I am using to write out the value:  System.IO.File.AppendAllText(HttpContext.Current.Server.MapPath("/logging.txt"), strVal);   I'm guessing it's something to do with localization but if c# strings are just unicode surely this should just work?  CLARIFICATION: Just a bit more info, Jon Skeet's answer is correct, however I also get the issue when I URLEncode the string. Is there a way of preventing this?  So the URL encoded string looks like this:  "%c2%a32000"  %c2 = Â %a3 = £  If I encode as ASCII the £ comes out as ?  Any more ideas?
6195
Using PHP, what's the fastest way to convert a string like this: "123" to an integer?  Why is that particular method the fastest? What happens if it gets unexpected input, such as "hello" or an array?
39627
I read about how is an input message prepared to be hashed by MD4,MD5 or SHA-1:     Step1 Append padding bits      The input message is "padded" (extended) so that its length (in bits)   equals to 448 mod 512. Padding is always performed, even if the length   of the message is already 448 mod 512. Padding is performed as   follows: a single "1" bit is appended to the message, and then "0"   bits are appended so that the length in bits of the padded message   becomes congruent to 448 mod 512. At least one bit and at most 512   bits are appended.       Step2. Append length      A 64-bit representation of the length of the message is appended to   the result of step1. If the length of the message is greater than   2^64, only the low-order 64 bits will be used.  The resulting message   (after padding with bits and with b) has a length that is an exact   multiple of 512 bits. The input message will have a length that is an   exact multiple of 16 (32-bit) words.       ... algorithms steps   I read that hose 2 steps are always the same for input messages for MD4, MD4 and SHA-1. How about  SHA-224 / SHA-256 / SHA-384 / SHA-512? How do they 'prepare' input to compute a hash? The same way maybe?
115588
I have a just one table mapped in a datacontext.  Here's the property and attribute on the column of interest:  [Column(Storage="_CustomerNumber", DbType="VarChar(25)")] public string CustomerNumber {   This column is, in fact, a varchar(25) and has an index.  I've got some simple code:  DataClasses1DataContext myDC = new DataClasses1DataContext(); myDC.Log = Console.Out;  List&lt;string&gt; myList = new List&lt;string&gt;() { "111", "222", "333" }; myDC.Customers     .Where(c =&gt; myList.Contains(c.CustomerNumber))     .ToList();   Which generates this SQL text:  SELECT [t0].[CustomerNumber], [t0].[CustomerName] FROM [dbo].[Customers] AS [t0] WHERE [t0].[CustomerNumber] IN (@p0, @p1, @p2) -- @p0: Input NVarChar (Size = 3; Prec = 0; Scale = 0) [111] -- @p1: Input NVarChar (Size = 3; Prec = 0; Scale = 0) [222] -- @p2: Input NVarChar (Size = 3; Prec = 0; Scale = 0) [333] -- Context: SqlProvider(Sql2005) Model: AttributedMetaModel Build: 3.5.21022.8   Notice that the paramaters are nvarchar!  When this query hits the database, it generates a horrible plan which involves converting the multi-million row index on CustomerNumber to nvarchar before seeking within it.  I'm not allowed to change the table, but I can change the query and the dbml.  What can I do to get the data out without getting this index conversion?
52656
How can I use/display characters like ♥, ♦, ♣, or ♠ in Java/Eclipse?  When I try to use them directly, e.g. in the source code, Eclipse cannot save the file.  What can I do?  Edit: How can I find the unicode escape sequence?
22890
In Java, I have a String and I want to encode it as a byte array (in UTF8, or some other encoding). Alternately, I have a byte array (in some known encoding) and I want to convert it into a Java String. How do I do these conversions?
108771
In the below scenario  i am Accepting the ID of object in the string form : What will be the best way to avoid the SQL injection for ASId.  public static List&lt;AB__c&gt;ABC(string ASId)         records = [select id, name,abc__c,der__f, from AB__c WHERE der__f = :ASId WITH SECURITY ENFORCED ORDER BY AB__c ASC NULLS LAST];
44986
I have a String representation of a date that I need to create a Date or Calendar object from. I've looked through Date and Calendar APIs but haven't found anything that can do this other than creating my own ugly parse method. I know there must be a way, does anyone know of a solution?
14745
How do I make an MD5 hash of a string with Delphi?
73925
Earlier today a question was asked regarding .  The top answer, at time of writing, suggests in PHP just using htmlspecialchars and mysql_real_escape_string.   My question is: Is this always enough? Is there more we should know? Where do these functions break down?
40753
Recently I have started playing with jQuery, and have been following a couple of tutorials. Now I feel slightly competent with using it (it's pretty easy), and I thought it would be cool if I were able to make a 'console' on my webpage (as in, you press the ` key like you do in  games, etc.), and then have it Ajax itself back to the server in-order to do stuff.  I originally thought the best way would be to just get the text inside the textarea, and then split it, or should I use the keyup event, convert the keycode returned to an ASCII character, append the character to a string and send the string to the server (then empty the string).  I couldn't find any information on getting text from a textarea, all I got was keyup information. Also, how can I convert the keycode returned to an ASCII character?
4190
I am looking to use Java to get the MD5 checksum of a file.  I was really surprised but I haven't been able to find anything that shows how to get the MD5 checksum of a file.  How is it done?
27515
I have a Java String that contains XML, with no line feeds or indentations. I would like to turn it into a String with nicely formatted XML. How do I do this?  String unformattedXml = "&lt;tag&gt;&lt;nested&gt;hello&lt;/nested&gt;&lt;/tag&gt;"; String formattedXml = new [UnknownClass]().format(unformattedXml);   Note: My input is a String. My output is a String.   (Basic) mock result:    &lt;?xml version="1.0" encoding="UTF-8"?&gt; &lt;root&gt;   &lt;tag&gt;     &lt;nested&gt;hello&lt;/nested&gt;   &lt;/tag&gt; &lt;/root&gt;
10097
Does Java have a built-in way to escape arbitrary text so that it can be included in a regular expression? For example, if my users enter "$5", I'd like to match that exactly rather than a "5" after the end of input.
38310
Given the following classes and controller action method:  public School {   public Int32 ID { get; set; }   publig String Name { get; set; }   public Address Address { get; set; } }  public class Address {   public string Street1 { get; set; }   public string City { get; set; }   public String ZipCode { get; set; }   public String State { get; set; }   public String Country { get; set; } }  [Authorize(Roles = "SchoolEditor")] [AcceptVerbs(HttpVerbs.Post)] public SchoolResponse Edit(Int32 id, FormCollection form) {   School school = GetSchoolFromRepository(id);    UpdateModel(school, form);    return new SchoolResponse() { School = school }; }   And the following form:  &lt;form method="post"&gt;   School: &lt;%= Html.TextBox("Name") %&gt;&lt;br /&gt;   Street: &lt;%= Html.TextBox("Address.Street") %&gt;&lt;br /&gt;   City:  &lt;%= Html.TextBox("Address.City") %&gt;&lt;br /&gt;   Zip Code: &lt;%= Html.TextBox("Address.ZipCode") %&gt;&lt;br /&gt;   Sate: &lt;select id="Address.State"&gt;&lt;/select&gt;&lt;br /&gt;   Country: &lt;select id="Address.Country"&gt;&lt;/select&gt;&lt;br /&gt; &lt;/form&gt;   I am able to update both the School instance and the Address member of the school.  This is quite nice!  Thank you ASP.NET MVC team!  However, how do I use jQuery to select the drop down list so that I can pre-fill it?  I realize that I could do this server side but there will be other dynamic elements on the page that affect the list.  The following is what I have so far, and it does not work as the selectors don't seem to match the IDs:  $(function() {   $.getJSON("/Location/GetCountryList", null, function(data) {     $("#Address.Country").fillSelect(data);   });   $("#Address.Country").change(function() {     $.getJSON("/Location/GetRegionsForCountry", { country: $(this).val() }, function(data) {       $("#Address.State").fillSelect(data);     });   }); });