Restarted my laptop yesterday morning and it could not start Windows. Here's how I fixed it.
I tried booting into safe mode but it got stuck at loading "Classpnp.sys".
I put my Windows 7 DVD in the drive and booted from the DVD. After it installed it's files and I got to the install screen I selected repair in the lower left corner. It ran saying it was searching for installs even though it listed my install. I finally had to power it off after two hours because it wasn't getting anywhere.
It was clear I wasn't going to get anywhere on my laptop so I took the hard drive out and attached it externally to another computer. The drive showed up OK so I ran "CHKDSK" on it. When "CHKDSK" finished I put the drive back into my laptop.
Back on my laptop I booted from the DVD and ran repair. This time it was able to find my install! It took about a half hour to run but eventually the repair finished.
I booted into Windows and I was able to log in. The start-up was really slow and not getting anywhere fast so I powered off the laptop and started Windows in safe mode.
The laptop booted into safe mode just fine. I opened a command prompt as administrator and ran "sfc /scannow". It finished and the message said that there were some files it was not able to repair.
I restarted the laptop and booted into Windows. This time it started up just fine! I checked the hard drive and noticed I had almost double the free space that I had when I last looked at it a couple of days ago. Obviously there are some files were corrupted. So far everything is working OK but I do realize that this hard drive cannot be trusted and I need to get a new hard drive.
No words wasted! Getting to the point about the work I do, the problems I deal with, and some links to posts about where I work.
Translate
Friday, July 13, 2012
Wednesday, July 11, 2012
jQuery - DataTables Plug-in
Received a request to have the tables sortable in the the web application that I'm working on. I looked around a bit to see what was available and decided to give DataTables a try. The first column in my table is fixed and contains links to actions (view and edit) so I'm using the FixedColumns plugin to hold the column in place while the remainder of the table is scrollable both horizontally and vertically.
So far it's been working very nicely but there were a couple of issues. The FixedColumns plugin wasn't setting the column width correctly for an empty table. That was fixed by setting the "iLeftWidth" property. I also needed to set it so that the first column could not sortable on. I found that the simplest way to do that was to use the "aoColumnDefs" property.
Here is my initialization script:
So far I'm very impressed by what this jQuery plug-in can do. I have noticed that the page load times have increase. Waiting to see if this will be an issue for the end users.
So far it's been working very nicely but there were a couple of issues. The FixedColumns plugin wasn't setting the column width correctly for an empty table. That was fixed by setting the "iLeftWidth" property. I also needed to set it so that the first column could not sortable on. I found that the simplest way to do that was to use the "aoColumnDefs" property.
Here is my initialization script:
$(document).ready( function () {
var oTable = $('#tableID').dataTable( {
"aaSorting": [ [1, "asc"] ],
"sScrollY": "600px",
"sScrollX": "100%",
"bScrollCollapse": true,
"bStateSave": true,
"bPaginate": false,
//make first column not sortable
"aoColumnDefs": [{"bSortable": false, "aTargets": [0]}]
});
new FixedColumns( oTable, {
"iLeftWidth": "100"
});
});
So far I'm very impressed by what this jQuery plug-in can do. I have noticed that the page load times have increase. Waiting to see if this will be an issue for the end users.
Monday, July 9, 2012
jQuery - Convert HTML Table to Excel
One of my users needs to be able to save table data as an Excel file in the web app that I'm working on and the web app is just weeks from being released. Luckily it's easy to do this using the jQuery table2CSV plugin. It seems there are a few of these floating around the Internet. I got mine from the jQuery tableToCSV plugin site.
Works like a charm. The only thing I need to fix was:
Change this:
if ($(this).css('display') != 'none') tmpRow[tmpRow.length] = formatData($(this).html());
To this:
if ($(this).css('display') != 'none') tmpRow[tmpRow.length] = formatData($.trim($(this).html()));
Thursday, June 28, 2012
jQuery - Multiple Subscriptions to a Topic
The other thing that caught me a couple of times this past month were multiple subscriptions to a topic when using subscribe. This was causing my AJAX action to be called multiple times. It turns out that if you do this:
What you need to do is specify the id of the tag like this this:
$.subscribe('Whatever}', function(event,data) {...
in the page that you are returning using AJAX, the subscribe is saved. So the next time you make the same AJAX request and return with the page you will have another subscription to the topic.
What you need to do is specify the id of the tag like this this:
$('#TheID').subscribe('Whatever', function(event,data) {...
AJAX - Prevent Page Caching
There were a couple of little things that caught me this past. The first one was how Internet Explorer is so aggressive about caching and it's really annoying when it caches AJAX results. I decided to deal with it in my Struts action by adding a header to my response like this:
this.response.addHeader("Cache-Control", "max-age=0,no-cache,no-store,post-check=0,pre-check=0");
Monday, June 25, 2012
Internews - InfoAmazonia Launched: The Amazon as You’ve Never Seen It
Internews and O Eco, a Brazilian environmental news agency, have launched a pioneering new website. InfoAmazonia.org is an interactive mapping platform that provides timely news and reports of environmental challenges in the Amazon region through an innovative visualization of data.
More...
Friday, June 15, 2012
AJAX - Browser History
One of the issues with using AJAX in a web site is that the browser history does not work. I spent a few days trying out quite a few of the solutions that you can find on the web and I was unable to find one that worked consistently in my application. The only option left was to add my own history and back button to my application.
The script file, rgUrlHistory.js:
In my application I call rgPushAction to save my URL and some additional information:
On the menu bar in my web application I added a left arrow icon and call the the following JavaScript when the image is clicked:
This script uses jQuery post with the URL we saved returned in rgObj.action to populate our target Div tag, divBody. "listView" is just another function that is called with the additional information we saved in the rgObj object. That's all there is to doing your own browser history for your AJAX actions.
The script file, rgUrlHistory.js:
var rgUrlStack = new Array();
var rgIdx = 0;
function rgPushAction(mAct, mApp, mID, mType) {
rgObj = [];
rgObj.action = mAct;
rgObj.appID = mApp;
rgObj.type = mType;
rgObj.id = mID;
rgUrlStack.push(rgObj);
//limit to 10 items
if (rgUrlStack.length > 10) rgUrlStack.splice(0,1);
rgIdx = rgUrlStack.length;
}
function rgBackAction() {
var rgPop;
//if we are at the top of the stack we need to pop this value because the first value popped is the current URL
if (rgUrlStack.length == rgIdx) rgUrlStack.pop();
//if we still have a value, pop it
if(rgUrlStack.length > 0){
rgPop = rgUrlStack.pop();
//always keep one value on the stack
if(rgUrlStack.length == 0) rgUrlStack.push(rgPop);
}
return rgPop;
}
In my application I call rgPushAction to save my URL and some additional information:
onclick="rgPushAction('%{urlFkey}','%{appTableID}','%{ID}','%{currentAppTable.type}');
On the menu bar in my web application I added a left arrow icon and call the the following JavaScript when the image is clicked:
function runBackQuery(){
$.publish('HideViewMenu');
var rgObj = rgBackAction();
if(rgObj != ""){
listView(rgObj.type, rgObj.appID, rgObj.id)
$.post(rgObj.action, function(result){
$("div#divBody").html(result);
});
$.publish('ShowDivBody');
}
}
This script uses jQuery post with the URL we saved returned in rgObj.action to populate our target Div tag, divBody. "listView" is just another function that is called with the additional information we saved in the rgObj object. That's all there is to doing your own browser history for your AJAX actions.
Subscribe to:
Posts (Atom)