Search Results

Search found 7 results on 1 pages for 'kobi'.

Page 1/1 | 1 

  • deadlock when using WCF Duplex Polling with Silverlight

    - by Kobi Hari
    Hi all. I have followed Tomek Janczuk's demonstration on silverlight tv to create a chat program that uses WCF Duplex Polling web service. The client subscribes to the server, and then the server initiates notifications to all connected clients to publish events. The Idea is simple, on the client, there is a button that allows the client to connect. A text box where the client can write a message and publish it, and a bigger text box that presents all the notifications received from the server. I connected 3 clients (in different browsers - IE, Firefox and Chrome) and it all works nicely. They send messages and receive them smoothly. The problem starts when I close one of the browsers. As soon as one client is out, the other clients get stuck. They stop getting notifications. I am guessing that the loop in the server that goes through all the clients and sends them the notifications is stuck on the client that is now missing. I tried catching the exception and removing it from the clients list (see code) but it still does not help. any ideas? The server code is as follows: using System; using System.Linq; using System.Runtime.Serialization; using System.ServiceModel; using System.ServiceModel.Activation; using System.Collections.Generic; using System.Runtime.Remoting.Channels; namespace ChatDemo.Web { [ServiceContract] public interface IChatNotification { // this will be used as a callback method, therefore it must be one way [OperationContract(IsOneWay=true)] void Notify(string message); [OperationContract(IsOneWay = true)] void Subscribed(); } // define this as a callback contract - to allow push [ServiceContract(Namespace="", CallbackContract=typeof(IChatNotification))] [AspNetCompatibilityRequirements(RequirementsMode = AspNetCompatibilityRequirementsMode.Allowed)] [ServiceBehavior(InstanceContextMode=InstanceContextMode.Single)] public class ChatService { SynchronizedCollection<IChatNotification> clients = new SynchronizedCollection<IChatNotification>(); [OperationContract(IsOneWay=true)] public void Subscribe() { IChatNotification cli = OperationContext.Current.GetCallbackChannel<IChatNotification>(); this.clients.Add(cli); // inform the client it is now subscribed cli.Subscribed(); Publish("New Client Connected: " + cli.GetHashCode()); } [OperationContract(IsOneWay = true)] public void Publish(string message) { SynchronizedCollection<IChatNotification> toRemove = new SynchronizedCollection<IChatNotification>(); foreach (IChatNotification channel in this.clients) { try { channel.Notify(message); } catch { toRemove.Add(channel); } } // now remove all the dead channels foreach (IChatNotification chnl in toRemove) { this.clients.Remove(chnl); } } } } The client code is as follows: void client_NotifyReceived(object sender, ChatServiceProxy.NotifyReceivedEventArgs e) { this.Messages.Text += string.Format("{0}\n\n", e.Error != null ? e.Error.ToString() : e.message); } private void MyMessage_KeyDown(object sender, KeyEventArgs e) { if (e.Key == Key.Enter) { this.client.PublishAsync(this.MyMessage.Text); this.MyMessage.Text = ""; } } private void Button_Click(object sender, RoutedEventArgs e) { this.client = new ChatServiceProxy.ChatServiceClient(new PollingDuplexHttpBinding { DuplexMode = PollingDuplexMode.MultipleMessagesPerPoll }, new EndpointAddress("../ChatService.svc")); // listen for server events this.client.NotifyReceived += new EventHandler<ChatServiceProxy.NotifyReceivedEventArgs>(client_NotifyReceived); this.client.SubscribedReceived += new EventHandler<System.ComponentModel.AsyncCompletedEventArgs>(client_SubscribedReceived); // subscribe for the server events this.client.SubscribeAsync(); } void client_SubscribedReceived(object sender, System.ComponentModel.AsyncCompletedEventArgs e) { try { Messages.Text += "Connected!\n\n"; gsConnect.Color = Colors.Green; } catch { Messages.Text += "Failed to Connect!\n\n"; } } And the web config is as follows: <system.serviceModel> <extensions> <bindingExtensions> <add name="pollingDuplex" type="System.ServiceModel.Configuration.PollingDuplexHttpBindingCollectionElement, System.ServiceModel.PollingDuplex, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/> </bindingExtensions> </extensions> <behaviors> <serviceBehaviors> <behavior name=""> <serviceMetadata httpGetEnabled="true"/> <serviceDebug includeExceptionDetailInFaults="false"/> </behavior> </serviceBehaviors> </behaviors> <bindings> <pollingDuplex> <binding name="myPollingDuplex" duplexMode="MultipleMessagesPerPoll"/> </pollingDuplex> </bindings> <serviceHostingEnvironment aspNetCompatibilityEnabled="true" multipleSiteBindingsEnabled="true"/> <services> <service name="ChatDemo.Web.ChatService"> <endpoint address="" binding="pollingDuplex" bindingConfiguration="myPollingDuplex" contract="ChatDemo.Web.ChatService"/> <endpoint address="mex" binding="mexHttpBinding" contract="IMetadataExchange"/> </service> </services> </system.serviceModel>

    Read the article

  • Grails target folder doesn't appear to be on application's classpath

    - by Kobi
    I have a grails project with some additional java source files under src/java folder. When compiling/running the server, the files under that directory get compiled into the project's target folder, together with all other groovy/grails classes. So far so good. However, when I try to load one of the java source files (from src/java) using reflection (Class.forName to be exact), a ClassNotFoundException gets thrown. What is peculiar about the whole thing is that if I copy that same class from project's target/ folder into the following location (on windows): <myuser>\.grails\1.2.2\projects\<MyProjectName>\resources then no exception gets thrown and the corresponding class is loaded fine. This seems to indicate to me that the integrated grails server only looks at classes within the user's dynamically generated project folder, and not the actual project's target folder. Is my understanding correct? Is there a way to force grails to copy certain classfiles from target/ folder into the resources folder within the user dir? Is there a different way to load the classfiles using reflection? I was looking at using the grailsApplication's classloader but that didn't seem to work either. Any tips would be more than welcome. Thanks a lot in advance!

    Read the article

  • XSL - How to disable output escaping for an attribute?

    - by Kobi
    I've had the following <a> tag: <a href="http://myserver/_forms?url={@FileRef}&amp;id=5">...</a> One of the files is called "File's got apostrophe.xml". The output of the XSL is: <a href="http://myserver/_forms?url=/blah/File&amp;#39;s got apostrophe.xml&id=5">...</a> The problem is the the apostrophe is HTML-escaped (twice?) into &amp;#39;, which breaks the link. I've also tried using <xsl:attribute>, with same results: <a> <xsl:attribute name="href"> <xsl:value-of select="concat('http://myserver/_forms?url=', @FileRef, '&amp;id=5')" disable-output-escaping="yes" /> </xsl:attribute> </a> Outputting <xsl:value-of select="@FileRef" disable-output-escaping="yes" /> works well - the unescaped value is printed on the page. How can I set the attribute without escaping the string?

    Read the article

  • help for splitting a string in javascript

    - by Hero
    Hi everyone... I'd asked a question about the splitting the a string like below: Input string: "a=aa| b=b||b | c=cc" and the output: a=aa b=b||b c=cc Kobi's answer was: var matches = "a=aa|b=b||b|c=cc".match(/(?:[^|]|\|\|)+/g) his answer was correct. But I need to use "split" method and save store the outputs in a array. so I can't use the Match Method. So please help me...

    Read the article

  • BitmapFactory.decodeResource returns null value

    - by krasnoff
    I am tring to load bitmaps from an internal resource in a View object (the source itself is in "drawable" files). the code is: import android.content.Context; import android.graphics.Bitmap; import android.graphics.BitmapFactory; import android.graphics.Canvas; import android.util.AttributeSet; import android.view.View; public class BannerView extends View { private Bitmap m_Banner = null; public BannerView(Context context, AttributeSet attributeSet) { super(context, attributeSet); m_Banner = BitmapFactory.decodeResource(getResources(), R.drawable.banner); } } Why m_Banner value is null? thank you in advance Kobi

    Read the article

  • This should be real easy. How to find a button through its Value (Jquery Selector)

    - by Raja
    I have this HTML: <div id='grid'> <input type="button" value="edit"/> <input type='button' value='update'/> </div> How to I attach a click event only to Update button. I know I could add a class to it or specity an id but both are not possible since it is in gridview. I tried this: $("input:button[@value='update']").click(function(){alert('test');}); but it displays an alert for both buttons. I know I must be doing something silly. Any help is much appreciated. Thanks Kobi for helping me out. Given below is the right answer. $("input[value='update']").click(function(){alert('test');});

    Read the article

  • CodePlex Daily Summary for Tuesday, June 21, 2011

    CodePlex Daily Summary for Tuesday, June 21, 2011Popular ReleasesESRI ArcGIS Silverlight Toolkit: June 2011 - v2.2: ESRI ArcGIS Silverlight Toolkit v2.2 New controls added: Attribution Control ScaleLine Control GpsLayer (WinPhone only)Terraria World Viewer: Version 1.4: Update June 21st World file will be stored in memory to minimize chances of Terraria writing to it while we read it. Different set of APIs allow the program to draw the world much quicker. Loading world information (world variables, chest list) won't cause the GUI to freeze at all anymore. Re-introduced the "Filter chests" checkbox: Allow disabling of chest filter/finder so all chest symbos are always drawn. First-time users will have a default world path suggested to them: C:\Users\U...AcDown????? - Anime&Comic Downloader: AcDown????? v3.0 Beta7: ??AcDown???????????????,?????????????????????。????????????????????,??Acfun、Bilibili、???、???、?????,???????????、???????。 AcDown???????????????????????????,???,???????????????????。 AcDown???????C#??,?????"Acfun?????"。 ????32??64? Windows XP/Vista/7 ????????????? ??:????????Windows XP???,?????????.NET Framework 2.0???(x86)?.NET Framework 2.0???(x64),?????"?????????"??? ??????????????,??????????: ??"AcDown?????"????????? ??v3.0 Beta7 ????????????? ???? ?? ????????????????? "??????"?????"?...BlogEngine.NET: BlogEngine.NET 2.5 RC: BlogEngine.NET Hosting - Click Here! 3 Months FREE – BlogEngine.NET Hosting – Click Here! This is a Release Candidate version for BlogEngine.NET 2.5. The most current, stable version of BlogEngine.NET is version 2.0. Find out more about the BlogEngine.NET 2.5 RC here. If you want to extend or modify BlogEngine.NET, you should download the source code. To get started, be sure to check out our installation documentation. If you are upgrading from a previous version, please take a look at ...Microsoft All-In-One Code Framework - a centralized code sample library: All-In-One Code Framework 2011-06-19: Alternatively, you can install Sample Browser or Sample Browser VS extension, and download the code samples from Sample Browser. Improved and Newly Added Examples:For an up-to-date code sample index, please refer to All-In-One Code Framework Sample Catalog. NEW Samples for Windows Azure Sample Description Owner CSAzureStartupTask The sample demonstrates using the startup tasks to install the prerequisites or to modify configuration settings for your environment in Windows Azure Rafe Wu ...Facebook C# SDK: 5.0.40: This is a RTW release which adds new features to v5.0.26 RTW. Support for multiple FacebookMediaObjects in one request. Allow FacebookMediaObjects in batch requests. Removes support for Cassini WebServer (visual studio inbuilt web server). Better support for unit testing and mocking. updated SimpleJson to v0.6 Refer to CHANGES.txt for details. For more information about this release see the following blog posts: Facebook C# SDK - Multiple file uploads in Batch Requests Faceb...NLog - Advanced .NET Logging: NLog 2.0 Release Candidate: Release notes for NLog 2.0 RC can be found at http://nlog-project.org/nlog-2-rc-release-notesPowerGUI Visual Studio Extension: PowerGUI VSX 1.3.5: Changes - VS SDK no longer required to be installed (a bug in v. 1.3.4).Gendering Add-In for Microsoft Office Word 2010: Gendering Add-In: This is the first stable Version of the Gendering Add-In. Unzip the package and start "setup.exe". The .reg file shows how to config an alternate path for suggestion table.Intelligent Enterprise Solution: Document for this project: Document for this projectTerrariViewer: TerrariViewer v3.1 [Terraria Inventory Editor]: This version adds tool tips. Almost every picture box you mouse over will tell you what item is in that box. I have also cleaned up the GUI a little more to make things easier on my end. There are various bug fixes including ones associated with opening different characters in the same instance of the program. As always, please bring any bugs you find to my attention.Kinect Paint: KinectPaint V1.0: This is version 1.0 of Kinect Paint. To run it, follow the steps: Install the Kinect SDK for Windows (available at http://research.microsoft.com/en-us/um/redmond/projects/kinectsdk/download.aspx) Connect your Kinect device to the computer and to the power. Download the Zip file. Unblock the Zip file by right clicking on it, and pressing the Unblock button in the file properties (if available). Extract the content of the Zip file. Run KinectPaint.exe.CommonLibrary.NET: CommonLibrary.NET - 0.9.7 Beta: A collection of very reusable code and components in C# 3.5 ranging from ActiveRecord, Csv, Command Line Parsing, Configuration, Holiday Calendars, Logging, Authentication, and much more. Samples in <root>\src\Lib\CommonLibrary.NET\Samples CommonLibrary.NET 0.9.7Documentation 6738 6503 New 6535 Enhancements 6583 6737DropBox Linker: DropBox Linker 1.2: Public sub-folders are now monitored for changes as well (thanks to mcm69) Automatic public sync folder detection (thanks to mcm69) Non-Latin and special characters encoded correctly in URLs Pop-ups are now slot-based (use first free slot and will never be overlapped — test it while previewing timeout) Public sync folder setting is hidden when auto-detected Timeout interval is displayed in popup previews A lot of major and minor code refactoring performed .NET Framework 4.0 Client...MVC Controls Toolkit: Mvc Controls Toolkit 1.1.5 RC: Added Extended Dropdown allows a prompt item to be inserted as first element. RequiredAttribute, if present, trggers if no element is chosen Client side javascript function to set/get the values of DateTimeInput, TypedTextBox, TypedEditDisplay, and to bind/unbind a "change" handler The selected page in the pager is applied the attribute selected-page="selected" that can be used in the definition of CSS rules to style the selected page items controls now interpret a null value as an empr...Umbraco CMS: Umbraco CMS 5.0 CTP 1: Umbraco 5 Community Technology Preview Umbraco 5 will be the next version of everyone's favourite, friendly ASP.NET CMS that already powers over 100,000 websites worldwide. Try out our first CTP of version 5 today! If you're new to Umbraco and would like to get a quick low-down on our popular and easy-to-learn approach to content management, check out our intro video here. What's in the v5 CTP box? This is a preview version of version 5 and includes support for the following familiar Umbr...LevelZap: 1.0: Initial version. Zap away!Ribbon Browser for Microsoft Dynamics CRM 2011: Ribbon Browser (1.0.514.30): Initial releaseCoding4Fun Kinect Toolkit: Coding4Fun.Kinect Toolkit: Version 1.0Kinect Mouse Cursor: Kinect Mouse Cursor v1.0: The initial release of the Kinect Mouse Cursor project!New ProjectsBaffoHat Kinect: BaffHat is a game for fun with friends and drink a little.Bango Windows Phone 7 Application Analytics SDK: Bango application analytics is an analytics solution for mobile applications. This SDK provides a framework you can use in your application to add analytics capabilities to your mobile applications. It's developed in C#.NET (4.0) and targets the Windows Phone 7 operating system.C++ Winsock WebSocket server: A websockets server built in C++ using the C APIs Winsock and <windows.h>. Works with the current version of Chrome (13.0.782.24).Core.Cpp: CORE-CPPDataContractJson ValueProviderFactory: ValueProviderFactory for ASP.NET MVC that uses the DataContractJsonSerializer for JSON Serialization. This comes in handy when porting RESTful JSON Services from WCF to ASP.NET MVC.E4D CRM 2011 Ribbon Utility: E4D CRM 2011 Ribbon Utility helps you speed Dynamics CRM 2011 Ribbon customization. Ribbon customization tasks can be exhausting, as it require many iterations, mouse clicks and input. This utility does the heavy lifting for you: it will zip, upload and publish automatically!EASY: Eve Application Service for YoueGlass: eGlassGrove SMTP Mailer: Grove SMTP Mailer is a Simple and Open Source SMTP E-Mail Sender Written in Visual Basic by Hommerhart - Effect-7 Grove SMTP Mailer on SourceForge : https://sourceforge.net/projects/grovesmtpmailer/hoox: PHP/MySQL CMS focused on speed and simplicity over feature-diversity.Intelligent Enterprise Solution: An ERP source code,including sample,demo,tool.documentKinect Touch Device: A simple "WPF4 Touch Device" using Kinect with OpenNI & NITE (written in C#). This project makes it easy to transform your WPF4 touch application in "touch less" with the Kinect with little change : replace "Window" base class by "KinectWindow". Currently the Touch Down and Touch Up is determined by the distance of the hand from the Kinect. A possible change would be to detect if the hand is open or closed to enable the Touch Down or Touch Up.kinectPainter: kinect paint projectLiteQuery: Lite Query is an implementation of the Query Object Pattern that will help you to build the queries in the Frontend layer in a way that will be independent from the ORM used in Data Access. The object is translated in the language of the ORM framework using Query Translators. This version comes with translators for Entity Framework and NHibernate.octoInstall: octoInstall is a fast and easy to operate installer and updater utility. For updating it uses a binary compare techology, that creates very small update packages to patch software from one version to another and saves up to 99% of update size.P7T_Engine: P7T_Engine makes it easier for developers to develop advanced 2D game and also basic 3D games. You'll no longer have to write your own engine for 2D games or write large chunks of code to make your project happen. The entire engine is developed in C++. LUA scripting ability is something that we are looking forward to.Panning Tile Control for Windows Phone 7: The panning tile control mimics the functionality of the Windows Phone 7 music tile: Photos and text slowly pan, scroll and fade. It can be used inside of any WP7 Silverlight app.PerstDemo: This project is to show the large amount of data, which is in the format of XML file on Window Phone 7 using Perst Database for this we convert XML to Perst. Due to large data, it consumes a lot of time in conversion & also if fire queries on the database. So, what can be done to lessen the time consumed. Please, download the project http://perstdemo.codeplex.com/releases/view/68640 and have a look. Waiting for the response, ideas, suggestions....SimplePaxos: Implement a simple paxos protocolSOL Polar Converter: Create optimized polars for Bluewater Racing and Expedition from Sailonline races or text polar dataStructured Web Data Extraction: The dataset used in SIGIR 2011 paperSurveyTemplate: This is just for practising the use of culteInfo class in c#Task Unlocker: A site level feature that provides UI for unclocking tasks locked by workflow upgrade. Why tasks get locked : Explanation of cause http://blogs.code-counsel.net/Wouter/Lists/Posts/Post.aspx?ID=118 Inspiration for this feature : Workaround code http://geek.hubkey.com/2007/09/locked-workflow.html Test Project kobi: just for testWindows Azure CDN Helpers: This is a project that helps you quickly utilize the Windows Azure CDN from your ASP.NET MVC website. These helpers will work on sites hosted on and off Windows Azure.WPF Breakout: Remake of the classic Breakout game using WPF. WPFRadio: a WPF Radio Web Player ...

    Read the article

1