Daily Archives

Articles indexed Wednesday May 5 2010

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

  • SQL Server 2008 R2 Released to IT Pros

    Microsoft released versions of SQL Server 2008 R2 products to IT professionals on Monday....Did you know that DotNetSlackers also publishes .net articles written by top known .net Authors? We already have over 80 articles in several categories including Silverlight. Take a look: here.

    Read the article

  • something like persistent X forwarding?

    - by Arthur Ulfeldt
    I'm having trouble with the title on this one, please edit. When users connect to a VM with VNC/NX/RDP/other-tla they get a persistent desktop in a window . When they connect using ssh -X forwarding they get a local window managed by the local windo-manager that is not persistent. 1: is there a way to run a program on the VM and have it managed locally AND have it persistent? 2: can the client be on windows or OS-X? ps: in this case the vm's are running Ubuntu

    Read the article

  • remove words containing non-alpha characters

    - by dnkb
    Given a text file with space separated string and a tab separated integer, I'd ;like to get rid of all words that have non-alpha characters but keep words consisting of alpha only characters and the tab plus the integer afterwards. My attempts like the ones below didin't yield any good. What I was trying to express is something like: "replace anything within word boundaries that starts and ends with 0 or more whatever and there is at least one :digits: or :punct: in between". sed 's/\b.[:digits::punct:]+.\b//g' sed 's/\b.[^:alpha:]+.\b//g' What am I missing? See sample input data below. Thank you! asdf 754m 563 a2a 754mm 291 754n 463 754 ppp 1409 754pin 4652 pin pin 462 754pins 652 754 ppp 1409 754pin 4652 pi$n pin 462 754/p ins 652 754 pp+p 1409 754 p=in 4652

    Read the article

  • CodePlex Daily Summary for Tuesday, May 04, 2010

    CodePlex Daily Summary for Tuesday, May 04, 2010New ProjectsAlbum photo de club - Club's Photos Album: Un album photos permettant d'afficher les photos et le détails des membres d'un club - Photo album allowing to view photos and details of the membersBlog.Net Blogging Components: Blog.Net server-side blogging components to add a blog to your current ASP.NET website.FilePirate - Really Advanced LAN File Sharing: Really Advanced, yet super easy, LAN Party File Sharing written using the .Net Framework and C#. Ditch DirectConnect or Windows File Sharing at y...Fisiogest: Programa de gestión de una clínica de fisioterapiaIdeaNMR: An online repository of NMR experiment automated setups with wiki type documentation library and client program providing automated experiment setu...Introducción a Unity: Código de ejemplo del uso de Unity en diferentes situaciones. - Registro de clases, instancias e interfaces. - Resolución de clases, instancias e...Iowa City .NET Developers: This is the project site for the Iowa City .NET Developers.isanywhere: A command line utility to see if one or more files (given a filemask) are to be found anywhere inside a specific directory, or elsewhere inside one...LczCode: lczLog4net udp logs viewer: UdpLogViewer is a .NET 4 WinForm application that receives udp messages from log4net and shows them in a grid. It is possible to filter them or sh...New Silverlight XPS Viewer (In Sl4): New Silverlight XPS viewer Novuz: Novuz is a usenet indexer and reporter. It's developed both in Visual Studio 2010 and MonoDevelop, one of the key features of Novuz is that it sho...PodSnatch: PodSnatch is a podcast client that makes it easy to download rss-enclosures. Multiple simultaneous downloads enabled by threading. GUI is built wi...Robot Shootans: A simple top down shooter game where the player has to kill robots running at them. Written in C++ using SDL with various extentionsSharePoint Rsync List: This program will syncronize files and directories from and unc/local/sharepoint to a SharePoint 2007 or 2010 server. Supports of to 2GB files and ...SignInAndStorageLib: SignInAndStorageLib makes properly handling both sign in and storage issues in Xbox 360 XBLIG XNA games simple. Written in C#, SignInAndStorageLib...SilverBBS: ANSI-style bbs experience delivered via Silverlight. Silverlight flip-down counter: A Silverlight widget that enables you to count down towards a preconfigured event on a configured date.SmartieFly: Smartie Fly is a quiz software program written in C# using Silverlight. It uses SQL Server as a backend database. VS2010 Framework Driven Testing: CodedUITests generate a lot of code, and they break on every change to the object under test. Goals: - write new tests manually, but with as litt...WMediaCatalog: Advanced multimedia cataloguer. Allows users to keep their musical collections well organized and provides flexible methods of filtering, serarching WPathFinder: A simple path management application for windows. Functionality includes: - Add/remove/change path entries easily. - Search for all instances of a...Yasminoku: Yasminoku is an open source "Sudoku" alike game totally written in DHTML (JavaScript, CSS and HTML) that uses mouse. Includes sudoku solver. This c...New ReleasesAlbum photo de club - Club's Photos Album: App - version 0.4: version 0.4 - Critère d'affichage des membres : nom, année, ville - Navigation entre les images d'un membres - Navigation entre les membres - Affi...Album photo de club - Club's Photos Album: Code - Version 0.4: Code source de la version 0.4BigDecimal: Concept Evaluation Release 2 (BigDecimals): This in the second updates release of BigDecimals. It has the four simple arithmetic rules Addition, Subtract, Multiple and Division.CBM-Command: 2010-05-03: New features in this build Keyboard Shortcuts Panel Swapping Panel Toggling On/Off Toggling 40/80 Columns Confirming Quit Confirming GO64...Directory Linker: Directory Linker 2: This release introduces Undo Support and Symbolic File Link support. More details can be found here http://www.humblecoder.co.uk/?p=141DotNetNuke Skins Pack: DotNetNuke 80 Skins Pack: This released is the first for DNN 4 & 5 with Skin Token Design (legacy skin support on DNN 4 & 5)DTLoggedExec: 1.0.0.0: -FIRST NON-BETA RELEASE! :) -Code cleaned up -Added SetPackageInfo method to ILogProvider interface to make easier future improvements -Deprecated...GenerateTypedBamApi: Version 2.1: Changes in this release: NEW: Support for Office Data Connectivity Components 2010 NEW: Include both x86 and x64 EXE's due to lack of support in ...HobbyBrew Mobile: Beta 1 Refresh: Risolto bug circa il salvataggio di ricette (veniva impostato scorrettamente che si trattava di Mash Design "infusione" se ri-aperte con hobbyBrew)...Home Access Plus+: v4.2: Version 4.2 Added Overrides into the Booking System Some slight CSS changes to the Help Desk Updated the config tool to work anywhere on the LA...Hubble.Net - Open source full-text search database: V0.8.3.0: V0.8.3.0 Show server version in about dialog. Fix a bug of deleting querycache files. V0.8.2.9 Change sql client to support userid and password Ch...IdeaNMR: IdeaNMR Client: This is a client program with an example package.kdar: KDAR 0.0.21: KDAR - Kernel Debugger Anti Rootkit - signature's bases updated - usability increased - NDIS6 MINIPORT_BLOCK checks addedLightWeight Application Server: 0.4.1: One step further to beta - yet another release for c# developers audience only. Changes: 1. API - added a LWAS.Infrastructure.Storage service to d...Log4net udp logs viewer: UdpLogViewer 1.0: First release of UdpLogViewer, version 1.0.MDownloader: MDownloader-0.15.11.58370: Fixed minor bugs.Metabolite Enterprise Libraries for EPiServer CMS using Page Type Builder: Metabolite Enterprise Libraries 1.2 Beta 2: This is the beta release of the Metabolite Enterprise Libraries 1.2 Beta 2 for use with EPiServer 6 and Page Type Builder 1.2 Beta 2.Microsoft Silverlight Analytics Framework: Version 1.4.3 Installer: Pre-release Installer for Visual Studio 2010 and Expression Blend 4 RCSupports both Silverlight 3 and Silverlight 4 Release NotesFixed null referen...MultipointTUIO: Multipoint SDK v1.5 Release: Rebuilt against v1.5 of the Microsoft Multipoint SDK, this mean Windows 7 support (and 64bit I think!)My Notepad: My Notepad: This is the status of My Notepad until now. This is many built in features but has to undergo a lot of modifications. The release does not include ...New Silverlight XPS Viewer (In Sl4): Silverlight XPS Viewer: Background: During my development last week I was working on a Silverlight based XPS viewer. During this viewer we came to a situation in which the...NSIS Autorun: NSIS Autorun 0.1.6: This release includes source code, executable binary, files and example materials.Open Diagram: Open Diagram 5.0 Beta May 2010: This is the first beta release of Open Diagram 5.0. Select Crainiate.Diagramming.Examples.Forms as the startup project to view the current Class D...Pocket Wiki: PC Wiki (zip) 1.0.1: PC Version of Pocket Wiki. Unzip and run. Requires .NET Framework 2.0Pocket Wiki: Pocket Wiki 1.0.1 (cab): Pocket Wiki cab installation - requires DotNet 2.0 or greater. Default wiki language is "slash" - a syntax I created that is easy to type on keyboa...Pocket Wiki: Pocket Wiki.sbp: Pocket Wiki Source Code (version .72) - Basic4PPCPublish to Photo Frame: 1.0.2.0: This version adds: add borders to portrait images, for photo frames that crop them incorrectly.Reflection Studio: Reflection Studio 0.1: First download release, it contains a lot of things but allways in beta version. Hope you will like the preview.SharePoint 2010 PowerShell Scripts & Utilities: PSSP2010 Utils 0.1: This is the initial release with SPInstallUtils.psm1 module. This module includes Get-SPPrerequisites and New-SPInstallPackage cmdlets. Refer to th...Silverlight 4.0 Popup Menu: Context Menu for Silverlight 4.0 v1.1 Beta: Multilevel menus are now supported. Added design time support for the PopupMenuItem elements. The project is now under Subversion.Silverlight flip-down counter: FlipDownCounter v1.0: The final release of the Silverlight flip-down counter. Please refer to the included readme file for information on how to use the counter.Stratosphere: Stratosphere 1.0.0.1: Moved scalable block file system implementation to Stratosphere.FileSystemSystem.AddIn Pipeline Builder: Pipeline Builder 1.2: Lots of improvements from the CTP, version 1.0: - Added dialogue for possible overwrite if the file has changed: possibility of ignoring changes (p...ThoughtWorks Cruise Notification Interceptor: 1.0.1: Fixed an issue with the regex that parses the incoming notification. This issue would send failure messages when the build was "fixed".ThreadSafeControls: ThreadSafeControls v0.1: This is the first binary release of the ThreadSafeControls library. I'll call it a pre-alpha release.TracerX Logger/Viewer for .NET: 4.0: View this CodeProject article for documentation on how to use the latest version of the Logger. About the DownloadsVersion: 4.0.1005.1163 Changese...VCC: Latest build, v2.1.30503.0: Automatic drop of latest buildVisual Studio DSite: Lottery Game (Visual C++ 2008): An advanced lottery game made in visual c 2008.VivoSocial: VivoSocial 7.1.3: Version 7.1.3 of VivoSocial has been released. If you experienced any issues with the previous version, please update your modules to the 7.1.3 rel...Xrns2XMod: Xrns2XMod 1.0: Features added Conversion of all possible convertible features between Renoise and MOD / XM. FlacBox lib updated (thanks to Yuri) NAudio lib in...Most Popular ProjectsRawrWBFS ManagerAJAX Control ToolkitMicrosoft SQL Server Product Samples: Databasepatterns & practices – Enterprise LibrarySilverlight ToolkitiTuner - The iTunes CompanionWindows Presentation Foundation (WPF)ASP.NETDotNetNuke® Community EditionMost Active ProjectsIonics Isapi Rewrite Filterpatterns & practices – Enterprise LibraryRawrHydroServer - CUAHSI Hydrologic Information System ServerAJAX Control Frameworkpatterns & practices: Azure Security GuidanceNB_Store - Free DotNetNuke Ecommerce Catalog ModuleBlogEngine.NETTinyProjectDambach Linear Algebra Framework

    Read the article

  • Correctly parsing an ATOM feed

    - by Joseph
    I currently have setup a Python script that uses feedparser to read a feed and parse it. However, I have recently come across a problem with the date parsing. The feed I am reading contains <modified>2010-05-05T24:17:54Z</modified> - which comes up in Python as a datetime object - 2010-05-06 00:17:54. Notice the discrepancy: the feed entry was modified on the 5th of may, while python reads it as the 6th. So the question is why this is happening. Is the ATOM feed (that is, the one who created the feed) wrong by putting the time as 24:17:54, or is my python script wrong in the way it treats it. And can I solve this?

    Read the article

  • SQL - Counting sets of Field-B values for each Field-A value

    - by potrnd
    Hello, First of all sorry that I could not think of a more descriptive title. What I want to do is the following using only SQL: I have some lists of strings, list1, list2 and list3. I have a dataset that contains two interesting columns, A and B. Column A contains a TransactionID and column B contains an ItemID. Naturally, there can be multiple rows that share the same TransactionIDs. I need to catch those transactions that have at least one ItemID in each and every list (list1 AND list2 AND list3). I also need to count how many times does that happen for each transaction. [EDIT] That is, count how many full sets of ItemIDs there are for each TransactionID", "Full Set" being any element of the list1 with any element of the list2 with any element of the list3 I hope that makes enough sense, perhaps I will be able to explain it better with a clear head. Thanks in advance

    Read the article

  • book on domain knowledge

    - by Newbie
    Is there any book that talks about domains i.e. financial , marketing, banking, telecom etc?. I am not talking about Domain Specific Languages(DSL) but only of domains. Thanks

    Read the article

  • How to get size of file in visual c++?

    - by karikari
    Below is my code. My problem is, my destination file always has a lot more strings than the originating file. Then, inside the for loop, instead of using i < sizeof more, I realized that I should use i < sizeof file2 . Now my problem is, how to get the size of file2? int i = 0; FILE *file2 = fopen(LOG_FILE_NAME,"r"); wfstream file3 (myfile, ios_base::out); // char more[1024]; char more[SIZE-OF-file2]; for(i = 0; i < SIZE-OF-file2 ; i++) { fgets(more, SIZE-OF-file2, file2); file3 << more; } fclose(file2); file3.close();

    Read the article

  • ASPNET MVC - Override Html.TextBoxFor(model.property) with a new helper with same signature?

    - by JK
    I want to override Html.TextBoxFor() with my own helper that has the exact same signature (but a different namespace of course) - is this possible, and if so, how? The reason for this is that I have 100+ views in an already existing app, and I want to change the behaviour of TextBoxFor so that it outputs a maxLength=n attribute if the property has a [StringLength(n)] annotation. The code for automatically outputting maxlength=n is in this question: http://stackoverflow.com/questions/2386365/maxlength-attribute-of-a-text-box-from-the-dataannotations-stringlength-in-mvc2. But my question is not a duplicate - I am trying creating a more generic solution: where the DataAnnotaion flows into the html automatically without any need for additional code by the person writing the view. In the referenced question, you have to change every single Html.TexBoxFor to a Html.CustomTextBoxFor. I need to do it so that the existing TextBoxFor()'s do not need to be changed - hence creating a helper with the same signature: change the behaviour of the helper method, and all existing instances will just work without any changes (100+ views, at least 500 TextBoxFor()s - don't want to manually edit that). I tried this code: (And I need to repeat it for each overload of TextBoxFor, but once the root problem is solved, that will be trivial) namespace My.Helpers { public static class CustomTextBoxHelper { public static MvcHtmlString TextBoxFor<TModel, TProperty>(this HtmlHelper<TModel> htmlHelper, Expression<Func<TModel, TProperty>> expression, object htmlAttributes, bool includeLengthIfAnnotated) { // implementation here } } } But I am getting a compiler error in the view on Html.TextBoxFor(): "The call is ambiguous between the following methods or properties" (of course). Is there any way to do this? Is there an alternative approach that would allow me to change the behaviour of Html.TextBoxFor, so that the views that already use it do not need to be changed?

    Read the article

  • certain BitMapData types dont work in a beginBitmapFill() method.

    - by numerical25
    Say I loaded a bitMap into a bitmapData type called tileImage. tileImage = Bitmap(loader.content).bitmapData; say I decided to add that bitmap into a sprite like below this.graphics.beginBitmapFill(tileImage ); this.graphics.drawRect(0, 0,tWidth ,tHeight ); It would of course work. But say If I decided to add tileImage into a another bitMapData type like below var tImage:BitmapData = new BitmapData(30,30); tImage.copyPixels(tileImage,tRect,tPoint); and I then added tImage to my sprite this.graphics.beginBitmapFill(tImage); this.graphics.drawRect(0, 0,tWidth ,tHeight ); I then get the following error ArgumentError: Error #2015: Invalid BitmapData. tRect and tPoint are all predefined and set. tRect x and y are 0,0 and the width and height are 30x30. tPoint is 0,0 as well. Yes I understand that this is a very brief explanation but I wanted to elaborate that a bitMapdata type that has its data from the copypixel method does not work with beginBitmapFill. but a varible that gets its data straigt from the source, does. One works, and one doesnt, yet they are both the same data types. why is this ?

    Read the article

  • LINQ to SQL Could not find key member. Only fails on server.

    - by Adam Carr
    I have a scenario where I am inheriting from an abstract class in my partial linq to sql auto generated class implementation. My base abstract class has an abstract property called ID which I have flagged inside my LINQ to SQL model with the instance modifier override. This works fine locally without any issues. I have also done some development on another machine and it works fine there too (both in VS2008 and using Subversion). I am running CI with TeamCity and the build succeeds and deploys as desired. The problem is when the server tries to hit the database for the first time via the LINQ to SQL data context, it generates the following error. "Could not find key member 'Id' of key 'Id' on type 'CustomType'. The key may be wrong or the field or property on 'CustomType' has changed names." I have tried changing my configuration by not implementing the Id field in my base class but this still fails. Why does it work on both of my DEV machines but not on the server? I am using LINQ to SQL in another project that runs on this server just fine. FYI: LINQ to SQL, SQL 2008, .NET 3.5, SERVER 2008, IIS 7.0 UPDATE I have gone back and added the same table a second time in the same data model but without a base class and have then displayed the results from that table and got no errors. This tells me it has something to do with my base abstract class and the need to flag a property on one of my linq to sql model classes (that belongs to a key relationship) with the instance modifier of override. No answer to this yet but am getting closer. UPDATE I have fixed my issue by simply changing my approach to my problem but I am still interested in why this doesn't work. I created a new WinSrv2008 VPC and patched it, deployed a pre-built version of my site to it and still got the same error. I now assume the issue is like what the person said here, a dependency issue with VS2008. My question is what or what? Will install VS2008 on the VPC to see if it works after that.

    Read the article

  • ASP.NET 2.0 and COM Port Communication

    - by theaviator
    ASP.NET 2.0 and COM Port Communication Hello Guys, I have a managed DLL which communicates with the devices attached on COM/Serial ports. The desktop Winforms application sends requests on ports and receives/stores data in memory. In Winforms app I have added a reference to DLL and I am using the methods. This works well. Now, there is a situation where I need to show this data from serial/com port on a web-page. And also users should be able to send requests to the ports using this DLL. I have made a web app in ASP.NET (2.0). Added a reference to the DLL. I am able to use this DLL, the DLL communicates on the COM upon button click on web-page and also the response is shown on web page. However I am not happy with the approach and strongly feel that this is a bad approach. Also the development server crashes after 3 -4 requests. What is the best approach in this scenario. If I use a windows service then how would my ASP.net app will communicate with the Weindows service. Or can this be easily done using WCF. I have not used WCF any time nor any of .net remoting technique. Please suggest me the best architecture in this scenario. Thank you

    Read the article

  • Programmatically adding a trusted cert in Java

    - by directedition
    I use SSL to communicate between two components written in Java. I can't use a CA, so I have to self-sign everything. Unfortunately, this means that when I try to handshake, I get a SunCertPathBuilderException. I can create my own X509TrustManager that just trusts everything, but that sort of defeats the purpose of having a signed cert. I would like, when first making the connection, to prompt the user with "SSL handshake with invalid cert. Add cert to store?" or something so they could have it added for them to their certificate store, like web browsers do at sites with invalid certs. I can find plenty of examples online of adding a cert to the store through the commandline, but I can't figure out how to do it programmatically. Is there a way to do this?

    Read the article

  • C#: Does an IDisposable in a Halted Iterator Dispose?

    - by James Michael Hare
    If that sounds confusing, let me give you an example. Let's say you expose a method to read a database of products, and instead of returning a List<Product> you return an IEnumerable<Product> in iterator form (yield return). This accomplishes several good things: The IDataReader is not passed out of the Data Access Layer which prevents abstraction leak and resource leak potentials. You don't need to construct a full List<Product> in memory (which could be very big) if you just want to forward iterate once. If you only want to consume up to a certain point in the list, you won't incur the database cost of looking up the other items. This could give us an example like: 1: // a sample data access object class to do standard CRUD operations. 2: public class ProductDao 3: { 4: private DbProviderFactory _factory = SqlClientFactory.Instance 5:  6: // a method that would retrieve all available products 7: public IEnumerable<Product> GetAvailableProducts() 8: { 9: // must create the connection 10: using (var con = _factory.CreateConnection()) 11: { 12: con.ConnectionString = _productsConnectionString; 13: con.Open(); 14:  15: // create the command 16: using (var cmd = _factory.CreateCommand()) 17: { 18: cmd.Connection = con; 19: cmd.CommandText = _getAllProductsStoredProc; 20: cmd.CommandType = CommandType.StoredProcedure; 21:  22: // get a reader and pass back all results 23: using (var reader = cmd.ExecuteReader()) 24: { 25: while(reader.Read()) 26: { 27: yield return new Product 28: { 29: Name = reader["product_name"].ToString(), 30: ... 31: }; 32: } 33: } 34: } 35: } 36: } 37: } The database details themselves are irrelevant. I will say, though, that I'm a big fan of using the System.Data.Common classes instead of your provider specific counterparts directly (SqlCommand, OracleCommand, etc). This lets you mock your data sources easily in unit testing and also allows you to swap out your provider in one line of code. In fact, one of the shared components I'm most proud of implementing was our group's DatabaseUtility library that simplifies all the database access above into one line of code in a thread-safe and provider-neutral way. I went with my own flavor instead of the EL due to the fact I didn't want to force internal company consumers to use the EL if they didn't want to, and it made it easy to allow them to mock their database for unit testing by providing a MockCommand, MockConnection, etc that followed the System.Data.Common model. One of these days I'll blog on that if anyone's interested. Regardless, you often have situations like the above where you are consuming and iterating through a resource that must be closed once you are finished iterating. For the reasons stated above, I didn't want to return IDataReader (that would force them to remember to Dispose it), and I didn't want to return List<Product> (that would force them to hold all products in memory) -- but the first time I wrote this, I was worried. What if you never consume the last item and exit the loop? Are the reader, command, and connection all disposed correctly? Of course, I was 99.999999% sure the creators of C# had already thought of this and taken care of it, but inspection in Reflector was difficult due to the nature of the state machines yield return generates, so I decided to try a quick example program to verify whether or not Dispose() will be called when an iterator is broken from outside the iterator itself -- i.e. before the iterator reports there are no more items. So I wrote a quick Sequencer class with a Dispose() method and an iterator for it. Yes, it is COMPLETELY contrived: 1: // A disposable sequence of int -- yes this is completely contrived... 2: internal class Sequencer : IDisposable 3: { 4: private int _i = 0; 5: private readonly object _mutex = new object(); 6:  7: // Constructs an int sequence. 8: public Sequencer(int start) 9: { 10: _i = start; 11: } 12:  13: // Gets the next integer 14: public int GetNext() 15: { 16: lock (_mutex) 17: { 18: return _i++; 19: } 20: } 21:  22: // Dispose the sequence of integers. 23: public void Dispose() 24: { 25: // force output immediately (flush the buffer) 26: Console.WriteLine("Disposed with last sequence number of {0}!", _i); 27: Console.Out.Flush(); 28: } 29: } And then I created a generator (infinite-loop iterator) that did the using block for auto-Disposal: 1: // simply defines an extension method off of an int to start a sequence 2: public static class SequencerExtensions 3: { 4: // generates an infinite sequence starting at the specified number 5: public static IEnumerable<int> GetSequence(this int starter) 6: { 7: // note the using here, will call Dispose() when block terminated. 8: using (var seq = new Sequencer(starter)) 9: { 10: // infinite loop on this generator, means must be bounded by caller! 11: while(true) 12: { 13: yield return seq.GetNext(); 14: } 15: } 16: } 17: } This is really the same conundrum as the database problem originally posed. Here we are using iteration (yield return) over a large collection (infinite sequence of integers). If we cut the sequence short by breaking iteration, will that using block exit and hence, Dispose be called? Well, let's see: 1: // The test program class 2: public class IteratorTest 3: { 4: // The main test method. 5: public static void Main() 6: { 7: Console.WriteLine("Going to consume 10 of infinite items"); 8: Console.Out.Flush(); 9:  10: foreach(var i in 0.GetSequence()) 11: { 12: // could use TakeWhile, but wanted to output right at break... 13: if(i >= 10) 14: { 15: Console.WriteLine("Breaking now!"); 16: Console.Out.Flush(); 17: break; 18: } 19:  20: Console.WriteLine(i); 21: Console.Out.Flush(); 22: } 23:  24: Console.WriteLine("Done with loop."); 25: Console.Out.Flush(); 26: } 27: } So, what do we see? Do we see the "Disposed" message from our dispose, or did the Dispose get skipped because from an "eyeball" perspective we should be locked in that infinite generator loop? Here's the results: 1: Going to consume 10 of infinite items 2: 0 3: 1 4: 2 5: 3 6: 4 7: 5 8: 6 9: 7 10: 8 11: 9 12: Breaking now! 13: Disposed with last sequence number of 11! 14: Done with loop. Yes indeed, when we break the loop, the state machine that C# generates for yield iterate exits the iteration through the using blocks and auto-disposes the IDisposable correctly. I must admit, though, the first time I wrote one, I began to wonder and that led to this test. If you've never seen iterators before (I wrote a previous entry here) the infinite loop may throw you, but you have to keep in mind it is not a linear piece of code, that every time you hit a "yield return" it cedes control back to the state machine generated for the iterator. And this state machine, I'm happy to say, is smart enough to clean up the using blocks correctly. I suspected those wily guys and gals at Microsoft engineered it well, and I wasn't disappointed. But, I've been bitten by assumptions before, so it's good to test and see. Yes, maybe you knew it would or figured it would, but isn't it nice to know? And as those campy 80s G.I. Joe cartoon public service reminders always taught us, "Knowing is half the battle...". Technorati Tags: C#,.NET

    Read the article

  • Transparent proxying in MacOS X 10.6 Snow Leopard (and maybe FreeBSD)

    - by apenwarr
    I'm trying to create a transparent proxy on my MacOS machine in order to port the sshuttle ssh-based transproxy VPN from Linux. I think I almost have it working, but sadly, almost is not 100%. Short version is this. In one window, start something that listens on port 12300: $ while :; do nc -l 12300; done Now enable proxying: # sysctl -w net.inet.ip.forwarding=1 # sysctl -w net.inet.ip.fw.enable=1 # ipfw add 1000 fwd 127.0.0.1,12300 log tcp from any to any And now test it out: $ telnet localhost 9999 # any port number will do # this works; type stuff and you'll see it in the nc window $ telnet google.com 80 # any host/port will do # this *doesn't* work! After the latter experiment, I see lines like this in netstat: $ netstat -tn | grep ^tcp4 tcp4 0 0 66.249.91.104.80 192.168.1.130.61072 SYN_RCVD tcp4 0 0 192.168.1.130.61072 66.249.91.104.80 SYN_SENT The second socket belongs to my telnet program; the first is more suspicious. SYN_RCVD implies that my SYN packet was correctly captured by the firewall and taken in by the kernel, but apparently the SYNACK was never sent back to telnet, because it's still in SYN_SENT. On the other hand, if I kill the nc server, I get this: $ telnet google.com 80 Trying 66.249.81.104... telnet: connect to address 66.249.81.104: Connection refused telnet: Unable to connect to remote host ...which is as expected: my proxy server isn't running, so ipfw redirects my connection to port 12300, which has nobody listening on it, ie. connection refused. My uname says this: $ uname -a Darwin mean.local 10.2.0 Darwin Kernel Version 10.2.0: Tue Nov 3 10:37:10 PST 2009; root:xnu-1486.2.11~1/RELEASE_I386 i386 Does anybody see any different results? (I'm especially interested in Snow Leopard vs Leopard results, as there seem to be some internet rumours that transproxy is broken in Snow Leopard version) Any advice for how to fix?

    Read the article

  • When trying to copy a virtual disk in VMware vSphere client, I get an errror.

    - by Zak
    I'm pretty new to all the VMware world, so this is probably mainly a question about the right set of documentation to look at. I'm trying to clone/copy a VM that I installed on an ESXi installation. I was trying to follow along with the top example here: http://serverfault.com/questions/16320/is-there-a-way-to-clone-an-existing-vm-on-an-esxi-server-without-having-to-re-imp However, I'm using the vSphere client to connect to the ESXi box and manage it, and the vSphere client is telling me it won't let me rename the vmdk file. The real answer I want is how do I clone the VM I installed if I want to spin up 5 copies. Is there another utility I can use to copy the vmdk file, then create a new virtual machine using it? Any idea why they nerfed the feature in vSphere client?

    Read the article

  • Is there a global inbox for android?

    - by Loony2nz
    I'm a Blackberry fan and I have been aching to get a phone with a better UI (and not the jesusPhone). I was looking at the Android platform and find it quite fun to play with. However, one of the crucial elements of my BB that I love to death is the global inbox of all my email accounts. (not to mention the BB messenger, but I can live without that). Is there an addon or does the android have this feature natively? I played with my friend's Verizon Droid, and she couldn't tell me. Thanks!

    Read the article

  • Retrieving top 50 rows from Table using LINQ

    - by James
    Hey, Am new to LINQ, and am trying to retrieve the top 50 rows of a particular table. In SQL Server using an actual query i coudl say "Select TOP 50 from Transactions" , but not sure how i need to do that with LinQ Any pointers that could help ? Thanks !

    Read the article

  • Replay attacks for HTTPS requests

    - by MatthewMartin
    Let's say a security tester uses a proxy, say Fiddler, and records an HTTPS request using the administrator's credentials-- on replay of the entire request (including session and auth cookies) the security tester is able to succesfully (re)record transactions. The claim is that this is a sign of a CSRF vulnerability. What would a malicious user have to do to intercept the HTTPS request and replay it? It this a task for script kiddies, well funded military hacking teams or time-traveling-alien technology? Is it really so easy to record the SSL sessions of users and replay them before the tickets expire? No code in the application currently does anything interesting on HTTP GET, so AFAIK, tricking the admin into clicking a link or loading a image with a malicious URL isn't an issue.

    Read the article

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