Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
M

Matt Meyer

@Matt Meyer
About
Posts
51
Topics
0
Shares
0
Groups
0
Followers
0
Following
0

Posts

Recent Best Controversial

  • Encryption and decryption
    M Matt Meyer

    Schneier's stuff is generally regarded as the best around. Applied Cryptography (https://www.schneier.com/book-applied.html[^]) is probably the best you're going to find on the subject. The book itself is a little dated, but it's still a very, very good reference, and the majority of the topics are still relevant today. It's a very technical, and requires a working knowledge of C and some advanced mathematics. He's got some other less technical books as well on the subject of cryptography - Practical Cryptography is decent if you don't want to know the inner workings, but want to know how to effectively select correct algorithms and implement cryptography. I haven't read Cryptography Engineering yet, it's supposed to be a second edition of Practical Cryptography. I'm not sure if it gets as technically detailed as Applied. A list of his books are at https://www.schneier.com/books.html[^]

    C# security help question

  • sending mails
    M Matt Meyer

    True, standards can be ignored but it's worth pointing out that the ports listed weren't just arbitrarily chosen by the service provider. 995 is used for encrypting the POP3 protocol (POP3S, another standard :-D ). Port 465 is an old remnant from Exchange's method of encryption. It's become common due to Outlook/Microsoft's support of Exchange over the Submission port standard in their mail clients. These days, both protocols are supported in Outlook. One other note about 465 is that it will break using System.Net.Mail.SmtpClient due to how the encryption was implemented. See the remarks section at http://msdn.microsoft.com/en-us/library/system.net.mail.smtpclient.enablessl.aspx[^] for the details.

    C# csharp html com help

  • sending mails
    M Matt Meyer

    Dave Kreskowiak wrote:

    Hotmail and Yahoo will probably not use the same port numbers

    Port 587 is a standard for SMTP servers (similar to port 25), usually referred to as the 'submission' port. It's set aside for authenticated users to submit messages to the e-mail service. It typically needs encryption, but I don't believe that's a requirement of the standard. https://www.ietf.org/rfc/rfc2476.txt[^]

    C# csharp html com help

  • Reading Null values in a byte array
    M Matt Meyer

    When thinking in terms of bytes (or any integral types), null and 0 are the same. In your example, when this line

    variable = BitConverter.ToInt32(message, (int)position);

    returns a zero, that would correspond to a null value.

    C# help database data-structures tutorial question

  • Problem connecting to MySQL
    M Matt Meyer

    What happens if you try to connect to the database using a standard MySQL client? It almost looks like a firewall may be blocking your connection.

    C# help csharp database mysql sysadmin

  • DNS propagation > 72 hours
    M Matt Meyer

    That all depends on how the SOA record is configured. Servers will cache the DNS records for as little or as much time as it is instructed to hold it for. Well.. properly configured servers will, it's anybody's guess for the misconfigured servers out there. Edit: To check your SOA record with nslookup.exe, run the following:

    C:\>nslookup -type=soa domain.com

    It should return the SOA in a human-readable format for you.

    The Lounge php com question

  • Why VB is popular in America!
    M Matt Meyer

    Well, much like VB itself, our elevators are not designed for programmers... :-D

    The Lounge c++ php visual-studio com

  • Help with DriveInfo. VolumeLabel exception please
    M Matt Meyer

    I'm going to change your life (just like mine was a few years back...) :-D

    if (d.VolumeLabel == null || d.VolumeLabel.Length == 0) {

    Can be written as this:

    if (string.IsNullOrEmpty(d.VolumeLabel)) {

    C# help question

  • How do I generate a Unique AlphaNumeric ID in C#
    M Matt Meyer

    Guid should already satisfy your requirement in creating unique identifiers. They're already a product of cryptographic hashing functions, so you shouldn't need to hash them again. You can use ToString with a format provider to get a string representation of the value without the dashes. Or, as an alternative, you can always roll your own UUID implementation according to the standards. One other note - GetHashCode isn't a cryptographic hash, nor is it guaranteed to be consistent between frameworks or platforms. Check the Remarks section at MSDN.

    C# csharp help question

  • How can i change regex to work in javascript
    M Matt Meyer

    The forward slashes are causing your problems because they're telling the interpreter that it's the end of the expression since they're not escaped. Converting your expression from the original into the javascript should only require a copy/paste and manually escaping the pattern's forward slashes. Ie, (?:https?|ftp|file)://|www\.|ftp\.) becomes (?:https?|ftp|file):\/\/|www\.|ftp\.) Here's a Regex reference for javascript that can help you convert your expression: http://www.w3schools.com/jsref/jsref_obj_regexp.asp[^] Also, there's a regular expression forum on here: http://www.codeproject.com/Forums/1580841/Regular-Expressions.aspx[^] They will probably give you more help about regex syntax problems than the javascript forum.

    JavaScript regex question csharp javascript asp-net

  • How can we restrict a user from changing the download path url's fine name.
    M Matt Meyer

    You accomplish this by keeping your assets in a non-accessible location (eg, somewhere in App_Data) and using an HttpHandler to serve the files out after verifying permissions.

    C# com help

  • Speed of execution
    M Matt Meyer

    Nope, don't know how to make it faster. I did try a few different loop approaches, but I get the impression they're being optimized down by the compiler into the same thing. They all seem to come out roughly the same speed (within a ms of each other). If you need something faster, you're going to be better off using C/C++. And, just for kicks, I did try using raw pointer arithmetic in an unsafe context. It was still coming out slower then just looping. I found this odd...

    C# csharp question c++ visual-studio com

  • Speed of execution
    M Matt Meyer

    You have some goofy stuff in there that shouldn't be needed. You're creating a pointer to your array (which requires the unsafe context), then you use your pointer as if it were the array:

    byte[] data = new byte[size];
    [...]
    unsafe{
    fixed (byte* ptr = data) {
    [...]
    for (int i = 0; i < size; i++)
    ptr[i] = 128;
    [...]
    }
    }

    All of that should be condensed down to this:

    byte[] data = new byte[size];
    [...]
    for (int i = 0; i < size; i++)
    data[i] = 128;

    Give that a whirl and see how the speeds match up. I'm not sure what performance implications unsafe contexts create.

    C# csharp question c++ visual-studio com

  • Reading a file in local drive using Java script
    M Matt Meyer

    I do welcome the drag and drop features (this is probably the most common request I used to have when doing web stuff). However, I don't like the idea of implicitly agreeing to local file access by just selecting something in a file input field. Especially since Firefox forces you into the file dialog when you focus on the field, and you cannot delete the input field's contents after selecting a file.

    JavaScript java javascript html sysadmin tools

  • Reading a file in local drive using Java script
    M Matt Meyer

    Graham Breach wrote:

    No, you cannot do that just using Javascript from a browser.

    Actually... You used to not be able to do it with a browser (was viewed as a security hole). However, with HTML5, browsers have started putting in functionality to trap the filestream when a user selects a file in the input box. More details are here: http://www.html5rocks.com/en/tutorials/file/dndfiles/[^] Personally, I still view it as a security problem because I remember all of the details from back in the day, but my opinions don't seem to be falling in line with the new generation of web folks. (yea, yea, get off my lawn and all that) :)

    JavaScript java javascript html sysadmin tools

  • xml to html
    M Matt Meyer

    You might want to look into using XSLT for translating your XML into something HTML friendly.

    Linux, Apache, MySQL, PHP html com xml question

  • How to add a Second Parameter
    M Matt Meyer

    I used string literals in my example. If you want the variables themselves (and they're at least protected), you can do this:

    <%# String.Format("return showComment(""{0}"",""{1}"")", Parameter1, Parameter2) %>

    where Parameter1 and Parameter2 are variable names in the page object.

    JavaScript csharp javascript asp-net com

  • How to add a Second Parameter
    M Matt Meyer

    You have a second quote before Parameter2.

    JavaScript csharp javascript asp-net com

  • Who to write HTML code using Csharp
    M Matt Meyer

    You could create a file that is the template and contains the content of the markup. for example:

    blah blah blah...

    {0}

    {1}
    {3}

    Then you can read in that file and use that in a single string.Format line to create the files from a template.

    public void DesignPage(string TemplateFile, string OutputFile, string[] Contents){
    /* skipping file checks, array checks, etc */
    string content = File.ReadAllText(TemplateFile);
    content = string.Format(content, Contents);
    File.WriteAllText(OutputFile, content);
    /* clean up, etc */
    }

    You can also update the file templates without having to recompile, etc.

    C# csharp html css visual-studio data-structures

  • How to add a Second Parameter
    M Matt Meyer

    You can using String.Format directly in the binding:

    <%# String.Format("return showComment(""{0}"",""{1}"")", "Patameter1", "Parameter2") %>

    JavaScript csharp javascript asp-net com
  • Login

  • Don't have an account? Register

  • Login or register to search.
  • First post
    Last post
0
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups