Search Results

Search found 2013 results on 81 pages for 'matt lewis'.

Page 59/81 | < Previous Page | 55 56 57 58 59 60 61 62 63 64 65 66  | Next Page >

  • How do I use a jQuery not selector to select relative URLs?

    - by Matt
    I'm working on a little jQuery script to add Google Analytics pageTracker onclick data to all relative URLs on my forum, allowing me to track clicks to external sites. I don't want to add the onclick to internal links on forum.sitename or sitename, and I don't want to add them to any hrefs marked # or that start with /. My script below works nicely, but for one minor problem! All of the forum's URLs are relative and don't start with /. I appear to have no way to change that, so need to modify the jQuery below to prevent it adding the onclick to links like as it currently does. What I want to do, is to write a .not() function like .not("[href!^=http") to prevent jQuery from adding the onclick to any hrefs which do not start with http. However, .not() appears not to support this. I'm new to jQuery and can't figure this out. Any pointers would be massively appreciated. $(document).ready(function(){ // Get URL from a href var URL = $("a").attr('href'); // Add pageTracker data for GA tracking $("a") .not("[href^=#]") .not("[href^=http://forum.sitename]") .not("[href^=http://www.sitename]") .attr("onclick","pageTracker._trackEvent('Outgoing_Links', 'Forum', " + URL + ");") ; }); Thanks!

    Read the article

  • Java class Class<T> and static method Class.forName() drive me crazy.

    - by matt
    Hi, this code doesn't compile. i'm wandering what i am doing wrong: private static Importable getRightInstance(String s) throws Exception { Class<Importable> c = Class.forName(s); Importable i = c.newInstance(); return i; } where Importable is an interface and the string s is the name of an implementing class. The compiler says: ./Importer.java:33: incompatible types found : java.lang.Class<capture#964 of ?> required: java.lang.Class<Importable> Class<Importable> c = Class.forName(format(s)); thanks for any help!

    Read the article

  • Add Attribute (System.Attribute variety) to .aspx page - not the code-behind

    - by Macho Matt
    I am creating a custom Attribute (extending System.Attribute). I know I can put it on another class easily enough by doing the following. [MattsAttribute] public class SomeClassWhichIsACodeBehind { However, I need to be able to test this attribute easily, and putting it in the code-behind would cause a lot of extra effort to get it deployed to an environment which would respond to the behavior of attribute. What I would like to do: declaratively apply this attribute to the .aspx page itself (which is really just another class that inherits from the code-behind). Is this possible? If so, what is the proper syntax for doing this?

    Read the article

  • How to specify MQ channel table location for .net web application using web.config

    - by Matt
    I've been going around in circles for a while on this one now. I'm trying to connect to a distributed queue manager using a supplied channel table file. I can get this to work if I specify the environmental variable MQCHLLIB and MQCHLTAB on my server. However the IBM documentation states that the .net config file can override these variables. Here is what I have placed in my web.config file: ... <configSections> <section name="CHANNELS" type="System.Configuration.NameValueSectionHandler" /> </configSections> <CHANNELS> <add key="ChannelDefinitionDirectory" value="C:\temp"></add> <add key="ChannelDefinitionFile" value="DSM_MOM_TEST.tab"></add> </CHANNELS> ... And here is the code that is executing: Hashtable properties = new Hashtable(); //Add managed connection type to parameters. const String connectionType = MQC.TRANSPORT_MQSERIES_CLIENT; properties.Add(MQC.TRANSPORT_PROPERTY, connectionType); return new MQQueueManager(queueManagerName, properties); queueManagerName is set to the generic queue manager "*Q101T". However this isn't working and I get an error returned: 2058 MQRC_Q_MGR_NAME_ERROR I've been unable to find any more documentation on how to get this to work other than the environmental variables and the standard mqclient.ini should be overriden by the channels stanza in the web.config. Is there something that I've missed in the code? Any tips would be greatly appreciated.

    Read the article

  • Flash AS3: automate property assignment to new instance from arguments in constructor

    - by matt lohkamp
    I like finding out about tricky new ways to do things. Let's say you've got a class with a property that gets set to the value of an argument in the constructor, like so: package{ public class SomeClass{ private var someProperty:*; public function SomeClass(_someProperty:*):void{ someProperty = _someProperty; } } } That's not exactly a hassle. But imagine you've got... I don't know, five properties. Ten properties, maybe. Rather then writing out each individual assignment, line by line, isn't there a way to loop through the constructor's arguments and set the value of each corresponding property on the new instance accordingly? I don't think that the ...rest or arguments objects will work, since they only keep an enumerated list of the arguments, not the argument names - I'm thinking something like this would be better: for(var propertyName:String in argsAsAssocArray){this[propertyName] = argsAsAssocArray[propertyName];} ... does something like this exist?

    Read the article

  • Force Binding Update Silverlight

    - by Matt
    How can I force my objects DataContext bindings to update? I'm using an event on a grid, and binding updates are not being processed before my event fires. Any cheap tricks to get around this? In the end I can always do things the old manual way of getting the values from my textboxes and updating my object, but it'd be nice to have binding do it for me.

    Read the article

  • Outlook 2007 VSTO Add-in deployed by click-once doesn't detect published updates

    - by Matt
    I have created an outlook 2007 add-in project in vs2008, targeting .net 3.5, then migrated the project to vs2010. I have then published the project from vs2010 to a web site, and installed the add-in using click-once to a virtual machine running xp, .net 3.5 sp1, and outlook 2007. This all works great and I can see my add-in within outlook. Publish update settings are set to update the add-in at startup rather than every 7 days. However when I then make a simple change to the add-in, update the AssemblyVersion and AssemblyFileVersion of the add-in project, and then publish the updates, when I run outlook it doesn't detect that there is a new version, and just runs the current one that is installed. I can see that the publish has generated a new setup.exe and added a new folder to the 'Application Files' folder with the current (autogenerated) publish version. Can anyone suggest anything how I can get the update to be deployed to the client?

    Read the article

  • Is it possible to have a Shared/Static Dependency Property?

    - by Matt H.
    [using VB.NET, but I can easily read C# code in responses] I have a class called QuestionClipboard with ALL shared methods/properties. I previously had a QuesitonClipboard.doesClipboardHaveContent function that returned true/false if there was a Object on my 'clipboard'. I'd prefer to implement a Dependency Property so I can allow this true/false value to participate in data binding. The "GetValue(dp as DependencyProperty)" method requires an object instance, which would mean that my Property CAN'T be shared! Here is what the code would look like in my perfect world... Of course, the word "Shared" before the property declaration renders this code useless. Private Shared clipboardHasContentPropertyKey As DependencyPropertyKey = DependencyProperty.RegisterReadOnly("clipboardHasContent", GetType(Boolean), GetType(QuestionClipboard), _ New PropertyMetadata(False, Nothing, New CoerceValueCallback(AddressOf coerceClipboardHasContent))) Private Shared clipboardHasContentProperty As DependencyProperty = clipboardHasContentPropertyKey.DependencyProperty Public SHARED Property clipboardHasContent As Boolean Get Return GetValue(clipboardHasContentProperty) End Get Set(ByVal value As Boolean) SetValue(value) End Set End Property

    Read the article

  • Fluent nHibernate - How to map a non-key column on an association table?

    - by The Matt
    Taking an example that is provided on the Fluent nHibernate website, I need to extend it slightly: I need to add a 'Quantity' column to the StoreProduct table. How would I map this using nHibernate? An example mapping is provided for the given scenario above, but I'm not sure how I would get the Quantity column to map: public class StoreMap : ClassMap<Store> { public StoreMap() { Id(x => x.Id); Map(x => x.Name); HasMany(x => x.Employee) .Inverse() .Cascade.All(); HasManyToMany(x => x.Products) .Cascade.All() .Table("StoreProduct"); } }

    Read the article

  • Has Windows 7 Fixed the 255 Character File Path Limit?

    - by The Matt
    As I understand it, the limitation of 255 characters in a file path is a Windows limitation. What is the reasoning for this? If so, has this been resolved in Windows 7? In our continuous integration practices, we often have deeply nested project structures and it would be extremely useful to be able to go beyond 255 characters. Right now we are somewhat forced to structure our projects in such a way as to not hit this artificial ceiling.

    Read the article

  • mysqli and php requesting rows returned in object oriented scripting...

    - by Matt
    in object oriented php mysqli I am trying to request a username, and return if it matches a row, without actually returning any user data. How would I write this?...so far I have... $sql = "SELECT NULL FROM database WHERE usernick=?"; $stmt = $link->prepare($sql) $stmt->bind_param('s', $snr); $stmt->execute(); After this step I need to see if a row matched the query...but I have no idea how to write it, everyone here pretty much writes in mysql if I dont mention I want object oriented mysqli :S

    Read the article

  • Good IM/Chat solution for pasting code

    - by Matt Miller
    We've got several distributed developers working together on a couple of projects. We've been using Skype to host chats with all the developers, and it works okay except for one thing: It REALLY mangles any code we copy and paste into the chats -- especially the whitespace in Python. This question has tons of opinions about chat clients & servers, but no one has much to say about pasting in code. (http://stackoverflow.com/questions/36415/best-chat-im-tool-for-developers) Is anybody out there using a chat or im client that handles source code really well?

    Read the article

  • Is it possible to add a Silverlight 3 out-of-browser application to the add/remove programs list?

    - by Matt Lacey
    Is it possible to include a Silverlight (3) out-of-browser application to the add-or-remove programs list? The intention is to be able to remove the OOB application that way (not just by right-clicking from within the running app)? If the OOB app is installed with a shortcut to the desktop and you try to delete the shortcut you are presented with the standard 'you are just deleting a shortcut if you want to delete the application go to add or remove programs' dialog. I want to tidy up this inconsistency.

    Read the article

  • Problem updating through LINQtoSQL in MVC application using StructureMap, Repository Pattern and UoW

    - by matt
    I have an ASP MVC application using LINQ to SQL for data access. I am trying to use the Repository and Unit of Work patterns, with a service layer consuming the repositories and unit of work. I am experiencing a problem when attempting to perform updates on a particular repository. My application architecture is as follows: My service class: public class MyService { private IRepositoryA _RepositoryA; private IRepositoryB _RepositoryB; private IUnitOfWork _unitOfWork; public MyService(IRepositoryA ARepositoryA, IRepositoryB ARepositoryB, IUnitOfWork AUnitOfWork) { _unitOfWork = AUnitOfWork; _RepositoryA = ARepositoryA; _RepositoryB = ARepositoryB; } public PerformActionOnObject(Guid AID) { MyObject obj = _RepositoryA.GetRecords() .WithID(AID); obj.SomeProperty = "Changed to new value"; _RepositoryA.UpdateRecord(obj); _unitOfWork.Save(); } } Repository interface: public interface IRepositoryA { IQueryable<MyObject> GetRecords(); UpdateRecord(MyObject obj); } Repository LINQtoSQL implementation: public class LINQtoSQLRepositoryA : IRepositoryA { private MyDataContext _DBContext; public LINQtoSQLRepositoryA(IUnitOfWork AUnitOfWork) { _DBConext = AUnitOfWork as MyDataContext; } public IQueryable<MyObject> GetRecords() { return from records in _DBContext.MyTable select new MyObject { ID = records.ID, SomeProperty = records.SomeProperty } } public bool UpdateRecord(MyObject AObj) { MyTableRecord record = (from u in _DB.MyTable where u.ID == AObj.ID select u).SingleOrDefault(); if (record == null) { return false; } record.SomeProperty = AObj.SomePropery; return true; } } Unit of work interface: public interface IUnitOfWork { void Save(); } Unit of work implemented in data context extension. public partial class MyDataContext : DataContext, IUnitOfWork { public void Save() { SubmitChanges(); } } StructureMap registry: public class DataServiceRegistry : Registry { public DataServiceRegistry() { // Unit of work For<IUnitOfWork>() .HttpContextScoped() .TheDefault.Is.ConstructedBy(() => new MyDataContext()); // RepositoryA For<IRepositoryA>() .Singleton() .Use<LINQtoSQLRepositoryA>(); // RepositoryB For<IRepositoryB>() .Singleton() .Use<LINQtoSQLRepositoryB>(); } } My problem is that when I call PerformActionOnObject on my service object, the update never fires any SQL. I think this is because the datacontext in the UnitofWork object is different to the one in RepositoryA where the data is changed. So when the service calls Save() on it's IUnitOfWork, the underlying datacontext does not have any updated data so no update SQL is fired. Is there something I've done wrong in the StrutureMap registry setup? Or is there a more fundamental problem with the design? Many thanks.

    Read the article

  • Why do my WPF UIElements NOT have OnPreview events?

    - by Matt.M
    I'm building a custom Silverlight UserControl which needs to listen to events using Preview/Tunneling, but for some reason the compiler is telling me they are not recognized or accessible. For example, I can add an event handler to MouseLeftButtonDown, but not PreviewMouseLeftButtonDown. This doesn't make sense because according to Microsoft (http://msdn.microsoft.com/en-us/library/system.windows.uielement_members(v=VS.100).aspx) all UIElements should have Preview events attached. Any ideas as to why this is happening? I'm using Visual Studio 2010 Trial, Blend 4 RC and .Net 4, if that makes a difference.

    Read the article

  • From my code, I can't trace the out of bounds exception.

    - by Matt
    public override Models.CalculationNode Parse(string expression) { var calNode = new Models.CalculationNode(); int i = expression.Length; char[] x = expression.ToCharArray(); string temp = ""; //Backwards assembly of the tree //Right Node while (!IsOperator(x[i]) && i > 0) { if (!x[i].Equals(' ')) temp = x[i] + temp; i--; } } It has been a while since I've used trees and I'm getting an out of bounds exception in the while loop.

    Read the article

  • Is search and replace the only way to rename an asp control in the code behind file?

    - by Matt
    Is search and replace the only way to rename as asp control in the code behind file? I find this extremely annoying, but it is the only way I can find. Scenario: I'll find a variable that needs renaming (Usually to meet naming convention) I'll rename the variable in the aspx/ascx file. I'll have to go in the code behind files and search and replace. I get annoyed Are there any better ways - preferably that would not touch a similarly named variable in another scope in the project. I'm on VS2008 with resharper -- does VS2010 address this perhaps?

    Read the article

  • Using GET instead of POST to delete data behind authenticated pages

    - by Matt Spradley
    I know you should use POST whenever data will be modified on a public website. There are several reasons including the fact that search engines will follow all the links and modify the data. My question is do you think it is OK to use GET behind authenticated pages in something like an admin interface? One example would be a list of products with a delete link on each row. Since the only way to get to the page is if you are logged in, is there any harm in just using a link with the product ID in the query string?

    Read the article

  • Refresh list of drawables in Eclipse?

    - by Matt Swanson
    When I add drawable resources to my project they do not show up in the list of drawables in the Reference Chooser. I checked the R file and there are references for the files. I have tried refreshing the project, cleaning the project, and fixing project properties and nothing seems to help. Sometimes a couple will randomly show up in there, but not all of them. The only consistent way I can get them to show up is to restart Eclipse. Any ideas? Thanks

    Read the article

  • Simple 2 way encryption for C#

    - by Matt Dawdy
    I'm looking for very simple encrypt and decrypt functionality for some data. It's not mission critical. I need something to keep honest people honest, but something a little stronger than ROT13 or Base64. I'd prefer something that is already included in the .Net framework 2.0 so I don't have to worry about any external dependencies. Pre-emptive EDIT: I really don't want to have to mess around with public/private keys, etc. I don't know much about encryption, but I do enough to know that anything I wrote would be less than worthless...in fact, I'd probably screw up the math and make it trivial to crack.

    Read the article

< Previous Page | 55 56 57 58 59 60 61 62 63 64 65 66  | Next Page >