Read more: BMC Biology
Animals That Can Live Without Oxygen Discovered, Aliens Basically Guaranteed to Exist Now
Read more: BMC Biology
Top 7 Operating Systems for Serious Server Applications
The heart of the software part of a server is the operating system. This is the single most important thing that you’ll have to install and will be very hard to change without interrupting normal operations (it might even be impossible to replace if you made significant customizations that will run only on that specific configuration).
That is why you should choose it very carefully and weight in all the advantages and disadvantages of the available operating systems. Depending on what you need (increased stability, maximum performance, fast serving of static or dynamic pages, fast database operations, etc.), some OS’es will work better (sometimes significantly better) than others. Read more: HostWisely
SQL SERVER – 2008 – Introduction to Snapshot Database – Restore From Snapshot
CREATE DATABASE SnapshotDB ON
(Name ='RegularDB',
FileName='c:\SSDB.ss1')
AS SNAPSHOT OF RegularDB;
GO
-- Select from Regular and Snapshot Database
SELECT * FROM RegularDB.dbo.FirstTable;
SELECT * FROM SnapshotDB.dbo.FirstTable;
GORead more: Journey to SQL Authority with Pinal Dave
Creating Stored Procedures with Managed Code
from Production.Product
where ProductSubcategoryID=@ProductSubcategoryID;Listing 1Developing the solution The first step is to create a SQL Server project by opening Visual Studio.NET 2005 and select File | New | Project Read more: C# Corner
Using AntiXss As The Default Encoder For ASP.NET
Debugging Delegation and Kerberos Configuration
Official site: DelegConfig v2 beta (Delegation / Kerberos Configuration Tool)
Downloading WinDBG
2. Open the ISO from the installation media and open the Debuggers directory.
3. In the Debuggers directory, run the appropriate MSI or setup EXE for x86 and follow the instructions in the Setup Wizard.
4. After installation is complete, you can find the debugger shortcuts by clicking Start, pointing to All Programs, and then pointing to Debugging Tools for Windows (x86). Read more: Winterdom
Assembly-level initialization at design time
How To Increase Your Chances Of Surviving A Microsoft Interview
RSA Encryption with .NET 2.0 Cryptography Services and Crypto++ Wrapped as a Managed C++ Class Library
* Disclaimer
* Using the code
* Glossary
* Background
* The Problem
o Key Exchange
o Data Transfer
o Block Encryption and Decryption
* Interop classes
o CLR, Crypto++ and the C++ Standard Library
o Setting pointers to the new and delete operators
* Implementation Details
o class RSAES_PKCS15 (Managed C++)
o class CryptoPP_RSAES_PKCS15 (Native C++)
* Tester Applications
o C# Console Application Tester
* Things to do
* Other useful things
o BER and DER encoding/decoding of Integers
* Known Issues
o LoaderLock Exception
o Compiling Crypto++ as Unicode
o Base64 Encoding/Decoding with Crypto++
* In Closing
* Acknowledgements
* References
* HistoryIntroductionThe purpose of this article is to show the interaction between Crypto++ and .NET 2.0 Cryptography services using RSA PKCS#1 encryption and to show how to wrap a Crypto++ as a managed class. Often a client and server use different cryptographic services and need to interact correctly e.g. the public portions of the encryption key need to be exchanged between them and data from the client needs to be decrypted by the server and vice versa. Most of the articles I could find were for older versions of .NET and the documentation on how to use the Cryptography services was a bit sparse, hence the need for this article. In order to simplify things, I have stripped away the usual communication links between the client and the server. Byte arrays will be passed between them instead. No existing standards will be used to exchange keys either, the public modulus and exponent integers will be sent as byte arrays again. Putting these components together is a plumbing job � explaining this would be very specific to my problem and would confuse a complicated article even more. Below is a short description of what will be achieved by this article: I want to use Crypto++ from C#, so I wrap it using a managed C++ class as follows: 1. Compile Crypto++ 5.5.1 either as a static lib or as a DLL using Visual Studio 2005 with dynamically linked standard multithreaded libraries (/MD or /MDd)
2. Create a native wrapper class which provides a simple interface to Crypto++ and encrypts or decrypts a byte array of any size
3. Create a managed C++ class which encapsulates the native wrapper class and converts .NET managed types to native types (and vice versa) and then calls the Crypto++ wrapper class methods
Read more: Codeproject
XmlSerializer class for reading and writing XML.
{
string ThisCategory;
string ThisHRef;
string ThisTitle; public string Category
{
get { return ThisCategory; }
set { ThisCategory = value; }
} public string HRef
{
get { return ThisHRef; }
set { ThisHRef = value; }
} public string Title
{
get { return ThisTitle; }
set { ThisTitle = value; }
}
}Using the XmlSerializer class, we use Serialize.Deserialize to read the data and XmlSerializer.Serialize to write the data. An instance of the XmlSerializer class could be created using: XmlSerializer Serializer = new XmlSerializer(typeof(LinkObjectsList));Then the data could be written using:TextWriter Writer = new StreamWriter(Filename);
Serializer.Serialize(Writer, LinksList);
Writer.Close();Data could be read using:TextReader Reader = new StreamReader(Filename);
LinksList = (LinkObjectsList)Serializer.Deserialize(Reader);
Reader.Close();It is nearly that easy. Note that when the data is as simple of the above data, it is possible to read and write the data using a DataTable. If however the data is more complicated than what a single DataTable is capable of, then the XmlSerializer class can be easier (see below). Note that the LinkObject class above represents one link. We are writing and reading a list of links, where list could be called an array or a collection or a table or something else. We can create a list of links using: List<LinkObject> LinksList = new List<LinkObject>();Read more: C# Corner
Basic analysis of an unmanaged memory dump (C++)
NET DiscUtils
How to use the Library
Here's a few really simple examples.How to create a new ISO:CDBuilder builder = new CDBuilder();
builder.UseJoliet = true;
builder.VolumeIdentifier = "A_SAMPLE_DISK";
builder.AddFile(@"Folder\Hello.txt", Encoding.ASCII.GetBytes("Hello World!"));
builder.Build(@"C:\temp\sample.iso"); You can add files as byte arrays (shown above), as files from the Windows filesystem, or as a Stream. By using a different form of Build, you can get a Stream to the ISO file, rather than writing it to the Windows filesystem. Read more: Codeplex
Psscor2 Managed-Code Debugging Extension for WinDbg
* managed exception information
* what types are in the managed heap and their reference chain
* which ASP.NET pages are running on which thread
* the contents of the ASP.NET cache
* and much more.Read more: Jin's WebLog original, translated
Download: MS Download
הגדרה של appSettings
יש ל - appSettings שני מאפיינים מעניינים האחד נקרא file והשני נקרא configSource. שניהם מאפשרים להוציא את ה - appSettings לקובץ נפרד לדוגמא
1. configSource מחייב להעביר את כל ההגדרות של appSettings לקובץ החיצוני לעומת file שמאפשר להכניס חלק מהערכים בקובץ המקורי.
2. configSource הוא ממש כמו קובץ הקונפיג המקורי וכל שינוי בו יעשה restart ל - application לעומת file שמאפשר לשנות את הקובץ בלי restart.
Some useful Addins for SQL Server Management Studio 2005 and 2008
SSH Port Forwading and Tunneling
ssh -v -g -R remoteport:localhost:localport root@remotehost#e.g. forwarding my local webserver on port 8080 to http://developers-blog.org:80
ssh -v -g -R 80:localhost:8080 root@developers-blog.org#to bypass the ClientAliveInterval you can append a while loop to hold up the SSH connection
ssh -v -g -R 80:localhost:8080 root@developers-blog.org "while [ 1 ]; do sleep 10; echo '\''loop step'\''; done" Local Port Forwading example:#you want to forward a remote port to my local machine
ssh -v -g -L localport:remotehost:remoteport root@remotehost#e.g. i want to see my local webserver on my
ssh -v -g -L 8080:developers-blog.org:80 root@developers-blog.org #for bypass the ClientAliveInterval you can append a while loop as well
ssh -v -g -L 8080:developers-blog.org:80 root@developers-blog.org "while [ 1 ]; do sleep 10; echo '\''loop step'\''; done" Read more: Developers Blog - Programming Languages, Technologies and Visions
How to setup a local web server on your computer using XAMPP
Installing XAMPP on your computer 1. First, download XAMPP for Windows Installer
2. Then run the installer on your computer and make sure that your Windows firewall unblocks Apache.
3. Run the Apache administrator.
4. Open your browser and go to http://127.0.0.1 – If all went well, a screen will appear where you can choose your language.
5. Go to http://127.0.0.1/security/xamppsecurity.php and setup a password (it ill be used for your databases), and click on “Password Changing”. Congratulations! You’re done! Now put your website’s files in a new directory under C:\xampp\htdocs\ (if you installed xampp in C:\xampp). For example: C:\xampp\htdocs\myproject\; and setup your databases using PHPMyAdmin located here http://127.0.0.1/phpmyadmin/. Configuring Mod RewriteRead more: Richard Castera
VC++ Tip: Get detailed build throughput diagnostics using MSBuild, compiler and linker
1>Build started 1/12/2010 5:31:58 PM.
1>_PrepareForClean:
1> Deleting file "Debug\mfc-app.lastbuildstate".
1>InitializeBuildStatus:
1> Creating "Debug\mfc-app.unsuccessfulbuild" because "AlwaysCreate" was specified.
1>ClCompile:
1> stdafx.cpp
...............
1> ChildFrm.cpp
1> Generating Code...
1>Manifest:
1> Deleting file "Debug\mfc-app.exe.embed.manifest".
1>LinkEmbedManifest:
1> mfc-app.vcxproj -> C:\Users\user\documents\visual studio 2010\Projects\mfc-app\Debug\mfc-app.exe
1>FinalizeBuildStatus:
1> Deleting file "Debug\mfc-app.unsuccessfulbuild".
1> Touching "Debug\mfc-app.lastbuildstate".
1>Read more: Visual C++ Team Blog
Moving data between 32-bit and 64-bit SQL Server instances
Understanding RAID for SQL Server
Level 1 is one of our favorite ways to set up SQL Server. It is fast and provides data protection like a superhero straddling the speed and safety worlds. All superheroes have weaknesses, and RAID level 1 is no exception—it uses two hard disks of identical sizes, and this can cause several drawbacks. The first drawback is that the size of your logical disk is the same as the size of one of the physical disks. In other words, you pay for two disks, and you only get to use the storage size of one.
The other, more important, drawback is that you can only store files of up to the size of one of the disks on the logical disk. For example, if you have two 185 gigabyte (GB) drives in the RAID level 1 configuration, you end up with a single logical drive of 185 GB. In this example, the maximum file you could hold on the disk would be less than 185 GB in size. Since your largest database files are the .mdf file (which holds the data) and the .ldf file (which holds the transaction logs), you need to make sure that they do not exceed the size of the level 1 logical drive.
One way to prevent the data from exceeding the size of the level 1 drive is to create a secondary database file (.ndf) of an equal size on another level 1 logical drive set. This divides the data in the database between the two files.
You can keep your transaction log file (.trn) from getting too big by frequently backing up the transaction log, which allows it to be stored on a RAID level 1 array.
As we continue this series of posts about the disk subsystem, we will talk more about which database files go on which kinds of logical drives and about the arrangement of physical disks. RAID Level 5SQL Server 2008 Books Online says that level 5 is also known as striping with parity. "Data redundancy is provided by the parity information. The data and parity information are arranged on the disk array so that the two types of information are always on different disks" ("RAID Levels and SQL Server," SQL Server 2008 Books Online, MSDN). A RAID level 5 configuration lets you have more than two physical drives in the RAID configuration. In fact, there is really no benefit until you have there or more drives. The data is written to all three drives at the same time. However, the data is read from any of the drives without involving the other physical drives in the array. Read more: Understanding RAID for SQL Server Part 1, Part 2
Creating a Web Service in Cloud
public double GetFactorial(int x)
{
double factorial = 0;
if (x >= 0)
{
factorial = CalcFactorial(x);
} return factorial;
}privat static double CalcFactorial (int x)
{
// base case
if (x <= 1)
{
return 1;
} return x * CalcFactorial (x -1);
} Now, press F5 and you will get the following.Read more: Sajid's TechnoTips
Use the Cassia .NET Library to Detect Users Connected to Windows Server
using (ITerminalServer server = manager.GetRemoteServer("your-server-name"))
{
server.Open();
foreach (ITerminalServicesSession session in server.GetSessions())
{
Console.WriteLine("Session ID: " + session.SessionId);
Console.WriteLine("User: " + session.UserAccount);
Console.WriteLine("State: " + session.ConnectionState);
Console.WriteLine("Logon Time: " + session.LoginTime);
}
}Read more: DevX.com
Official site: Cassia Project Home
C++0x Core Language Features In VC10: The Table
When we announced that the Visual Studio 2010 Release Candidate Is Now Available For Download, a reader, Igor, asked us to provide a table summarizing which C++0x Core Language features are implemented in VC10. So, here it is! It's derived from, but slightly modified from, GCC's tables. For example, I added "Rvalue references v2".
Proposal | VC9 | VC10 | |
Rvalue references | No | v2 | |
Rvalue references v2 | No | v2 | |
Rvalue references for *this | No | No | |
Initialization of class objects by rvalues | Yes | Yes | |
static_assert | No | Yes | |
auto | No | Yes | |
Multi-declarator auto | No | Yes | |
Removing old auto | No | Yes | |
Trailing return types | No | Yes | |
Lambdas | No | v1.0 | |
decltype | No | Yes | |
Right angle brackets | Yes | Yes | |
Extern templates | Yes | Yes | |
nullptr | No | Yes | |
Strongly typed enums | Partial | Partial | |
Forward declared enums | Partial | Partial | |
Extended friend declarations | Partial | Partial | |
Local and unnamed types as template arguments | Yes | Yes | |
C++0x Core Language Features: Concurrency | | | |
exception_ptr | No | Yes | |
Thread-local storage | Partial | Partial |
Read more: Visual C++ Team Home
Unable to create a login in SQL Server 2005 and we get the following error The server principal '[\$]' already exists.
=======· When you try to create a login using the command "Create login [<Domain>\<Machine account>$] from windows" we might get the following erroro Msg 15025, Level 16, State 2, Line 1
o The server principal '<DOMAIN NAME>\<MACHINE NAME>$' already exists.
· The following error might be returned when we try creating the SQL Server login in Management studioo Create failed for Login '<DOMAIN NAME>\<MACHINE NAME>$'. (Microsoft.SqlServer.Smo)
o The server principal ‘<DOMAIN NAME>\<MACHINE NAME>$’ already exists. (Microsoft SQL Server, Error: 15025)
· The error message says that the server principal already exists. However, if you look for any such principal under Security in Management studio you will not find the login <DOMAIN NAME>\<MACHINE NAME>$
· Further, when you run the following query in a new query window, you will not find the login <DOMAIN NAME>\<MACHINE NAME>$o Select LOGINNAME from sys.SYSLOGINSCAUSE
===== This problem occurs if there is already a login which is registered under the same SID as that of the Login which you are trying to add.RESOLUTION
=========· To determine whether the SID already exists for a different login, please follow these steps:
· In the new query window, run the following command:
GO
· Once the raw hex SID is retrieved run the following query against that SID to fetch the Server Principal name as shown in the below example:
o This should give you the server principal that is already using the above SID. · Technically, it is not possible to have a more than one login with the same SID unless these logins have been manually created. Read more: Microsoft SQL Server Tips & Tricks
Operator Overload - Part 2 (explicit, implicit)
{
public int Value { get; set; } public Dolar(int value)
{
Value = value;
}
}
כל פעם שנרצה לייצר מופע נצרך לכתוב כך:
{
return new Dolar(value);
}
ולמעשה השמה של מספר למופע של Dolar יקרא לפונקצייה הזאת. אנחנו יכולים גם להגדיר explicit operator במקרים שאנחנו חוששים לאיבוד מידע
Cassandra Jump Start For The Windows Developer
* Digg
* RedditSounds interesting or at least worth a look, right? Well I thought so, however during my journey of getting the database setup I have come to realize there is almost no documentation on installation for Linux, and even less for Windows. So I am going to provide you with a jump start to installing Cassandra on your machine. I am doing this so you don’t have to spend days jumping around the web, going down false paths, and pulling your hair out like I did, all so you can get on to what you really care about … development.
First Things FirstThe first thing you need to understand about Cassandra is that it is developed in Java. So you can run it on any machine that supports Java 6 or better. So before you go any farther make sure you Java JRE is updated to the latest version. The next thing you need is a copy of Cassandra. Which can be found here. My setup is going to be based off of the latest stable release.
Running From WindowsAs I said before you can run from an operating system that Java has a runtime for. So the first and probably most obvious one for a Windows developer, is running Cassandra on Windows. Read more: Nick Berardi's Coder Journal
The day I understood TDD
{
var val1 = ValueGenerator.GetNextValue(typeof(int));
var val2 = ValueGenerator.GetNextValue(typeof(int)); Assert.AreNotEqual(val1, val2);
}Read more: Helper Code
Microsoft release Feature Builder Power Tool
Redirecting functions in shared ELF libraries
1. The problem
1.1 What does redirecting mean?
1.2 Why redirecting?
2. Brief ELF explanation
2.1 Which parts does ELF file consist of?
2.2 How do shared ELF libraries link?
2.3 Some useful conclusions
3. The solution
3.1 What is the algorithm of redirection?
3.2 How to get the address, which a library has been loaded to?
3.3 How to write and restore a new function address?
4. Instead of conclusion
5. Useful links1. The problemWe all use Dynamic Link Libraries (DLL). They have excellent facilities. First, such library loads into the physical address space only once for all processes. Secondly, you can expand the functionality of the program by loading the additional library, which will provide this functionality. And that is without restarting the program. Also a problem of updating is solved. It is possible to define the standard interface for the DLL and to influence the functionality and the quality of the basic program by changing the version of the library. Such methods of the code reusability were called “plug-in architecture”. But let’s move on. Of course, not every dynamic link library relies only on itself in its implementation, namely, on the computational power of the processor and the memory. Libraries use libraries or just standard libraries. For example, programs in the C\C++ language use standard C\C++ libraries. The latter, besides, are also organized into the dynamic link form (libc.so and libstdc++.so). They are stored in the files of the specific format. My research was held for Linux OS where the main format of dynamic link libraries is ELF (Executable and Linkable Format). Recently I faced the necessity of intercepting function calls from one library into another - just to process them in such a way. This is called the call redirecting.Read more: Codeproject
Connect Microsoft Excel To SQL Azure Database
Import SQL Azure Data Into ExcelYou need to be running Excel 2010 (post-Beta 2 builds) for these steps to work properly. Read more: John R. Durant's WebLog
Lockless memory allocator
It is a simple step to speed up your software. No source code changes are required. The Lockless memory allocator seemlessly replaces your system allocator, and you reap the performance benefits. Spend Less on Hardware You can save money on hardware by spending less on expensive processors and memory. The Lockless memory allocator can speed up your software in a more inexpensive way to meet your performance targets. Fully Utilize Modern Multicore Machines. The Lockless memory allocator is designed for 64bit multicore machines whilst still supporting 32bit applications. Allocations are 16 byte aligned to optimize SSE2 usage. 64 byte allocations are cache-line aligned to prevent speed loss from cache-line bouncing in multithreaded applications. Multithread Optimized The Lockless memory allocator uses lock-free techniques to minimize latency and memory contention. This provides optimal scalability as the number of threads in your application increases. Per-thread data is used to reduce bus communication overhead. This results in thread-local allocations and frees not requiring any synchronization overhead in most cases. Read more: Lockless
Canadian researchers reveal online spy ring based in China
Common Setup Issues and Their Resolutions, When Publishing WCF Service to Local IIS
Read more: WCF Tools team's blog
Speeding Up NHibernate Startup Time
IFormatter serializer = new BinaryFormatter();//first time
cfg = new Configuration().Configure();using (Stream stream = File.OpenWrite("Configuration.serialized"))
{
serializer.Serialize(stream, configuration);
}//other times
using (Stream stream = File.OpenRead("Configuration.serialized"))
{
cfg = serializer.Deserialize(stream) as Configuration;
} Check it out for yourselves.Read more: Development With A Dot
!address -summary explained
[You’ll find !address –summary as the part of Ext.dll extension].We can interpret quite a few things from it which can help us in further debugging. Here’s how For example (for 32 bit app)0:027> !address –summary
-------------------- Usage SUMMARY --------------------------
TotSize ( KB) Pct(Tots) Pct(Busy) Usage
29b32000 ( 683208) : 32.58% 41.98% : RegionUsageIsVAD
1cab1000 ( 469700) : 22.40% 00.00% : RegionUsageFree
d3b4000 ( 216784) : 10.34% 13.32% : RegionUsageImage
3bfc000 ( 61424) : 02.93% 03.77% : RegionUsageStack
f0000 ( 960) : 00.05% 00.06% : RegionUsageTeb
2896a000 ( 665000) : 31.71% 40.86% : RegionUsageHeap
0 ( 0) : 00.00% 00.00% : RegionUsagePageHeap
1000 ( 4) : 00.00% 00.00% : RegionUsagePeb
1000 ( 4) : 00.00% 00.00% : RegionUsageProcessParametrs
1000 ( 4) : 00.00% 00.00% : RegionUsageEnvironmentBlock
Tot: 7fff0000 (2097088 KB) Busy: 6353f000 (1627388 KB)-------------------- Type SUMMARY --------------------------
TotSize ( KB) Pct(Tots) Usage
1cab1000 ( 469700) : 22.40% : <free>
119a8000 ( 288416) : 13.75% : MEM_IMAGE
10b5000 ( 17108) : 00.82% : MEM_MAPPED
50ae2000 ( 1321864) : 63.03% : MEM_PRIVATE------------------- State SUMMARY --------------------------
TotSize ( KB) Pct(Tots) Usage
3152f000 ( 808124) : 38.54% : MEM_COMMIT
1cab1000 ( 469700) : 22.40% : MEM_FREE
32010000 ( 819264) : 39.07% : MEM_RESERVE Largest free region: Base 6b0b2000 - Size 0203e000 (33016 KB) * Read more: WebTopics