Search Results

Search found 3484 results on 140 pages for 'chris dubois'.

Page 93/140 | < Previous Page | 89 90 91 92 93 94 95 96 97 98 99 100  | Next Page >

  • Is it OK to use WPF assemblies in a web app?

    - by Chris
    I have an ASP.NET MVC 2 app targeting .NET 4 that needs to be able to resize images on the fly and write them to the response. I have code that does this and it works. I am using System.Drawing.dll. However, I want to enhance my code so that not only am I resizing the image, but I am dropping it from 24bpp down to 4bit grayscale. I could not, for the life of me, find code on how to do this with System.Drawing.dll. But I did find a bunch of WPF stuff. This is my working/sample code (runs in LinqPad). // Load the original 24 bit image var bitmapImage = new BitmapImage(); bitmapImage.BeginInit(); bitmapImage.UriSource = new Uri(@"C:\Temp\Resized\18_appa2_015.png", UriKind.Absolute); //bitmapImage.DecodePixelWidth = 600; bitmapImage.EndInit(); // Create the destination image var formatConvertedBitmap = new FormatConvertedBitmap(); formatConvertedBitmap.BeginInit(); formatConvertedBitmap.Source = bitmapImage; formatConvertedBitmap.DestinationFormat = PixelFormats.Gray4; formatConvertedBitmap.EndInit(); // Encode and dump the image to disk var encoder = new PngBitmapEncoder(); encoder.Frames.Add(BitmapFrame.Create(formatConvertedBitmap)); using (var fileStream = File.Create(@"C:\Temp\Resized\18_appa2_015_s2.png")) { encoder.Save(fileStream); } It uses System.Xaml.dll, WindowsBase.dll, PresentationCore.dll, and PresentationFramework.dll. The namespaces used are: System.Windows.Controls, System.Windows.Media, and System.Windows.Media.Imaging. Is there any problem using these namespaces in my web application? It doesn't seem right. If anyone knows how to drop the bit depth without all this WPF stuff (which I barely understand, BTW) I would be thrilled to see that too.

    Read the article

  • Wildcard PHP text search

    - by Chris
    I have a text string that has been doctored to be web safe URLs i.e. non alphanumeric's are converted to "_". What I want to do is search for the original name before it was converted, this means that I need some kind of wild card search i.e. What I have test__mytest With wildcards test??mytest The string I would find with the wildcard search test: mytest Can someone tell me how to achieve this in PHP? Thanks

    Read the article

  • What is a dictionary attack?

    - by Chris
    When we say dictionary attack, we don't really mean a real dictionary, do we? My guess is we mean a hacker's dictionary i.e. rainbow tables, right? My point is we're not talking about someone keying different passwords into the login box, we're talking about someone who has full access to your database (which has hashed passwords, not plain passwords) and this person is reversing the hashes, right?

    Read the article

  • PHP secure logon script - md5 hash is not matching the hash i wrote to the database in a previous sc

    - by Chris Sobolewski
    I am trying to cobble together a login script in PHP as a learning project. This is the code for my database write when the user registers. Both of these values are written to the database. $this->salt = md5(uniqid()); $this->password = md5($password.$salt); Upon logging in, the following function is fired. For some function challengeLogin($submittedPassword, $publicSalt, $storedPassword){ if(md5($submittedPassword.$publicSalt) == $actualPassword){ return 0; }else{ return 1; }; } Unfortunately, on stepping through my code, the two values have never equaled. Can someone help me understand why?

    Read the article

  • Outlook - check email address type

    - by Chris Gunner
    I am trying to make a macro in Outlook that will scan the To: list for a certain text string, and spit out a message if all but one (or two, etc) addresses have it. Is there a simple way to do this? Essentially, I am trying to write something that'll avoid being able to send a restricted message to a bunch of people with the string 'xyz' in the address, if one or more do not have it. AutoComplete makes this difficult, without checking through one-by-one.

    Read the article

  • What is the worst class/variable/function name you have ever encountered

    - by Chris Noe
    Naming things well is arguably Job 1 for professional programmers. Yet we have all suffered from some bad naming choices from time to time. So just to vent a little, what are some doozies that you may have run across? Just to get things started: One of our original developers wasn't sure what to call a secondary key - on what turned out to be a primary table for this app - so he called it: DL2WhateverTheHellThatIs. Unfortunately this system generates entity mappings from the XML, and attributes defined there result in classes, methods, and constants that are referenced through-out the app. To this day it is very hard to find a source file that does not reference this, er, thing! A few actual examples: DL2WhateverTheHellThatIsBean cos = (DL2WhateverTheHellThatIsBean)itr.next(); String code = getDL2WhateverTheHellThatIs().getCode(); From from = new From("DL2WhateverTheHellThatIs"); String filter = "_dL2WhateverTheHellThatIs._code"; (Very difficult to refactor)

    Read the article

  • Parameters not being passed into template when using the .Net transform classes

    - by Chris F
    I am using the .Net XslCompiledTranform to run some simple XSLT (see below for a simplified example). The example XSLT is meant to do simply show the value of the parameter that is passed in to the template. The output is what I expect it to be (i.e. <result xmlns:p1="http://www.doesnotexist.com"> <valueOfParamA>valueA</valueOfParamA> </result> when I use Saxon 9.0, but when I use XslCompiledTransform (XslTransform) in .net I get <result xmlns:p1="http://www.doesnotexist.com"> <valueOfParamA></valueOfParamA> </result> The problem is that that the parameter value of paramA is not being passed into the template when I use the .Net classes. I completely stumped as to why. when I step through in Visual Studio, the debugger says that the template will be called with paramA='valueA' but when execution switches to the template the value of paramA is blank. Can anyone explain why this is happening? Is this a bug in the MS implementation or (more likely) am I doing something that is forbidden in XSLT? Any help greatly appreciated. This is the XSLT that I am using <?xml version="1.0" encoding="utf-8"?> <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:extfn="http://exslt.org/common" exclude-result-prefixes="extfn" xmlns:p1="http://www.doesnotexist.com"> <!-- Replace msxml with xmlns:extfn="http://exslt.org/common" xmlns:extfn="urn:schemas-microsoft-com:xslt" --> <xsl:output method="xml" indent="yes"/> <xsl:template match="/"> <xsl:variable name="resultTreeFragment"> <p1:foo> </p1:foo> </xsl:variable> <xsl:variable name="nodeset" select="extfn:node-set($resultTreeFragment)"/> <result> <xsl:apply-templates select="$nodeset" mode="AParticularMode"> <xsl:with-param name="paramA" select="'valueA'"/> </xsl:apply-templates> </result> </xsl:template> <xsl:template match="@* | node()" mode="AParticularMode"> <xsl:param name="paramA"/> <valueOfParamA> <xsl:value-of select="$paramA"/> </valueOfParamA> </xsl:template> </xsl:stylesheet>

    Read the article

  • How to search SVN repository for a file when I'm not sure where I put it?

    - by Chris Thornton
    Co-worker is sure he checked in a file: foo_oustanding.dpr but isn't sure when/where (we have lots of "tools" and "utility" ancillary branches, lots of project branches, etc.. I need a way to search the entire repository for this file. I could check the whole source tree out to my HD, but that would take several hours. Is there a faster way? I tried the Repo Browser (Tortoise) and it didn't seem to have a search. I also thought about dumping the log, from the beginning of time. But that seemed silly. I have, at my disposal: Tortoise SVN 1.6 Subversion 1.5.6 running on Apache It runs on a Windows 2003 server. Remote Desktop access to the server, with admin rights. Thanks for any ideas.

    Read the article

  • stuck on sliders with jquery

    - by chris
    I am building a portfolio page of different work that has been done and im using two different jquery sliding techniques, one nested in amongst the other one. The first slider works great but the second one doesnmt work that great for the first few and then doesnt work at all. If you take a look at this page- You can click the clients up and down the left side to slide the main divs, but when you click on the squares in below the images to slide in and out the content, either it doesnt work as smoothly as it should or it doesnt work right at all. http://justni.com/wip/mdd/martin_duggan_portfolio.html anyone wanna take a look at the code and tell me what am doing wrong?

    Read the article

  • Disable button after submit

    - by Chris Philpotts
    I'm trying to disable a button when a user submits a payment form and the code to post the form is causing a double post in firefox. This problem does not occur when the code is removed, and does not occur in any browser other than firefox. Any idea how to prevent the double post here? System.Text.StringBuilder sb = new StringBuilder(); sb.Append("if (typeof(Page_ClientValidate) == 'function') { "); sb.Append("if (Page_ClientValidate() == false) { return false; }} "); sb.Append("this.value = 'Please wait...';"); sb.Append("this.disabled = true;"); sb.Append(Page.GetPostBackEventReference(btnSubmit )); sb.Append(";"); btnSubmit.Attributes.Add("onclick", sb.ToString()); it's the sb.Append(Page.GetPostBackEventReference(btnSubmit )) line that's causing the issue Thanks EDIT: Here's the c# of the button: <asp:Button ID="cmdSubmit" runat="server" Text="Submit" /> here's the html This code posts twice (and disables the submit button and verifies input): <input type="submit" name="ctl00$MainContent$cmdSubmit" value="Submit" onclick="if (typeof(Page_ClientValidate) == 'function') { if (Page_ClientValidate() == false) { return false; }} this.value = 'Please wait...';this.disabled = true;document.getElementById('ctl00_MainContent_cmdBack').disabled = true;__doPostBack('ctl00$MainContent$cmdSubmit','');" id="ctl00_MainContent_cmdSubmit" /> This code posts twice (but doesn’t disable the submit button): <input type="submit" name="ctl00$MainContent$cmdSubmit" value="Submit" onclick="__doPostBack('ctl00$MainContent$cmdSubmit','');" id="ctl00_MainContent_cmdSubmit" /> This code posts once (but doesn’t verify the user input and doesn’t disable the submit button): <input type="submit" name="ctl00$MainContent$cmdSubmit" value="Submit" id="ctl00_MainContent_cmdSubmit" /> This code posts once (but doesn’t disable submit button): <input type="submit" name="ctl00$MainContent$cmdSubmit" value="Submit" onclick="javascript:WebForm_DoPostBackWithOptions(new WebForm_PostBackOptions(&quot;ctl00$MainContent$cmdSubmit&quot;, &quot;&quot;, true, &quot;&quot;, &quot;&quot;, false, false))" id="ctl00_MainContent_cmdSubmit" /> This code doesn’t post at all: <input type="submit" name="ctl00$MainContent$cmdSubmit" value="Submit" onclick="this.disabled = true;WebForm_DoPostBackWithOptions(new WebForm_PostBackOptions(&quot;ctl00$MainContent$cmdSubmit&quot;, &quot;&quot;, true, &quot;&quot;, &quot;&quot;, false, false))" id="ctl00_MainContent_cmdSubmit" /> Obviously it’s the disabling of the submit button that’s posing the problem. Do you have any ideas how we can disable the submit to avoid multiple clicking?

    Read the article

  • Creating a standard card game (iPhone SDK)

    - by Chris
    I am trying to create a card game with a standard deck of cards. I need to be able to create a new card on screen every time someone draws a card from the deck and then be able to continuously move it throughout gameplay. I have image files for every card available in the game. I have tried creating a card object which held a UIImageView for the card along with some other basic data but I had trouble referring back to that card to move it again after the first touch. Was this the right way to do this?

    Read the article

  • How can I execute a SQL query in emacs lisp?

    - by Chris R
    I want to execute an SQL query and get its result in elisp: (let ((results (do-sql-query "SELECT * FROM a_table"))) (do-something-with results)) I'm using Postgres, and I already know all of my connection information (host, username, password, db et al) I just want to execute the query and get the result back, synchronously.

    Read the article

  • Strange behavior with gcc inline assembly

    - by Chris
    When inlining assembly in gcc, I find myself regularly having to add empty asm blocks in order to keep variables alive in earlier blocks, for example: asm("rcr $1,%[borrow];" "movq 0(%[b_],%[i],8),%%rax;" "adcq %%rax,0(%[r_top],%[i],8);" "rcl $1,%[borrow];" : [borrow]"+r"(borrow) : [i]"r"(i),[b_]"r"(b_.data),[r_top]"r"(r_top.data) : "%rax","%rdx"); asm("" : : "r"(borrow) : ); // work-around to keep borrow alive ... Another example of weirdness is that the code below works great without optimizations, but with -O3 it seg-faults: ulong carry = 0,hi = 0,qh = s.data[1],ql = s.data[0]; asm("movq 0(%[b]),%%rax;" "mulq %[ql];" "movq %%rax,0(%[sb]);" "movq %%rdx,%[hi];" : [hi]"=r"(hi) : [ql]"r"(ql),[b]"r"(b.data),[sb]"r"(sb.data) : "%rax","%rdx","memory"); for (long i = 1; i < b.size; i++) { asm("movq 0(%[b],%[i],8),%%rax;" "mulq %[ql];" "xorq %%r10,%%r10;" "addq %%rax,%[hi];" "adcq %%rdx,%[carry];" "adcq $0,%%r10;" "movq -8(%[b],%[i],8),%%rax;" "mulq %[qh];" "addq %%rax,%[hi];" "adcq %%rdx,%[carry];" "adcq $0,%%r10;" "movq %[hi],0(%[sb],%[i],8);" "movq %[carry],%[hi];" "movq %%r10,%[carry];" : [carry]"+r"(carry),[hi]"+r"(hi) : [i]"r"(i),[ql]"r"(ql),[qh]"r"(qh),[b]"r"(b.data),[sb]"r"(sb.data) : "%rax","%rdx","%r10","memory"); } asm("movq -8(%[b],%[i],8),%%rax;" "mulq %[qh];" "addq %%rax,%[hi];" "adcq %%rdx,%[carry];" "movq %[hi],0(%[sb],%[i],8);" "movq %[carry],8(%[sb],%[i],8);" : [hi]"+r"(hi),[carry]"+r"(carry) : [i]"r"(long(b.size)),[qh]"r"(qh),[b]"r"(b.data),[sb]"r"(sb.data) : "%rax","%rdx","memory"); I think it has to do with the fact that it's using so many registers. Is there something I'm missing here or is the register allocation just really buggy with gcc inline assembly?

    Read the article

  • How do I start using Linux for web development?

    - by Chris Maple
    OK, so that's maybe not the best title, but I don't know exactly what I want to do, so, please, hear me out. I've used Windows pretty much all my life although I played with Linux on several occasions. At work everyone does web development with php on Windows using the same IDE and stuff. I would like to experience the powerful Linux command line as well as test my web apps locally running the Linux version of php, however I prefer to keep using the IDE because I feel that version control, FTP, code completion etc. are helpful to my productivity. Eventually I would also like to dive into Ruby and Python and I hear that they're not really suited for Windows users. Is running a Linux distro in a virtual machine my best bet? Should I try something like Wubi (Ubuntu running inside Windows)? Or are there any other options out there?

    Read the article

  • Ctrl-Backspace Visual Studio 2010

    - by Chris Watts
    I recently upgraded to Visual Studio 2010 and found out that when i press Ctrl-Backspace on a empty line it will delete the line, which is what it did in 2008, but then it will also delete the last character on the line above. I have tried to see if there is any settings anywhere but i cant seem to find any. Does anyone know if you can change this or did they make it default in 2010 Im using C#, if that makes a difference.

    Read the article

  • Validate an Xml file against a DTD with a proxy. C# 2.0

    - by Chris Dunaway
    I have looked at many examples for validating an XML file against a DTD, but have not found one that allows me to use a proxy. I have a cXml file as follows (abbreviated for display) which I wish to validate: <?xml version="1.0" encoding="utf-8"?> <!DOCTYPE cXML SYSTEM "http://xml.cxml.org/schemas/cXML/1.2.018/InvoiceDetail.dtd"> <cXML payloadID="123456" timestamp="2009-12-10T10:05:30-06:00"> <!-- content snipped --> </cXML> I am trying to create a simple C# program to validate the xml against the DTD. I have tried code such as the following but cannot figure out how to get it to use a proxy: private static bool isValid = false; static void Main(string[] args) { try { XmlTextReader r = new XmlTextReader(args[0]); XmlReaderSettings settings = new XmlReaderSettings(); XmlDocument doc = new XmlDocument(); settings.ProhibitDtd = false; settings.ValidationType = ValidationType.DTD; settings.ValidationEventHandler += new ValidationEventHandler(v_ValidationEventHandler); XmlReader validator = XmlReader.Create(r, settings); while (validator.Read()) ; validator.Close(); // Check whether the document is valid or invalid. if (isValid) Console.WriteLine("Document is valid"); else Console.WriteLine("Document is invalid"); } catch (Exception ex) { Console.WriteLine(ex.ToString()); } } static void v_ValidationEventHandler(object sender, ValidationEventArgs e) { isValid = false; Console.WriteLine("Validation event\n" + e.Message); } The exception I receive is System.Net.WebException: The remote server returned an error: (407) Proxy Authentication Required. which occurs on the line while (validator.Read()) ; I know I can validate against a DTD locally, but I don't want to change the xml DOCTYPE since that is what the final form needs to be (this app is solely for diagnostic purposes). For more information about the cXML spec, you can go to cxml.org. I appreciate any assistance. Thanks

    Read the article

  • Need an app config file opinion here.....

    - by Chris
    I know that app config is used to provide environmental type of values for process variables. And it is very much key/value oriented. But I have a process (windows service) that uses a skeleton xml template file to produce a fuller version of that file after processesing. What about the idea of including that 'skeleton xml' in the app config file? I am trying to aviod having a standalone xml skeleton file, since it is 'configuration' related, in a way.

    Read the article

  • acts_as_solr returns all rows in the database when using the model as search query

    - by chris Chan
    In our application we're using acts_as_solr for search. Everything seems to be running smoothly except for the fact that using the model name as the search query returns every single row in the table. For example, let's say we have a users table. We specify acts_as_solr in our model to search the fields first name, last name and handle acts_as_solr :fields = [:handle, :lname, :fname]. When you use "user" as the search term it returns every single user in the system, or every row in the database as a result. Has anyone else run into this?

    Read the article

  • Do controls need to be defined in a web app or will .NET do it for you

    - by Chris
    I always thought that when you dropped a control onto an .aspx page that a declaration of that control ended up being generated for you (either in a designer file, or within your code behind). All of the apps I have worked on have worked this way. A coworker of mine was installing resharper and it was showing that all her code behind pages would not build. Turned out that resharper could not find a definition for any control that she has dropped onto her markup. She has no designer files, and no declarations in markup. Do they get automatically built when putting together the partial classes? Is there an option at that page/project level to instruct .NET to do this for you? Is this a difference between web app and web site? This is a a .NET 3.5 site, C#, and it is running in a production environment. Thanks in advance

    Read the article

  • User upload file above web root with php

    - by Chris
    I have a website where local bands can have a profile page, I'm implementing an upload system so that they can add songs to their profile. I want to make sure that clever visitors to my website cannot download their songs. I was thinking about uploading them to above the folder for my domain so that they cannot be accessed directly. Is this a good idea and/or possible? If not, what do you suggest I do to try and avoid users downloading songs. I'm already using a flash player to try and prevent downloads.

    Read the article

  • How to have abstract and overriding constants in C# ?

    - by Chris
    Hi all, My code below won't compile. What am i doing wrong? I'm basically trying to have a public constant that is overridden in the base class. public abstract class MyBaseClass { public abstract const string bank = "???"; } public class SomeBankClass : MyBaseClass { public override const string bank = "Some Bank"; } Thanks as always for being so helpful!

    Read the article

< Previous Page | 89 90 91 92 93 94 95 96 97 98 99 100  | Next Page >