Burak Ozdemir 's Blog


I share what I value.
Writings from an Engineer


Pattern ( Digit & Alphabet ) Recognition using Matlab’s Neural Network Toolbox

Programming No Comments »

pattern recognition

Here is a complete project, which does primitive pattern recognition, it contains pretty enough information to make you grasp the subject. The network is based on the ‘network’ object, so it is a network build from bottom to top, we assign each significant property by hand.

Download Project

AND / OR Gate Implementation using Matlab Neural Network Toolbox

Programming 6 Comments »

After years :) I dare to make a new post without any unnecessary introduction, there happened a lot (Master of Science Degree, Marriage and etc..) and didn’t find time to get busy with blogging, so these are what I’m currently tackling with..

MATLAB

 

 

AND Gate
========
x=[0 0 1 1; 0 1 0 1];
t=[0 0 0 1];
net = newp(x,t);
net = train(net,x,t);
sim(net,[0;0]);
sim(net,[1;0]);
sim(net,[1;1]);
sim(net,[0;1]);

OR Gate
=======
x=[0 0 1 1; 0 1 0 1];
t=[0 0 0 1];
net = newp(x,t);
net = train(net,x,t);
sim(net,[0;0]);
sim(net,[1;0]);
sim(net,[1;1]);
sim(net,[0;1]);

Do jobs in open source programming suck?

Programming 1 Comment »

Recent CNN Money survey pointed out interesting results that while expert users of .NET get higher initial salaries and hefty annual increments that can go up to 15%, open source programmers get only modest hike of just two percent. A debate has been raging in the IT community as to why do .NET programmers get better salary than the open source programmers.

The debate, intentionally or unintentionally, seems to be working in favor of Microsoft, who obviously has vested interest in promoting ASP.NET. RedHat, Zope, and IBM are known as excellent paymasters to open source programmers and scout for talented programmers from open source community.

Read the rest of this entry »

Simple Text Editor with Java Swing

Programming 6 Comments »

Hi again, for this post I decided to demonstrate JAVA’s Swing library.With this library it is easy to create applications with GUI.Anyway I never prefer to write Windows applications in JAVA, however if you need cross-platform stuff, Swing may be a choice.Unlike awt, Swing looks like same in the all platforms. This simple Editor program, uses JMenuBar (Standard Menubar) , JToolBar (Standard Toolbar) , JDesktop (MDI) , Images for buttons , also Editor is capable of inserting images to the text. (StyledDocument).

Here is the source code:
Read the rest of this entry »

Perl and Regular Expressions

Programming No Comments »

perl-at-work-sign.png

Perl is one of the most rooted scripting languages, and has wide range of libraries for any purpose.Nowadays I’m studying it, and exploring its great usage and ease of use.Perl has powerful string processing ability, and also when you have confidence in using regular expressions, you may achieve anything on parsing.Here I want to demonstrate its simple syntax.

\t : Tab Character
\n : New Line
\r : Carriage Return
\f : Form Feed Character
\cX : Control Character CTRL-X.  : Match any one character
| : Alternation
( ) : Group  / Also returns the values for $1 , $2 , $3 after proper matches.
[ ] : Define Character class^ : Match the beginning       $ : Match the end
\b : Match at a ”word” boundary  \B : Match at not a ‘word’ boundary

* : Match 0 or more times
+ : Match at least 1 or more times
? : Match 0 or 1 times

\d : [0-9] A digit            \D : A non-digit
\s : Whitespace char       \S : A non-whitespace char.

/i : ignore case    /g : Match globally (all matches)      /s : Substitute, Replace

=~ True If the regex matches        !~ True If the regex doesn’t match

The above information will be helpful if you have just started to learn Regular Expressions.

Technorati Tags: , , , , ,

C# and Inline Assembly

Programming 1 Comment »

Inline assembly was a technique to use I386 assembly language directives in a C++ code. Programmers often use this technique to gain speed at intense calculations. However C# is far away from this concept, being lack of such a need, C# stands as a limited programming language against C++. According to some gossip, they are considering to add this in Whidbey.

However you may not want to wait for Whidbey, yes it is said to be there exist some solutions, (I heard this from one my programmer friend). Surprisingly the idea seems very interesting to me. The point is that you call assembly functions from a DLL, so the only thing that differs is coding, you just call some functions to make your calculations in machine language, and as a result. you acquire the indispensable augmentation in performance.

Never tried this method, but I will definitely try, in the following posts I may expose it with some code samples. Another important point that you may use this method in VB.NET also, as you can use the DLL in a same manner. Goodbye until to next post!

Technorati Tags: , , , , , , ,

.NET & MySQL – F(r)iends?

Programming No Comments »

Hi, in my previous post I discussed and compared IIS and ASP against PHP and Apache. In this post I’ll be discussing diffuculties about communicating with a MySQL database in ASP.NET on a shared hosting. As you know if you have a direct access to your web server, nothing is impossible but in most cases you can not.

For example, I am using GoDaddy’s shared hosting plans and I’m really happy with.However I am discovering the limits lately, and I am understanding what are you capable of to do with shared hosting using ASP.NET.Chances are that if you are using PHP, you have greater freedom and everything becomes possible.

Yesterday I was trying to connect to a MySQL database with .NET, I accomplished this on Windows very smoothly without having any problems.(I used ByteFX .NET library to connect MySQL).On the other hand, on Web, this is nearly impossible, you can not use external dlls on many of the shared hostings (security issue).I tried to use ODBC to connect MySQL, I didn’t use any DLLs and again I couldn’t connect to MySQL database (By the way this MySQL database is not on my shared hosting, on a completely different host), because thanks to GoDaddy, they have blocked outgoing connections to other database hosts.So I was only able to connect an inner MySQL database.You may ask why MySQL? Because you may not find free database hosts that give MSSql (there are lots of hosts that provides free MySQL databases), and also you may not have any other options other than MySQL, so in such a case your all hands are tied.

Briefly I am really considering to use PHP rather ASP.NET, day by day I discover something that is possible in all the way with PHP and not possible with ASP.NET.
This is really driving me nuts.As you see PHP gains another +1 against ASP.NET.See you next time…

Technorati Tags: , , , , , , , , ,

ASP.NET Url Rewrite – ASP.NET/IIS VS PHP/Apache

Programming 1 Comment »

Have you ever realized how difficult url rewrite can be in ASP.NET which is hosted in IIS?
If you are coding php and hosting it on an apache server, your job is pretty easy. You may just write appropriate
matchings for your urls ( this is typically done by regular expressions ) in htaccess file. However this is not just that easy on IIS. You may ask, why the subject contains “ASP.NET”, this is because IIS is just used to host ASP.NET in usual. You may host ASP.NET on your apache, but the hosting firms in the market do not use apache servers for ASP.NET. They use IIS.

Url rewriting can be made in few ways, with ISAPI modules, or you may configure IIS to direct .html or anyother extensions to ASP.NET dll. However you need to access your IIS server.If you are using a shared hosting like me :) , you may be disappointed but you should accept that you can only do url rewrites which ends in .aspx extension, because IIS directs .aspx extensions to asp.net dll, and your custom rewrites in your global.asax will run before IIS gives an “404 Not Found Error”.

Yes I hate .aspx/.php or any other extensions different than .html. Not only me prefer .html , but also Google prefers .html extensions, and most likely to index that pages.Briefly the same situation can happen if you host php on IIS (which is pretty a dumb action to do), as a result this is not related but .NET, but again If we consider php/apache bros. they gain +1 against asp.net/IIS .

Technorati Tags: , , , ,

Win32 API Introduction

Programming No Comments »

A small win32 application code that was taken from http://www.winprog.org/tutorial/ . Great win32 tutorial for beginners, nowadays I am interested in win32 api programming and found this site from google, here the code piece:

#include <windows.h>

int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance,
LPSTR lpCmdLine, int nCmdShow)
{
MessageBox(NULL, “Goodbye, cruel world!”, “Note”, MB_OK);
return 0;
}

Yes, this is a way of saying “Hello World” in win32 api :)
Maybe I’ll add some small tools in the future if I can learn, it is pretty hard and complicated.

Tags: ,

MPI – Parallel Bubble Sort

Programming 3 Comments »

Below I am giving VC++ project file (utilizing MPI) of a parallelized bubble sort algorithm, you may find it useful, there are message passings between master and slave tasks, also there are some functions like merge, bubblesort and swap.

Download 9 KB

Copyright Protected ©2007 http://www.buraak.com
Contact info : <burak [at] buraak [dot] com>
Entries RSS Comments RSS Log in
eXTReMe Tracker

Privacy Policy