I can bet that you never heard about this operator on c# development but it's nice to know anyway:
operator =&
usually used in logical statement which is equivalent to x&=y -------> x& (y=x) The left-shift operator (<<) shifts its first operand left by the number of bits specified by its second operand (always int ) exemple : i << 1---------->0x2 Operator >>=
is equivalent to x >>= y---------> x = x >> y
Operator x /= y
is equivalent to x /= y---------> x = x / y
It is very common in information systems to have functions where the users are able to search the data by selecting freely among many possible criterias. When you implement such a function with SQL Server there are two challenges: to produce the correct result and have good performance. Here few option i found:
Option 1: Using IF statements
IF @ClientNum IS NOT NULL SELECT ... FROM CLients WHERE ClientNum = @ClientNum ELSE IF @NumMatric IS NOT NULL SELECT ... FROM Client WHERE NumMatric= @NumMatric ELSE IF @Clientname IS NOT NULL SELECT TOP 100// This is to have only few client and not all of them FROM Client WHERE clientName LIKE @clientName + '%' ORDER BY clientName ELSE RAISERROR('No client found!')
SELECT TOP 100 FROM Client WHERE (ClientNum = @ClientNum AND @ClientNum IS NOT NULL) OR (NumMatric = @NumMatric AND @NumMatric IS NOT NULL) OR (Clientname LIKE @Clientname + '%' AND @Clientname IS NOT NULL) ORDER BY Clientname
Option 3: Using Dynamic SQL
Here we assuming that OPTION (RECOMPILE) works like it does in SQL 2008 SP2, SQL 2008 R2 CREATE PROCEDURE ClSearch @ClientName varchar(25) = null, @ClientNum varchar(25) = null, @ClientMatrix varchar(25) = null AS BEGIN SELECT * FROM Client WHERE (@ClientName IS NULL OR (ClientName = @ClientName )) AND (@ClientNum IS NULL OR (ClientNum = @ClientNum )) AND (@ClientMatrix IS NULL OR (ClientMatrix = @ClientMatrix )) OPTION (RECOMPILE) END
PS: Since the query is recompiled every time, you get a query plan that is optimised for the exact search conditions at hand. But if the search routine is called with high frequency, the recurring compilation may cause an overload on the server.
Handling Multi-valued Parameters:
To handel Multi-valued parametre the best way is to use intlist_to_tbl is a function that cracks a comma-separated list into table ex: AND (ClientMatrix IN (SELECT MatrixTabClient FROM intlist_to_tbl(@ClientMatrix)) OR @ClientMatrix IS NULL)
In the end i want to say changing searches based on the given parameters is a complicated subject and i always recommend to use index this will gain a lot of performance in the result.
Ok first of all this doesn't have any relationship with csharp or whatever .Net code you will think about.
Today i feel about teach you guys something cool to do , we going to learn how to hack to your Girlfriend 's computer so be careful and do exactly what i tell you to do.
OK HACKERS ... ARE YOU READY !
Step 1: Migrate the Meterpreter
Before we start our keylogger, we need to migrate the Meterpreter to the application or process we want to log the keystrokes from. Let's check to see what processes are running on the victim system by typing:
meterpreter >ps
Notice in the screenshot above that we have a listing of every process running on the victim system. We can see about 1/3 of the way down the process listing with a Process ID (PID) of 912, the Notepad application is open and running.
Let's migrate to that process and capture any keystrokes entered there. Type:
meterpreter > migrate 912
You can see from the screenshot that Meterpreter responds that we have migrated successfully,
Step 2: Start the Keylogger
Now that we have migrated the Meterpreter to the Notepad, we can embed the keylogger.
Metasploit's Meterpreter has a built-in software keylogger called keyscan. To start it on the victim system, just type:
meterpreter> keyscan_start
With this command, Meterpreter will now start logging every keystroke entered into the Notepad application.
Step 3: Write a Short Note on the Victim System
Let's now move to our victim system and write a short note to make sure it works.
As you can see in screenshot above, Cheatah has written a short note to Stud, asking him to come visit while her boyfriend is gone. All of these keystrokes are being captured by our keylogger providing us with evidence of her cheating heart (or some other organ).
Step 4: Recover the Keystrokes
Now, let's go back to our system with Meterpreter running on Metasploit. We can now dump all of the keystrokes that were entered on Cheatah's computer. We simply type:
meterpreter> keyscan_dump
As you can see, every keystroke has been captured including the tabs and end of line characters. Now you have the evidence on Cheatah!
I hope you like this article and you enjoyed ... cheers
You can use file and URI associations in Windows Phone 8 to automatically launch your app when another app launches a specific file type or URI scheme. When launched, a deep link URI is used to send the file (a reference to the file) or URI to your app. You can also use the association launching API to launch another app in the same way. This topic describes file and URI associations, and how you can use them in your app.
File associations allow your app to automatically launch when the user wants to open a particular file. That file could come from a variety of sources including, but not limited to:
an email attachment
a website via Internet Explorer
a Near Field Communications (NFC) tag
another app from the Store
To register for a file association, you must edit WMAppManifest.xml using the XML (Text) Editor. In Solution Explorer, right-click the WMAppManifest.xml file, and then click Open With. In the Open With window, selectXML(Text) Editor, and then click OK.
When your app is launched to handle a particular file type, a deep link URI is used to take the user to your app. Within the URI, the FileTypeAssociation string designates that the source of the URI is a file association and the fileToken parameter contains the file token. For example, the following code shows a deep link URI from a file association.
namespace sdkAutoLaunch
{
class AssociationUriMapper : UriMapperBase
{
privatestring tempUri;
publicoverride Uri MapUri(Uri uri)
{
tempUri = uri.ToString();
// File association launchif (tempUri.Contains("/FileTypeAssociation"))
{
// Get the file ID (after "fileToken=").int fileIDIndex = tempUri.IndexOf("fileToken=") + 10;
string fileID = tempUri.Substring(fileIDIndex);
// Get the file name.string incomingFileName =
SharedStorageAccessManager.GetSharedFileName(fileID);
// Get the file extension.string incomingFileType = Path.GetExtension(incomingFileName);
// Map the .sdkTest1 and .sdkTest2 files to different pages.switch (incomingFileType)
{
case".sdkTest1":
returnnew Uri("/sdkTest1Page.xaml?fileToken=" + fileID, UriKind.Relative);
case".sdkTest2":
returnnew Uri("/sdkTest2Page.xaml?fileToken=" + fileID, UriKind.Relative);
default:
returnnew Uri("/MainPage.xaml", UriKind.Relative);
}
}
// Otherwise perform normal launch.return uri;
}
}
}
for all the people who looking for icons for any app for windows phone 8 & 7 this is a nice collection you may like:
http://www.geekchamp.com/icon-explorer/action-icons