Saturday, October 20, 2012

Mendeley as a Research Tool

For anyone that is doing a research paper, whether it be a journal article, a thesis or dissertation, or even a school paper, Mendeley (http://www.mendeley.com/) is an invaluable tool (and it's free). I've used it quite a bit lately for writing papers and for doing my Master's Thesis. What I use it for is a place to put the PDFs of all the papers that I want to reference in my paper. I thought I'd give a couple tips on things that I've learned while using it.

LaTeX Bibliography

I highly recommend using LaTeX (http://www.latex-project.org/) for writing research papers. There is a bit of a learning curve, but once you get past that, it is so nice to have complete control over the layout and look of your document.  Creating a bibliography or references section for a paper using LaTeX and Mendeley is easy. Gone were the days when you had to carefully craft each reference to fit a particular style. Once all the papers you want to reference are in Mendeley, go to Edit-->Select All. Then click File-->Export. Select 'BibTeX' as the output type and give it a name (I call mine local.bib). Locate the folder to store it in, and then hit Save. Now in your LaTeX document, you can reference the file for your bibliography:

\newpage
\singlespacing
\bibliographystyle{IEEEtran}
\bibliography{local}
Now, when you want to create a reference in the paper somewhere, you simply go back over to Mendeley. Right click on the paper you want to reference, and then click 'Copy LaTeX' citation. Go to your LaTeX document, and paste in the reference code where it belongs. Now when you create a PDF from your LaTeX document, the reference number is automatically set. So easy!


Peer Reviews

Another nice feature of Mendeley is the ability to highlight and make notes in the documents. I've used this as a way to get comments from my advisor. You could do this with Microsoft Word of course, but it's nice to use the same tool for reviewing your paper that you use to review other papers.

One thing that I have not quite figured out yet is how to update a document. If I make changes to a document, if I want to replace it, I have to actually delete the file attachment and reattach the file. You might lose highlights and notes doing it that way though. What I've had to do is just create a new document for the updated file and call it Rev 2 or something.






Monday, October 15, 2012

How to Move a Window that is Off the Screen

Sometimes I run into situations where a window is off the screen and I need to move it back into view. This happens often when using Remote Desktop from my home computer with a single monitor to my work computer that has a dual monitor setup. Sometimes the windows that I want are on the second monitor. If you can see your taskbar (the bar at the bottom of the screen with the start menu), and the window you want to show is on the taskbar as an icon, you can right click on the icon and select 'Move' from the menu. This will give you a cursor with arrows pointing in four directions. Then tap an arrow key (such as up or left) on your keyboard. Then as you move your mouse the window will come into view.

In certain situations, however, the window may not be showing up in the taskbar, so it is a little more tricky. The first step is to try to make it the active window. Holding Alt and then pressing Tab will allow you to cycle through the active windows. Keep pressing tab until you get to the window you would like to move. Then let go of Alt. Now you can use the following key combinations to show the window's menu. First tap alt on your keyboard once. Then tap the up arrow key, and then tap the left arrow key. You should now see a menu. Hit the down arrow key until 'Move' is highlighted, and then press 'Enter'. Now move your mouse and you should see your window. So again, once the window is highlighted, Alt,Up,Left is the key sequence to get to the window's menu.

I hope this helps someone!

Wednesday, March 19, 2008

Invalid Postback or Callback Argument

This error message seems to be very common in an ASP.Net application. Most of the time it is caused by databinding at the wrong time during a postback. Usually it can be solved by wrapping a call to DataBind() with an "if (!IsPostBack)" as in the following:

if (!IsPostBack)
{
myList.DataBind();
}

However, sometimes you may need to bind during a postback. As in my case, I had a DataList nested inside of a repeater. I also had a button inside of each element of the DataList that needed to fire, so I needed to attach an ItemCommand event to each DataList inside the repeater on postback. Therefore, I couldn't use the normal solution to this problem.

The reason the error occured was when somebody would click the Button too quickly. In other words, the page needed to finish loading before allowing the user to click the button. I came across the following blog posting that solved the issue for me:

http://forums.asp.net/t/1144649.aspx

It's easy -- it's just a server control you plop down on the page. What it does is asks the user to wait until the page finishes loading before clicking on anything.

I hope someone else finds this useful.

Wednesday, February 6, 2008

Adding a Network Printer to All Users

Usually if you add a network printer under one user on Windows XP, you have to add the same printer on the other user accounts on the same computer. Here is how you can permanently add a network printer that is visible to all users logging into that computer:

rundll32 printui.dll,PrintUIEntry /ga /c\\[Local Computer Name] /n\\[Network Computer name]\[Shared Printer Name].

Then, you need to restart the printer spooler service by doing the following:

1. Go to Control Panel --> Administrative Tools --> Services
2. Locate "Print Spooler" and right-click it.
3. Click Restart

The new printer should now show up in Control Panel-->Printers and Faxes.

I hope somebody else finds this useful.

Saturday, February 2, 2008

Reflection and Medium Trust

Up to today I thought if you host a website in a Medium Trust environment for .NET, reflection is basically turned off or not allowed. It was rather frustrating to not be able to use some of the nice abilities that reflection provides because the website is hosted in a Medium Trust environment. However, reflection IS still allowed, but whatever you are looking for has to be marked as public. For example, I had a class that looked something like the following:

internal class MyClass
{
private bool _someProperty;

public bool SomeProperty
{
get { return _someProperty; }
set { _someProperty = value; }
}
}

Because the class is marked "internal", it is not accessible using reflection in a Medium Trust environment. Just by changing "internal" to "public", I was able to query the classes properties using reflection:

public class MyClass
{
...
}

I hope someone else finds this useful.

Friday, February 1, 2008

User Defined Function Error

I wanted to post this so that I won't forget how to fix it and also in case somebody else runs into the same issue.

In SQL Server 2005, I had a function that returned all records from a certain table:

SELECT * FROM Employees;

Best practices would be to not return all fields, but I don't care. I got the error:

View or function 'dbo.FunctionName' has more column names specified than columns defined.

I simply had to rebuild the function and all was well.

UPDATE: Sometimes this error is a lot harder to catch! Instead of getting the error, it was just shifting all the columns and so the values returning from the function were in the wrong columns! I think I better start specifying fields explicitly.

Tuesday, January 22, 2008

Going After Your Dreams

I want to continue the discussion of the Early Adopter vs. Lagger concept. One of the areas this concept applies to is in our dreams or goals in life. I think many of us have a desire to excel, to contribute to the world, to make a difference and to have our contributions have a positive effect on society. We want to be the best at what we do. We have a dream of who we want to become. Unfortunately, other people don't always seem to have that same vision. Some people think you should have a different vision, or their vision. There are others who doubt and say things like, "you would have had to start when you're young. You'll never be able to catch up." Have you ever heard that before? I think that's absurd quite frankly. I think that we are just as capable when we are older of picking up a talent or learning a new skill. Now, part of the reasoning for comments like those is the fact that as you get older you have a lot more responsibilities and obligations. You supposedly have less time. I consider myself a busy guy. I have a lot going on. I have a wife, two small children with one coming in a week or so. I have work, church responsibilities, etc. But what I have realized is we always have time, the problem is in how we use or prioritize our time. Maybe I've digressed a little bit. The point I wanted to make, though, is it is never too late to go after dreams. True, maybe if we procrastinate we may miss opportunities, but another one will come. Jump on and run with it when it does. How does this relate to the Early Adopter vs. Lagger discussion? The thing you have to realize when you start going after a dream is there is almost certainly going to be some late majority or laggers in your life that don't quite catch the same vision. At least, not yet. What should happen, is you take criticisms and doubts into account, and do your research. But if it is still a viable and a realistic dream, you should go for it. Or at least you start in the path that leads you there. In fact, that's a key point. You're not going to reach your dream tomorrow. Maybe not in the next few months or even years. But, if you are diligent and stay focused and keep working hard, you will eventually arrive at your final destination. What prompted this post was something I was reading in the Book of Mormon. In 1st Nephi 17, Nephi is commanded by the Lord to build a boat so that he can cross the Pacific Ocean and arrive in the now American Continent. His brothers thought that was a ridiculous idea. Nephi had never built a boat, how was he going to all of a sudden know how to build a boat, especially one that would actually make it across the great waters and land safely on the other side. It seemed absurd to his brothers. To make a long story short, they do complete the boat and safely made it across the ocean and started a civilization in the Americas. Nephi succeeded, despite his brothers trying to bring him down. His brothers were definitely laggers. So I say go for it. If you have a dream, you want to acheive something, go for it. Do what it takes. You will find that those missed tv shows and other distractions didn't matter anyway. You need to work hard. As my wife pointed out, "You can't reach your dreams by dreaming." You'll feel better for having accomplished something, and perhaps you could be in a better position to make a difference to the world.