i found nice web tool to convert VB.NET to C# and vice versa …
http://www.developerfusion.com/tools/convert/vb-to-csharp/ ,
maybe be useful
Understanding the differences between VBA and Visual Basic .NET can help you make a more informed decision about converting your code. This section examines differences in the following areas:
- Language
- Project management
- Security
- Deployment
Language Differences
Because Visual Basic .NET was designed to take advantage of the .NET Framework, it contains many changes and areas where compatibility with previous versions of the language has not been preserved. The following is a partial list of changes to the Visual Basic language in Visual Basic .NET. For more information, see Introduction to Visual Basic .NET for Visual Basic Veterans.
' Using Ctype to convert the Object.returned by Sheet1 to a Worksheet.
MsgBox(CType(ThisWorkbook.Worksheets("Sheet1"), Excel.Worksheet).Name)
ActiveDocument.Tables(1).Cell(1, 1).Range = "Name"
ThisApplication.ActiveDocument.Tables(1).Cell(1, 1).Range.Text = "Name"
ThisApplication.ActiveDocment.Tables.Item(1).Cell(1, 1).Range.Text _
= "Name"
Selection.Find.Wrap = wdFindContinue
ThisApplication.Selection.Find.Wrap = Word.WdFindWrap.wdFindContinue
' VBA Dim mySelection as Selection Dim myOtherSelection as String Set mySelection = Selection myOtherSelection = Selection ' Visual Basic .NET Dim mySelection As Word.Selection Dim myOtherSelection As String mySelection = ThisApplication.Selection myOtherSelection = ThisApplication.Selection.Text
- Control anchoring is now possible, so that when a user resizes your form, the controls automatically resize and reposition properly.
- Setting tab order is much easier with Windows Forms. Enable tab ordering by clicking Tab Order on the View menu. Then simply click each control in the preferred order.
- Creating menus in-line is an improvement over menu creation in VBA.
- In VBA, you can show a form as vbModal or vbModeless. In Visual Basic .NET, the ShowDialog method is used to display a form modally; the Show method is used to display a form non-modally. Note, however, that the form will display non-modally, but when you click in the Word or Excel document, the form moves to the background, which can be confusing to your users.
- Many new form controls are also available in Visual Basic .NET, such as data-entry validators, common dialog boxes, hyperlinked labels, system tray icons, panels, numeric-up/downs, on-the-fly designable tree views, Help file linkers, ToolTip extenders, and more
Project Management Differences
When you start using Visual Basic .NET to create your Office solutions, one difference you will notice is the location of the code in your project. When you use VBA to create an Office solution, the code resides in modules, UserForms, and class modules within a Word template, Word document, or Excel workbook. When you use Visual Studio Tools for the Microsoft Office System, the code resides in classes and Windows Forms, which are compiled into an assembly, and is referenced by the Word or Excel document.
The Visual Studio .NET IDE has enhanced functionality, but it is similar to the VBA IDE in many ways. Each has an explorer for viewing projects, modules, forms, and references. Each provides a properties window, toolbox, object browser, and debugging capabilities. Table 1 lists some differences you might notice when managing your projects.
Table 1. Differences in the VBA and Visual Studio .NET IDE
| VBA IDE | Visual Studio .NET IDE |
|---|---|
| Project Explorer contains a dynamic list of all of the projects (templates, documents, and add-ins) that are currently open. | Solution Explorer contains a static list of one or more projects in the open solution. |
| Project files are stored in subfolders: UserForms, modules, and class modules. | Project files are stored alphabetically and are not categorized into subfolders. |
| In Word, the project contains a folder that shows the references to global templates. In Word and Excel, external references are set using theReferences command on the Tools menu.
If you create a Web reference using the Web Services Toolkit, classes are created for the Web service and all of its methods. The classes are located in the Class Modules folder. |
The project contains a folder that shows the references you have set using the Add Reference command on the Projects menu.
If you create a Web reference, the reference is located in the Web References folder. |
| Project files have distinct file extensions: UserForms (.frm), class modules (.cls), and modules (.bas). | Project files for forms, modules, and class modules all have the same .vb extension. Supporting files have other extensions (.xml, .aspx, and so on.). |
| In a VBA solution for a Word template or document, ThisDocument is located in the Microsoft Word Objects folder.
In a VBA solution for an Excel Document, ThisWorkbook and the worksheets are located in the Microsoft Excel Objects folder. |
Visual Basic .NET Word projects contain a ThisDocument code file.
Visual Basic .NET Excel projects contain a ThisWorkbook code file. |
Another difference that you will find is in the use of ActiveX controls. In VBA, ActiveX controls are top-level objects and have IntelliSense support. In Visual Basic .NET, you must define variables for the controls, use the FindControl method in Visual Studio Tools for the Microsoft Office System, and convert them to a strong type in order to access IntelliSense.
Security Differences
The Microsoft .NET Framework provides security features that you cannot take advantage of in VBA. In VBA, there are three basic security options:
- Set the security settings to high on user machines and digitally sign your code.
- Let the user decide whether or not to trust the code when presented with the macro virus warning.
- Set the security to low to allow all code to run (including malicious code). Note that this third option should never be used.
Word and Excel documents with managed code extensions that are created using Visual Basic .NET do not use Office macro security, which relies on the Office certificate store. They incorporate the standard security features available in the Microsoft .NET Framework 1.1, for example:
- Code signing is no longer necessary, as there are several types of evidence that are available for security in .NET Framework, including Application Directory, Strong Name, URL, and more.
- Administrators can use standard tools to set security policies. The security policy must grant full trust to an assembly or the code cannot execute.
- The end user cannot change security options within Word or Excel to permit untrusted code to run. If the end user opens a document with untrusted code, the code will not run.
For more information on setting security in the .NET Framework, read the Visual Studio Tools for the Microsoft Office System help topic, “Security in Office Solutions That Use Managed Code Extensions,” or see An Overview of Security in the .NET Framework.
Deployment Differences
Deploying Visual Basic .NET applications is quite different from deploying VBA applications. Visual Studio Tools for the Microsoft Office System projects usually consist of two files: the assembly, which contains the compiled code, and the document (Excel worksheet or Word document or template), which contains custom properties that point to the assembly. The document and assembly are deployed separately. Unlike many VBA projects where the code is embedded in the document, in Visual Studio Tools for the Microsoft Office System projects, the assembly can be stored in a shared network location, or it can be copied to each end user’s computer. The advantage in deploying an assembly to a network location is that it is easier to update the code because you will have only one copy of the assembly on the network share. Users can modify and customize their copy of the document and will have access to the updated assembly every time the document is opened. This happens automatically, with no user intervention.
You can understand the features of ADO.NET by comparing them to particular features of ActiveX Data Objects (ADO).
In-memory Representations of Data
In ADO, the in-memory representation of data is the recordset. In ADO.NET, it is the dataset. There are important differences between them.
Number of Tables
A recordset looks like a single table. If a recordset is to contain data from multiple database tables, it must use a JOIN query, which assembles the data from the various database tables into a single result table.
In contrast, a dataset is a collection of one or more tables. The tables within a dataset are called data tables; specifically, they are DataTable objects. If a dataset contains data from multiple database tables, it will typically contain multiple DataTable objects. That is, each DataTable object typically corresponds to a single database table or view. In this way, a dataset can mimic the structure of the underlying database.
A dataset usually also contains relationships. A relationship within a dataset is analogous to a foreign-key relationship in a database —that is, it associates rows of the tables with each other. For example, if a dataset contains a table about investors and another table about each investor’s stock purchases, it could also contain a relationship connecting each row of the investor table with the corresponding rows of the purchase table.
Because the dataset can hold multiple, separate tables and maintain information about relationships between them, it can hold much richer data structures than a recordset, including self-relating tables and tables with many-to-many relationships.
Note Data adapters, data connections, data commands, and data readers are the components that make up a .NET Framework data provider. Microsoft and third-party providers can make available other .NET Framework data providers that can be integrated into Visual Studio. For information on the different .NET Data providers, see .NET Data Providers.
Sharing Data Between Applications
Transmitting an ADO.NET dataset between applications is much easier than transmitting an ADO disconnected recordset. To transmit an ADO disconnected recordset from one component to another, you use COM marshalling. To transmit data in ADO.NET, you use a dataset, which can transmit an XML stream.
The transmission of XML files offers the following advantages over COM marshalling:
Richer data types
COM marshalling provides a limited set of data types — those defined by the COM standard. Because the transmission of datasets in ADO.NET is based on an XML format, there is no restriction on data types. Thus, the components sharing the dataset can use whatever rich set of data types they would ordinarily use.
Performance
Transmitting a large ADO recordset or a large ADO.NET dataset can consume network resources; as the amount of data grows, the stress placed on the network also rises. Both ADO and ADO.NET let you minimize which data is transmitted. But ADO.NET offers another performance advantage, in that ADO.NET does not require data-type conversions. ADO, which requires COM marshalling to transmit records sets among components, does require that ADO data types be converted to COM data types.
Penetrating Firewalls
A firewall can interfere with two components trying to transmit disconnected ADO recordsets. Remember, firewalls are typically configured to allow HTML text to pass, but to prevent system-level requests (such as COM marshalling) from passing.
Because components exchange ADO.NET datasets using XML, firewalls can allow datasets to pass.
So what’s going inside there? .. what happens when you think, move, blink , smile …etc?
Well .. let’s see ..
Each action inside your brain is associated with a certain intensity measured in micro voltage .. electricity! .. yeah this is how it goes..
So when you think in a certain action, perform a muscular movement or even have a certain feeling [Sad, Happy .. etc], your brain fires a series of signals with an intensity that corresponds to this action.
Brain Rhythms:
EEG Signals are grouped into 5 categories bas on their frequency:
- Delta waves (0.5-4 Hz): mainly associated with sleeping.
- Theta waves(4- 7.5 Hz): They fire when as consciousness slips towards drowsiness, in other words when you feel sleepy or even when you get a short nap.
- Alpha waves (8-13 Hz): Relaxed awareness without attention or concentration.
- Beta waves (14-26 Hz): Active thinking and attention
- Gamma waves (30 – 45 Hz): They often detect occurences of diseases.
Source: EEG Signal Processing, Saeid Sanei and J.A. Chambers
What is a build system?
A build system is a piece of software that helps you build your project. Build doesn’t necessarily mean compile, there are many tasks associated with certain project, you may want to build a distributable package for example, package the current source code in a compressed archive, or you may want to build a PDF manual from documentation. The tasks you may need depends on the project and your requirements, but every task usually has some kind of a process that is repeatable every time you want to do that task.
Why use a build system?
A build system allows you to define steps needed to do what you want, which makes processing those repeatable tasks easy, less error-prune, time efficient, and more importantly unifies the process across different developers. A build system allows you to specify your dependencies clearly (i.e. To do C, you must do A and D first), and saves time by building files that was changed from the last build only.
Introduction to Ant
Ant is a cross-platform build system designed for Java software projects, although it can be used in other contexts, it’s widely used in Java projects. With Ant, you write an XML file, and then invoke ant with that file and other parameters to process the build.
For a software project, you will define targets. Targets are collections of tasks you want to do, common targets you will probably define are:
- build to compile the source code using the javac compiler.
- dist to build a distributable JAR file of the project, and maybe source code too if you want.
- clean to delete compiled files and JAR files.
Those are just suggestions and to give you an idea of what targets are, but you can define the target to do whatever you want.
Steps within targets are executed by calling Ant Tasks. Removing a directory is a task for example that takes one parameter which is the directory to be removed. Ant provides a collection of predefined tasks, and you can write your own custom task in Java if those tasks don’t cover your needs, or isn’t available elsewhere.
Ant Example
This is an example build.xml file to show how Ant configurations look like: [1]
<?xml version="1.0" encoding="UTF-8"?>
<project name="ExampleProject">
<property name="src" location="src" />
<property name="build" location="build" />
<!--Defining a target named "build"-->
<target name="build">
<!--Create the build directory using the predefined "mkdir" Ant Task-->
<mkdir dir="${build}"/>
<!--Invoke the javac compiler to compile source code to the build directory-->
<javac srcdir="${src}" destdir="${build}"/>
</target>
<!--A "clean" target to delete compiled files-->
<target name="clean">
<delete dir="${build}">
</target>
</project>
To execute the build target in that example, you need to go to the command line, and switch to the directory where the XML file exists, then execute ant followed by the target name, in this case: ant build [2].
Ant assumes the file name is build.xml, if that’s not the case, you will have to pass the configuration file name as a parameter to ant (i.e. ant -f otherfile.xml).
Fortunately for those who don’t like the command line, as Ant is widely used, it’s integrated in many Integrated Development Environments like Eclipse, NetBeans and others.
Further Reading
Other Build Systems
Footnotes
[1] I’ve skipped introducing ant properties to keep it a short introduction, shouldn’t be hard to get though.
[2] This requires that you’ve already installed Ant of course.
السلام عليكم و رحمه الله و بركاته
All of us heard about visualization in Department of Scientific Computing , some know what it is others who don’t or actually didn’t saw a real application this post intends to show a simple example.
Scientificly speaking this is a Visualization technique called “IsoSurface” (in case of 3D visualization).
more explanation about these techniques and applications will be followed.
Good Luck all.
Flood fill algorithm is an algorithm used to fill an area of certain color with another color.
We use it in our application after extracting the lung borders to refill the lung area with the original intensity of the source image.
Here's a little demo for this algorithm, the image is fixed, and don't spend much time asking your self what this image could represent :D
it's th image resulted from sobel edge detection of lung CT image, anyway :D
all you have to do is to choose a color and click the area you want to fill, and get the image colored ;)
It's a direct implementation of the third pseudo code that could be found here
http://www.codecodex.com/wiki/Implementing_the_flood_fill_algorithm
My implementation is downloadable from here
any comments or questions are appreciated :)
Thanks :)
ITK is an open source system that provide developers lots of ready to use tools for image processing especially medical images segmentation and registration.
It's really useful I advise whoever going to deal with medical images to use this toolkit it's helpful (Y).
But since it's implemented in C++ and we use C# in our project, I used a wrapper called ManagedITK which covers the majority of ITK functions.
For more info please refer to:
---------------------------------------
http://www.itk.org/ ---> The ITK project
http://code.google.com/p/manageditk/ ---> The ManagedITK
It has been while I know :)
But here we're again ;)
I don't know if the title is expressive enough !! But it's ok :D
I just felt that we need to redefine the goal of the project and the output we aim to gain. May be this is because we read more and asked more, so actually I feel that we keep discovering what we really have to do. But I promise we won't keep discovering till the Final seminar isA (A) :D
Well let me sum up what we aim to :
----------------------------------------------
- CBIR based CAD system for lung tumors.
- The system should be totally automated so that the user (physician) will not have to do much work in order to make the system able to identify the tumors.
- The automation is achieved through:
- Automatic lung segmentation
- Automatic identification of tumor candidates.
- Automatic feature extraction.
- Evaluation of the tumor characteristics which gives an initial diagnosis of the tumor (Malignant or Benign).
- By retrieving similar tumors we can confirm our initial diagnosis.
- Finally we show the physician the previous cases and probability that this tumor can be malignant or benign.
Introduction
Artificial Intelligence started in the fifties with a very optimistic vision. Scientists at that time predicted that machines outsmarting human will be built in 10-20 years.Unfortunately (or maybe luckily) this was far optimistic than reality was. AI Scientists after that went through an era of pessimism and thought that -i.e. machines outsmarting man -was impossible.
However, The optimistic era re-started some years ago. This was due to the great increase in computer’s power over the years which really proved Moore’s Law (computer power is doubled every 2 years) .
“AI Scientists worry machines may outsmart Man” is an article in the NewYork Times.They are debating whether there should be limits on research that might lead to loss of human control over computer-based systems.
Why worry ?
So what’s new in order to make scientists start to worry. Unstoppable Computer Viruses, Predator Drones ,self-driving cars, software-based personal assistants,service robots in the home and robots navigating the world are all signs of machines that would harm mankind easily if one of the following happened :
- Man lost control over them.
- They were used by criminals
- Evil was programmed in them for research.
- They had BUGS
The Singularity
Technological Singularity refers to the prediction that human will create machines that out-smart human, causing the end of the human era due to the control of machines. The idea of an “intelligence explosion” in which smart machines would design even more intelligent machines was proposed by the mathematician I. J. Good in 1965. To understand the idea more please watch The Matrix.
The power of forgetting nothing
I and a friend during Cairo ICT 2010 were chating with a researcher working with DARPA about this issue. I was saying that the singularity is very far away and that building extremely intelligent machines is impossible in the coming years. He – the researcher- stated that it’s not that far.Although it’s very hard for humans to invent algorithms that make the machines outsmart humans, the machines still have a power not found in humans : The Power of remembering everything
. According to him,This fact will lead the machines to learn extremely fast and outsmart humans in a small time.
Just Imagine,All the experiences and sciences a man learns in 40 years could be learned by a machine in -say- 7 months. I think you now can understand what i mean !
So, how could i tell him ?!!
i can call him, thats gonna waste sometime..
what about an SMS, the phone sux in writing text
i can mention him in a tweet with the message, No, too public !!
a direct message would be a good choice (Y).
but an offline messenger message is more reliable, what about a mail ?!!
but, google wants to replace mail by wave, so a wave would be better
why a whole wave, i can just wave-ping him.
what about a Buzz ?! so i can test it..
it’s like facebook anyway, i can tell him on facebook
just tag him in a post, or write to his wall, again too public…
a private messa..DOES HE EVEN NEED TO KNOW !!!!
he’ll contact me soon, i can tell him then..
Good Night !
Tagged: Buzz, Email, Facebook, Google, Twitter, Wave

