LaxLoafer 71 Posting Whiz in Training

dc1000,

I guessed what you really meant ;-)

128 °C / 267 °F - That sounds way too hot. Typical maximum operating temperatures for Intel CPUs is around 60-70 °C.

Have you seen smoke rising yet?

I'd be wary of putting another CPU in that motherboard until you've diagnosed the fault.

LaxLoafer 71 Posting Whiz in Training

dc1000,

Is it possible airflow through the case has decreased in some way?

  • Are the case fans working efficiently, oriented to maximise airflow?
  • Is the PSU fan expelling hot air?
  • Check for obstructions such as ribbon cables and blocked vents.

Has the CPU been overclocked? Running at higher speeds will produce more heat and decrease stability. Underclocking has the opposite effect, which might help you to get the system working again.

jingda commented: Nice thinking +11
LaxLoafer 71 Posting Whiz in Training

Hiyatran,

The body onload event occurs after a document has finished loading. Attempting to write content after this has happened will invalidate the structure of your HTML document. This might explain why you're seeing a blank page.

To add additional content to a page you'll need to obtain a reference to an existing element and then modify it in some way. One way to achieve this is to do something like...

<html>
<head>
<title></title>
<script type="text/javascript">
function foobar() {
    document.getElementById('placeholder').innerHTML = "The Martians are coming!";
}
</script>
</head>
<body onload="foobar()">
<p>Hello Earthling.</p>
<p id="placeholder"></p>
</body>
</html>

The code above works by obtaining a reference to an existing 'p' element, identified here as 'placeholder', and then changing the value of its innerHTML property.

LaxLoafer 71 Posting Whiz in Training

Arthas,

Closing unused programs and services will help to reduce memory usage, as Harinath has already mentioned.

If you know all those services are needed, consider installing more RAM ;-)

85% memory usage seems a little high to me and I wonder if this leaves enough working memory for other processes. What do others think?

When your system runs low on physical memory it'll make increased use of virtual memory, typically stored in a file on your hard disk. As I'm sure you know already, disk access is much slower than physical memory access.

You can find out which processes are using virtual memory by monitoring your system's resources. Start Task Manager, select the Performance tab, and click on the 'Resource Monitor...' button. The Resource Monitor utility will appear. Select its Memory tab and watch the 'Hard Faults/sec' column. Hard faults occur when memory has been swapped out and is no longer available in physical memory.

Taking a quick look at your screen capture of Task Manager, aside the numerous hosted processes, I notice you have SearchIndexer running. This service is useful if you often need to search through the content of files on your system. My own personal experience is I can live without this, and turning it off can make a noticeable difference to performance.

You also have a process using a user mode driver. See if you can replace this with a kernel mode driver, or …

LaxLoafer 71 Posting Whiz in Training

... to post photos of my dogs, and I didn't feel like spending the ten bucks on a new domain name.

Want to go bark in time? Check out DaniWeb at the Internet Archive: http://web.archive.org/web/20011127030236/http://daniweb.com/

LaxLoafer 71 Posting Whiz in Training

Somewhere in this photo is a computer desk nearing perfection...

LaxLoafer 71 Posting Whiz in Training

Hi Avinash,

iText is a good choice for Java developers, but perhaps not the best one for your requirement.

Built-in support for HTML in the early free versions of iText and iTextSharp was rather limited. This might explain why your tables failed to render correctly. The Flying-saucer project can be used to extend iText's capabilities. For iTextSharp you may want to find an ASP.NET port of this, if one exists.

The latest edition of iText and iTextSharp includes an HTMLWorker class, which should offer an improvement. This is released under the AGPL license, so whether it is free or not will depend on what you want to do with it.

Have you tried any other PDF components?

It may be worthwhile looking around because like any piece of software each component will have strengths and weaknesses, support for different languages, platforms, features, ease of use, etc. You should find there are components out there that convert ASP.NET pages to PDF within just a few lines of code.

Also have a look out for online demonstrations. You may be able to determine which component was used by decompressing the PDF and looking at the source. You may get to see how your ASP.NET page renders immediately, without the need to install anything first.

LaxLoafer 71 Posting Whiz in Training

Hi Avinash,

You'll find the easiest way to convert a document to PDF in ASP.NET is to make use of a ready made component. There are many PDF components available on the market today, some of which are multi-threaded and suitable for server-side scripting. All you need to do is Google for them.

Some PDF components will enable you to convert directly from web pages to PDF. This is a more desirable approach than using Word as an intermediary format, as each conversion step may lose something in the translation. More importantly, I'd be extremely wary of processing documents that were generated client-side because of the security risks.

That's my short answer :-)

If on the other hand you enjoy a challenge, and have no shortage of time in this life or the next, server-side Office Automation is possible. You'll need to overcome quite a few hurdles.

Office is primarily designed as an interactive application, so dialog boxes may cause your application to appear to hang. Knowing when this happens and troubleshooting issues will prove difficult because recent versions of Windows run services in session 0, which prevents user interaction. Your service and MS Office task will need to run as the same user in order to communicate properly.

Note that Microsoft does not recommend or support server-side Automation of Office, and there are risks in running Microsoft Office server-side that you'll need to be aware of.

If you still feel server-side office …

LaxLoafer 71 Posting Whiz in Training

Avinash,
Welcome to the forum! Please see DaniWeb's FAQ page, and note the 'Keep it Organized' section;-)
I'll post a response to a duplicate of your question, found here: [thread=381383]Save File to a given location without Open/Save Dialogue Box[/thread]

LaxLoafer 71 Posting Whiz in Training

Geoff,

What I believe you're attempting to do is usually best done without the use of JavaScript.

Using style sheets it's possible to assign a background image to an 'a' element. You can also specify the color of the link when a mouse hovers over with the :hover CSS Pseudo class...

This should work on all modern browsers.

Have a look at the following example. Let us know if it doesn't match what you're hoping to achieve.

<html>
<head>
<title></title>
<style type="text/css">
a.button {
	background: url(graphics/industry_button.jpg);
	display: block;
	width: 133px;
	height: 30px;
	color: Red;
}

a.button:hover {
	color: #066;
}
</style>
</head>
<body>
	<a class="button" href="industry.php">Industry</a>
</body>
</html>
LaxLoafer 71 Posting Whiz in Training

Gotboots,

Your code looks great, but there are quite a few errors...

  • Your function 'margin()' is missing a closing curly brace '}'.
  • 'onupdate' isn't an input element event, AFAIK. Try 'onchange' instead.
  • The input element values are of type string, so your conditional test will not work as expected. Try converting the strings to integer values with the parseInt() function, e.g. var LIST = parseInt(document.getElementById("list").value);
  • Note that javascript statements end with a semicolon. You're missing about three.

The doctype declaration in your HTML isn't quite right too. Which development environment are you using? Find one that supports syntax checking, HTML validation, and code completion. This'll help you to reduce errors and should make learning HTML or JavaScript a little easier.

LaxLoafer 71 Posting Whiz in Training

Hi Willy

The style object can be used to not only set but get information too. So to reverse your statement, try:

var myBorder = document.getElementById('id').style.border;

The string returned by style.border should look much like your example "5px solid blue", with the border's width, style, and color in a single line.

It's often more convenient to access each attribute individually. For border styles you can do so by going through the style.border property like this:

var myColor = document.getElementById('id').style.border.color;
var myStyle = document.getElementById('id').style.border.style;
var myWidth = document.getElementById('id').style.border.width;

The style object also provides properties that map more directly to attributes, such as style.borderWidth or style.borderLeftWidth. There's a certain amount of duplication here, but you'll find the access offered is sometimes more refined.

Further info: HTML DOM Style Object...

LaxLoafer 71 Posting Whiz in Training

Hi,

Currently, in JavaScript, I append string to an existing string using the following method :

var str = "Hello ";
str += "fellow ";
str += "Daniweb.com ";
str += "members.";

I am looking out for a better and efficient way to do it ... please let me know...

Thanks.

Rahul,

Your example makes use of an assignment operator. Because JavaScript strings are immutable, each assignment might result in the creation of a new string object.

You could also have written your example like this...

var str = "Hello " +
"fellow " +
"Daniweb.com " +
"members.";

The code above uses JavaScript's concatenation operator '+'.

However I doubt this would really make any difference in terms of performance. If there is a faster way of concatenating string literals, surely a compiler would optimize this sort of thing out? Using '+=' is a very common pattern for building strings ;-)

There are other ways to build strings. If you wish to delve further into the subject, here's a blog article that may interest you: String Performance: an Analysis, by Tom Trenka
http://www.sitepen.com/blog/2008/05/09/string-performance-an-analysis/

LaxLoafer 71 Posting Whiz in Training

Hi there!...
Does anybody know of a example...

Hello to you too!

Ajaxnewbie,

There are some AJAX examples to be found on w3schools.com that you might find useful. See: AJAX Examples

Using AJAX is useful if you wish to import snippets of information. For loading entire web pages, the following approach using IFrames should do the trick...

<html>
<head>
<title></title>
<script type="text/javascript">
function myClick(link, frameId) {
	var theFrame = document.getElementById(frameId);
	theFrame.style.display = "block";
	theFrame.src = link.href;
}
</script>
</head>
<body>
<a href="http://www.example.com/" onclick="myClick(this,'frame1'); return false;">Click here!</a>
<iframe id="frame1" style="display: none;" src="http://about:blank" width="300" height="200"></iframe>
</body>
</html>
LaxLoafer 71 Posting Whiz in Training

The difference between setTimeout and setInterval is the former will call your showImages function only once.

setTimeout("showImages(0)",1000);
setTimeout("showImages(1)",2000);
setTimeout("showImages(2)",3000);

The three lines of code above will call showImages three times, at 1 second apart.

If you like you could wrap this up into a for loop like:

for(var i = 0; i <= 2; i++) {
setTimeout("showImages(i)", i * 1000);
}

setInterval works slightly differently. You need only call it the once:

var theInterval = setInterval("showImages()", 1000);

This will call your showImages function every second until cleared. Note you need to pass clearInterval the reference obtained from setInterval:

window.clearInterval(theInterval);

You'll want to delay calling clearInterval immediately, otherwise setInterval will appear to do nothing. One way to do this is to assign it to a button click on your page.

<button onclick="window.clearInterval(theInterval)">Stop</button>

Using the setInterval approach, you'd need some way to keep a track of which image is displayed. You could do this with a global variable, which is then incremented inside your showImages function.

var imageIndex = 0;
function showImages() {
  displayImage(imageIndex);
  imageIndex++;
}

Well, something like that. Hope this helps.

LaxLoafer 71 Posting Whiz in Training

Willy,

Your code is calling document.write() after the page has finished loading. This will quite likely invalidate the HTML document tree. You browser would not have been expecting further data, so could this explain the problem you're seeing?

One possible solution would be to create another element. If you give the element an 'id', you'll then be able to reference it later on, by using document.getElementById(), and update the content of that element. That way you'll keep the structure of your HTML document intact.

For example:

<html>
<head>
<title></title>
<script type="text/javascript">
    function adding() {
        var p = document.getElementById('p1');
        p.innerHTML = "some result";
    }
</script>
</head>
<body>
<p onclick="adding(); return false;">Click to display result</p>
<p id="p1"></p>
</body>
</html>
LaxLoafer 71 Posting Whiz in Training

Hi Sean

Your showImages function will be called 1000 milliseconds after each call to setTimeout. As the iteration of your 'for' loop will complete very quickly, you should expect to see a one second delay followed by all your images shown in quick succession.

Perhaps the setInverval function is what you are looking for?

LaxLoafer 71 Posting Whiz in Training

Hi Bookmark,

You can use loop statements such as 'for' or 'while' to return execution to the beginning of a block of code. You'll also need an exit condition, otherwise you'll end up in an infinite loop. In your case the exit condition should be a password match.

Return commands are something different. These come into play when you want to return a value from a function or exit a function at a specific point. When a function returns, execution resumes with the statement following your function call. A return command will not take you to the top of a script.

Writing JavaScript to check a password can be trivial, and here's a minimal example:

while(prompt("Enter the password:") != "password");

However, JavaScript based password routines are insecure and rarely a good idea. This is because the source code is publically accessible. There is little to prevent anyone from reading your password or bypassing the check altogether.

For more secure forms of password checking, you might want to look at server-side scripting languages, possibly PHP or ASP.NET.

To answer your second question, HTML is not executable code, so cannot be called. JavaScript will load XML, but you'll find this topic is beyond the basics. Post another question when you get there ;-)

LaxLoafer 71 Posting Whiz in Training

You'll find the name of the browser's layout engine is typically included in the user-agent string. Using Javascript you can access this through the navigator object. See: navigator.userAgent

To redirect to another URI you can set window.location...

So, your code might look something a little like this:

<script type="text/javascript">
    if (navigator.userAgent.indexOf('Gecko') > 0)
        window.location = "http://www.example.com";
</script>

Be aware it is possible for the user agent string to be faked. If your browser detection needs to be more resilient then you may want to research 'browser sniffing'.

It's likely there are already scripts that will do this for you and freely available to use. Unfortunately I don't have one to suggest at this time. Apologies.

LaxLoafer 71 Posting Whiz in Training

I love how even everyone here was rickrolled, no-one even said a thing about it, but kept talking about processors!

Had anyone actually been lured into clicking on your Rick-rolling link, would they have responded to your post? Try harder next time :p

LaxLoafer 71 Posting Whiz in Training

Wow, that's amazing!

Even if the headline was true, would the increase in processing power make a perceptible difference?

When we went from 16 MHz to 32 MHz processors, the performance boost was immediately apparent. Tasks that might have taken 1 minute only took half that time. My human brain could register that :-)

At 1.6 GHz that same task would take just 0.6 seconds. Double the processing power again and the difference becomes less perceptible. This is an over simplification, as the CPU is only one of many components that affect performance.

My point is, raw processing power ain't wot is used to be. Chip makers will continue churn out new products and market them by extolling their performance. And we'll continue to buy into this, believing our systems have become obsolete! Why?

Composed on a 25 MHz Intel 386 DX.

LaxLoafer 71 Posting Whiz in Training

Hajira,

Searching for tutorials on the Internet is one way, as Fbody has already shown.

There are a lot of resources to be found but, as you may have discovered, there's also a lot of chaff, which can make finding good resources a time consuming challenge.

Have you looked at traditional books? I'd suggest doing this because generally they undergo a higher level of scrutiny than web tutorials, typically by a professional editor and publisher. Most of the junk gets removed for you :-)

There are a great many available on the subject and you can find a review of a few right here on Daniweb...

Try to find one that's targeted for your specific development environment and platform, if possible. Otherwise you might find some code examples won't work as expected, which can be very frustrating for a beginner. Until you've mastered the basics of a language, you may not be equipped to solve such problems.

Good luck!

LaxLoafer 71 Posting Whiz in Training

Here's one I've not seen mentioned yet...

"C++ Essentials" by Sharam Hekmat, 14th July 2005
PragSoft Corporation

The author describes it as a concise introduction to C++ for beginners and without unnecessary verbosity. I wouldn't disagree.

The book and its tutorials are aimed at the Unix environment. However, anyone beginning to learn C++ in another environment will likely find this book a useful resource, provided they've already mastered the knack of compiling programs.

The book is just over 300 pages long. It's available in PDF format as a free download from PragSoft's website...

http://www.pragsoft.com/books/CppEssentials.pdf

(I have no affiliation with this company)

My personal favourite is "Effective C++", by Scott Meyers.

LaxLoafer 71 Posting Whiz in Training

We used to send messages across our LAN with the NET SEND command. So convenient! That was until some evildoer placed net.bat in the same directory...

*.bat trumps *.exe every time ;-)

Apparently, they inserted an extra sentence into every message sent, selected from an array of random insults.

Rest in peace NET SEND.

LaxLoafer 71 Posting Whiz in Training

Hi Riswan

You'll need a web server in order to process Active Server Pages (ASP).

Microsoft's web server is part of Internet Information Services (IIS). This is usually installed to server editions of Microsoft operating systems, such as Windows 2008. It'll work on Windows 7 also, and should be adequate for development purposes, but suspect there are limitations that might make it unsuitable for demanding enterprise applications.

IIS is not installed on Windows 7 by default. You can find out how to install and configure it on Microsoft's TechNet here...

To get started in writing ASP scripts, I would suggest installing Visual Web Developer Express, which is available for free from Microsoft. You'll find the installation includes a development web server that requires little or no configuration, which should help you to get up to speed.

Note that ASP and ASP.NET are two different languages. ASP.NET is a newer scripting language, based on the .NET Framework, and integrates better with newer versions of IIS. ASP on the other hand uses good old COM.

LaxLoafer 71 Posting Whiz in Training

Oops - I've posted twice :-(
Can this one be deleted?

LaxLoafer 71 Posting Whiz in Training

Hi Smitsfamily

It's not immediately obvious to me what the cause is, but here are a couple of things I would try...

Turn the system on and press the F2 key as soon as you see the blue Dell logo. This will take you into the system setup (BIOS). Navigate to the Power Management Setup page and see if you can disable the Advanced Configuration and Power Interface (ACPI).

Do this as a temporary measure, to see if this will get you into Windows. You can always reset it again afterwards. The default ACPI suspend type on a Dell Vostro 200 is S3.

When PCs boot the video graphics adapter typically starts in VGA mode, before switching to a higher resolution for Windows. I am wondering if something is preventing the graphics card from entering the higher resolution, making it seem like the monitor has gone to sleep?

Booting into Windows 'safe mode' will allow you to stay in VGA. To get into safe mode, you need to press F8 a few seconds before Windows loads.

Assuming the above gets you into Windows, you should now be able to find and check the power management options in the control panel. But, I suspect the issue may resolve itself if you simply shut the system down cleanly and restart.

LaxLoafer 71 Posting Whiz in Training

Nyamoga,

Did you apply a BIOS update from Acer or some other source?

This is important if your installation of Windows came preinstalled...

Acer use System Lock Preinstallation (SLP), like all major OEMs. This basically ties your installation of Windows to only those motherboards configured by Acer. The manufacturer is identified by a string in the BIOS.

If you've overwritten the manufacturer's string, I would expect Windows to become deactivated. However, from past experience, it seems to prevent some installations from booting. Isn't that cool!

If this is the case, here are a couple of simple things you could try:
* Patch your BIOS again with an update from Acer
* Installing a retail version of Windows

Good luck.

LaxLoafer 71 Posting Whiz in Training

Hi Vinaysrk

The TimeSpan.Parse() method accepts strings representing timespans, not dates. The format for timespans is documented here on MSDN:

TimeSpan.Parse Method (String)

I notice also in line 4 of your code you're attempting to assign a TimeSpan to a string. You'll get a "Cannot implicitly convert type" error message at compile time.

Assuming date1 and date2 actually contain dates, I think your code should use the DateTime structure and look something like this:

DateTime date1 = DateTime.Parse(TextBox1.Text);
DateTime date2 = DateTime.Parse(TextBox2.Text);
TimeSpan ts = date1 - date2;
TextBox3.Text = ts.ToString();

DateTime.Parse will thow exceptions if an invalid date is entered, so you'll want to catch this, unless you're 100% sure the user is never going to enter an invalid date.

LaxLoafer 71 Posting Whiz in Training

Hi Chase

Assuming your question is related to software development, there's an article on MSDN about writing your own 'preview handlers' that may interest you. It's essentially written for managed code, but may also offer some useful insights if you intend to use native code.

See: Windows Vista and Office: Writing Your Own Preview Handlers

Is this what you're referring to?

LaxLoafer 71 Posting Whiz in Training

Hi Violet

I saw exactly the same error message after downloading a CHM file from the Internet...

"Navigation to the webpage was canceled"

The solution for me was to right-click on the downloaded file, select 'Properties', hit the Unblock button on the General tab, and then OK it.

This is a security feature that was introduced to help protect your system from potentially dangerous file types. You can find out more about this on Microsoft's support site:
Description of how the Attachment Manager works in Microsoft Windows

LaxLoafer 71 Posting Whiz in Training

Thanks but..
I've tried the following in DOS:
I copied the same name of that file and paste it in the DOS and used it in the ren command like this:
ren K:\AL JAMAL FE AL ISLAMÿÿÿÿ[2011-08-01-15-29-10].ts newFile.ts
I also tried the rename command..
Nevertheless, nothing went okay!
I always got the following message:
The syntax of the command is incorrect.
(I've attached an image of what I've done on MS-DOS)
Thanks in advance.

MeOnly,

The message in your screen grab reads "The syntax of the command is incorrect". You're seeing this error because the ren command is expecting two parameters only. You need to enclose the filenames in quotation marks if the string contain spaces.

However, this won't solve the problem because the filename contains an illegal character, between the "ÿÿÿÿ" and opening square bracket.

Give DOS another chance. Try this from the command line...

Type "DIR /X". This will reveal the filename's short DOS name. Yay!

On my system it looks something like this:
2011-07-09 19:36 1,032 ALJAMA~1.TS AL JAMAL FE AL ISLAMÿÿÿÿ[2011-08-01-15-29-10].ts

Note the short 8.3 format name. From the command line again, see if you can then rename it:

REN ALJAMA~1.TS newFile.ts

jingda commented: Excellent Help +10