Sunday, 23 June 2013

find two tag with regex

<docTitle(.*?)>(.*?)</docTitle><rakesh(.*?)>(.*?)</rakesh>

<docTitle>gjnghjjgh</docTitle><rakesh>cvnnnghjjhgjhjhjhg</rakesh>
<docTitle>gjnghjjgh</docTitle><rakesh>cvnnnghjjhgjhjhjhg</rakesh>
<docTitle>gjnghjjgh</docTitle><rakesh>cvnnnghjjhgjhjhjhg</rakesh>
<docTitle>gjnghjjgh</docTitle><rakesh>cvnnnghjjhgjhjhjhg</rakesh>
<docTitle>gjnghjjgh</docTitle><rakesh>cvnnnghjjhgjhjhjhg</rakesh>
<docTitle>gjnghjjgh</docTitle><rakesh>cvnnnghjjhgjhjhjhg</rakesh>
<docTitle>gjnghjjgh</docTitle><rakesh>cvnnnghjjhgjhjhjhg</rakesh>
<docTitle>gjnghjjgh</docTitle><rakesh>cvnnnghjjhgjhjhjhg</rakesh>
<docTitle>gjnghjjgh</docTitle><rakesh>cvnnnghjjhgjhjhjhg</rakesh>
<docTitle>gjnghjjgh</docTitle><rakesh>cvnnnghjjhgjhjhjhg</rakesh>
<docTitle>gjnghjjgh</docTitle><rakesh>cvnnnghjjhgjhjhjhg</rakesh>
<docTitle>gjnghjjgh</docTitle><rakesh>cvnnnghjjhgjhjhjhg</rakesh>
<docTitle>gjnghjjgh</docTitle><rakesh>cvnnnghjjhgjhjhjhg</rakesh>

find self tag by regex

     _r = new Regex("<item (.*?)/>");
            foreach (Match m in _r.Matches(_text))
                if (m.Value.ToLower().Contains("
thumb-") || m.Value.ToLower().Contains("pages") || m.Value.ToLower().Contains("replicamap") || (m.Value.Contains("cover.jpg") && !File.Exists(_inputFolderPath + "\\OUTPUT\\OPS\\images\\cover.jpg")) || (m.Value.Contains("cover.xhtml") && !File.Exists(_inputFolderPath + "\\OUTPUT\\OPS\\images\\cover.jpg")))
                    _text = _text.Replace(m.Value, string.Empty);
            _r = new Regex("<itemref (.*?)/>");
            foreach (Match m in _r.Matches(_text))
                if ((m.Value.Contains("cover.xhtml") && !File.Exists(_inputFolderPath + "\\OUTPUT\\OPS\\images\\cover.jpg")))
                    _text = _text.Replace(m.Value, string.Empty);
            _text = _text.Replace("<item id=\"css\" href=\"css/TablesAndFloats.css\" media-type=\"text/css\"/>", "<item id=\"css\" href=\"css/styles.css\" media-type=\"text/css\"/>");
            if (_creator != "")
            {
                _r = new Regex("<dc:creator>(.*?)</dc:creator>");
                if (_r.IsMatch(_text))
                    _text = _text.Replace(_r.Match(_text).Value, "<dc:creator>" + _creator + "</dc:creator>");
            }

Monday, 10 June 2013

What is the relation between Classes and Objects

What is the relation between Classes and Objects



Our old article based on OOPS show you detail about class and object, now there is a big relationship between class and object.
They look very much same but are not same. Class is a definition, while object is a instance of the class created. Class is a blue print while objects are actual objects existing in real world. Example we have class CAR which has attributes and methods like Speed, Brakes, Type of Car etc. Class CAR is just a prototype, now we can create real time objects which can be used to provide functionality.
Example we can create a TATA car object with 100 km speed and urgent brakes.

Wednesday, 5 June 2013

Sql Server 2005 vs 2008


.Difference between Sql Server 2005 and Sql Server 2008
S.NoSql Server 2005Sql Server 2008
1
XML datatype is introduced.
XML datatype is used.
2
Cannot encrypt the entire database.
Can encrypt the entire database introduced in 2008.
3
Datetime is used for both date and time.
Date and time are seperately used for date and time
4
No table datatype is included.
Table datatype introduced.
5
SSIS is started using.
SSIS avails in this version.
6
CMS is not available.
Central Management Server(CMS) is Introduced.
7
PBM is not available
Policy based management(PBM) server is Introduced.

ajax vs jquery and Ajax vs Javascript


AJAX Difference FAQs-1

1.Difference between AJAX and jQuery
S.No
AJAX
jQuery
1
AJAX is a powerful tool which cannot use HTML since it is a simple tool and it can not reload the page after it is once loaded.
JQuery is a light weight language that focuses the interaction in the HTML elements.
2
AJAX is a combination of several technologies such as CSS, HTML, DOM and many more. In combination with these technologies, AJAX provides new functionalities.
JQuery cannot provide a new functionality by combining with other technologies.
3
AJAX should be accessed in a proper procedure to retrieve data from the server.
JQuery can be accessed through front-end therefore JQuery does not require understanding of the complete procedure to setup a page.
4
Heavy usage of AJAX often leads to the server overload due to more number of connections created.
There is no chance for overload of server while using JQuery since there is no such heavy usage in JQuery.

2.Difference between AJAX and JavaScript
S.No
AJAX
JavaScript
1
AJAX allows the coder send request data asynchronously in order load new data without changing the web page.
JavaScript is a client side scripting language that allows the creation of dynamic web pages by providing a new level of interactivity.
2
AJAX supports the server side scripting Language.
JavaScript provides support to the client side scripting language.
3
AJAX can load the web page after it is been loaded for the first time.
JavaScript cannot load the pages after it is once loaded.
4
AJAX does not install Trojan in the computer.
JavaScript can install Trojan in the computer.

Difference between MVC 2 and MVC 3 in ASP.NET


Difference between MVC 2 and MVC 3 in ASP.NET





S.No
MVC 2
MVC 3
1
View Engines:
MVC 2 uses only Web Forms view engine (.aspx).
View Engines:
The view engines used in the ASP.NET MVC 3 Framework are the Razor View Engine (.cshtml or .vbhtml) and the Web Forms view engine (.aspx).
2
Chart, WebGrid, WebImage, WebMail Controls:
Not Available
Chart, WebGrid, WebImage, WebMail Controls:
Available
3
Objects available for sharing data between View and Controller:
TempData, ViewData
Objects available for sharing data between View and Controller:
TempData, ViewData ,ViewBag
4
Web Forms view engine syntax:
<%=Html code %>
Razor View Engine syntax:
@Html code
5
Support for jQuery:
Good
Support for jQuery:
Better
6
Support for Dependency Injection:
Good
Support for Dependency Injection:
Better
7
Support of Layouts:
Only Master Page (.master)
Support of Layouts:
Both Master Page (.master) and Layout Page (_Layout.cshtml)

Tuesday, 4 June 2013

WPF Architecture

WPF Architecture

Share
The Major components of WPF Architecture are Presentation Framework, Presentation Core and Media Integration Layer. The architecture divides in three major groups Managed Layer, Media Integration Layer (Unmanaged code) and Core Operating System.

Managed layer contains WindowsBase, Presentation Framework and Presentation Core assembly. Media Integration Layer contains Milcore(Media Integration Library Core)  and WindowsCodecs modules and both are unmanaged code. Media Integration Layer interacts with Direct3D and Direct3D interacts with Device Driver.



Presentation Framework – Holds top level WPF types includes Window, Controls, Styles, and Layout Panels etc. The code and controls written in WPF Application is mostly interacting with this layer.

Presentation Core – Holds base types such as UI Element and Visual. Almost all the controls you are directly interacting with are derived from these types. Presentation Framework uses most of the types defined in this layer.

MilCore – Media Integration Library is core rendering system. MIL is unmanaged code. This layer converts WPF elements into the format that Direct3D expects. Windows7 and Windows Vista uses this assembly to render its Desktop.

WindowsCodecs– provides supports for imaging like image processing, image displaying and scaling etc.

Direct3D – This layer is used to render graphics created using WPF Applications.

Rainbow table concept

Now what if I wanted to break into this account? The fact that the same input always generates the same hash tag means I can build up a database of inputs and outputs and use that to attack an account, this is called using a ‘rainbow table’, a database of inputs/outputs used to determine a hashed password.  Rainbow tables are easily found on the internet, so this one-way hash is not as safe as once thought.  If your interested in learning more about rainbow tables, check out http://ophcrack.sourceforge.net/.

So what’s the best way of stoping rainbow table hacking? Salting. By generating a random “salt” for every user and attaching it to their passwords before hashing, you have made the rainbow tables ineffective. For example, the password ‘qwerty123′ becomes ‘qwerty123AS@#$fgr=’ and is then hashed into ’8a7bb436d4849395072483f7715b7edb’.  Because the salt generates a random string and each user in your database has a different salt value, you have effectively removed the threat of rainbow tables.

If you want to read more about the inner workings of rainbow tables, take a look at this post: http://chargen.matasano.com/chargen/2007/9/7/enough-with-the-rainbow-tables-what-you-need-to-know-about-s.html


Rainbow tables (Rainbow Table) is a crack hash algorithm technology, its performance is very shocking, on a common PC combined with NVIDIA CUDA technology for NTLM algorithm can achieve up to 103,820,000,000 times per second try (more than expressly one hundred billion) for the widely used MD5 close to one hundred billion times. Even more amazing is that rainbow table technology is not intended to address the vulnerability of a hash algorithm attack, but similar brute force, are valid for any hash algorithm.
It is almost incredible, Roger can not wait to see the principle of introduced. In fact, this is not new technology, but unfortunately, the search for the principle of rainbow tables "out of the articles on the introduction of the principle of rainbow tables have quite right, Roger is here a brief look at the main reference Wiki this with good English can go to this paper .

http://www.webdbtips.com/45045/