Thursday, December 17, 2009

Windows 7 - Change theme font properties

Just a quick tip: If you want to change your desktop/theme font, you are looking for the old windows properties tab. You can easily get this on the screen by opening a Run dialog box (Windows + R keys) and then type Control Color and hit enter to directly open Window Color and Appearance box.

Tuesday, December 15, 2009

Terminating XMBC remotely on Ubuntu

Last few weeks I have been testing XMBC 9.11 Alpha/Beta on my Ubuntu Media system. Personally I think it is the best Media manager/player ever :).. But due to the fact it is still a beta release, the application sometimes does not respond or hangs and completely blocks the system.

The easies way to kill it and free your system without a reboot, is just open putty.exe and login remotely to your ubuntu system and issue the following command:

killall -9 xbmc.bin

This will terminate XBMC and will free your system. In my case I just restart XBMC :)

Merging items with same title in gantt view in Sharepoint

Today, got a challenge with Sharepoint where a user wanted to see multiple entries in a gannt view in Sharepoint. Below is the jquery magic you can use in a CEWP.

function docready() {

var row = [];
var ix=0;



$('tr.ms-ganttTaskRow th').each(
  function() {
    row[ix] = $(this).parent();
    ix++;
  }
);


ix=0;
for(ix=1; ix< row.length; ix++){
   var $prevrow = row[ix].prev();
   var prevtxt = $prevrow.find('th').text();
   var curtxt  = row[ix].find('th').text();
   if (prevtxt == curtxt) {
     var colix =0;
     row[ix].find('td').each(
       function() {
         var ht = $(this).html();
         if (ht.length > 0){
           $prevrow.find('td:eq('+colix+')').html(ht);
         }
         colix++;
       }
     );
     row[ix].remove();
   }
}

}

_spBodyOnLoadFunctionNames.push("docready");


Explanation of the code:

  1. Trigger the docready on load
  2. Store all the rows in an jquery array for easy processing
  3. Walk through the rows array starting from second item and match the row header with previous row, if so, copy the contents of the columns to the row above and remove after processed.
There is only one catch, the gantt view needs to be sorted on the row header column.

Tuesday, November 17, 2009

Killing tasks/processes from the command line in Windows 7

Sometimes you quickly need to kill a task in Windows (mostly from the command line). With Windows 7 this can be done by using the taskkill command. First thing you need to do is start a command line with administrative priviledges:

Type in command in the start menu, when the Command Prompt shows up, right click and select Run as Administrator.


 


After a warning message (if UAC is turned on), the command line is shown. Before we kill something, we need to know what we would like to kill :). This can be done by issuing a tasklist command.



The tasklist command will show all the running tasks (similar to task manager). This list can be quite long depending on your system. You can quickly filter by issuing the /M switch, eg.

taskkill /M vm*

will show all tasks (and modules) starting with vm in the name

Now killing the task is the easy part. Just issue a taskkill /IM with the name of the task:



The /IM specifies that we are using the image name and the /F at the end is used to specify we would like to kill the process forcefully. You can also kill a task by PID (process id) by using the /PID instead of /IM. It also allows you to kill multiple tasks eg:

taskkill /PID 230 349 230 /F

will kill processes 230, 349 and 230 simultaneously. The taskkill has much more functionality, eg killing multiple task based on filters, for example:

taskkill /IM note* /FI "windowtitle eq untitle*"
 

will kill every task name starting with note (eg notepad) and where the title starts with untitle, with other word kill all instances of empty notepad.

Enjoy!




Monday, November 9, 2009

Cisco VPN 5.0.00.340 after Windows 7 Update

2 weeks ago I have updated my laptop to Windows 7 and today I wanted to use my VPN account. When trying to connect, I got an error 440 Driver Failure. Fixing this issue was quite easy, however you do need to have the Cisco VPN installation files.

Goto start, type "add remove"  and select Add or Remove programs



From the list of installed applications, scroll to the Cisco VPN item and press repair.



If your original installation files are still in the same folder, all will go well, otherwise you will get a popup screen asking for the installation files. Luckily I have my backup and it was easy to find them :)
It works like a charm now!

Friday, October 23, 2009

Domination of the web

Just read an article on techcrunch that Sean Parker thinks that the web will be dominated by Facebook/Twitter and not google:
To be clear, he thinks Google will stay huge and relevant, but it’s dominance will go down because collecting data is less valuable than connecting people, he said.
I have to disagree with this.

  1. I still believe that Facebook and Twitter (and any other major social service) is currently over-hyped. In the future the hype will disappear and the dying process will start.
    As long as google delivers the best search experience, it will never die. Finding information on the net is an essential part of surfing the web.

  2. It is also a matter of time until the success of social website will hurt itself. People are still not aware of the privacy issues involved with it; every day I see more and more FAIL pictures of facebook updates. When the users realize that everything they say/post/publish is stored forever with the possibility that it can be used against you, the frequency of use will become less.

  3. If you want to spot the next big thing for the future, you need to look at the teenagers, as they are the future. I remember that these social sites are not very strongly presented in this age category. This is also correct when I look around me. I believe the current social sites are focused on the 25+ to 45 age range. This means either when the teenager become older they will start using the current social sites or they will laugh at it and invent/continue with their own technology. (see also point 6)

  4. As this guy mentions, Connecting people is the future relevance of being dominant, I don't think so. Connecting people has always existed during the existence of the internet. In my youth it was something called IRC. Great tool to chat and meet people. In my time and area I think it was even more popular then the current social sites. It still exists and is used widely I guess, but as mentioned in point 1 the hypes goes over and it gets into coma.Other old examples are ICQ, MSN, Skype, etc.... All still exist and all do their work but they were never able to dominate the web. This brings us to point 5.

  5. I think this guy doesnt understand the web. The web is much much more than a way of communication between people. Just of because of this social sites can not dominate. They are trends of the internet, like trends of color. Suppose the most trendy color currently is red (eg. 80% of cars/dresses/etc are red), I believe you cannot say that all important things in the future will be of the color red. It will be for a time, but then the next color will come...etc. But google is the freaking color spectrum itself... no matter what the trend is, it will always be on top of that.

  6. The future is the mobile web and google/apple understand this. Teenagers mostly use mobile devices to communicate directly (mostly with SMS messages in europe). It is just a matter of time until the internet connectivity speeds and costs will be low enough for people to massively use it. Once this happens, the usage of internet will shift to the mobile world. Collecting data and presenting it (as this guy mentions what google does) will become even more bigger then now. People will want to have information anywhere at any time. I think Augmented reality is a good example of a future technology which will be very big. No matter how social a human is, at the end the world evolves around its self. Finding the information to help him/her a step further will always overrule the social aspect.
As a conclusion I would expect that the current social sites will still be big and can only stay big if they become part of the cloud, allowing future users to integrate their services with other services. This is also where google expels and will unless it doesnt become evil, will dominate the future :)

Thursday, October 22, 2009

FileList Version 1.0 Release

I mentioned in my previous post, I was planning to develop a tool to easily generate a list of files in a folder for further processing. Well, last night I put something together and I am now releasing it to the public.

I am calling is FileList and it is a portable application. Unzip to a folder where you have read/write access. All settings are saved in the application folder.

Some features:
  • Unicode support for multilingual use
  • Drag and drop support, you can drop folders/files to the application and it will list the files of the folder
  • Command line argument supported (for right click event in explorer)
  • Settings to change font and customize output

Screenshots:









Original Location

Mirror



 


Some disclaimers (just to make things clear)
You are free to use this application for personal, business or any other use. The application is provided as is and use it at your own risk. The application is not evil and has no ET functionality (call home). I cannot be put responsible for any damages what so ever.By downloading and using this application you confirm this. I have tried to make the application as bug free as possible, however if you encounter any issues, do let me know.
If you would like to distribute this application, please let me know. In no case can you ask any money for this application.

Wednesday, October 21, 2009

Files list

Today I have been in need of a tool which could easily generate a list of files in a folder which I can easily copy and paste for further editing. Normally I do this by issuing a dir command in the command prompt and redirecting output to a file, etc. This works fine if it is occasional, but if you need to do it on a regular basis (like me in this case), a tool might help.

Searching on the net I have found the "5 Ways to Print Folder and Directory Contents in Windows", which listed some apps, which I tried. None of the application met my criteria (easy to use, small, multilingual, drag and drop), so I have decided to create my own app which I will share soon.

If you have any suggestions on a file lister tool, please let me know.

Friday, October 16, 2009

Maintenance of Sharepoint Web Parts

For some reason, all the web parts ever added to a page in Sharepoint are actually never really removed when you delete them from the page. You can see this for example when you edit the page in Sharepoint Designer. Actually it is a good feature which allows you to retrieve webparts which could have been accidently removed by a user.

You can also remove or clean up the not used web parts in a page by using the Web Part Maintenance page.





It also allows you to remove buggy web parts which prevent your page to load.

You can access this maintenance page by going to the following page:

http(s)://[site-collection-root]/_layouts/spcontnt.aspx?url=[relative path to the page]

Tuesday, October 13, 2009

Vista, svchost.exe and my CPU

Last week I started to have issues with my Vista Laptop. Until now Vista has been great with me, I never understood why people complained about it anyway. After each boot and login my cpu maxed out. Initially with taskmanager I was not able to see which process was eating my processor, so got the tool Process Explorer (Sysinternals ... now Microsoft) and watched what happened.

It seemed that the svchost.exe was eating all my cpu cycles. Hovering with the mouse on it showed the services which it involved.



There was definitely a service which was doing something terribly wrong. Right click - Properties and then the Threads tab showed me that the dnsrslvr.dll!Reg_DoRegisterAdapter+0x501 was the cause. After googling for this I found only 1 entry, which luckily was the entry which helped me.

Summary on how to resolve this is as follows:

There seems to be a network adapter definition in the registry which is incorrectly referenced. In order to find this you need to use the Process Monitor tool and filter on the registery changes only and you will see a lot of entries like:

RegOpenKey HKLM\System\CurrentControlSet\Services\Tcpip\Parameters\DNSRegisteredAdapters\{0751F0D9-4F38-4FCB-8EA8-2E05F05FC711} SUCCESS Desired Access: Read

What you now need to do is to get the GUID of the adapter, in the example above it is:
0751F0D9-4F38-4FCB-8EA8-2E05F05FC711

and use the registry editor and navigate to the following path:

HKLM\System\CurrentControlSet\Services\Tcpip\Parameters\DNSRegisteredAdapters\{0751F0D9-4F38-4FCB-8EA8-2E05F05FC711}

and remove this entry. The moment I removed it from the registry, my issue was solved.

Note: If you are more careful it would be better to create a backup of your registry and/or create a restore point.

It seems that the adapter was an vmware adapter (I do have vmware installed), and for some reason it got corrupted. I didnt test vmware yet, so I dont know what the impact of this would be on vmware.

Probably another solution would be to uninstall vmware.

Friday, September 4, 2009

Enlarge input width size in edit/new pages

When editing list items in SharePoint, one of the most irritating issues I find is the width of the input fields, in particular the rich-text editor. So I have decided to fix this.




First of all we need to go to the page and set it in edit mode, which can be done by using the ToolPaneView=2 querystring. (See SharePoint Kings for more info), eg:

.....your-sharepoint-list-url..../EditForm.aspx?ToolPaneView=2

Then add a Content Editor WebPart. Make sure it is hidden in the appearance.
Finally add the following code:

<script type="text/javascript" src="{url-to-jquery}/jquery.js" language="javascript"></script> 


<script type="text/javascript">
function docready() {
  $('.ms-formbody').css('width', '100%');
  $('.ms-long').css('width', '100%');
  $('.ms-rtelong').css('width', '100%'); 
  $('.ms-rtelonger').css('width', '100%'); 
  $('#onetIDListForm').css('width', '100%');
}

_spBodyOnLoadFunctionNames.push("docready");

</script> 

Your forms will now use the complete width of your window.

Update: 25 september - Added the rte-longer class for also resizing the rich-text boxes

Future of navigation: Augmented Navigation



For more information about augmented reality, see this presentation

Tuesday, August 4, 2009

Function reference calculated fields in Sharepoint

Some times you need a list of functions you can use in Sharepoint calculated fields. It seems that this is available in your local machine...just go to: C:\Program Files\Microsoft Office\Office12\1033\STSLIST.CHM (if you got Office/Access 2007 installed)



or if you need an online version: wssdemo

or on your local sharepoint server:

http://server-name/_layouts/help.aspx?lcid=1033&cid0=MS.OSS.manifest&tid=MS.OSS.CH10176029&sq=calculated%20column


Show the year/week in Sharepoint

In order to group per week in a Sharepoint list, I have used the following function:

=IF([Completed date];YEAR([Completed date])&"/"&IF((INT(([Completed date]-DATE(YEAR([Completed date]);1;1)+(TEXT(WEEKDAY(DATE(YEAR([Completed date]);1;1));"d")))/7)+1)>10;INT(([Completed date]-DATE(YEAR([Completed date]);1;1)+(TEXT(WEEKDAY(DATE(YEAR([Completed date]);1;1));"d")))/7)+1;"0"&INT(([Completed date]-DATE(YEAR([Completed date]);1;1)+(TEXT(WEEKDAY(DATE(YEAR([Completed date]);1;1));"d")))/7)+1);"Uncompleted")

Actually the code to determine the weeknumber is:

=INT(([Completed date]-DATE(YEAR([Completed date]);1;1)+(TEXT(WEEKDAY(DATE(YEAR([Completed date]);1;1));"d")))/7)+1

So actually what I did was to first detect if the [Completed date] is valid (not empty), if it is it will show the text uncompleted. The next step was to check whether the week number is 2 digits if not then we will add an additional 0 to it, in order to make sure we can sort it correctly.

Modifying pages without the Edit page option in Sharepoint

Sometimes you want to customize a Sharepoint page, however the Edit Page item in the Site Actions Menu is not available. A good example for this is the Display and Edit page of a list item.

You can still do this by adding the ?ToolPaneView=2 parameter after the page url, eg. DispForm.aspx?ToolPaneView=2

Sunday, January 18, 2009

jQuery 1.3 issue - part 2

I have to apologize to the jQuery team, as it seems that jQuery does work. It seems there was a very strange issue with the Finjan software we are using at the office. When I downloaded jQuery at home, all seemed to be working.. after doing a file compare between what I got at the office and what I had downloaded at home, there was 1 line (the line I mentioned in previous post), different.

Anyway, this has been a lesson for me to double check the firewall and proxies..

Thursday, January 15, 2009

jQuery 1.3 issue/bug

First of all congrats to the jQuery team with the new 1.3 release, however maybe it is me only.. but it doesn't work. I have downloaded it used it on my test sites and none of them work: there is an issue in the jQuery code.

So I checked http://api.jquery.com and the same issue..(in IE7 and FF3)



Now I was interested what went wrong, downloaded dev version, checked the error message:



Line 2097 seemed the issue:

div.appendChild( document.createElement('Comment').data = "" );

I guess appendChild assumes an Element object, however:

document.createElement('Comment').data = ""

returns an empty string. Removing the .data="" fixes the issue for now, but I have no idea how it will effect the rest of the code.
I can't imagine that jQuery team released a non working version! Am i doing something wrong or do more people have this issue?

I still have some other pages which gives errors on events, but first a smoke :)

Thursday, January 1, 2009