Friday, June 28, 2013
Xojo Real Studio
Windows 8.1 Preview Now Available
Friday, June 14, 2013
A Beginner’s Guide to Big O Notation
O(1)
bool IsFirstElementNull(String[] strings)
{
if(strings[0] == null)
{
return true;
}
return false;
}
O(N)
for loop and the function would return early, but Big O notation will always assume the upper limit where the algorithm will perform the maximum number of iterations.bool ContainsValue(String[] strings, String value)
{
for(int i = 0; i < strings.Length; i++)
{
if(strings[i] == value)
{
return true;
}
}
return false;
}
O(N2)
bool ContainsDuplicates(String[] strings)
{
for(int i = 0; i < strings.Length; i++)
{
for(int j = 0; j < strings.Length; j++)
{
if(i == j) // Don't compare with self
{
continue;
}
if(strings[i] == strings[j])
{
return true;
}
}
}
return false;
}
O(2N)
Logarithms
Tuesday, June 21, 2011
How to import an Excel file into SQL Server 2005 using Integration Services
Integration Services, which replaces Data Transformation Services (DTS) in SQL Server 2005, is a wonderful tool for extracting, transforming, and loading data. Common uses for Integration Services include: loading data into the database; changing data into to or out from your relational database structures; loading your data warehouse data; and taking data out of your database and moving it to other databases or types of storage. This article describes how you can use the new features of SQL Server 2005 Integration Services (SSIS) to load an Excel file into your database.
Note: There are several wizards that come with SQL Server Management Studio to aid you in the import and export of data into and out of your database. I will not look at those wizards; I will focus on how you can build a package from scratch so that you don’t have to rely on the wizards.To begin the process, I open SQL Server Business Intelligence (BI) Development Studio, a front-end tool that is installed when you install SQL Server 2005. The BI Development Studio is a scaled down version of Visual Studio. Then I select New Integration Services Project and give the project a name. See image 1.
Image1:
When the project opens, you will see an environment that may look familiar to you if you have used SQL Server DTS; some of the items of the toolbox are the same. For the purposes of this project, I am interested in dragging the Data Flow task item from the toolbar into the Control Flow tab. (The idea of a Data Flow task is one of the major differences between DTS and SSIS packages. In an SSIS package, you can control the manner in which your package logic flows inside of the Control Flow tab. When you need to manage the data aspects of your project, you will use the Data Flow task. You can have several different Data Flow tasks in your project — all of which will reside inside the Control Flow tab.) See image 2.
image 2.
Double-click the Data Flow task that you have dragged onto the Control Flow tab. The available options in the Toolbar have changed; I now have available Data Flow Sources, Data Flow Destinations, and Data Flow Transformations. Since I am going to import an Excel file into the database, I will drag the Excel Source item from the Toolbar onto the screen. See image 3.
image 3
The Excel Source item represents an Excel file that I will import from somewhere on my network. Now I need somewhere to put the data. Since my plan is to put the data into the database, I will need a Data Flow Destination. For the purposes of this example, I will choose SQL Server Destination from the Data Flow Destination portion of the toolbar and drag it onto my Data Flow tab. See image 4.
image 4
To designate which Excel file I want to import, I double-click the Excel Source item that I moved onto the screen. From there, I find the Excel file on the network that I want to import. See image5.
image5
I also need to designate the sheet from the Excel file that I want to import, along with the columns from the sheet that I want to use. image 6 and 7 depict these options.
image 6
image 7
Now that I have defined my Excel source, I need to define my SQL Server destination. Before doing that, I need to indicate the Data Flow Path from the Excel file to the SQL Server destination; this will allow me to use the structure of the data defined in the Excel Source to model my SQL Server table that I will import the data into. To do this, I click the Excel Source item and drag the green arrow onto the SQL Server Destination item. See image 8.
image 8
To define the database server and database to import the data, double-click the SQL Server Destination item. I will define the server in which I will import the data, along with the database that the data will reside. See image 9.
image 9
I also need to define the table that I will insert the Excel data into. I will create a new table named SalesHistoryExcelData. See image 10.
image 10
Under the Mappings section, I define the relationship between the Input Columns (the Excel data) and the Destination Columns (my new SQL Server table). See image 11.
image 11
Once I successfully define the inputs and outputs, my screen will look like the one below. All I need to do now is run the package and import the data into the new table by clicking the green arrow in the top-middle of the screen, which executes my package. See image 12.
image 12
Image 13 shows that my package has successfully executed and that 30,000 records from my Excel Source item have been transferred to my SQL Server destination.
image 13
Sample Excel file is image14
Wednesday, May 25, 2011
Intel i3 vs. Quad Core - Processors ?
i7 = 4 physical cores / 8 threads (Operating system reads 8 cores)
i5 = 4 physical cores / 4 threads (Operating system reads 4 cores)
[dual core] i5 = 2 physical cores / 4 threads (Operating system reads 4 cores) (like an i3 but faster graphics)
i3 = 2 physical cores / 4 threads (Operating system reads 4 cores)
Qxxxx series = 4 physical cores / 4 threads (Operating system reads 4 cores)
Exxxx series = 2 physical cores / 2 threads (Operating system reads 2 cores)
Physical cores are actual 'real' cores. Threads are how many ways the data is transferred. Generally the number of cores match the number of threads but Intel's new i3/i5/i7 series have different amount of threads and cores which is called Hyper threading (typically two threads per core)
The new iX series are better because they run cooler, use 32nm, better memory latency and of course, hyper threading.
Different programs use different amounts of cores so depending on what you use, the performance will be different. If you use a program with multicore then the i7 will be faster, even if it has a slower GHz because of its 4 cores plus hyper threading (8 threads total)
Personally, I would get the i3 if you don't use any hardcore programs like Adobe Suite, or something like that.
By the way, the new i3's and dual core i5's have graphics chips built in to them. The quad core i5 and i7 do not have onboard graphics.
Tuesday, May 24, 2011
Resume tips for experienced IT pros
That’s what I used to think too. I’m not a resume expert, but I thought I had a killer resume. Then, three potential clients in three month’s time nixed me because they thought I was “light” in areas where I was actually a specialist.
If that isn’t a wake-up call, I don’t know what is. So I called a close friend of mine, who is an IT manager at a large company. He knows my abilities, he’s an IT geek at heart, and he’s seen a ton of resumes. He looked at my resume and said, “Yep, I’d have thrown it right in the trash.” I called a couple more friends in similar positions. “It could use some improvement,” one of them told me. Ouch. At least they were honest. Basically, I had a resume that would sell me as an administrator or engineer, but not as an architect or consultant, which was the type of work I was looking for.
I am going to share eight resume tips that sum up what I have learned.
Resume pointers
Most of the standard rules for building a resume still apply: Make sure you have a readable format, proofread for spelling and grammar errors, keep it simple, etc. However, experienced IT pros need to follow some more specialized guidelines. A few of these tips may actually contradict your previous notions of what to include (and exclude) on your resume. They certainly contradicted mine.- Keep your list of “core skills” short and sweet. When you’ve worked with a lot of different technologies, you want to show the world all you’ve done. However, having a long list of core skills actually gives the impression that you know only a little bit about most of those things and that you’re a generalist, not the specialist that the potential client/employer needs. Keep this list to a handful of key skills or possibly eliminate the list altogether.
- Don’t list certification exams. At the very least, minimize the impact of this list. The average IT pro might want to list exams passed to build up a resume, but for the IT veteran, this actually marginalizes real-world experience and accomplishments.
- Quantify projects and results. For example, if you do an Active Directory implementation, specify how many sites, domains, and servers were involved. If you design an e-commerce system, specify the increased percentage of sales that resulted from the project. Tell the potential client/employer exactly how you helped a previous company that you worked for.
- Bullets, bullets, bullets. Don’t use paragraph style writing to describe your projects, tasks, and duties. Bullet-point every major accomplishment or project and leave out the minor things. (Your resume is already going to be too big anyway.)
- Include examples of work, if possible. For instance, maybe you’ve written articles for an online magazine, or perhaps you built an e-commerce site. Include links to pertinent examples so potential clients/employers can see firsthand what you do.
- Highlight major accomplishments. If you’re a high-tech consultant, you may have a lot of smaller projects and clients. Maybe you were hired as a “grunt” for a couple of short-term assignments but had a major project last year. You can’t exclude the small stuff, or potential clients/employers will question what you’ve been doing. But you can minimize the impact by focusing attention on the bigger things. Some ways of doing this include using a slightly larger font, boldface, or italics, or even drawing a thin border around the major accomplishments. But don’t go overboard-subtlety is still key.
- Seek advice from actual managers. Recruiters, agents, brokers, and human resource personnel are all different from managers. Managers want to see results, and they usually know how to spot a weak candidate. If managers think your resume reflects someone who can’t do the job, you’ll never get anywhere. Run your resume by some managers you know and have them critique it for you.
- Know when to stop. If you list all your experience from all the jobs, contracts, or projects you’ve handled, your resume will be more like a book. Find a place to stop listing your experience. If you feel you must at least acknowledge previous experience, try making a separate section and just bullet-point where you worked and what your title/function was. Of course, you’ll usually want to do this only for the less-accomplished jobs that you don’t want to highlight on your resume.