Developer Freedom
Sharing my daily challenges with all fellow developers so they can avoid issues that I had. Issues related to .Net framework development.
Tuesday, June 23, 2015
Friday, May 03, 2013
Note: this post has also the hamza maksoora but as a substring of a whole string, it also should not match.
Note: this post has the hamza in the thrid line but it is hamza maftoo7a, should not match the search we are looking for.
Monday, April 15, 2013
Monday, December 10, 2012
Friday, December 07, 2012
Tuesday, December 04, 2012
Thursday, November 29, 2012
Wednesday, November 28, 2012
Tuesday, November 27, 2012
Wednesday, November 21, 2012
Tuesday, November 20, 2012
Friday, November 16, 2012
Thursday, November 15, 2012
Wednesday, November 14, 2012
Thursday, November 01, 2012
Friday, February 10, 2012
Friday, March 25, 2011
Monday, February 21, 2011
Wednesday, July 28, 2010
Thursday, June 24, 2010
Tuesday, June 22, 2010
Monday, June 21, 2010
adwards
Hello, and welcome to Google AdWords. We're excited to have you on board! There's just a few details we need from you to set up your account.
To begin creating your AdWords account, choose the user name and password you'd like to use with AdWords.
Thursday, June 17, 2010
this is my fake post!
Tuesday, April 27, 2010
Thursday, April 08, 2010
spartans
There are few sounds in this world more satisfying than the sound of a ping pong ball landing in a Solo cup.
Beirut or Beer Pong, as it known for short, requires minute precision and impeccable hand-eye coordination.
It also requires teamwork (it's a two-on-two game and you need both people to pull their weight to accomplish the sought-after "sendback"), strategy (the question of "to bounce, or not to bounce") and an unyielding commitment to excellence, many of the virtues espoused at Michigan State University.
msu
Garden Mount: 60 inches long- pushes into the ground
Roof Mount: 15 inches long- conforms to roof pitch
Post Mount: 15 inches long- attaches to any vertical surface with a 3 x 3 inch mount plate
Deck Mount: 15 inches long- attaches to any horizontal surface with a 3 x 3 inch mounting plate
test 1
Is it unethical to harness the crazy the internet has to offer by purposely seeking out the psychos? I'm not talking scary psychos, though for a girl looking for a guy, the line is much finer than a m4w, I'd say. So this is more conjecture and less an actual plan on my part. I just can't help thinking it's a shame the power of these crazies won't be able to make me laugh as much as i deserve.
I recently signed up for OkCupid, though immediately realized I have no place there, and don't want to meet anyone. I have plenty of good friends and am not looking for a boyfriend. I don't even like people I don't already know, so I pretty much ignore it. But i do check in every once in a while for curiosity's sake. A few days ago i received a note from someone calling himself Pete1. Here goes (prepare gag reflex):
As I Pluck you down from your tree out of my reach 12
I would savor your flavor just like a ripe peach. 12
Want to walk hand in hand with you across the beach. 12
So many lessons in love I'd like you to teach. 12
You say that you were working so hard at your school, 12
As I wipe off my chin overflowing with drool, 12
Your pictures responsible; this nat'(u)ral event, 12
Know all of this is true; that what I said I meant. 12
What I said was genuine, I wipe off the glob 12
Because it is my heart that you've have managed to rob. 12
Remain convinced that you're act-u-lee a burglar, 12
Still really want to take you out for a burger. 12
I know there is more to you than read-uh-lee seen, 12
As my waking thoughts are plagued with you in my dreams12
It is for only you that this here song is sung, 12
I really want to massage; your lips with my tounge. 12
Out of my mouth; with all of the things that I had said, 12
This insane balding man; who is out of his head. 12
Hope I kept your int-rest with this here little poem, 12
And within your eyes fine-a-lee find a new home. 12
Uh. User blocked, obv. But I just went back to the email message because I couldn't help wanting to get to the end of the poem. In order to do that I had to go onto his profile and unblock him.
Wednesday, April 07, 2010
The data that was hacked across computers in India and Indian mission abroad also included sensitive data regarding the Maoist and Naxalite movement in the country, India’s ties with Russia and Middle East and information on Indian missile systems. The hackers also got hold of Dali Lama’s
The data that was hacked across computers in India and Indian mission abroad also included sensitive data regarding the Maoist and Naxalite movement in the country, India’s ties with Russia and Middle East and information on Indian missile systems. The hackers also got hold of Dali Lama’s
Monday, March 29, 2010
Wednesday, March 17, 2010
Tuesday, March 16, 2010
Thursday, March 11, 2010
Wednesday, March 10, 2010
Monday, March 01, 2010
Friday, July 17, 2009
so you upgraded from VS2005 or VS2008 to VS 2010 and you do not like the code view, meaning the font for the code in the new version looks weired and not clear?
a simple change to the options will set the font to the same font you used to see in previous versions of vs.net
basically the new visual studio 2010 uses the font called "Consolas", while the older version 2008 used the font, "Courier New", simply in visual studio .net 2010, go to Tool --> Options --> Environment --> Fonts and Colors and then on the right hand side change the font from "Consolas" to "Courier New".
screen shot is below:
you can see some Ron's code here!
Friday, March 20, 2009
There are always a bad way to do things and a good way to do it, I was reminded with that today after fighting with issues related to FtpWebRequest class !
I want to focus my article today about the how to specifically call the "GetRequestStream" method of the "FTPWebRequest" class. If you are not aware of the usage of this method, basically you use it to start writing to a buffer stream to upload a file from a source to a destination server. The following is the BAD DO NOT ATTEMP way of calling this method: I have highlighted the bad code in red below:
//Create a FTP Request Object and Specfiy a Complete Path
FtpWebRequest reqObj = (FtpWebRequest)WebRequest.Create(_completeFTPPath);
//Call A FileUpload Method of FTP Request Object
reqObj.Method = WebRequestMethods.Ftp.UploadFile;
//do not keep the connection after uploading the file
reqObj.KeepAlive = false;
//If you want to access Resourse Protected You need to give User Name and PWD
reqObj.Credentials = new NetworkCredential("username here", "password here");
//FileStream object read file from Local Drive
byte[] buffer = File.ReadAllBytes(_localUploadFullPath);
reqObj.Proxy = null;
reqObj.GetRequestStream().Write(buffer, 0, buffer.Length);
reqObj = null;
why this is bad: couple of things:
1- it cause the uploaded file to "keep writing" into the stream without finishing file upload!
2- on the receiving end, the inetinfo.exe "locks" the file and you cannot do anything with the file (which is not complete anyway) until you either kill inetinfo.exe or let it release the file after few minutes.
Below is the right way to do it:
Stream s = reqObj.GetRequestStream();
s.Write(buffer, 0, buffer.Length);
s.Close();
so we created a stream object that we can really control, once you get the stream back, you can write to it, and then call the close method to release the resources associated with ftp.
this is it, it's a small trick but it save you a lot on debugging and falling into a big trab.
Tuesday, March 10, 2009
In a SSIS package I created couple of days ago, I was trying to minimize the number of connection strings / objects in the package so that I can have less "values to configure" in the SSIS package config files.
In the package, I had a single OLEDB connection in the connection managers window, and I did the infamous access of the connection inside the scipt task hoping I can reuse, the error I got was:
"Unable to cast COM object of type 'System.__ComObject' to class type 'System.Data.OleDb.OleDbConnection'."
so I did some search and found this thread from technet
http://social.technet.microsoft.com/Forums/en-US/sqlintegrationservices/thread/7d9b3a46-9f90-4886-8a25-acabaf5d6a3f/
read the last post:
"Correct, if you want to use the connection object in a script, it must be ADO.NET, not OLE-DB, so that means two for you. The alternative is what the other posted attempted, using the connection string from an OLE-DB connection, to initialise a .NET connection object, but with the limitation of no password. if you use only integrated security it is a poissible solution."
So, I belive integration of connections between the package and the child scipt task still needs some work on the microsoft side. because now you have to either create two connections, one of type OLEDB and one of type ADO.Net, which will cause two config values in the ssis config file.
Or do it like what I did:
I created a package variable to hold the connection string and then I create my own object in the script task from this connection string, not that straightforward but the best I can do now.
happy ssis programming!
-Tamer
Thursday, March 05, 2009
Hi all ! I have been playing with SSIS for the last few weeks. The package I was building was sophisticated and I had to reuse some of the code that I had in other .net library projects.
In SSIS Script Task, to reference an external library, you need to add the library to the GAC so it can find the binary at runtime. If you go that route, you will have to add a strong key to the existing library, right? will that's what I did, and it did not take me that long to figure out that created problems for me ! here is a simple example:
1- .net Projects 1 references Library Lib1, no strong keys, and dll of Lib1 is moved along with Project 1 when I do a complie.
2- SSIS needs to reference the library. So I add strong key to Lib1, recompile, and add to GAC.
3- now SSIS is happy.
4- Project 1 now does not have a copy of the DLL, visual studio automatically does not include Lib1 in Builds because you are not supposed to call it this way now, you need to move how you call Lib1 to the GAC way.
5- once Lib1 added to the GAK, and once you add a reference to the GAC assemply in the app.config, Project 1 will work again.
The question is, what if you do not have just one Project 1? what if you have 10 projects that reference Lib1, are you going to change all of them because of SSIS, hell no, I will not personally do that! ,,,
Easiest route is to find a way to directly use the code from Lib1 in SSIS script task, in my case Lib1 code was available so it was easy copy couple of .cs classes to the Script Task in the SSIS package, and Boom, I immediatly removed the reference to Lib1 from SSIS, and lived my life without strong keys / GAC stuff...
if you have a different way of doing it, let's know!!
Monday, March 02, 2009
I was working today on a SSIS project using Business Intelligence Development Studio 2008 and I created a script task with vb.net as the default language. Then add some code and references to .net dlls.
Close the task, did something in the package, then I went back to the Script task and things disappeared, so I was upset for a moment there because of lost code. So I tried to add the reference again to my dll and it gave the message:
"no template information found. See the application log in Event Viewer for more details".
opened event viewer and found the following error in the application log:
The global template information is out of date. Regenerate the templates by running 'VSTA.exe /installvstemplates' or reinstalling the application.
I tried both:
1- ran VSTA.exe /installvstemplates and devenv.exe /installvstemplates: did not solve the issue
2- un/re installed VS.net 2008, did not do it either.
so I thought I may try to drop in a Script Task that is in a diff language, so I tried C# and adding reference in the VSA worked great ! so somthing looks corrupt on my side now with vb.net inside VSA. will tackle this issue later but at least I can get back to development to recover lost hours :)..
have a good working day!!
Sunday, February 22, 2009
sometimes you run into issues when trying to add a .net assemply to the GAC, especially when there are so many command options for the gacutil command.
You need the assemply to be strongly type, you use the "sn" command for that (from the dot net sdk command prompt).
To create a strong name key in visual studio, Open up the project in vs.net, and click on the project properties, go to the Signing Tab (6th at the bottom), and check the check box called "Sign the assemply", then choose "New" from the drop down. this will create a strong name key and also assign it to the assemply, now recompile the project, and then open windows explorer where the assemply is located, copy the location of the assemply, and then open a vs sdk command prompt, type in:
gacutil -i yourDLLName.dll
and you are set !!
happy programming!
Friday, August 29, 2008
the new blug in for firefox 3.0, inerting maps and finding information based on language could save lots of time for users around the world. I wonder if the timing for releasing such feature was planned ahead by Creators of Mozilla to beat the new IE8 which is available for download in beta 1 at the moment. I think Mozzila is now few steps ahead passed IE!
nc work mozzila!
Monday, February 19, 2007
Restore mdf file without ldf in SQL Server 2005
We had some disk space issues on one of the drives and the reason was because one sql log file had 611 GB of disk space used, so I stopped the service and deleted the file hopeing that creating a similar database with the same name can generate an empty log file that I can use, but this was a mistake, so I searched around for a solution and most of the articles out there was kind of outdated, it mentiones solutions that are not supported anymore by sql server 2005, like changing system tables which is not supported anymore, so here is the solution:
--move the mdf file to a temporary directory, and create a new database with the same name, point it to use an existing mdf file
Create database
for attach_rebuild_log
and this did the trick for me, the output was little weired:
File activation failure. The physical file name "W:\SQLServerData\myoldLogFile.ldf" may be incorrect.
New log file 'W:\SQLServerData\temp\newLogFile_log.LDF' was created.
And because you probably did this operation using a temporary location, you need to move the files, you can restart sql server service, detach the database, and move the files whereever you want, and then attach from the new location
it works!
Wednesday, January 17, 2007
I experienced some performance issues with visual studio 2005 yesterday, it started with taking long time to save a file, I thought that I have changed something, or added add-on that caused this to happen, also it took longer time to open the IDE, although I have a dual core with 3 G of memoory...
but thanks god, I downloaded sp1 from http://www.microsoft.com/downloads/details.aspx?familyid=BB4A75AB-E2D4-4C96-B39D-37BAF6B5B1DC&displaylang=en , it took some time to install but it the problem has gone immediatly !
Friday, January 12, 2007
After some struggles and wondering why my application hangs sometimes without throwing any exceptions or errors in event log entries, I was able to find out that the Regex in .Net was the issue.
so I started investigating and there are some nice handy solutions online but it's little sophsiticated and coupled specifically with regular expressions, while if you use the ThreadPool class, it's much easier to control threads and start asynchronous processes and wait for it a for a certain amount of time until it either finishes or the time is up.
here is all what you need (vb.net 2.0 .net framework)!
Imports System.Threading
'you create a threadnotify object to monitor the asynchronous process
Dim ThreadNotify As AutoResetEvent = New AutoResetEvent(False)
'start the process
ThreadPool.QueueUserWorkItem(New WaitCallback(AddressOf StartMyAsyncProcess), ThreadNotify)
'wait 1.5 seconds , if the time is over, the thread will halt itself and this program will resume.
ThreadNotify.WaitOne(1500, True)
end sub
'the asynch process
Private Sub StartMyAsyncProcess(ByVal state As Object)
in_string = Regex.Replace(in_string, "\s*\r\n\s*", vbNewLine)
state.set()
End Sub
Friday, November 17, 2006
so far I have tried 2 technologies for adding graphs to my .net sites, I used the dotnetcharting component http://dotnetcharting.com/ and I also used the fusion flash component http://www.infosoftglobal.com/FusionCharts/ , they are both great, but when it comes to having multiple series, here comes the challenge !
the graphs XAxis points must be defined regardless of the different series added to the graph, in the first technology, the dotnetcharting component, it takes the first series data and it uses it as the base for the XSeries points. For the second technology, the fusion charts, it takes a XML
It's very difficult if the values of XAxis among different serieses are not similar, and you have to add your own logic to handle it. so you start first by having a unique set of all points for the XAxis for all serieses, and then you order it. For example, lets assume that you have series1 and series 2,
series1 has the values for XAxis: Jan,Feb,March
series2 has the values for XAxis: March,Feb,April
so you will first need to define the unique elements: Jan,Feb,March,Apr. then you will need to order it. and also you might want to fill in the gaps for missing xaxis values, like in series2, it does not have the "Jan" values, so you will need to add it, and you will set it's value to 0.
It's not straight forward, but it's doable, hopefully I was able to make things more clear...