Saturday, December 28, 2013

Obtaining Computer Name From an IP Address

In this world all the computers that are connected to a network have to be identified in some way, hence, the IP (Internet Protocol) address exists and gives each computer a unique identification number by which we can find them.

However, when you work with a computer that is in a local network it's always necessary to get connected to it, what is more, sometimes you need to access to it without being physically there. Thanks to god that we have a mechanism to see our machine remotely, and this requires obviously the IP address or the computer name.

Yes, a computer name, because remember that the IP address is composed by many numbers that are not easy to remember, even more, sometimes the name of the machine gives you a clue about what kind of computer is, for example, where I work a name beginning with "PE" means that the computer is located at Peru meanwhile starting with "CO" means that it's in Colombia.

Perhaps it happened that you only have the IP address but no idea if the computer is the one you need, if the name can help you to be sure you can use the "nbtstat" command in Windows using the parameter "-a" with the IP address of the computer.




Execute the command and wait for results.




You will notice that there are four names, this is because there are two different names the first one is the domain name and the second one is the computer name (the final goal). The another two names are the same but they have other codes because of the names clasification.


Monday, December 23, 2013

Making Excel VLOOKUP Function to Work


I have seen many times that there are some scenaries where the Excel VLOOKUP function is not able to calculate the value we are looking for. For example, let's search the amount for the ID 16 according to a little table with this value.




This is something really easy to do, we need only to use VLOOKUP function selecting the ID, the matrix and the column to be search.




However, when you see the result of this function you notice that there's an error despite the values are fine.




The reason of this error is that the searched ID value is stored as text, so you can convert it in number in this case because it's only one value, but what if it were a thousand of them?.




To avoid worrying about format issues just embraces the key value in the VALUE function inside the VLOOKUP function.




Once you use the function you are going to get the value that corresponds to the ID.




Consider that this is an example where the VLOOKUP function won't work as we want, I helped many people with this to solve another kind of problems with this function.

Sunday, December 15, 2013

Changing Size of VirtualBox Disc

Since I decided to use Linux, because I like it a lot, I knew that I'll need Windows anyway due to the fact that everyone (at most) uses it and considering also that my posts would have to be focused in this operating system (my readers use it).

To overcome this situation I decided to install a virtual machine on my Linux (Debian specifically) to avoid rebooting anytime I need to do something in Windows, to accomplish this purpose I installed VirtualBox and installed in it Windows 7.

However, In some point there was need to get more disk space but I couldn't get it because when you define a virtual machine you specify a determined disk size. But, it can be done the following to increase the disk size using the tools provided by VirtualBox.

First, increase the disk size by using a VirtualBox command created for this task. Remember that the virtual machine has to be turned off to be able to modify the virtual disk, once you are sure about this, go to the configuration of the machine.




Then, go to "Storage" section and pick your virtual disk, this is just to get the physical path of it in your computer, copy it from "Location" label.




With this path copied go to a command line and execute "vboxmanage modifyhd <your_disk_path> --resize <new_size_in_megabyter>", it's very similar in Windows so you won't have any problem, in this example I'm increasing the size to 26 GB.




Now you have your virtual disk with the desired size, but as a physical disk it's necessary to asing the new space to the operating system, to do this boot the virtual machine (in my case Windows) and go to "Start", right click over "Computer" and click on "Manage".




In the new window go to "Disk Management" and you will see not asigned space (consequence of the size increment), just right click over the partition next to this free space and select "Extend Volume...".




Finally, select the amount of bytes you will need in the new partition and that's all, more space for your virtual machine.



Sunday, September 29, 2013

Creating Scripts To Insert Data From Existing Tables

When we work with systems is inevitable to work with data that is manipulated by these, and there are moments when you need to move data created by one application to another database, but it's not necessary to copy all the database to another one, maybe you require just to move all data for particular tables.

For this task, SQL Server can help us by using the "Generate Scripts..." option that it's into Management Studio tool, you only have to right-click over the source database and go to "Tasks" menu and here locate the option said before.


You will see the introduction, just click "Next".


As I said at the beginning in this opportunity we are going to select a group of tables and not all the database.


Specify the media where this result is going to be published. But, in this case it is necessary to click on "Advanced" option to personalized the operation.


As we want just the data, select "Data only" in the "Types of data to script".


Review the summary of the operation to be executed.


Wait for the process to finish successfully.


Once the process finishes with success the output file can be use directly over the new database that have the tables with no data.


Sunday, September 22, 2013

Using Calculated Fields in Dynamic Tables with Excel

Honestly, I don't consider myself an expert in dynamic tables, although many people think that actually I am this is just because I know many tricks about Excel, however I don't use dynamic tables a lot and therefore there are things about this tables than I don't know.

One day, when I was at work, a partner called me to watch his computer because he had a big doubt about something so he decided to ask me about it. He was managing a huge dynamic table that have a bigger simple table as data source, this dynamic table resumed all sales from region, but the problem was that he needed to show that resume not with the exact amount but rounded to thousands.

At that moment I couldn't help him because I didn't know how to do it, but now I took a time for testing ways of doing that and I want to show you what could have done at that time.

First at all create a simple table with few regions and sales value in 3 currencies.


With this information, select it and  go to "Insert" tab and select "Dynamic Table" to create one based in the simple table created above.


You will have your dynamic table created, select  "Regiones" field to have the first column of the new table.


 Now select the "Options" tab and inside here select "Fields, Items & Sets" button to select the option "Calculated Field" from the menu.


Once you see the new window the next step is to set the new field, first put a name for it and second, place the function for this, in this case you have to use a previous existing field to divide it over 1000 and this result has to be rounded by using the native function round provided by Excel.


Doing so will give you a new column in your table that shows the amount of sales but in thousands as it is required.


If you want to see the original value just check the original field from the panel, in this case is the "Dólar" field.


Using this method will provide you many useful ways to present information in an easy way, it depends on the complexity of the functions to be used to calculate the new field.


Sunday, September 8, 2013

Attaching Files to Microsoft Word

Probably you already know, but I work with systems, I mean, I analyze the client requeriments and specify the features a new software or piece of it will have, to do so it's well know that exists an standard document where an analyst have to explain in detail how the feature will behave when the user interacts with it.

Many times, it's necessary to make references to other documents to get the specification clearer enough, and this is why I thought about attaching files instead of referencing them because the person who this document was address for couldn't access to our repository, so I tried to send a unique file containing all the information to avoid any problem. As I did this through Word I'll show you how to do it in it, probably you can do the same with the other Office applications.

The first thing you have to do is to prepare the file that is going to be attached, once you got this file you are now able to use it inside a parent file. The next step it's to open the parent file and locate the place where the another file will be attached.

 
Once you have located the position of the attachment select the "Object" list under the "Insert" section, in this list select also the "Object..." button.


Choose the tab "Create from File" because a previous created file will be selected.


Just search the file you want to attach in the Windows explorer.


Finally, as you selected your file to be added to your parent file, click on "Display as Icon" to show the file as icon.


With this your file is ready to be sent containing the attachment file you selected.


Sunday, July 7, 2013

Inserting Comments on Microsoft Excel

I've just got an Excel file one day when I was working really hard, the problem was that this file contained a lot of numbers with no labels, which I considered something really strange, but suddenly I realized that the description of each calculation was as a comment, so I decided to write about it.

As you know very well, Microsoft Excel allows you to put comments on every cell, what it's very useful at the end when you want to explain something due to the fact that Excel it's not for writing long text. To do so, just go to the ribbon called "Review" and click on "New Comment" and then you can write anything you want in the tiny yellow space that appears.



Well, that's ok but I don't want to be clicking all time in the same button to get a comment inmmediately. Yeah, you're right, this is why I have a little trick, just press "Shift" + "F2" keys to create a comment in one shot and also you can use it to edit any comment you find in your file, in this way you will save you some time and effort.


Sunday, June 9, 2013

Changing Text Size in Microsoft Communicator or Lync

Believe it or not, all these years that I've been working in a company showed me one particular problem that people usually ask me for a solution. The problem was that when working with Microsoft Lync (formerly Microsoft Communicator) suddenly the text chat changed its size to be smaller and almost illegible.

I have always questioned how people do this, because I couldn't figure out what combinations are required to made text change its size, but it's quite easy to fix this.

First at all, this is usually the standard size in a chat window.


After a mysterious combination of keys suddenly changes to this size.


To fix this it is necessary to enable menu window, it is possible by pressing "Alt" key, after doing so you have to pick "View" and move the mouse over "IM Text Display Size" to select a bigger size, as you will see the size will be selected as the minumun possible.


This is a configuration for a particular chat window rather than a global one, therefore you can't establish this in the main window.


Sunday, April 21, 2013

Changing Disk Location in VirtualBox

When we are looking for different kind of operating systems you can think on installing these on your computer, but sometimes you won't use it as usual as you really do with your always-used operating system.

This is my case, I use Linux, Debian specifically, but I bear on mind that Windows will be necessary in some ocassions . Therefore, I decided to install a virtual machine so I won't need to switch between systems which is very annoying.

For doing so It's necessary to have a virtualization software, an application that simulates a virtual PC, where you can install an operating system just like you'll do it on your real computer. As you should imagine there are many of these applications but I prefer VirtualBox for being free.

When you install this software it will help you to configure your virtual machines (yes, you can have many) having as an important step the creation of a virtual disk to be used for the virtual PC, all is happiness when you use the wizard but I needed later to use my virtual disk in another computer so I didn't want to install everything again but to use my previous virtual disk created.

Then, in this situation you first need to have created your new virtual PC, once you have done that you just have to tell to this virtual PC that you'll use the virtual disk from another virtual PC previously created, this is quite easy. First select yout virtual machine, in this case "Remote Desktop" then you pick on "Configuration" button.




Locate the "Storage" section and under "SATA Controller" click on the icon that is show, this icon is for adding a virtual disk.




There will appear a message like this asking you about what disk you are going to set, you pick the button to select a previously created disk.




You pick your disk and it will be attached to your virtual PC, now you just remove the another one to keep just one. The next time you boot your virtual machine it will use the new disk.


Saturday, March 30, 2013

Beginning Task Date Does Not Move in Project

I don't know if you use Microsoft Project as I do, but I have seen many times the case I'll describe next.

Imagine that you have this simple project schedule where all tasks depend each other.


Then, you realize that the subtask 2 is going to last 5 days indeed, so you make this fix and hope the task 3 to begin just when subtask 2 finishes. However, when you do this change the beginning date of task 3 doesn't move, only the final date moves, highlighting new dates.
 

Don't worry, it's not that your project has broken or something like that, the little detail here is that, although you have your tasks set to be automatically programmed, all tasks won't move its dates if there're progress recorded in them.

That's why if you want to have this date moved you must go to task details and clear any porcentage shown.


That's the way to do it, and you will see the task moving according to your changes.


So, you can now moving your dates as you wish, be careful with this because I have seen many project managers that use this trick to hide relays.

Friday, March 29, 2013

Executing SQL Script from Command Line

Yes, It's more pretty your SQL Server Management Studio, because you can just go to "File" option, find there "Open" and click on "File..." to load a SQL file (.sql) to execute it without problems.

But, have you ever tried to do so with a file create by this tool being large enough to freeze it literally when you open it? Well, in this case there's no way to execute that file through the tool.

Therefore, here we are with a SQL Server command that will help us with this task. You just have to keep in mind the command: sqlcmd, simple right?.

Let's say that we have a SQL server called "MY_SERVER" and my SQL instance "MY_INSTANCE" installed there. What I need now is to execute the following script "my_large_script.sql" located at "D:\Test".

It's important to consider that this command use Windows authentication by default, so it's only required to put this line in any command prompt:

sqlcmd -S MY_SERVER\MY_INSTANCE  -i D:\Test\my_large_script.sql

However, if you are using SQL authentication it's neccesary to use your credential in this way:

sqlcmd -S MY_SERVER\MY_INSTANCE  -U domain\my_user -P my_password -i D:\Test\my_large_script.sql

That's all, have fun with your scripts.




Sunday, January 6, 2013

Inserting Rows o Columns in Excel Not Permitted

I'm opening an Excel file and when I try to insert a new row or column I get a message error giving me a large text about how this is not possible. I have seen many people facing this message, although this gives the solution, sometimes it's hard to understand what this message is trying to say.



But, what's happening? Let me tell you that you' re using all the rows or columns of the file, yes, believe it or not you are having information (even blank space) at least at the last row or column allowed. So, when you want to add a new one, Excel tries to delete this row or column because it will be out of range with the new element inserted.

The solution is going to the last column or row, to do so you can use this shortcut: Ctrl + Down arrow if you want to go to the last row or Ctrl + Right arrow to go to the last column, as shown in the images.





Then, you just have to select the entire row or column and delete, the next step is to save the file to to let Excel to detect this change, once you did this you'll be able to add one row or column, if you need more just follow the same procedure but deleting more rows or columns.