Search Results

Search found 2587 results on 104 pages for 'alex chen'.

Page 9/104 | < Previous Page | 5 6 7 8 9 10 11 12 13 14 15 16  | Next Page >

  • Get status of servlet request before the response is returned

    - by Alex
    Good evening, I am in the process of writing a Java Servlet (Struts 2, Tomcat, JSP etc) which is capable of doing some fairly complex simulations. These can take up to 2 minutes to complete on the and will return a graph of the results. It is trivial to calculate the percentage of the simulation completed because the process works by repeating the same calculations 1000s of times. I would be interested to know if anyone has ever tried to use client side technology to provide any estimate of the percentage complete. I.e query the servlet processing to get the number of cycles completed at various point throughout the simulation. This could then be displayed as a bar in the client browser. Any thoughts, advice, resources would be much appreciated. Thanks, Alex

    Read the article

  • WCF high instance count: anyone knows negative sideffects?

    - by Alex
    Hi there! Did anyone experience or know of negative side effects from having a high service instance count like 60k? Aside from the memory consumption of course. I am planning to increase the threshold for the maximum allowed instance count in our production environments. I am basically sick of severe production incidents just because "something" forgot to close a proxy properly. I plan to go to something like 60k instances which will allow the service to survive using default session timeouts at a call rate average for our clients. Thanks, Alex

    Read the article

  • What is the difference between MVC model 1 and model 2?

    - by Alex Ciminian
    I've recently discovered that MVC is supposed to have two different flavors, model one and model two. I'm supposed to give a presentation on MVC1 and I was instructed that "it's not the web based version, that is refered to as MVC2". As the presentations are about design patterns in general, I doubt that this separation is related to Java (I found some info on Sun's site, but it seemed far off) or ASP. I have a pretty good understanding of what MVC is and I've used several (web) frameworks that enforce it, but this terminology is new to me. How is the web-based version different from other MVC (I'm guessing GUI) implementations? Does it have something to do with the stateless nature of HTTP? Thanks, Alex

    Read the article

  • "Circuit breaker" for net.msmq?

    - by Alex
    Hi, The Circuit Breaker pattern, from the book Release It!, protects a service from requests while it is failing (or recovering). The net.msmq binding used with transactions give us nice retry and poison message capabilities. But I am missing the implementation of such a "Circuit breaker" pattern. A service is put under even heavier load by retries while it is already in a failure condition (like DB connectivity issues causing loads of blocked threads etc.). Anyone knows about a behavior extension or similar that explicitly closes the service host when defined failure thresholds have been exceeded? Cheers, Alex

    Read the article

  • Template engine recommendations

    - by alex
    I'm looking for a template engine. Requirements: Runs on a JVM. Java is good; Jython, JRuby and the like, too... Can be used outside of servlets (unlike JSP) Is flexible wrt. to where the templates are stored (JSP and a lot of people require the templates to be stored in the FS). It should provide a template loading interface which one can implement or something like that Easy inclusion of parameterized templates- I really like JSP's tag fragments Good docs, nice code, etc., the usual suspects I've looked at JSP- it's nearly perfect except for the servlet and filesystem coupling, Stringtemplate- I love the template syntax, but it fails on the filesystem coupling, the documentation is lacking and template groups and stuff are confusing, GXP, TAL, etc. Ideas, thoughts? Alex

    Read the article

  • Silverlight Cream for November 26, 2011 -- #1175

    - by Dave Campbell
    In this Issue: Michael Washington, Manas Patnaik, Jeff Blankenburg, Doug Mair, Jon Galloway, Richard Bartholomew, Peter Bromberg, Joel Reyes, Zeben Chen, Navneet Gupta, and Cathy Sullivan. Above the Fold: Silverlight: "Using ASP.NET PageMethods With Silverlight" Peter Bromberg WP7: "Leveraging Background Services and Agents in Windows Phone 7 (Mango)" Jon Galloway Metro/WinRT/Windows8: "Debugging Contracts using Windows Simulator" Cathy Sullivan LightSwitch: "LightSwitch: It Is About The Money (It Is Always About The Money)" Michael Washington Shoutouts: Michael Palermo's latest Desert Mountain Developers is up Michael Washington's latest Visual Studio #LightSwitch Daily is up From SilverlightCream.com:LightSwitch: It Is About The Money (It Is Always About The Money)Michael Washington has a very nice post up about LightSwitch apps in general and his opinion about the future use... based on what he and I have been up to, I tend to agree on all counts!Accessing Controls from DataGrid ColumnHeader – SilverlightManas Patnaik's latest post is about using the VisualTreeHelper class to iterate through the visual tree to find the controls you need ... including sample code31 Days of Mango | Day #18: Using Sample DataJeff Blankenburg's Day 18 in his 31-Day Mango quest is on Sample Data using Expression Blend, and he begins with great links to his other Blend posts followed by a nice sample data tutorial and source31 Days of Mango | Day #19: Tilt EffectsDoug Mair returns to the reigns of Jeff's 31-Days series with number 19 which is all about Tilt Effects ... as seen in the Phone application when you select a user... Doug shows how to add this effect to your appLeveraging Background Services and Agents in Windows Phone 7 (Mango)Jon Galloway has a WP7 post up discussing Background Services and how they all fit together... he's got a great diagram of that as an overview then really nice discussion of each followed up by his slides from DevConnections, and codeNetflix on Windows 8This one isn't C#/XAML, but Richard Bartholomew has a Netflix on Windows 8 app running that bears noticeUsing ASP.NET PageMethods With SilverlightPeter Bromberg has a post up demonstrating calling PageMethods from a Silverlight app using the ScriptManager controlAWESOME Windows Phone Power ToolJoel Reyes announced the release of a full-featured tool for side-loading apps to your WP7 device... available at codeplexMicrosoft Windows Simulator Rotation and Resolution EmulationZeben Chen discusses the Windows 8 Simulator a bit deeper with this code-laden post showing how to look at roation and orientation-aware apps and resolution.First look at Windows SimulatorNavneet Gupta has a great into post to using the simulator in VS2011 for Windows 8 apps. Four things you really need this for: Touch Emulation, Rotation, Different target resolutions, and ContractsDebugging Contracts using Windows SimulatorCathy Sullivan shows how to debug W8 Contracts in VS2011... why you ask? because when you hit one in the debugger, the target app disappears.. but enter the simulator... check it outStay in the 'Light!Twitter SilverlightNews | Twitter WynApse | WynApse.com | Tagged Posts | SilverlightCreamJoin me @ SilverlightCream | Phoenix Silverlight User GroupTechnorati Tags:Silverlight    Silverlight 3    Silverlight 4    Windows PhoneMIX10

    Read the article

  • Google I/O 2012 - Advancing Accessibility for the Web

    Google I/O 2012 - Advancing Accessibility for the Web Rachel Shearer, Dominic Mazzoni, Charles Chen This session will help you learn through code samples and real world examples how to design and test your web apps for complete accessibility coverage. We will review APIs such as the Text-to-speech (TTS) API, tools like ChromeVox and ChromeShades and how Google products implement solutions today for users with disabilities. For all I/O 2012 sessions, go to developers.google.com From: GoogleDevelopers Views: 61 3 ratings Time: 55:25 More in Science & Technology

    Read the article

  • Meet the WebCenter Product Marketing Team!

    - by Kellsey Ruppel
    As we wrap up this week recapping all the great things that happened at Oracle OpenWorld, we thought we'd share with our community the faces behind this blog and the Oracle WebCenter Product Marketing team! With the majority of the team working remotely, OpenWorld is the one time we are all together for an entire week. L to R: Lance Shaw (WebCenter Content), Christie Flanagan (WebCenter Sites), Peggy Chen (leads WebCenter product marketing), Kellsey Ruppel (WebCenter Portal & Oracle Social Network), & Michael Snow (WebCenter Suite).

    Read the article

  • Raiders of the Lost iPhone

    <b>MacNewsWorld:</b> "Will Gizmodo's Jason Chen land in the cooler for his part in leaking Apple's next-gen iPhone to the world? Or did Silicon Valley's High Tech Task Force violate legal protections established to shield journalists when they raided the editor's home?"

    Read the article

  • How to Evict a Failed Node and Add it Back to SQL Server 2005 Cluster

    Adding and removing nodes in SQL Server Clusters is not so difficult, and instructions on how to do so abound on the internet. However, mismanagement when adding/removing nodes can quickly become a 'gotcha' that wastes time. Bo Chen offers insight into some of those scenarios that are not normally covered in the standard online documents.

    Read the article

  • How to Evict a Failed Node and Add it Back to SQL Server 2005 Cluster

    Adding and removing nodes in SQL Server Clusters is not so difficult, and instructions on how to do so abound on the internet. However, mismanagement when adding/removing nodes can quickly become a 'gotcha' that wastes time. Bo Chen offers insight into some of those scenarios that are not normally covered in the standard online documents.

    Read the article

  • Sector bancario, un reto de transformación tecnológica

    - by Fabian Gradolph
    El sector financiero se encuentra en un momento clave. No sólo por la coyuntura económica actual, sino también por cuestiones estructurales y normativas que obligan a las entidades bancarias -normalmente a la cabeza de la innovación tecnológica, por cierto- a seguir dando pasos hacia el futuro, manteniendo la tecnología en el corazón de su estrategia de negocio. Así se ha puesto de manifiesto en el encuentro que se ha celebrado hoy en Madrid: Oracle in Banking, donde expertos de Oracle, clientes de la compañía y analistas han puesto sobre la mesa algunos de los desafíos a los que se enfrenta el sector e ideas para aprovechar al máximo la tecnología en la resolución de estos desafíos. El evento ha sido todo un éxito, con asistencia masiva de clientes y partners. En la imagen que ilustra este artículo pueden verse, por este orden: una panorámica de la sala, Modesto Villajos, Regional Sales Manager de Oracle, quien ejerció de maestro de ceremonias. Leopoldo Boado, Country Manager de Oracle España, quien realizó la introducción, Alex Kwiatkowski, de IDC, quien expuso los prinicipales desafíos a los que se enfrenta la banca, y Máximo Díez, Senior Director Financial Services de Oracle, que planteó las diferentes estrategias de transformación que pueden emprender los bancos. El evento se completó con intervenciones de clientes de Oracle (Banco Espírito Santo -BES- de Portugal; y BBVA, de España), y presentaciones y demostraciones técnicas.  De particular interés fue la intervención de Alex Kwiatkowski. De acuerdo con su punto de vista hay cuatro áreas esenciales a las que se enfrenta el sector. La primera de ellas es el marco regulatorio. El sector financiero está sometido a una constante presión normativa (probablemente acrecentada en estos tiempos de incertidumbre), no sólo a nivel nacional, sino también a nivel europeo y global. El cumplimiento exquisito de todas estas normas es esencial para el buen funcionamiento del sistema. La segunda área crítica es la necesidad de ofrecer una experiencia de usuario multicanal satisfactoria, de forma que se potencie la retención de clientes. A veces es difícil darnos cuenta, pero hoy en día nuestras interacciones con el banco han alcanzado una gran diversidad de canales (sucursal, ATM, Internet, banca telefónica, banca móvil...). Esto supone un permanente desafío tecnológico y de procesos para las entidades financieras. El tercer elemento crítico es el del incremento de la eficiencia de las operaciones, manteniendo los costes bajo control o incluso reduciéndolos aún más. Por último, las entidades bancarias tienen ante sí el reto de encontrar nuevas fuentes de ingresos, de forma que el foco deje de estar únicamente en la reducción de costes y la minimización de riesgos. Lo cierto es que en la actualidad, la atención principal se centra en estos dos puntos, pero como mencionó Alex Kwiatkowski "los CIO`s de los bancos se van a plantar en la mesa del CEO con la necesidad de realizar renovaciones completas de los sistemas de core banking y la necesidad de invertir en el desarrollo de nuevos canales". Máximo Díez también enfatizó esta necesidad en su presentación. Los bancos tienen la obligación de econtrar nuevas fórmulas para impulsar el crecimiento, pero la implementación de estrategias en este sentido presenta fuertes desafíos a causa de las limitaciones de los sistemas IT existentes. No hay duda de que se presenta un futuro muy interesante en el ámbito tecnológico para el sector financiero. Lo que Oracle puede hacer y ofrece a las entidades financieras puede encontrarse en este enlace: Financial Services.

    Read the article

  • Silverlight Cream for February 21, 2011 -- #1049

    - by Dave Campbell
    In this Issue: Rob Eisenberg(-2-), Gill Cleeren, Colin Eberhardt, Alex van Beek, Ishai Hachlili, Ollie Riches, Kevin Dockx, WindowsPhoneGeek(-2-), Jesse Liberty(-2-), and John Papa. Above the Fold: Silverlight: "Silverlight 4: Creating useful base classes for your views and viewmodels with PRISM 4" Alex van Beek WP7: "Google Sky on Windows Phone 7" Colin Eberhardt Shoutouts: My friends at SilverlightShow have their top 5 for last week posted: SilverlightShow for Feb 14 - 20, 2011 From SilverlightCream.com: Rob Eisenberg MVVMs Us with Caliburn.Micro! Rob Eisenberg chats with Carl and Richard on .NET Rocks episode 638 about Caliburn.Micro which takes Convention-over-Configuration further, utilizing naming conventions to handle a large number of data binding, validation and other action-based characteristics in your app. Two Caliburn Releases in One Day! Rob Eisenberg also announced that release candidates for both Caliburn 2.0 and Caliburn.Micro 1.0 are now available. Check out the docs and get the bits. Getting ready for Microsoft Silverlight Exam 70-506 (Part 6) Gill Cleeren has Part 6 of his series on getting ready for the Silverlight Exam up at SilverlightShow.... this time out, Gill is discussing app startup, localization, and using resource dictionaries, just to name a few things. Google Sky on Windows Phone 7 Colin Eberhardt has a very cool WP7 app described where he's using Google Sky as the tile source for Bing Maps, and then has a list of 110 Messier Objects.. interesting astronomical objects that you can look at... all with source! Silverlight 4: Creating useful base classes for your views and viewmodels with PRISM 4 Alex van Beek has some Prism4/Unity MVVM goodness up with this discussion of a login module using View and ViewModel base classes. Windows Phone 7 and WCF REST – Authentication Solutions Ishai Hachlili sent me this link to his post about WCF REST web service and authentication for WP7, and he offers up 2 solutions... from the looks of this, I'm also putting his blog on my watch list WP7Contrib: Isolated Storage Cache Provider Ollie Riches has a complete explanation and code example of using the IsolatedStorageCacheProvider in their WP7Contrib library. Using a ChannelFactory in Silverlight, part two: binary cows & new-born calves Kevin Dockx follows-up his post on Channel Factories with this part 2, expanding the knowledge-base into usin parameters and custom binding with binary encoding, both from reader suggestions. All about UriMapping in WP7 WindowsPhoneGeek has a post up about URI mappings in WP7 ... what it is, how to enable it in code behind or XAML, then using it either with a hyperlink button or via the NavigationService class... all with code. Passing WP7 Memory Consumption requirements with the Coding4Fun MemoryCounter tool WindowsPhoneGeek's latest is a tutorial on the use of the Memory Counter control from the Coding4Fun toolkit and WP7 Memory consumption. Getting Started With Linq Jesse Liberty gets into LINQ in his Episode 33 of his WP7 'From Scratch' series... looks like a good LINQ starting point, and he's going to be doing a series on it. Linq with Objects In his second post on LINQ, Jesse Liberty is looking at creating a Linq query against a collection of objects... always good stuff, Jesse! Silverlight TV Silverlight TV 62: The Silverlight 5 Triad Unplugged John Papa is joined by Sam George, Larry Olson, and Vijay Devetha (the Silverlight Triad) on this Silverlight TV episode 62 to discuss how the team works together, and hey... they're hiring! Stay in the 'Light! Twitter SilverlightNews | Twitter WynApse | WynApse.com | Tagged Posts | SilverlightCream Join me @ SilverlightCream | Phoenix Silverlight User Group Technorati Tags: Silverlight    Silverlight 3    Silverlight 4    Windows Phone MIX10

    Read the article

  • Automated Error Reporting = More Robust Software

    - by Laila
    I would like to tell you how to revolutionize your software development process </marketing hyperbole> On a more serious note, we (Red Gate's .NET Development team) recently rolled a new tool into our development process which has made our lives dramatically easier AND improved the quality of our software, and I (& one of our developers, Alex Davies) just wanted to take a quick moment to share the love. I work with a development team that takes pride in what they ship, so we take software testing rather seriously. For every development project we run, we allocate at least one software tester for every two developers, and we never ship software without first shipping early access releases and betas to get user feedback. And therein lies the challenge -encouraging users to provide consistent, useful feedback is a headache, but without that feedback, improving the software is. tricky. Until fairly recently, we used the standard (if long-winded) approach of receiving bug reports of variable quality via email or through our support forums. If that didn't give us enough information to reproduce the problem - which was most of the time - we had to enter into a time-consuming to-and-fro conversation with the end-user, to get scrape together the data we needed to work out where the problem lay. As I'm sure you're aware, this is painfully slow. To the delight of the team, we recently got to work with SmartAssembly, which lets us embed automated exception and error reporting into our software with very little pain, and we decided to do a little dogfooding. As a result, we've have made a really handy (if perhaps slightly obvious) discovery: As soon as we release a beta, or indeed any release of software, we now get tonnes of customer feedback through automated error reports. Making this process easier for our users has dramatically increased the amount (and quality) of feedback we get. From their point of view, they get an experience similar to Microsoft's error reporting, and process is essentially idiot-proof. From our side of things, we can now react much faster to the information we get, fixing the bugs and shipping a new-and-improved release, which our users rather appreciate. Smiles and hugs all round. Even more so because, as we're use SmartAssembly's Automated Error Reporting, we get to avoid having to spend weeks building an exception reporting mechanism. It takes just a few minutes to add reporting to a project, and we get a bunch of useful information back, like a stack trace and the values of all the local variables, which we can use to fix bugs. Happily, "Automated Error Reporting = More Robust Software" can actually be read two ways: we've found that we not only ship higher quality software, but we also release within a shorter time. We can ship stable software that our users are happy to upgrade to, and we then bask in the glory of lots of positive customer feedback. Once we'd starting working with SmartAssembly, we were curious to know how widespread error reporting was as a practice. Our product manager ran a survey in autumn last year, and found that 40% of software developers never really considered deploying error reporting. Considering how we've now got plenty of experience on the subject, one of our dev guys, Alex Davies, thought we should share what we've learnt, and he's kindly offered to host a webinar on delivering robust software with Automated Error Reporting. Drawing on our own in-house development experiences, he'll cover how to add error reporting to your program, how to actually use the error reports to fix bugs (don't snigger, not everyone's as bright as you), how to customize the error report dialog that your users see, and how to automatically get log files from your users' machine. The webinar will take place on Jan 25th (that's next week). It's free to attend, but you'll still need to register to hear Alex's dulcet tones.

    Read the article

  • Vaadin table hide columns and container customization

    - by Alex
    Hello I am testing a project, using Vaadin and Hibernate. I am trying to use the HbnContainer class to show data into table. The problem is that I do not want to show all the properties of the two classes in the table. For example: @Entity @Table(name="users") class User { @Id @GeneratedValue(strategy=GenerationType.AUTO) private Long id; private String name; @ManyToOne(cascade=CascadeType.PERSIST) private UserRole role; //getters and setters } and a second class: @Entity @Table(name="user_roles") class UserRole { @Id @GeneratedValue(strategy=GenerationType.AUTO) private Long id; private String name; //getters and setters } Next, I retrieve my data using the HbnContainer, and connect it to the table: HbnContainer container = new HbnContainer(User.class, app); table.setContainerDataSource(container); The Table will only display the columns from User, and for the "role" it will put the role id instead. How can I hide that column, and replace it with the UserRole.name ? I managed to use a ColumnGenerator() to get the string value in the table, for the UserRole - but I couldn't remove the previous column, with the numerical value. What am I missing? Or, what is the best way to "customize" your data, before displaying a table (if i want to show data in a table from more than one object type.. what do I do?) If I can't find a simple solution soon, I think I will just build the tables "by hand".. So, any advice on this matter? Thank you, Alex

    Read the article

  • Programmatically convert *.odt file to MS Word *.doc file using an OpenOffice.org basic macro

    - by Chen Levy
    I am trying to build a reStructuredText to MS Word document tool-chain, so I will be able to save only the rst sources in version control. So far I -- Have rst2odt.py to convert reStructuredText to OpenOffice.org Writer format. Next I want to use the most recent OpenOffice.org (currently 3.1) that do a pretty decent work of generating a Word 97/2000/XP document, so I wrote the macro: sub ConvertToWord(file as string) rem ---------------------------------------------------------------------- rem define variables dim document as object dim dispatcher as object rem ---------------------------------------------------------------------- rem get access to the document document = ThisComponent.CurrentController.Frame dispatcher = createUnoService("com.sun.star.frame.DispatchHelper") rem ---------------------------------------------------------------------- dim odf(1) as new com.sun.star.beans.PropertyValue odf(0).Name = "URL" odf(0).Value = "file://" + file + ".odt" odf(1).Name = "FilterName" odf(1).Value = "MS Word 97" dispatcher.executeDispatch(document, ".uno:Open", "", 0, odf()) rem ---------------------------------------------------------------------- dim doc(1) as new com.sun.star.beans.PropertyValue doc(0).Name = "URL" doc(0).Value = "file://" + file + ".doc" doc(1).Name = "FilterName" doc(1).Value = "MS Word 97" dispatcher.executeDispatch(document, ".uno:SaveAs", "", 0, doc()) end sub But when I executing it: soffice "macro:///Standard.Module1.ConvertToWord(/path/to/odt_file_wo_ext)" I get a: "BASIC runtime error. Property or method not found." message On the line: document = ThisComponent.CurrentController.Frame And when I comment that line, the above invocation complete without error, but do nothing. I guess I need to somehow set the value of document to a newly created instance, but I don't know how to do it. Or am I going at it at a completely backward way? P.S. I will consider JODConverter as a fallback, because I try to minimize my dependencies.

    Read the article

  • Any recommended java profiling tutorial?

    - by Wing C. Chen
    Is there any recommended java application profiling tutorial? I am now using jProfiler and eclipse TPTP with my profiling. However, although equipped with wonderful weapons, as a newbie in java profiling, I am still missing the general theory and skill in pinpointing the bottleneck. So would you please provide me with some recommended tutorial for java profiling?

    Read the article

  • reStructuredText tool support

    - by Chen Levy
    I love reStructuredText, however the tools that support it are scattered all over the Internet. The official tool list is incomplete and/or outdated, and can be updated only via commit privileges. For some time there was a comprehensive list at the Wikipedia reStructuredText page, but this apparently "may not meet the notability guideline for web content" and is scheduled for removal. So to put it in a question form: What tool support can one expect to find when working with reStructuredText, e.g. text editors, Wiki software, converters to and from reStructuredText etc.?

    Read the article

  • actionscript swf: why the swf is cached in one web server

    - by Bin Chen
    Hi, I have one swf and a program to load this swf. The swf is put in a server. I encounter a weird problem that if I put this swf in serverA, each time my program will issue a http request to that webserver(with 304 response). But when I move the swf from serverA to serverB, some weird things happen, the progrom will only issue the first time http request, and after that, it didn't send any http request, it looks like it uses the cache in the disk. I wonder is how can I configure serverA make the behavior the same as serverB, as I guess the problem may exists in the http response that make the program not retrieving the swf from serverB any more. Bin

    Read the article

  • Spring MVC - Cannot map request parameters as a Map parameter in method?

    - by Ken Chen
    What I want to do is passing a map to the method in Controller using @RequestParam, but it seems not working. While this is working in Struts 2. Below is what I am trying: In JSP using JQuery: var order = {}; order['seq'] = "ASC"; var criteria = {}; criteria['label'] = "Directory"; $.post(context + 'menu/list', {"orders" : order, "criterias" : criteria} The parameters I am trying to post is an 'map' object order and criteria for listing menu. In Java: @RequestMapping("/{collection}/list") public @ResponseBody Map<String, ? extends Object> list(@PathVariable String collection, @RequestParam("criterias") Map<String, String> criteria, @RequestParam("orders") Map<String, String> order) { However, when I print out the map criteria & order in Java, it takes all value as below: Criteria: {criterias[label]=Directory, orders[seq]=ASC} Order: {criterias[label]=Directory, orders[seq]=ASC} Can @RequestParam in Spring be used to init a Map parameter?

    Read the article

  • How to compile and build C# projects with Ant and Mono?

    - by Wing C. Chen
    I am currently working on a project with both java and C# codes within. Java takes the major role in this project. However, C# still takes a small part in it. I am using Ant to build the projects, and would very much like to use it to build C# too. I have learned that it's possible to build C# under Ant with the help of Mono. Can anybody provide any link of tutorial or guidance here? I was trying to google for it. But I haven't found any comprehensive data.

    Read the article

  • Whats wrong with my triple DES wrapper??

    - by Chen Kinnrot
    it seems that my code adds 6 bytes to the result file after encrypt decrypt is called.. i tries it on a mkv file.. please help here is my code class TripleDESCryptoService : IEncryptor, IDecryptor { public void Encrypt(string inputFileName, string outputFileName, string key) { EncryptFile(inputFileName, outputFileName, key); } public void Decrypt(string inputFileName, string outputFileName, string key) { DecryptFile(inputFileName, outputFileName, key); } static void EncryptFile(string inputFileName, string outputFileName, string sKey) { var outFile = new FileStream(outputFileName, FileMode.OpenOrCreate, FileAccess.ReadWrite); // The chryptographic service provider we're going to use var cryptoAlgorithm = new TripleDESCryptoServiceProvider(); SetKeys(cryptoAlgorithm, sKey); // This object links data streams to cryptographic values var cryptoStream = new CryptoStream(outFile, cryptoAlgorithm.CreateEncryptor(), CryptoStreamMode.Write); // This stream writer will write the new file var encryptionStream = new BinaryWriter(cryptoStream); // This stream reader will read the file to encrypt var inFile = new FileStream(inputFileName, FileMode.Open, FileAccess.Read); var readwe = new BinaryReader(inFile); // Loop through the file to encrypt, line by line var date = readwe.ReadBytes((int)readwe.BaseStream.Length); // Write to the encryption stream encryptionStream.Write(date); // Wrap things up inFile.Close(); encryptionStream.Flush(); encryptionStream.Close(); } private static void SetKeys(SymmetricAlgorithm algorithm, string key) { var keyAsBytes = Encoding.ASCII.GetBytes(key); algorithm.IV = keyAsBytes.Take(algorithm.IV.Length).ToArray(); algorithm.Key = keyAsBytes.Take(algorithm.Key.Length).ToArray(); } static void DecryptFile(string inputFilename, string outputFilename, string sKey) { // The encrypted file var inFile = File.OpenRead(inputFilename); // The decrypted file var outFile = new FileStream(outputFilename, FileMode.OpenOrCreate, FileAccess.ReadWrite); // Prepare the encryption algorithm and read the key from the key file var cryptAlgorithm = new TripleDESCryptoServiceProvider(); SetKeys(cryptAlgorithm, sKey); // The cryptographic stream takes in the encrypted file var encryptionStream = new CryptoStream(inFile, cryptAlgorithm.CreateDecryptor(), CryptoStreamMode.Read); // Write the new unecrypted file var cleanStreamReader = new BinaryReader(encryptionStream); var cleanStreamWriter = new BinaryWriter(outFile); cleanStreamWriter.Write(cleanStreamReader.ReadBytes((int)inFile.Length)); cleanStreamWriter.Close(); outFile.Close(); cleanStreamReader.Close(); } }

    Read the article

< Previous Page | 5 6 7 8 9 10 11 12 13 14 15 16  | Next Page >