I have to submit a C++ project for marking soon, and I call system("cls") to clear the console a few times in my code. I know there are better methods but I just went for the easiest option.
As far as I am aware, system("cls") only works in Windows. The person who is going to mark my code will be using a virtual Windows machine in a computer with Mac. I have never used a virtual machine and I don't know much about them so I just want to make sure my code will run fine.
Yes it will. A Windows VM contains a regular Windows installation, running on a virtualised processor (under the control of the 'hypervisor').
Related
i have several virtual machines running on virtual box on my main Ubuntu OS.
But after the security updates (Spectre and Meltdown) on windows they weirdly stopped working.
I tried looking up the problem on google but it seems like no one else has experienced this problem.
Side Notes:
I have 2 OS-Systems (Windows/Ubuntu) running on a dual boot.
I have VT-X/AMD-v enabled in my BIOS settings and i disabled Hyper-V
on my Windows machine
I dont know how those two OS-Systems are even connect but i noticed
that my time switches about a hour if i first start Ubuntu and then
Windows. Therefore i guess that they are linked in some way
Some of the Virtual Machines require VT-X/AMD-v. I tried starting
those who dont require VT-X/AMD-v without it and they worked fine.
All machines worked perfectly fine before
Not sure if this question is off-topic on this website. If it is i'd be happy if someone can link me to places where this question is suitable.
What you experience is most likely a bug in the Virtualbox. Submit an issue to their bug tracker.
I have VT-X/AMD-v enabled in my BIOS settings and i disabled Hyper-V on my Windows machine
This is fine and is actually required.
my time switches about a hour if i first start Ubuntu and then Windows.
Most likely the timezone settings are different in two OSes, or one OS assumes that the CMOS clock runs in UTC and another thinks it is in local time zone. It has nothing to do with your problem.
Some of the Virtual Machines require VT-X/AMD-v.
Apparently pure application level software works fine, but hardware-accelerated VMMs require kernel modules to be loaded, and those may need adjustments after kernel updates, especially so drastic ones.
Not sure if this question is off-topic on this website.
Yes, it looks like this question is more suitable for ServerFault https://serverfault.com/
I just implemented a system-wide hook; it hooks into 32-bit processes and reverses their text (eg. hooks into textpad and reverses menu text etc., just to get some basic hooking going). I posted my code here:
Having trouble with microsoft detours
It works fine for textpad, chrome etc., but when I try to use it on the one program I really need, a java application, the application freezes. The program itself appears unaffected; no strange error codes or anything. It's the application (which is my broker's trading platform) that freezes. It's a .jnlp file that is launched via the java web-starter (which subsequently loads up the trading platform). It launches as a 32-bit process usng jre6.
I am running Windows 7 64-bit, Visual Studio 10.0, Detours 3.0. This is pretty unfamiliar territory for me; not sure how to proceed or how to debug this issue. I'm not married to the approach I used; if I could circumvent this issue with a different kind of hook I would gladly use that. Any idea how I can solve/debug this issue? Any help is appreciated.
UPDATE: Tried this on Intellij (a java IDE) and it freezes that too. I wondered if maybe it was just the fact that these applications load a ton of processes so maybe that was mucking things up, but tried it on Adobe Photoshop Elements (also loads a ton of processes) and it worked fine on that. So still stuck.
When you hook a process, you need to use 32 bit hook to hook a 32 bit process. Since you use VS 2010 64 bit, Have you set up your solution to generate a 32 bit hook?
Your target is a Java application. You may want to try the Java Accessibility to attch to the process and then use reflection to get the text and reverse it.
Good luck
I'm having problems opening directly TurboC++ compiler(dos version) on Windows X.
if I click on the TurboC++ icon through windows GUI it opens for a sec(a blank dos screen)
and shuts down.
so i have to access it through the command line i.e.,
cmd (enter)
c:\tc\bin (enter)
tc.exe
This way TurboC++ opens and I'm able to program and everything..
Why do I have to always start tc.exe through the command line? Why can't I start it through Windows XP?
Also, after starting tc.exe through the command line, I am unable to execute any graphics program through it.
I write a simple code for creating a circle using predefined functions..
when i compile and run the program tc.exe exits and returns back to the command prompt.
Why does this happen?Is there a solution?
I have also tried using DosBox to run TurboC++. it closes on executing the graphics program.
ps: this problem has occurred to only me and my friend.....
all PCs in our college have Windows XP or Vista installed and they have no problems.
im using initgraph(); function for initialising graphics drivers(using autodetect) and graphic mode.i have given the proper address for bgi files. and the folder contains the file required (EGAVGA.bgi). this program works fine in our college.does this have something to do about my graphics card(nvidia 9400 1gb)?
Graphics in the 80s were a completely different world than today - directly accessing hardware, often using undocumented features to optimize performance. Drivers didn't exist in DOS. Each program had to write their own hardware layer (hence why under DOS, you had to configure the video and soundcard for every single game separately. The fact that we can run any software from the 80s is a testament to the backwards compatibility work done by Microsoft.
You might have some luck running it on VirtualPC, VMWare or VirtualBox. All of them offer a free version, and if you can find and old copy of DOS 6.22 lying around, you might be good to go. Otherwise, you'll likely be stuck finding a physical 486 running Windows 3.11, and working on that. Depending on what deals your college has with Microsoft, they should be able to get a copy of DOS 6.22 for free - it's still offered for download on MSDN. Although, if you're still using TurboC++, they have not likely signed up for anything with MS. You can also try FreeDOS.
Right click on the TC icon and pick Properties. Go to the Compatibility tab. Play with the settings found there. If that doesn't help, ask your teacher how to use a 25 year old program on a modern computer.
How are you doing graphics? If you're using int 10h (or equivalent) to change the mode, that should work fine as it stands. If you're using BGI, make sure the program's working folder contains the BGI files that come with Turbo C++ -- for more details on initializing BGI, look up initgraph in the help.
Even modern PCs with modern graphics cards seem to have enough legacy support for the BGI code to work, though it seems like the program always runs fullscreen once in graphics mode, rather than in a window.
I don't know why Turbo C++ might not start from the GUI unfortunately. I've used Borland C++ just now to refresh my memory about the BGI stuff, and it worked OK.
Use visualc++ express instead. Its free and equipped with c++11.
for opening problem you can use a .bat file for opening Turbo C++
as follows:
open notepad and type the address of TC.exe and name of exe file like
D:\bhanu\TurboC++\TC.exe
and save it as TC.bat instead of TC.txt
and now double click it to run TC.
For graphics you first copy EGAVGA.BGI file from bgi folder to bin and then in the Turbo c++ open options->linker->library
and mark 'X' on bottom two libraries and un-mark all other libraries.
I have to program a C/C++ application. I have windows and linux (ubuntu 9.04) in my machine, and can program in both of them (via gcc/code blocks/vim,etc). The problem is that the executable is going to be run in a Unix (not linux) machine (will have access to it in about 20 days).
My Team Leader doesn´t want all of the code to be programmed in linux - unix. So, some of it will have to be developed in windows (and then many prayers will follow so that nothing bad happens).
The best thing i´ve come up with is to program remotely on the server, from windows and linux, so every programmer (only me for the next 2 weeks) is sort of happy.
In windows, I think i´m stuck with putty, but is there any alternative on linux, rather than ssh-vim? .
I read this Remote debugging with Eclipse CDT but it didn´t bring much light on the subject. At least not much hope.
There is another issue. I don´t consider C/C++ to be a portable language. At least for real programs. Sure it compiles, but many issues will arise, even with boost / stl. I haven´t taken a careful look to the code, but still, how wrong a I?
Any tips will be greatly appreciated.
Thanks in advance.
You could ssh w/ xming for a gui ide/editor that is on the remote machine.
If all the code is one the remote machine and compiled there, don't you have to worry about developers trying to work with the same resources? Also might the machine/network not be able to handle multiple ssh connections if you're using xming?
If you can convince your system administrator to install the libraries (an X server is not required), you can use X forwarding with SSH, which will allow you to execute X apps remotely and have them come up on your local server. If you're using Linux locally, you probably have X running already, and if you are using Windows, you can use the Xming server (with a little configuration to get it to accept remote connections). For debugging, if you need a separate shell, just set another instance of SSH going and perform debugging from another process.
As for portability, it depends on what you are trying to do. If all you want is a simple console-based application, you shouldn't run into any major portability concerns. If you are using more complex code, portability depends heavily on two things. The first is the choice of libraries - sure, you can run applications written for Win32 on Linux with Wine or actually compile them with Winelib, but it's not a pleasant experience. If you choose something more portable like Qt or gtkmm, you'll have a much easier time of things. Likewise for filesystem code - using a library like Boost.Filesystem will make things significantly simpler. The second thing that makes a big difference for portability is to follow the documentation. It's hard to stress this enough - many things that you do incorrectly will have varied results on different platforms, especially if you are using libraries that don't do checks (note: I highly recommend checking code against debug standard libraries for this reason). I once spent nearly a weak tracking down a portability bug that arose because someone didn't read the docs and was passing an invalid parameter.
If you want to use remote desktop like facility try VNC www.realvnc.com
or in case its just a remote login Hummingbird, EXceed could help
You might want to check the wingdb visual studio extension.
Not sure if this will help, but take a peek at sshfs. I haven't had a need to use it myself, but I have read others use it to access remote files and directories via ssh and work on the files locally. I presume you could access your remote home directory via sshfs and then use your local tools to work on the source files. I would very interested in knowing if this works out, so please post back if you give it a shot.
I use No Machine NX, which gives you the entire desktop of the remote machine. It also has a Windows client. I work remotely from home on Fridays, so I'm using it right now. You'll have to install it on the remote machine, and then install a client on your Windows or Linux machine.
I've been hearing a lot about about how the new version of VMWare Fusion can run virtual operating systems in "headless mode".
A Google search makes it clear that other virtualisation products also have similar features, however, I have not been able to find a good description of what this actually means? What is happening when you do this?
Headless mode means that the virtual machine is running in the background without any foreground elements visible (like the Vmware Fusion application)
You would have no screen to see running the front end; i.e. the screen/console would not be visible, even though the operating system is running, and would typically have to access the machine via SSH.
For anyone that is interested, you can activate headless mode in VMWare Fusion by running the following command in Terminal.app
defaults write com.vmware.fusion fluxCapacitor -bool YES