Search Results

Search found 3489 results on 140 pages for 'chris welsh'.

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

  • Geocoding autocomplete bias not working

    - by chris
    I'm using the following code to get the autocomplete functionality for an address input box using Google Maps API v3: function initializeAutocomplete() { var defaultBounds = new google.maps.LatLngBounds( new google.maps.LatLng(1.484016,103.575212), new google.maps.LatLng(1.233592,104.033618)); var input = document.getElementById('destStreet'); var myOptions = {bounds: defaultBounds, types: ['geocode']}; autocomplete = new google.maps.places.Autocomplete(input, myOptions); } The problem is that biasing doesn't seem to work as the first results are usually not relevant to the defined bounds (a country). I've seen a few apps working fine, so I'm wondering where the problem is. I came across the JQuery autocomplete plugin (http://code.google.com/p/geo-autocomplete/) which would seem like a good alternative since it has a region filter, but I'm unable to "install it" or use it because of my very limited knowledge (I learn by example). Could you please help me getting more relevant results with the above code or guide me through the implementation of the JQuery alternative? Of course I'm very open to other suggestions as well.

    Read the article

  • ASP.Net Layered app - Share Entity Data Model amongst layers

    - by Chris Klepeis
    How can I share the auto-generated entity data model (generated object classes) amongst all layers of my C# web app whilst only granting query access in the data layer? This uses the typical 3 layer approach: data, business, presentation. My data layer returns an IEnumerable<T> to my business layer, but I cannot return type T to the presentation layer because I do not want the presentation layer to know of the existence of the data layer - which is where the entity framework auto-generated my classes. It was recommended to have a seperate layer with just the data model, but I'm unsure how to seperate the data model from the query functionality the entity framework provides.

    Read the article

  • VS Intellisense: can you hide extension methods?

    - by chris
    By default Visual Studio displays all members and its extension methods for a type in intellisense. Sometimes I would like to hide the extension methods to make it easier to find the member I am actually looking for (especially when using Linq). Is there a shortcut or another way to display only the members of a type in intellisense?

    Read the article

  • 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

  • Issues dismissing keyboard conditionally with on iPhone

    - by Chris
    I have an app that has a username and password field. I want to validate the input before the the user is allowed to stop editing the field. To do that, I'm using the textFieldShouldEndEditing delegate method. If the input doesn't validate I display a UIAlertView. This approach works as advertised - the user cannot leave the field if the input doesn't validate. To have the done button on the keyboard dismiss the keyboard, I call resignFirstResponder on the textfield. The issue I have is the alert is being called twice. How do I keep the alert from showing twice?

    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

  • 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

  • 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

  • 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 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

  • 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

  • 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

  • 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 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

  • 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

  • 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

  • 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

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