Daily Archives

Articles indexed Saturday May 22 2010

Page 4/81 | < Previous Page | 1 2 3 4 5 6 7 8 9 10 11 12  | Next Page >

  • How to inject dependencies into a CustomUserNamePasswordValidator in WCF?

    - by Dannerbo
    I'm using a UserNamePasswordValidator in WCF along with Unity for my dependency injection, but since WCF creates the instance of the UserNamePasswordValidator, I cannot inject my container into the class. So how would one go about this? The simplest solution I can think of is to create a static proxy/wrapper class around a static instance of a UnityContainer, which exposes all the same methods... This way, any class can access the container, and I don't need to inject it everywhere. So I could just do UnityContainerWrapper.Resolve() anywhere in code. So basically this solution solves 2 problems for me, I can use it in classes that I'm not creating an instance of, and I can use it anywhere without having to inject the container into a bunch of classes. The only downside I can think of is that I'm now potentially exposing my container to a bunch of classes that wouldn't of had access to the container before. Not really sure if this is even a problem though?

    Read the article

  • How can I grab the iTunes-defined name for my iPhone/iPod device?

    - by Christophe Porteneuve
    Hey there, I'm trying to get the name for an iPhone/iPod device that the user entered in their iTunes. This is not, I repeat, not, necessarily what [[UIDevice currentDevice] name] returns (or any of its other methods). For instance, my iPhone is bound in iTunes to "iPhone 3G de Christophe…", to differentiate it from my wife's and other similar devices. That's the name I'd love to be able to grab. Is it stored anywhere on the device, and if so can I access it somehow? Thanks!

    Read the article

  • ScrolledWindow and wx.EVT_LEAVE_WINDOW

    - by Joril
    Hi everyone! I have a frame with a textctrl. When the mouse enters the textctrl (EVT_ENTER_WINDOW) I show a PopupWindow on top of the textctrl, and when the mouse leaves the popup (EVT_LEAVE_WINDOW) I hide it again. Everything works fine, except when inside the PopupWindow there's a ScrolledWindow with shown scrollbars. The EVT_LEAVE_WINDOW gets fired when I move the mouse on top of a scrollbar, so it looks like wxPython thinks the scrollbars are not part of the scrolledwindow.. :/ I tried binding the event to the popup or the scrollwindow itself, but nothing changes.. Is there a way I could get around this? Many thanks! (wxPython 2.8.8.0 on Xubuntu 8.10)

    Read the article

  • How to inject dependencies into a custom UserNamePasswordValidator in WCF?

    - by Dannerbo
    I'm using a UserNamePasswordValidator in WCF along with Unity for my dependency injection, but since WCF creates the instance of the UserNamePasswordValidator, I cannot inject my container into the class. So how would one go about this? The simplest solution I can think of is to create a static proxy/wrapper class around a static instance of a UnityContainer, which exposes all the same methods... This way, any class can access the container, and I don't need to inject it everywhere. So I could just do UnityContainerWrapper.Resolve() anywhere in code. So basically this solution solves 2 problems for me, I can use it in classes that I'm not creating an instance of, and I can use it anywhere without having to inject the container into a bunch of classes. The only downside I can think of is that I'm now potentially exposing my container to a bunch of classes that wouldn't of had access to the container before. Not really sure if this is even a problem though?

    Read the article

  • suggestion box in ruby on rails

    - by ohana
    hi, anyone know how to create a suggestion box in ruby on rails? all the materials i found so far are about observe some text field and update some list in other , not related to suggestion box... Thanks!

    Read the article

  • Using multiple Qt (SQL) Models

    - by radix07
    I have a near real-time application that I am using Qt and an SQLite database to run. I am curious if it is safe to have two separate models access a database at once. I know 2 separate views can access a model just fine, but I can't find any document addressing this. I also realize that SQLite is thread safe for reading, so I don't see a real issue to doing this from the SQLite part of things... Basically I want to use a QSqlTableModel to do the real-time read and write in the background and at the same time use a QSqlQueryModel to give the user desired data. Since I may be doing lots of filtering in the background using the table model I can't use it as the main view as well. I have gotten this to work for the most part, but am not sure if this is the best way to do this. If the models act like multiple SQL queries I don't believe this should be an issue, but I would like to know from someone I bit more knowledgeable about this stuff since this is pretty new to me. Thanks

    Read the article

  • In C#, how do you send a refresh/repaint message to a WPF grid or canvas?

    - by xarzu
    How do you send a refresh message to a WPF grid or canvas? In other words, I have noticed while in debug mode, I can write code that sends a line to the display and then, if that line is not right, I can adjust it -- but the previous line is still there. Now, the code I am writing sends information to the display based on what the user clicks. So this must mean that the display is not refreshed each time a new set of lines and boxes and text goes to the grid or canvas in WPF. Using C# code, how do you send a refresh/repaint message to a WPF grid or canvas?

    Read the article

  • Dynamic vertical menu for Wordpress

    - by buttonstack
    Does anyone know how to achieve a dynamic multi-level page menu for Wordpress? I have found a couple scripts but none of them put the subpages directly under the parent page or some will show every subpage to the entire menu Example: page1 (selected) –subpage1-1 –subpage1-2 page2 page3 This code comes close by inserting the subpages directly under, but it doesn't hide the subpages to the other pages. <?php if($post->post_parent) { $children = preg_replace('@\<li([^>^]*)>\<a([^>^]*)>(.*?)\<\/a>@i','<li$1><a$2><span>$3</span></a>',wp_list_pages('title_li=&amp;amp;amp;amp;amp;child_of='.$post->post_parent.'&amp;amp;amp;amp;amp;echo=0&amp;amp;amp;amp;amp;depth=1')); } else { $children = preg_replace('@\<li([^>^]*)>\<a([^>^]*)>(.*?)\<\/a>@i','<li$1><a$2><span>$3</span></a>',wp_list_pages('title_li=&amp;amp;amp;amp;amp;child_of='.$post->ID.'&amp;amp;amp;amp;amp;echo=0&amp;amp;amp;amp;amp;depth=1')); } if($children) { echo" <ul class=\"submenu\">\n". $children ."</ul>\n"; } ?>

    Read the article

  • What is the easiest way to deploy a MVC2 application from Visaul Studio 2010 to IIS 7.5?

    - by Richard
    I´ve tried a couple of different ways to deploy a application to a IIS 7.5 running on my machine for testing purposes and i´ve sort of hit a wall. Nothing works out of the box. Everything assumes I have knowledge I don't have and would prefer not to have to aqquire. Google isn't really helping either with answers ranging from "copy files by hand" to "install teamcity and set it up for CI". I have set up TeamCity for java projects before and it's really over kill for my needs at the moment. So anyone know of a fast, simple and easy way to deploy a application during testing/building?

    Read the article

  • WCF Callbacks often break

    - by cdecker
    I'm having quite some trouble with the WCF Callback mechanism. They sometimes work but most of the time they don't. I have a really simple Interface for the callbacks to implement: public interface IClientCallback { [OperationContract] void Log(string content); } I then implmenent that interface with a class on the client: [ServiceBehavior(InstanceContextMode = InstanceContextMode.PerSession)] [ServiceContract] internal sealed class ClientCallback : IClientCallback { public void Log(String content){ Console.Write(content); } } And on the client I finally connect to the server: NetTcpBinding tcpbinding = new NetTcpBinding(SecurityMode.Transport); EndpointAddress endpoint = new EndpointAddress("net.tcp://127.0.0.1:1337"); ClientCallback callback= new ClientCallback(); DuplexChannelFactory<IServer> factory = new DuplexChannelFactory<IServer>(callback,tcpbinding, endpoint); factory.Open(); _connection = factory.CreateChannel(); ((ICommunicationObject)_connection).Faulted += new EventHandler(RecreateChannel); try { ((ICommunicationObject)_connection).Open(); } catch (CommunicationException ce) { Console.Write(ce.ToString()); } To invoke the callback I use the following: OperationContext.Current.GetCallbackChannel().Log("Hello World!"); But it just hangs there, and after a while the client complains about timeouts. Is there a simple solution as to why?

    Read the article

  • Spring online repository for Maven

    - by Fortyrunner
    I've just installed Maven2 for the first time. By default it pulls down a few useful jars into a local project: jakarta-commons, junit etc. I wanted to pull in the latest Spring release (2.5.6 at the time of writing). But the online repositories I looked at (iBiblio and Maven) only had much older versions of Spring libraries. Are there any other repositories that are kept up to date? What is the best practice here; can we maintain them ourselves? I would be prepared to help out maintaining this stuff!

    Read the article

  • J2EE: Default values for custom tag attributes

    - by Nick
    So according to Sun's J2EE documentation (http://docs.sun.com/app/docs/doc/819-3669/bnani?l=en&a=view), "If a tag attribute is not required, a tag handler should provide a default value." My question is how in the hell do I define a default value as per the documentation's description. Here's the code: <%@ attribute name="visible" required="false" type="java.lang.Boolean" %> <c:if test="${visible}"> My Tag Contents Here </c:if> Obviously, this tag won't compile because it's lacking the tag directive and the core library import. My point is that I want the "visible" property to default to TRUE. The "tag attribute is not required," so the "tag handler should provide a default value." I want to provide a default value, so what am I missing? Any help is greatly appreciated.

    Read the article

  • 503 (Server Unavailable) WebException when loading local XHTML file in Visual C# 2008

    - by kcoppock
    Hello! So I'm currently working on an ePub reader application, and I've been reading through a bunch of regular XML files just fine with System.Xml and XmlDocument: XmlDocument xmldoc = new XmlDocument(); xmldoc.Load(Path.Combine(Directory.GetCurrentDirectory(), "META-INF/container.xml")); XmlNodeList xnl = xmldoc.GetElementsByTagName("rootfile"); However, now I'm trying to open the XHTML files that contain the actual book text, and they're XHTML files. Now I don't really know the difference between the two, but I'm getting the following error with this code (in the same document, using the same XmlDocument and XmlNodeList variable) xmldoc.Load(Path.Combine(Directory.GetCurrentDirectory(), "OEBPS/part1.xhtml")); "WebException was unhandled: The remote server returned an error: (503) Server Unavailable" It's a local document, so I'm not understanding why it's giving this error? Any help would be greatly appreciated. :) I've got the full source code here if it helps: http://drop.io/epubtest (I know the ePubConstructor.ParseDocument() method is horribly messy, I'm just trying to get it working at the moment before I split it into classes)

    Read the article

  • SharePoint Saturday DC

    - by Mark Rackley
    Wow… did you see this thing? 927 attendees? An exhibition hall full of vendors? 94 speakers? 100 sessions?? Insane is a word that comes to mind… SharePoint Saturday DC was definitely epic as far as SharePoint Saturdays go. I got to catch up with a lot of friends and make some new ones.  Met a couple of fans of the blog (hello ladies…;))  Did you know that people actually read this thing? I guess that means I need to stop putting so much garbage on here and more content. I’ll get right on that as soon as I find out how to add 6 hours to each day. Anyway, once again I did my “Wrapping Your Head Around the SharePoint Beast” session.  I tweaked it even more from Huntsville and presented to a packed room with some people sitting on the floor and standing in the aisles. It was a great crowd, very interactive and they seemed interested at least. Thank you guys so much for attending and please feel free to tell me of any suggestions you have to make the presentation better.  This is one of the presentations that will probably never die. Everyone beginning SharePoint development needs a good introduction and starting point. My goal is to make this THE session to see on the subject. So, a little interesting data about my class. Half of the room was brand new to SharePoint and only one person was using 2010. That tells me that this session still has legs and that 2007 isn’t going anywhere anytime soon.  I know my organization will be using 2007 for at least a couple more years. Oh yeah… the slide deck?  Here it is: SharePoint Saturday DC Slide Deck So, SharePoint Saturday was truly tremendous and if you weren’t there you missed out. @meetdux, @usher, and the rest of their crew did a spectacular job. You guys rock and are a huge asset to the community. Thanks for allowing me to speak. What’s up next for me?  I’m so glad you asked…. SHAREPOINT SATURDAY OZARKS IS JUNE 12TH! Although SharePoint Saturday Ozarks on June 12 in Harrison Arkansas will be a much more intimate event than DC, it promises to be a most memorable event. We’ve got over 30 speakers and sessions, some cool stuff to give away, and we’re going floating down the Buffalo River on the 13th. Let’s see you do THAT in DC.  :) Anyway, I hope to see you there and I would truly appreciate any help you can do to help publicize the event. We just got internet here in the hills and most people here are still looking for the “any” key….

    Read the article

  • Network email alerts

    - by stephenfalken
    I would like to buy or d/l an application that will alert our sysadmin in the event of network failure, like via email and/or phone call. I've looked around the net before posting this question, but I have one main concern: if our network goes down, how can a network monitoring application send email to alert us that it's down? Doesn't this have to be an external application that looks at our network from outside? Well anyway, I want to find something that will handle this for us - freeware if possible, sice we're not looking for heavy analysis - just simple alerts. Advice is appreciated.

    Read the article

  • Certain Programs cannot access internet

    - by Cindy
    Operating System: Windows 7 (x64) Problem: Certain Programs are unable to access the internet. They claim that there is no connection when you already are connected. Hello, before we start. Just letting you know I'm new here, and I'm very new to Windows 7. I installed it two days ago. I just installed Windows 7 on my laptop and I have a few problems. I play World of Warcraft, as well as a variety of games. And when I first attempt to log into the game, I get a windows error message, but it doesn't stop there. I thought World of Warcraft got corrupted during the upgrade. It seems that I am unable to access the internet from other online games as well. Most say in along the lines of "Cannot connect to patch server, try again later." I cannot use a downloader Also, I have internet explorer. The x32 version of the browser cannot connect to the internet, and when I try to enter "google.com", it says the same thing. I'm only accessing this site through Internet Explorer x64, which I would have been fine with is it's compatible with Adobe Flash. The only thing that seems to connect to the internet are Internet Explorer x64 and Windows Live Messenger. Here are the steps I have taken, but none worked. 1.) Disable Windows Firewall 2.) Have Windows Firewall Enabled, but allow the specific programs to access internet. And allowed all incoming access. 3.) Disabled UAC, Ran the programs as an admin, and set compatibility to Vista. 4.) Uninstalled an anti-virus program. (McAffee Security Suite 2010) 5.) Reinstalled the programs 6.) Reinstalled Windows 7 7.) Retaken the steps on the Administrator account. Please assist me in this problem. I need to get back into the game. Thanks so much in advance.

    Read the article

  • Can I set up my Ubuntu machine as a proxy?

    - by George Edison
    I have 2 machines connected to a network that provides internet access. I would like one of the machines, which is running Ubuntu 10.04, to act as an internet proxy for the other machine, which is running Windows. How would I set this up? Is there a good Ubuntu proxy I can install?

    Read the article

  • Cookies with urllib

    - by CMC
    This will probably seem like a really simple question, and I am quite confused as to why this is so difficult for me. I would like to write a function that takes three inputs: [url, data, cookies] that will use urllib (not urllib2) to get the contents of the requested url. I figured it'd be simple, so I wrote the following: def fetch(url, data = None, cookies = None): if isinstance(data, dict): data = urllib.urlencode(data) if isinstance(cookies, dict): # TODO: find a better way to do this cookies = "; ".join([str(key) + "=" + str(cookies[key]) for key in cookies]) opener = urllib.FancyURLopener() opener.addheader("Cookie", cookies) obj = opener.open(url, data) result = obj.read() obj.close() return result This doesn't work, as far as I can tell (can anyone confirm that?) and I'm stumped.

    Read the article

  • Comparing all values within a List against each other

    - by Kave
    I am a bit stuck here and can't think further. public struct CandidateDetail { public int CellX { get; set; } public int CellY { get; set; } public int CellId { get; set; } } var dic = new Dictionary<int, List<CandidateDetail>>(); How can I compare each CandidateDetail item against other CandidateDetail items within the same dictionary in the most efficient way? Example: There are three keys for the dictionary: 5, 6 and 1. Therefore we have three entries. now each of these key entries would have a List associated with. In this case let say each of these three numbers has exactly two CandidateDetails items within the list associated to each key. This means in other words we have two 5, two 6 and two 1 in different or in the same cells. I would like to know: if[5].1stItem.CellId == [6].1stItem.CellId = we got a hit. That means we have a 5 and a 6 within the same Cell if[5].2ndItem.CellId == [6].2ndItem.CellId = perfect. We found out that the other 5 and 6 are together within a different cell. if[1].1stItem.CellId == ... Now I need to check the 1 also against the other 5 and 6 to see if the one exists within the previous same two cells or not. Could a Linq expression help perhaps? I am quite stuck here... I don't know...Maybe I am taking the wrong approach. I am trying to solve the "Hidden pair" of the game Sudoku. :) http://www.sudokusolver.eu/ExplainSolveMethodD.aspx Many Thanks, Kave

    Read the article

  • How can I run a package created with Simple Build Tool?

    - by Lukasz Lew
    I run: $ echo 'object Hi { def main(args: Array[String]) { println("Hi!") } }' > hw.scala $ sbt > warn Set log level to warn > run Hi! > package $ java -jar target/scala_2.7.7/test_2.7.7-1.0.jar Exception in thread "main" java.lang.NoClassDefFoundError: scala/ScalaObject at java.lang.ClassLoader.defineClass1(Native Method) at java.lang.ClassLoader.defineClass(ClassLoader.java:621) at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:124) at java.net.URLClassLoader.defineClass(URLClassLoader.java:260) Why can't I run this jar package this way?

    Read the article

  • Android TextView Linkify problem with phone numbers and application version number

    - by Gaks
    I have a problem with TextView and autoLink feature. I have an about screen in my application with some information like support phone number, email address, website URL and application version in form like 01.01.01 After setting autoLink="all" on the textView, all values are linked fine - except that version number 01.01.01 is linked as the phone number as well. Is there some way to exclude this text fragment from linkifing?

    Read the article

< Previous Page | 1 2 3 4 5 6 7 8 9 10 11 12  | Next Page >