Wikipedia:Reference desk/Archives/Computing/2012 November 24
Computing desk | ||
---|---|---|
< November 23 | << Oct | November | Dec >> | November 25 > |
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. |
November 24
editWindows 8 fast startup feature
editWhat could cause the fast startup feature in windows 8 to stop working if it worked fine before? 176.248.109.88 (talk) 01:16, 24 November 2012 (UTC)
- talking only from my personal and short experience, I think the only thing the fast startup feature actually do is to hibernate the pc instead of turn it off… I realize that by the lcd built-in in my board …so, maybe if you deactivated the hibernate function of your system that could be the reason.
- Iskánder Vigoa Pérez (talk) 20:47, 24 November 2012 (UTC)
MSIE 8 on XP
editI run MSIE 8 on XP. When I have multiple browser windows open and one or more is slowly loading content, it often keeps putting itself as the top window. Is there a way to stop it doing this and to have the window I have selected stay as the top one? -- SGBailey (talk) 13:16, 24 November 2012 (UTC)
- TweakUI is your friend. Download it and try this. Apparently it doesn't happen if you open separate threads, it only happens if you open a new window from an existing thread/process (e.g. via right click "open in new window" or ctrl+n). Trio The Punch (talk) 15:43, 24 November 2012 (UTC)
- The best thing you can do is to install chrome or firefox.
- Iskánder Vigoa Pérez (talk) 20:45, 24 November 2012 (UTC)
- I agree with Iskánder, IE is a bad browser, and the alternatives are free. Trio The Punch (talk) 03:59, 25 November 2012 (UTC)
- Yes, but that wasn't the question, was it. :-) Thanks. -- SGBailey (talk) 21:54, 25 November 2012 (UTC)
Weird C++ linking problem at work
editI am facing a really weird C++ linking problem at work.
The basic idea is this. We are working on a Windows application (I am using Windows 7 on my work computer). I am running Visual Studio 2008 and Xoreax IncrediBuild as a distributed compiler on top of it. We have developed a Windows native C++ library, and I want to create a Managed C++ wrapper on top of it so it can be called from C# code.
The code compiles but does not link. I get linker errors about undefined external symbols for numerous functions in the native C++ library that are both declared and implemented in the library code. I have found out that these all come from functions that call functions from other objects, where the functions are both declared and implemented in the .h file. If I move the implementation to the .cpp file, the code links OK.
As an example, this doesn't work:
StdAfx.h in my wrapper:
#include "NativeLibrary.h"
NativeLibrary.h:
#include "Inner.h" class Outer { public: int GetMagicNumber() const { return myInner.GetMagicNumber(); } private: Inner myInner; };
Inner.h:
class Inner { public: int GetMagicNumber() const; };
Inner.cpp:
int Inner::GetMagicNumber() const { return 42; }
But it does work if I change NativeLibrary.h to this:
NativeLibrary.h:
#include "Inner.h" class Outer { public: int GetMagicNumber() const; private: Inner myInner; };
NativeLibrary.cpp:
int Outer::GetMagicNumber() const { return myInner.GetMagicNumber(); }
Does anyone have any idea what is going on here? JIP | Talk 15:30, 24 November 2012 (UTC)
- I tried your not working code in g++ (as it's often instructive to use another compiler). My only observarions:
- I had to add #include "Inner.h" to the top of Inner.cpp (perhaps you just didn't cut and paste that)
- I wrote a simple main.cpp:
#include <iostream>
#include "NativeLibrary.h"
int main(){
Outer o;
std::cout << o.GetMagicNumber() << std::endl;;
return 0;
}
- (which I guess is what you intended).
- That all compiles, links, and runs fine in g++
- -- Finlay McWalterჷTalk 16:37, 24 November 2012 (UTC)
- If your Inner.cpp really didn't #include inner.h, I think it should. To my mind, for both c and c++, modules should #include their own public interface, so you will get a compile-time error if you inadvertently change the signature so that the definition doesn't match the declaration. If you do allow that error to happen in C++, and you compile one .cpp but not the other, you may get a link error due to the differences in name mangling. -- Finlay McWalterჷTalk 16:47, 24 November 2012 (UTC)
- Yes, Inner.cpp #includes Inner.h and NativeLibrary.cpp #includes NativeLibrary.h. I just forgot to write it in the above example. Maybe this is specific to Visual Studio 2008 and Xoreax IncrediBuild. What is weird here is that the native library compiles and links fine by itself, but my wrapper which calls the library compiles, but does not link, even though all the symbols I get linker errors about are declared in the native library. JIP | Talk 16:59, 24 November 2012 (UTC)
- Then I'd again suspect name mangling. In addition to mangling names to encode C++ information, Microsoft compilers also add in stuff for the calling convention (for example, win32 API calls are FAR PASCAL, and are mangled as such). When cross language calling one has to take this into account, and you may have compiler settings that are using a default that makes the imported symbols mangle differently than those exported. You should be able to run DUMPBIN.EXE on the object files to see what the mangled names are. -- Finlay McWalterჷTalk 17:55, 24 November 2012 (UTC)
- Just a note, mostly for posterity. I'm wrong about win32 (and showing my age): X86 calling conventions shows that win16 calls were FAR PASCAL but that win32 calls are STDCALL. -- Finlay McWalterჷTalk 15:54, 25 November 2012 (UTC)
I ran DUMPBIN.EXE on the .dll and .lib files of the native library at work. The results don't even show the symbol GetMagicNumber
, in any plain or mangled form, anywhere. But then I took another Windows native C++ library, which also had a Managed C++ wrapper, and wrote similar code there. The code compiled and linked OK, and DUMPBIN.EXE showed the symbol GetMagicNumber
. The problem must be in the settings of either the native C++ libraries or the Managed C++ wrappers. I looked at the compiler and linker command line options in the Visual Studio 2008 project properties, and the only significant differences I could find were the compiler options of the native C++ libraries. Here are the options of the library that fails to link:
/Od /I "..\..\..\..\bin" /I "..\Include" /I "..\..\Core\include" /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_USRDLL" /D "_VC80_UPGRADE=0x0600" /D "_WINDLL" /D "_AFXDLL" /D "_MBCS" /FD /EHsc /RTC1 /MDd /Yu"stdafx.h" /Fp".\Debug/NativeLibrary.pch" /Fo".\Debug/" /Fd".\Debug/" /W3 /nologo /c /ZI /TP /errorReport:prompt
Here are the corresponding options of the library that links OK:
/Od /I "..\..\..\..\bin" /I "..\Include" /I "..\..\Core\include" /AI "..\..\..\..\Bin" /D "_DEBUG" /D "WIN32" /D "_WINDOWS" /D "_USRDLL" /D "_VC80_UPGRADE=0x0600" /D "_WINDLL" /D "_AFXDLL" /D "_MBCS" /GF /FD /EHa /MDd /Yu"stdafx.h" /Fp".\Debug/AnotherNativeLibrary.pch" /Fo".\Debug/" /Fd".\Debug/" /W3 /nologo /c /Zi /TP /errorReport:prompt
(Very minor editing has been done on the options, to mask away any application-specific names, to preserve our trade secrets. All the actual compiler and linker options are intact.) Maybe the problem is somewhere here? JIP | Talk 18:56, 26 November 2012 (UTC)
sentence syntax program (Continuation(
editI dont look for "parser online" or programs that parser sentence .I am looking for a program which I can use to signify sentence syntax above the words.thanks --82.81.171.245 (talk) 18:17, 24 November 2012 (UTC)
- I take it you are looking for something like this:
<font=Courier>
....A.................................A....A ....D.................................D....D A...J............................A....J....J R...E..........A............A....R....E....E T...C..........D............D....T....C....C I...T....N.....V......V.....V....I....T....T....N C...I....O.....E......E.....E....C....I....I....O L...V....U.....R......R.....R....L....V....V....U E...E....N.....B......B.....B....E....E....E....N ===================================================== A brown fox quickly jumped over the slow, lazy dog.
- (I haven't diagrammed a sentence for decades, so I hope I did it right.) If this is what you want, try "diagram English sentence online" for your search.
- The periods are just added because Wikipedia wants to make spaces narrower than characters (on my browser, at least). What's the proper way to stop this ? StuRat (talk) 15:51, 25 November 2012 (UTC)
There's an html entity - "& nbsp;" is your friend --82.227.17.30 (talk) 20:08, 25 November 2012 (UTC)
- @StuRat: (e/c) I see in your wikimarkup that you have tried to do this both by inserting a space in the beginning of each line, and by specifying a monospaced font. Inserting a space in the beginning of each line should be sufficient; the example I've written below works in my browser. And by the way, "over" in this context is a preposition, not an adverb. Wiktionary gives the following example of "over" as a preposition: "The dog jumped over the fence.[1]
- This looks ok in my browser:
P R A E A A D P D D A J O A J J R E A S R E E T C D I T C C I T N V V T I T T N C I O E E I C I I O L V U R R O L V V U E E N B B N E E E N --------------------------------------------------- A brown fox quickly jumped over the slow, lazy dog.
- That doesn't look right on my browser (Opera 12.11 on Windows 7). StuRat (talk) 05:06, 26 November 2012 (UTC)
- Weird. It looks fine if you use Opera 12.11 on Vista. Trio The Punch (talk) 15:13, 26 November 2012 (UTC)
- I just tested it on a fresh Win7 build 7600 install with Opera 12.11 build 1661 and it looks fine. Trio The Punch (talk) 15:29, 26 November 2012 (UTC)
- That doesn't look right on my browser (Opera 12.11 on Windows 7). StuRat (talk) 05:06, 26 November 2012 (UTC)
- @82.227: You've got a space between the "&" and the "nbsp;" which shouldn't be there, it should be " ". Writing StuRat's example using your technique, combined with <tt>specififying a monospaced font</tt> would work, but the markup would be horrendous:
Click "show" to see what it would look like
|
---|
<tt> P<br> R<br> A E A A<br> D P D D<br> A J O A J J<br> R E A S R E E<br> T C D I T C C<br> I T N V V T I T T N<br> C I O E E I C I I O<br> L V U R R O L V V U<br> E E N B B N E E E N<br> ---------------------------------------------------<br> A brown fox quickly jumped over the slow, lazy dog </tt> |
- So what would you recommend, instead ? I suppose I could leave the periods in and change the foreground and background color to match before each set, then change them back after the dots. StuRat (talk) 05:10, 26 November 2012 (UTC)
- You may want to use the <pre> HTML tag for preformatted text. Trio The Punch (talk) 15:06, 26 November 2012 (UTC)
- So what would you recommend, instead ? I suppose I could leave the periods in and change the foreground and background color to match before each set, then change them back after the dots. StuRat (talk) 05:10, 26 November 2012 (UTC)
Extended content
|
---|
P R A E A A D P D D A J O A J J R E A S R E E T C D I T C C I T N V V T I T T N C I O E E I C I I O L V U R R O L V V U E E N B B N E E E N --------------------------------------------------- A brown fox quickly jumped over the slow, lazy dog. |
- Yes, weird. I checked the HTML code that is generated. The initial-space technique that I used is rendered using the <pre> tag, so I suppose Trio's example and my example look similar in your browser. --NorwegianBlue talk 22:13, 26 November 2012 (UTC)
- All of the above examples now look correct for me, too. I installed lots of updates last night, so maybe one of them fixed the problem. StuRat (talk) 00:29, 28 November 2012 (UTC)
- Do you mean something that allows you to label a sentence with its syntactic structure manually? When in doubt I would simply use generic diagramming software like e.g. Dia. https://live.gnome.org/Dia There are professional specialist tools, but those are generally more or less tied to a specific formalism. KarlLohmann (talk) 13:02, 27 November 2012 (UTC)
Lenovo ThinkCentre's eSATA port
editDear Wikipedians:
Is it just me or has anyone noticed that Lenovo ThinkCentre (desktop)'s eSATA port in the back is extremely unstable? I plugged in an eSATA hard drive with the hope of booting from it, but about half the time ThinkCentre failed to pick up the hard drive and it doesn't show up in the boot menu. By comparison, the front panel USB port marked "1" seems much more stable.
What gives?
Thanks,
70.31.154.178 (talk) 23:06, 24 November 2012 (UTC)
- Link dump: http://support.lenovo.com/en_US/detail.page?LegacyDocID=SF09-D0099 Hcobb (talk) 23:57, 24 November 2012 (UTC)
- Thanks. 174.88.154.30 (talk) 17:00, 25 November 2012 (UTC)
- Without knowing stuff like how many different cables you've tried and how many different drives you've tried, the amount of useful information we can provide to you is close to zero. Nil Einne (talk) 14:14, 25 November 2012 (UTC)
- Sorry, allow me to elaborate. I have a standard desktop SATA hard drive that I have put into an external hard drive enclosure made by Vantec. I will get back to this post with detailed model and make information once I get back to Kingston. The eSATA cable was the default one that came with the enclosure. It is a grey-colored eSATA cable. The external enclosure is capable of both eSATA and USB connections. 174.88.154.30 (talk) 17:00, 25 November 2012 (UTC)
- if you've only tried one device and one cable then there's no way to known if the 'Lenovo ThinkCentre (desktop)'s eSATA port in the back is extremely unstable' even for your specific ThinkCentre or if it's just a problem with the eSATA device or the cable. (Note there is the third possibiltity it's simply your specific ThinkCentre.) I'm presuming you already search but even so if you can't find reports of problems with eSATA devices with ThinkCentres this still doesn't tell us much since eSATA isn't that popular. P.S. ThinkCentre appears to be a fairly generic branding. Even if there is a general problem with eSATA on the model or line of ThinkCentre you're using I doubt all ThinkCentres have the same problem, I suspect they don't even all have eSATA. P.P.S. one of the problems is our comment is somewhat unclear. You say it is unstable but you only mention how it's not detected sometimes. If the device works properly all the time when it is detected, this doesn't suggest instability to me at least not in the manner normally applied to computers. Rather either detection or connection or perhaps power issues. If the device is always detected once you get it to work even after completely powering off the computer but not touching the disk, but if you replug it or move it around it may not be detected this suggests a connection issue to me. If it is sometimes detected sometimes not without touching it, perhaps a power or detection issue. A detection issue could be due to power up times or something else. I would note it's easy to find reports of eSATA and certain ThinkCentres needing a BIOS update and AHCI for hotplugging, this may help even if you aren't technically hotplugging if it relates to power up times. And personally I always enable AHCI unless i have a good reason not to. Nil Einne (talk) 05:04, 27 November 2012 (UTC)
- Sorry, allow me to elaborate. I have a standard desktop SATA hard drive that I have put into an external hard drive enclosure made by Vantec. I will get back to this post with detailed model and make information once I get back to Kingston. The eSATA cable was the default one that came with the enclosure. It is a grey-colored eSATA cable. The external enclosure is capable of both eSATA and USB connections. 174.88.154.30 (talk) 17:00, 25 November 2012 (UTC)