Coolthing Of Theday

  • Subscribe to our RSS feed.
  • Twitter
  • StumbleUpon
  • Reddit
  • Facebook
  • Digg

Thursday, 5 December 2013

Free Export DataSet/DataTable/List<t> to Excel (without using or even having Excel installed)

Posted on 17:51 by Unknown

Code Project - A free "Export to Excel" C# class, using OpenXML

It's amazing that even now, in 2013, there are so many developers still asking for help on how to write C# and VB.Net code, to export their data to Excel.

Even worse, a lot of them will stumble on articles suggesting that they should write their data to a comma-separated file, but to give the file an .xls extension.

So, today, I'm going to walkthrough how to use my C# "Export to Excel" class, which you can add to your C# WinForms / WPF / ASP.Net application, using one line of code.

Depending on whether your data is stored in a DataSet, DataTable or List<>, you simply need to call one of these three functions, and tell them what (Excel) filename you want to write to.

  • public static bool CreateExcelDocument<T>(List<T> list, string ExcelFilename
  • public static bool CreateExcelDocument(DataTable dt, string ExcelFilename
  • public static bool CreateExcelDocument(DataSet ds, string ExcelFilename)

...

And that's all you have to do. The CreateExcelDocument function will create a "real" Excel file for you.

For example, if you had a created a DataSet containing three DataTables called

  • Drivers
  • Vehicles,
  • Vehicle Owners,

..then here's what your Excel file would look like. The class would create one worksheet per DataTable, and each worksheet would contain the data from that DataTable.

image

...

Look, friends don't let friends use Office InterOp... (omg, especially for server/automated ops!). There are any number of options now available, many free or reasonably priced. Just... don't.... do... it...

Read More
Posted in C#, Development, MicrosoftOffice, OpenXML | No comments

wxHexEditor, your new large, 16EBs (exabytes) large, file editor?

Posted on 17:42 by Unknown

beta news - Open files of any size with wxHexEditor

The PC world has plenty of hex editors; does it really need another? Our first thought was probably not, but that was before we’d spent a little time with the fast, feature-packed and extremely capable wxHexEditor.

Some hex editors have annoying limits on file sizes, for instance. But not this one. WxHexEditor can handle files up to 2^64 in size, that’s 16 billion gigabytes, which will probably be enough for the foreseeable future.

...

There are plenty of other interesting options hidden away in the menus. We found tools to compare two files and highlight the differences; calculate a host of checksums (MDx, SHAx, RipeMDx, HAVALx, TIGERx and more) for any given view; back up, restore or erase the contents of any device.

...

wxHexEditor

image

...

WxHexEditor isn't limited to files. Click Devices > Open Disk Device and you can also open one of your drives and browse through its sectors. (Try running the program as an administrator if a particular drive isn't listed.)

Whatever you've opened, wxHexEditor allows you to view its contents. You can search for text or hex values, manually edit bytes or run search and replace operations (files are by default set to Read-Only, reducing the chance of accidental alterations).

And despite its lowly 0.22 version number, wxHexEditor has even more options hidden away in its menus. You can calculate 25+ checksums for any given file, for instance, or compare two files and highlight any differences.

Verdict:

As a beta it needs to be used carefully, but wxHexEditor is already a very powerful tool, fast and packed with essential features.

wxHexEditor

image

Events:

  • Version 0.22 Beta Released (09/05/2013)
    • Now, supporting many codepages/encodings, including almost all DOS, ECBDIC, Windows CPs.
    • Also supporting multi character codepages like Shift JIS, UTF8/16/32 and others....
    • Added gksu and gksudo support for easy privilage elevations.
    • Added Russian translation, non-complete. (by Nikolai Novikov)
    • Fixed MacOSX binary issues that appears at old version due wx2.9
    • Many bug fixes also some usage changes.
  • Version 0.21 Beta Released (01/01/2013)
    • Device and Partition Backup/Restore and Erase tools.
    • Customizeable hex panel formatting.
    • Customizeable colours!
    • Linux Process Memory Read/Write access.
    • MultiLocale support with Turkish Language
    • Options Panel
    • Fixed Hex control input

Features:

  • It uses 64 bit file descriptors (supports files or devices up to 2^64 bytes , means some exabytes but tested only 1 PetaByte file (yet). ).
  • It does NOT copy whole file to your RAM. That make it FAST and can open files (which sizes are Multi Giga < Tera < Peta < Exabytes)
  • You can work with delete/insert bytes to file, more than once, without creating temp file!.
  • Could open your devices on Linux, Windows or MacOSX.
  • Memory Usage : Currently ~25 MegaBytes while opened multiple > ~8GB files.
  • Could operate with file thru XOR encryption.
  • Has multiple views to show multiple files in same time.
  • Has x86 disassembly support (via integrated udis86 library) to hack things little faster.
  • Has colourfull tags to make reverse engineering easier and more fun.
  • You can copy/edit your Disks, HDD Sectors with it.( Usefull for rescue files/partitions by hand. )
  • Sector Indication on Disk devices, also has Go to Sector dialog...
  • Formated CopyAs! It's easy to copy part of a file in HEX format for C/C++ source, ASM source, also supports HTML,phpBB and Wiki page formats with TAGs!!
  • Supports Hex or Text editor alone operation.Also can disable Offset region.
  • Supports customizeable hex panel formatting and colors.
  • Allows Linux Process Memory Editing operations
  • Comparison of binary files, allows merge of near results.
  • Supports ***many*** encodings including almost all DOS/Windows/MacOS CPs and multi-character sets like UTF8/16/32, Shift JIS, GBK, EUC_KR...
  • Decimal, Hexadecimal, Octal and LBA ("Sector+Offset") addressing modes, (switchable one to another by right click of mouse on Offset panel.
  • Save selection as a dump file feature for make life easier.
  • "Find Some Bytes" feature for quickly find next meaningful bytes at file/Disk
  • MD/RIPEMD/SHA/TIGER/HAVAL/CRC/ADLER/GOST/WHRILPOOL/SNEFRU checksum functions (via integrated mhash library.)
  • Import & Export TAGs support from file.
  • Written with C++/wxWidgets GUI libs and can be used with other OSes such as Mac OS, Windows as native application.

Every so often I need to open some pretty big files and always seem to have to search for an app each time. Caching this here so the next time I can give this one a try. Besides being able to open some pretty big files (16 EB... awesome) I dig some of it other features, like the hashing and device access.

On yeah, it's open source too...

Read More
Posted in C++, Utility, Windows | No comments

Think your passwords rock? Check out Telepathwords from Microsoft Research (which might have you thinking again about those passwords)

Posted on 17:31 by Unknown

Microsoft Research - Avoiding Vulnerable Passwords—and Rules, Too

You could think of it as a brainteaser: Create a sequence of eight or more characters that includes at least one uppercase letter, one lowercase letter, a digit, and a symbol, that doesn’t contain any words in English, and that is memorable enough that you can recall it.

For most of us, unfortunately, the challenge posed by these rules isn’t fun—it’s a painful chore forced upon us when choosing a password to access an email account, a company network, or a website.

Passwords that contain symbols and uppercase letters to meet these rules also tend to be difficult to type, especially on mobile devices.

Even worse, adhering to the rules doesn’t guarantee that your account or your password-protected data will remain secure. A surprising number of passwords that follow these rules are easily guessed by malicious hackers: “P@$$w0rd1,” for example, or “Qwerty123!”. If you specify one of these passwords, most login systems won’t raise any objections.

...

The free online research tool, launched Dec. 5, is called Telepathwords. Users can visit the project website and test the strength of their passwords—current ones, past ones, or ones they’re considering using.

“The system doesn’t ask the user to learn anything up-front or follow any specific rules,” Schechter says. “Rather, as you type each key of your intended password, it displays the characters it thinks you’re most likely to type next. If it succeeds in predicting one or more characters of the rest of your password, the evidence that these characters are predictable will be right in front of your eyes.”

image

...

Using Telepathwords feels similar to the autocomplete feature in search engines, except that it discourages you from following its predictions. Predictable characters don’t do much to increase the security of your password against those who might try to guess it, so if you type one of the three characters predicted by Telepathwords, a red X will appear above it. If you choose a character that is not among those predicted by Telepathwords, a green checkmark will appear above it.

While not truly telepathic, Telepathwords is endowed with great deal of knowledge about how users choose passwords. It knows all the usual substitutions, such as substituting the dollar sign ($) for an S. Telepathwords also looks for passwords constructed by moving a finger around the keyboard, regardless of direction. It has an extensive list of known-popular passwords, as well as a dictionary of English words and a list of common phrases obtained from Microsoft’s Bing search engine. And it’s wise to all sorts of tricks that users have devised—and attackers have long recognized—such as putting an asterisk between the letters of a familiar word.

Telepathwords also responds—with a diplomatically worded pop-up message—to passwords that rely on common substitutions or contain profanity, both of which attackers also are keenly aware.

...

Telepathwords

image

imageimageimage

Kind of fun and kind of scary all at the same time...

Read More
Posted in Utility, Web X.X | No comments

Rad Gate Post... Get your Red Gate Post here...

Posted on 17:20 by Unknown

simple talk - Melanie Townsend - Get a copy of the Red Gate Post

We recently put together a newspaper of some of the best articles from Simple-Talk and SQL Server Central, complete with a dash of advice, playful ads, and letters to the editor. It only seems fair to allow the newspaper to be downloadable in PDF form so here it is in all it’s glory (the PDF is about 6mb).

If you take advantage of the lovely crossword puzzle and quiz questions, you can find the answer key over at www.red-gate.com/puzzles with a little bonus PDF to download.

Make sure you leave a comment and let me know whether there’s anything you particularly liked about the newspaper or would like to see added or changed in case we do future versions!

image

imageimage

This is actually a great and funny read if you do anything SQL Server, Dev, DBA. If you can afford it (it's free) you should check it out...

Read More
Posted in DBA, ebook, SQLServer | No comments

[Humor] A familiar looking Project Team?

Posted on 17:12 by Unknown

agile scout - Every Software Project You’ve Ever Worked On

image

Let's I'm.... um... err... um.... yeah.  :P

Read More
Posted in Agile, ALM, Humor | No comments

Wednesday, 4 December 2013

Slicing .NET - NSlice, the Python like Slice for .Net

Posted on 17:31 by Unknown

Works on my machine - Slicing for .NET

...

First odd thing I read about Python was that a developer can use negative array indices. My reaction was: Why would I even want to get an IndexOutOfRangeException? That is just silly. But then I read what they actually do. They are just like the normal ones. The only difference is that they index the array backwards, for example: -1 means last, -2 means one before last, and so on. That is really handy. I cannot remember how many times I wrote count-1 or count-i.

After that I discovered that Python has an even cooler feature called array slicing. It is something like a quick for loop version. Let me show you an example:

array = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9] print array[1:9:2]

The above code prints [1,3,5,7].

So formally speaking slicing has the following form (each argument can be negative, all arguments are optional):

[ start_index : exclusive_boundary : iteration_step ]

...

This is a really powerful though succinct syntax. Look at the following two examples:

array[::-1] #reverses the array array[1:-1] #skips first and last element

Then I stared to think about those features - how can I port them to C# ?

NSlice

I decided to give it a try and created a .NET library. At the moment there are 3 extension methods:

- Slice – performs slice on a passed collection.
- At - works like an ElementAt extension. The only difference is that the index argument passed to an At extension can be negative.
- AtOrDefault - works like an ElementAtOrDefault extension, but it also accepts negative indices.

But there is more into it. NSlice was written to allow slicing 3 types of .NET collections in the most efficient manner:

- Indexed collections (IList<> implementations) - slicing is performed eagerly and instantly. It does not matter whether the collection has 10 elements or 10 million elements. This is because the result is not created by copying elements, but by creating a transparent view over source collection.
- Enumerables (IEnumerable<> implementations) - slicing is performed lazily. Each possible slice scenario was implemented separately to achieve the best speed performance and least memory footprint. It fits nicely into the LINQ model and could be even used to slice a stream, if the latter was wrapped into IEnumerable<> implementation.
- Strings - slicing is performed eagerly and a new string is returned as a result.

nabuk / NSlice

About NSlice

NSlice is a free .NET library, designed to give you more flexibility in manipulating collections, originally inspired by Python slicing feature.

(Jump straight to the Cheat Sheet if you want to see code samples right away.)

Overview

NSlice was written to allow slicing 3 types of .NET collections in the most efficient manner:

  • Indexed collections (IList<> implementations) - slicing is performed eagerly and instantly. It does not matter whether the collection has 10 elements or 10 million elements. This is because the result is not created by copying elements, but by creating a transparent view over source collection.
  • Enumerables (IEnumerable<> implementations) - slicing is performed lazily. Each possible slice scenario was implemented separately to achieve the best speed performance and least memory footprint.
    It fits nicely into the LINQ model and could be even used to slice a stream, if the latter was wrapped into IEnumerable<> implementation.
  • Strings - slicing is performed eagerly and a new string is returned as a result.

What is slicing ?

Slicing is just a for loop shortcut. Look at the following example:

...

But there is more. Slice allows each argument to be negative. It might seem weird to use negative indices but they are really useful. What are negative indices? They just index the collection backwards, for example: -1 means last, -2 means one before last and so on. See the following two examples to grasp the idea:

  • Get last five elements: Slice(-5)

  • Get collection without first and last element: Slice(1, -1)

...

nabuk / NSlice - Cheat Sheet

This page contains short code snippets that demonstrate NSlice features. If not specified explicitly, examples assume that collection variable has previously been initialized like this:

image

Like the author, the thought of a negative index seems really weird, but after reading about NSlice, it kind of makes sense. And it's much cooler than a reverse for loop. Then there's the other features too...Oh and that he's released the source. Cool, cool and double cool...

Read More
Posted in .Net, C#, Development | No comments

WiX'ing in VS 2013. WiX 3.8 adds VS 2013 support, bootstrapper and more

Posted on 17:21 by Unknown

InfoQ - Wix 3.8 Adds VS 2013 Support in Votive and WiX Native Library and Bootstrapper Application Functions

Wix, Windows installer package tool, has released version 3.8 with support for Visual Studio 2013 in Votive and WiX native libraries. It includes bootstrapper application functions which extends WixStandardBootstrapperApplication. The release provides an ability to detect Windows 8.1 in Burn in addition to detecting properties in WixVSExtension using Visual Studio 2013.

...

WiX - WiX Toolset v3.8

image

The v3.8 RTM build is v3.8.1128.0.

For more information see: http://robmensching.com/blog/posts/2013/11/28/wix-v3.8-released and http://www.joyofsetup.com/2013/11/28/wix-v3-8-released/.

Major features of WiX v3.8 are:

  • Support for Visual Studio 2013 in Votive and the WiX native libraries. (Bob Arnson and Rob Mensching)
  • Bootstrapper application functions to extend WixStandardBootstrapperApplication. (Neil Sleightholm)

Minor features include:
  • Properly detect Windows 8.1 version in Burn. (Blair Murri)
  • Visual Studio 2013 detection properties in WixVSExtension. (Bob Arnson)
  • fun.AutoVersion preprocessor function to provide automatic version numbers. (Neil Sleightholm)
  • New WixStandardBootstrapperApplication themes. (Neil Sleightholm)
  • Options in CloseApplication to send end-session messages, to be prompted if programs are still running, and to terminate the process if gentler requests are ignored. (Rob Mensching)
  • ThmUtil (and therefore WixStandardBootstrapperApplication) supports hidden controls and transparent images. (Neil Sleightholm and Rob Mensching)
  • LocUtil (and therefore WixStandardBootstrapperApplication) supports probing for default language resources rather than requiring region-specific language resources. (Neil Sleightholm)

The following issues were fixed in WiX v3.8:

..."

Free, open source and powerful, WiX is a seriously powerful setup builder...

Read More
Posted in Deployment, VisualStudio, WiX | No comments
Older Posts Home
Subscribe to: Posts (Atom)

Popular Posts

  • Mr. 7,000! This is my 7,000th post...
    Before this post; After; 20 visits between taking these snaps? Oh wait, that's probably me searching for past related posts....
  • "Windows Server Essentials Media Pack" (DNLA Stream, HTML5 and Dashboard Media stuff)
    Microsoft Downloads - Windows Server Essentials Media Pack This pack enables the media streaming functionality for Windows Server 2012...
  • Rad Gate Post... Get your Red Gate Post here...
    simple talk - Melanie Townsend - Get a copy of the Red Gate Post We recently put together a newspaper of some of the best articles fr...
  • Windows Management Framework 4.0 (PowerShell 4, PowerShell ISE, Management OData, WMI, etc.) now available
    Keith Hill's Blog - PowerShell 4.0 Now Available You can get PowerShell 4.0 for down level operating systems now via the WMF 4.0 d...
  • Viasfora - Your new favorite Visual Studio Text/*ML Editing Extension?
    Winterdom - Introducing Viasfora A couple of days ago, I unveiled Viasfora , my latest attempt at building a decently packaged extensi...
  • "Windows Server [2012 R2]: The Best Infrastructure to Run Linux Workloads"
    In the Cloud - What’s New in 2012 R2: Enabling Open Source Software Part 4 of a 9-part series . ... There are a lot of great s...
  • [Hardware Review] Life with Haswell... Haswell/Harris Beach Intel SDS Ultrabook Review - Part 2
    "So Greg, how's life with Haswell been?" "Pretty Sweet! (Mostly)" I've been given an opportunity to review t...
  • Caliburn.Micro v1.5.0 released (CM gets Tasks, Async/Await and Share/Setting for RT... and bug fixes of course)
    Caliburn.Micro - Caliburn.Micro v1.5.0 "Release Notes This release fixes many bugs. It also adds support for Task and async/a...
  • [Hardware Review] It's been a Haswell Summer... Haswell/Harris Beach Intel SDS Ultrabook Review - Part 3
    Are you all tired of it yet? Have you heard it often enough already? Well too bad! Haswell is Battery Love! MUHAHAhahahahaha.... There! ...
  • Want the world's best Science Fiction And Fantasy Library? Come to LA... The Eaton Collection @ UC Riverside
    CBS Los Angeles - The Eaton Collection: The Best Science Fiction And Fantasy Library Science fiction and fantasy fans rejoice and take...

Categories

  • .Net
  • 3DPrinting
  • AFeedYouShouldRead
  • Agile
  • ALM
  • Amazon
  • Amiga
  • Analytics
  • Android
  • ASP.NET
  • Azure
  • BigData
  • bing
  • Blogging
  • Book
  • BookReview
  • BUILD
  • C
  • C#
  • C++
  • Career
  • Cat
  • cheatsheet
  • ClickOnce
  • Cloud
  • ComputerHardware
  • css
  • Data
  • DBA
  • DependencyInjection
  • Deployment
  • Design
  • Development
  • devops
  • DVCS
  • ebook
  • EDD
  • Education
  • EnterpriseLibrary
  • EntityFramework
  • Exchange
  • Expression
  • gadget
  • Game
  • GIT
  • Google
  • Government
  • Hadoop
  • hardware
  • HardwareReview
  • HaswellReview
  • HTML5
  • Humor
  • IE
  • IEExtension
  • IfAllElseFails
  • IIS
  • ILMerge
  • Image
  • Infographic
  • interview
  • InversionOfControl
  • Java
  • Javascript
  • Kinect
  • LightSwitch
  • LINQ
  • Linux
  • LosAngeles
  • Lucene
  • Lync
  • MEF
  • Metro
  • MicrosoftOffice
  • MicrosoftOutlook
  • Mono
  • MVC
  • MVVM
  • NetMon
  • NLP
  • NoSQL
  • NuGet
  • OData
  • OneNote
  • OpenXML
  • Paint.Net
  • Personal
  • Photosynth
  • Physics
  • portable
  • Poster
  • PowerShell
  • Preparedness
  • Presentation
  • Prism
  • PrivateCloud
  • RegEx
  • RemoteDesktop
  • Reporting
  • RIAServices
  • Science
  • ScienceFiction
  • Scratch
  • Scrum
  • ServiceBus
  • SharePoint
  • Silverlight
  • SimiValley
  • SPA
  • Space
  • SQLServer
  • Storyboard
  • Surface
  • SVG
  • SystemAdministration
  • T4
  • TeamBuild
  • TeamFoundationServer
  • TechEd
  • Training
  • TypeScript
  • UnitTesting
  • UnityApplicationBlock
  • Utility
  • Veteran
  • VirtualMachine
  • Visio
  • VisualBasic
  • VisualStudio
  • WCF
  • Web X.X
  • Webcast
  • WebFeed
  • WebMatrix
  • Windows
  • Windows7
  • Windows8
  • Windows8.1
  • WindowsHomeServer
  • WindowsLiveWriter
  • WindowsPhone
  • WindowsServer
  • WinRT
  • WiX
  • WMI
  • WOPI
  • WPF
  • XAML
  • XBox360
  • XboxOne
  • zombie

Blog Archive

  • ▼  2013 (500)
    • ▼  December (12)
      • Free Export DataSet/DataTable/List<t> to Excel (wi...
      • wxHexEditor, your new large, 16EBs (exabytes) larg...
      • Think your passwords rock? Check out Telepathwords...
      • Rad Gate Post... Get your Red Gate Post here...
      • [Humor] A familiar looking Project Team?
      • Slicing .NET - NSlice, the Python like Slice for .Net
      • WiX'ing in VS 2013. WiX 3.8 adds VS 2013 support, ...
      • The TFS Upgrade Guide gets... well... upgraded. v3...
      • Windows 2012 Server Edition Comparison Matrix and ...
      • RegEx'ing - The RefCardz
      • 200 C# Video Tutorials? 200 VB? JavaScript? PHP? C...
      • What's the [table]diff? Diff'ing SQL Server tables...
    • ►  November (61)
    • ►  October (65)
    • ►  September (38)
    • ►  August (47)
    • ►  July (75)
    • ►  June (39)
    • ►  May (40)
    • ►  April (42)
    • ►  March (39)
    • ►  February (42)
Powered by Blogger.

About Me

Unknown
View my complete profile