Community Update (2013/12/06) â€“ Profiler or debugger for slow pages, WebAPI 2 output caching and secure OWIN WebAPI
Not a lot of content as for every Friday, but we got a few that is very interesting.
Profiler or debugger, output caching or per-controller configurationâ€¦ itâ€™s all bellow. Do not miss the last one on securing ASP.NET Web API with Windows Azure Active Directory with OWIN.
I wish you all a good weekend..NET
Why is the performance of an immutable list over 16 times slower than a standard list? I took a peek at what it was actually doing, and it made a lot of sense. In order to maintain efficient indexing access, the actual storage of the data in the immutable list is a binary tree. With the key being used as the indexer.
This result is a much higher cost for pretty much everything. Let us look at the following:
1: var listsp = Stopwatch.StartNew();
2: var list = new List<int>(Enumerable.Range(0, 10*1000*1000));
4: for (int i = 0; i < list.Count; i++)
6: var _ = list[i];
11: var ilist = ImmutableList<int>.Empty.AddRange(list);
14: for (int i = 0; i < ilist.Count; i++)
16: var _ = ilist[i];
This List<T> is 0.23 seconds, ImmutableList<T> takes 1.28 seconds. When I use foreach, instead, we get 0.22 seconds vs. 2.29 seconds.
As you can see from the blog post describing them, because immutable collections are mostly implemented as binary trees, I donâ€™t really think that there is a good way to approach this as is. The problem is that the immutable collections actually need to do a lot more than what I need them to do.
Now, it might have been more acceptable to use them if the perf was limited to just writing to them, it might have been acceptable. But as you can see, we have the same problem when we are reading, and that is quite unacceptable.
Audiobook creator is available to download on Mac App Store. You can find more details on our audiobook creator website.
Audiobook creator is an app which enables the creation of audiobooks from ebooks. You can listen to it on the go with a music player, smart phone or on your computer.
It is designed to convert ebooks into audiobooks. ItÂ reads aloud an ebook (epub) to an audiobook (m4b) file.
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
- 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.
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...
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 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.
As a beta it needs to be used carefully, but wxHexEditor is already a very powerful tool, fast and packed with essential features.wxHexEditor
- 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
- 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...
Think your passwords rock? Check out Telepathwords from Microsoft Research (which might have you thinking again about those passwords)
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.â€ť
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.
Kind of fun and kind of scary all at the same time...
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!
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...
Let's I'm.... um... err... um.... yeah. :P
Community Update (2013/12/05) â€“ What is OWIN, Azure Caching in MVC, WebAPI Deep Tutorial and some tools
So what do we have here? A very clear explanation of what is OWIN by Robert Muehsig (MVP). Itâ€™s a must read to finally know what OWIN is all about. Then thereâ€™s some way to optimize your MVC with Azure caching and compiled views and finally, we have an amazing multi-part tutorial on WebAPI. Donâ€™t forget to scroll at the bottom of the article to see the other parts.