Wikipedia:Reference desk/Archives/Computing/2014 July 27

Computing desk
< July 26 << Jun | July | Aug >> July 28 >
Welcome to the Wikipedia Computing Reference Desk Archives
The page you are currently viewing is an archive page. While you can leave answers for any questions shown below, please ask new questions on one of the current reference desk pages.


July 27

edit

How much battery does enabling C-States save?

edit

I'm using a Dell Latitude E7240 ultrabook with an 1.7 Ghz i3-4010U, 4 GB RAM, 128 SSD, Windows 8.1

The laptop has C-States enabled in the BIOS by default. However, when my computer is not in "High Performance" battery mode, or if it is not connected to Wifi, I hear a really annoying, sporadic whining sound somewhere from the laptop. Looking online, I have nailed the sound to what I believe is something known as "coil whine." It is a high-pitched pizoelectric buzzing sound.

I went into the BIOS and disabled "C-States" and the sound has appeared to have gone away.

However, since I plan on using the ultrabook as portable device, I am worried about negative battery life implications this may have. Does anyone have any rough ideas on how much disabling C-States will adversely affect my battery life?

Thanks. Acceptable (talk) 03:53, 27 July 2014 (UTC)[reply]

Do you mean how long a the maximum charge will last, or are you concerned about degradation of the battery to where it will no longer hold the maximum charge ? StuRat (talk) 13:20, 27 July 2014 (UTC)[reply]
I'm concerned with how long a maximum charge will last. By checking the predicted battery life by moving my mouse over the battery icon, it does seem that enabling C-States does increase the battery life by a few hours. But how accurate is this? Acceptable (talk) 15:55, 27 July 2014 (UTC)[reply]
Probably more accurate than any estimate we could provide. Of course, you can do the full test and see how long it takes to run the battery down with and without C-States enabled, while doing the same thing both times. StuRat (talk) 19:37, 27 July 2014 (UTC)[reply]

Budget desktop PC recommendations

edit

My HP/Vista is taking about 5 min. to boot and periodically freezes for a minute or two (CPU usage shoots up to 100%), so I'm looking for a replacement for about $500-600 Canadian (no gaming, just the basics). Any ideas? Future Shop is offering a Dell i3847-5387BK PC (Intel Core i5-4460 / 1TB HDD / 8GB RAM / Intel HD Graphics / Windows 8.1) for $570. Clarityfiend (talk) 09:55, 27 July 2014 (UTC)[reply]

It would be cheaper just to wipe it and start again on the same PC. Do you have the install or restore disk? Does it have Recovery option, which will restore Windows to its initial state from a hidden partition? CS Miller (talk) 10:24, 27 July 2014 (UTC)[reply]
This sounds to me like a software problem rather than a hardware problem. The solution probably isn't to buy new hardware, especially when that hardware is low end. The solution is probably to look at what unused programs are starting automatically at boot and which programs are over-utilizing the CPU. Also, I'm more interested in the specifications of the machine you have rather than the computer you would like to buy. Any computer you buy from Dell, HP, Toshiba, etc., will have bloatware installed on it that will slow the computer down. No matter how cheap the hardware in your PC, it should never take five minutes to boot. It doesn't just "wear out" inside and slow down mechanically. That's not normally how PCs work.—Best Dog Ever (talk) 12:02, 27 July 2014 (UTC)[reply]
One case where it might take 5 minutes to boot is if it's set to do a disk scan (check all the hard disks for errors) on boot. You can usually skip this by hitting a key on the keyboard, or you can disable it entirely. I normally only let the scan run when I'm not in a hurry or suspect a disk problem. StuRat (talk) 13:10, 27 July 2014 (UTC)[reply]
Windows doesn't run chkdsk by default. If it detects file-system corruption, it may run once and then start up normally from then on. If it's always running on bootup, then there's something wrong with the hard drive. This is very rare.—Best Dog Ever (talk) 20:26, 27 July 2014 (UTC)[reply]
Not in my experience. My old Windows 98 PCs regularly locked up, then did that when I rebooted. Apparently the settings are different on my Windows 8 PCs, or they don't lock up quite so badly, because when I have to reboot they don't do that. StuRat (talk) 14:33, 31 July 2014 (UTC)[reply]
I agree with the advice to re-install the operating system and go from there. If there are things on there you want to keep, another option is to get a new hard drive, install the O/S on that, and keep your current hard drive as a non-boot drive. If you're not able to do that yourself, you can have somebody do it for you for a fee.
Something else you might want to try first is some scans for malware. That is junk that they sneak in with downloads that does nothing useful but uses up resources on your PC. Products like Ad-Aware will remove such cruft. StuRat (talk) 13:16, 27 July 2014 (UTC)[reply]
Thanks all. I'll probably end up saving my stuff, reinstalling and seeing what happens. Clarityfiend (talk) 07:57, 28 July 2014 (UTC)[reply]
Note that after reinstalling Windows, you will have to spend a day reinstalling all the Windows updates. This can be expedited by enabling autologin on Windows, and possibly by downloading the latest service pack for version of windows you use. If you do download the service pack, I'd do it before wiping the PC. CS Miller (talk) 08:53, 28 July 2014 (UTC)[reply]

StringBuffer Object Concatenation in java

edit

While creating an object of StringBuffer class we get 16 addtional character memory space along with regular data and the modification on the object takes place in the same memory space. so i tried a scenario to clear my doubt, i concatenated a stringbuffer object say("catty") with another stringbuffer "tftwvdhwgdddghdbshgsyg" (more than 16 character long) to see the capacity of the Stringbuffer object but every time i get the capacity as 46(whenever the another one is more than 16 character long). i had thought of getting an error for concatenating a string more than 16 character long.i also want to know the way for printing the address of stringbuffer objects.will someone please explain this(doubt) ?(i am using jdk 1.6).182.18.179.2 (talk) 14:31, 27 July 2014 (UTC)[reply]

The point of StringBuffer is that it is elastic; if you try to add more stuff to it than it will currently accomodate, the buffer is resized. The documentation says "If the internal buffer overflows, it is automatically made larger." Although the internal implementation does eventually use an array, as a user of StringBuffer you can mostly forget that. -- Finlay McWalterTalk 15:05, 27 July 2014 (UTC)[reply]

thanks again ,but what about the capacity() always showing 46 and please tell me the method to print the address.with normal objects we just pass them in SOP to get their address.what to do with SOP as same process here prints the value contained in objects.182.18.179.2 (talk) 18:05, 27 July 2014 (UTC)[reply]

Java isn't C - you can't print the address of objects (unless you write some C); the addresses of objects is an implementation detail, which you shouldn't (and essentially can't) rely on. Printing a java.lang.Object prints its hashcode, which in some implementations may be the address - but this is an internal detail. Similarly, the specification for StringBuffer makes no guarantees about how much capacity it uses; it only promises to make sure there is enough. Different implementations will use a different strategy to decide how much to reserve. It's very rare for you to need to know the actual amount of capacity that is used; APIs to set and query this are provided for people who need to perform microoptimisations in this regard - in 99.9% of cases the defaults will be fine for you, and worrying about the capacity is a waste of your time. If you really care, pull the source for OpenJDK and read the source for expandCapacity in AbstractStringBuilder.java. -- Finlay McWalterTalk 22:07, 27 July 2014 (UTC)[reply]

got it.i actually became adventorous in my curiosity.thanks for guidance@ Finlay Mcwalter.182.18.179.2 (talk) 06:21, 28 July 2014 (UTC)[reply]

Don't let me discourage you from being curious. StringBuffer is an abstract data type, and in an ideal world you could always use it and never have to think about what's inside. Just in the way that you can drive a car without knowing how car engines work. But real software works on real computers, which are always somewhat constrained in space and time, so all abstractions are somewhat leaky. That's why the API has stuff to set and get the capacity - because, in a very few cases, you will have to worry about that. Usually those circumstances are pointed out when you profile the code (to discover why it's slower than you'd hope); worrying about minutiae like this without evidence from the profiler that it's relevant is usually a premature optimization. But you're absolutely right to be adventurous, not least because it's interesting how the insides of things work. -- Finlay McWalterTalk 11:50, 28 July 2014 (UTC)[reply]

WYSIWYG editor adding local reference

edit

I maintain my web pages with the free WYSIWYG editor KomPozer version 0.7.10 (20070831). The files on one site have the structure header + main + footer. The header file includes expressions such as

src="images/h_home1.gif"

But when I load a file into KomPozer, after the merge the expressions have had a local reference added,

src="file:///C:/Users/Hal/Documents/My%20Web%20Sites/images/h_home1.gif"

Obviously, the .gif then does not display correctly on the web site unless I manually remove 7 instances of the added text.

What is happening? Is there any way I can prevent this from happening? Is there a better free WYSIWYG editor? (On another computer KomPozer did the same thing, and so I used Microsoft Front Page, which I can’t install on my present computer.) --Halcatalyst (talk) 16:05, 27 July 2014 (UTC)[reply]

  • Perhaps you need to fully qualify where it should find the "images" directory, if not on your PC. I'm not quite sure how you would do that in KompoZer, but I suspect the URL or IP address of the server would be part of it. If, on the other hand, the "images" directory should exist on each user's PC, then it should probably have something like "$HOME" at the start of the string. StuRat (talk) 19:31, 27 July 2014 (UTC)[reply]
  • The images directory is a subdirectory of the directory where the main HTML file resides, as it is on the web server. I don't know what $HOME is or what it is used for. Is it part of HTML? --Halcatalyst (talk) 00:07, 28 July 2014 (UTC)[reply]
  • That's a variable which contains the user's home directory. In your case, perhaps a variable which contains the user's present work directory might work. That might be something like $PWD, or better yet you could just use ".", as in:
src="./images/h_home1.gif"
StuRat (talk) 13:05, 28 July 2014 (UTC)[reply]
I used Kompozer a long time ago and don't remember that problem. However, web composition software will often do this if you haven't saved the HTML page before adding the relative references. FWIW, that tag looks a bit odd for an image. Why not <img src="filename">?--Phil Holmes (talk) 07:49, 28 July 2014 (UTC)[reply]
The <syntaxhighlight lang=""> tag is a MediaWiki tag, not an HTML tag (which is why it doesn't show in the rendered page). The surrounding img tag was implied. --Tardis (talk) 07:07, 31 July 2014 (UTC)[reply]

Turning the scroll bar on permanently

edit

I have no idea why but on one mac I use, as opposed to others (and it appears regardless of which browser I am using, or at least in both Firefox and Chrome), the scroll bar on the right side of the page only appears when I place my cursor there, winking off when not "in use", rather than being a permanent feature when visiting any webpage that goes below the bottom of the screen. I dislike this; I want to make it permanent, like it is on the other macs I use. This mac runs OSX 10.8.3 and the Firefox browser I mostly use is the latest version and has been updated many times so this scroll bar feature seems unrelated to the browser version. Any help with how I can set this to off, or whatever is needed to stop this behavior? (By the way, one of the reasons I dislike is that it often doesn't even work, I have to fiddle with my cursor on the side and clicking there before the scrollbar even appears.) Thanks--108.14.111.128 (talk) 20:25, 27 July 2014 (UTC)[reply]

Go to your System Preferences > General > Show Scroll Bars > Always That should take care of it. Dismas|(talk) 20:45, 27 July 2014 (UTC)[reply]
Thanks so much Dismas. One of those things you either know where it is or you don't. No idea how it got turned off.--108.14.111.128 (talk) 22:16, 27 July 2014 (UTC)[reply]
Probably when you upgraded the Mac OS. it's a feature of the newer OS's, but i'm not sure when implemented. first time i noticed it was on ipad. El duderino (abides) 09:10, 28 July 2014 (UTC)[reply]