Jump to content

Wikipedia:Reference desk/Archives/Computing/2015 August 25

From Wikipedia, the free encyclopedia
Computing desk
< August 24 << Jul | August | Sep >> August 26 >
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.


August 25

[edit]

Unable to remove program from Windows 7 Startup List

[edit]

Hi, when I use 'msconfig' to remove a certain program from the Windows Startup list, it just reappears when the computer restarts. What is causing this to happen, and what can I do to prevent it? This is a legitimate program, not any kind of virus or malware. Actually it is "ABBYY FineReader", which is an OCR program. However, it keeps generating random spurious error messages, so I want to stop it running automatically, but not actually uninstall it. There are no other related programs in the Startup list. 109.145.19.55 (talk) 02:15, 25 August 2015 (UTC)[reply]

First, look in the application's preferences for a "start on startup" option. It is possible that this is checked. The program will just keep recreating the startup listing as long as this option is clicked. If it is already unchecked or the option isn't there let me know and we can move onto the next step. --Stabila711 (talk) 02:19, 25 August 2015 (UTC)[reply]
Thanks for the rapid response. I don't see any option like that. Also, I am a bit confused. How can the program re-add itself to the startup list if it is not running in the first place? What process actually does the re-adding? 109.145.19.55 (talk) 02:32, 25 August 2015 (UTC)[reply]
It is part of the registry. Editing this would be step 2. Uncheck the item in msconfig and then run regedit.exe. This needs to be run as an administrator. Navigate to the following folder HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Run and look for the program on the right side of the window. Right-click on it and click delete. This will remove the registry instructions for that program to start on startup. Restart, see what happens and let me know. --Stabila711 (talk) 02:36, 25 August 2015 (UTC)[reply]
Thank you. There is nothing in that list related to the ABBYY program. However, I am unable now to reproduce the problem. Previously, several times I unchecked the item in 'msconfig', restarted, and it reappeared. Now it is not doing this, even though I am doing nothing different. Even if I start the program manually it does not reactivate its startup entry. So I am a bit baffled right now. But anyway, for my benefit could you shed any light on why there are these two lists (registry and msconfig)? I would expect the 'msconfig' screen merely to be another interface to the registry. Why isn't 'msconfig' just reflecting the contents of that registry screen? 109.145.19.55 (talk) 02:58, 25 August 2015 (UTC)[reply]

There are actually three lists. MSConfig, and two in the registry. One under the file path listed above (which holds startup programs for all users) and one under HKEY_CURRENT_USER\SOFTWARE\Microsoft\Windows\CurrentVersion\Run (which holds startup programs for individual accounts). MSConfig was never designed to be used as a startup listing service. The startup list was more of an add-on that eventually overtook the original purpose of the program (system configuration). MSConfig was designed as a troubleshooting tool, not as a preference setting tool. The registry is the location where all program preferences are saved. Since some items in the registry are absolutely critical to the operation of the system it is much easier to add to it than to delete from it. For example, the registry will maintain options for programs that were uninstalled. Oftentimes when times go haywire it is because of an errant registry entry that has to be taken care of. Also, MSConfig does not require admin level access to change options. Regedit does. So, if there is a listing in the registry for a startup program and someone tries to uncheck it in MSConfig as a regular user the action won't carry over since the user does not have the proper privileges (this is a protection for the really important entries). --Stabila711 (talk) 03:09, 25 August 2015 (UTC)[reply]

Thank you for your very helpful advice. I will try your suggestions again if the problem recurs or I manage to reproduce it again. 109.145.19.55 (talk) 03:16, 25 August 2015 (UTC)[reply]
No problem and if it happens again please post again. The registry vs. MSConfig is one of the quirks of the Microsoft OS environment. --Stabila711 (talk) 03:19, 25 August 2015 (UTC)[reply]
Resolved

Turboboost on Intel 4790K

[edit]

Last week I got a new computer from a major maker. It has an Intel 4790K CPU (the "K" means that it can be overclocked). According to the Intel spec sheet, it can run at 4.0GHZ and has turbo boost to 4.4GHz (4/4/3/2, I think). However, according to Intel's Turbo Boost monitor program, it always runs at 4.0 - whether one, two, three, or four cores are being used.

So why wouldn't I be getting any of the turbo boost? Would it require more than the stock cooling, so the maker disabled it? Bubba73 You talkin' to me? 07:14, 25 August 2015 (UTC)[reply]

Computers are designed to only use the power they need. No computer will run at full power all the time. That would put an enormous amount of stress on the components and lead to early failure. It is likely that your computer is just not being taxed enough to hit overclocked levels. For example, my computer is rated at 2.9GHz but is overclocked to 4.0. It has never gotten to 4.0 with normal use. Even running multiple high intensity games at the same time only got it to 3.2. To run a true stress test you need a really good program. May I suggest Prime95. The program calculates prime numbers to infinity. Unzip the file and run it. Click Just Stress Testing and then OK on the next options screen. The program will run and your computer will be pressed to its limits. That is the only true way to know your maximum overclocked speed. --Stabila711 (talk) 07:35, 25 August 2015 (UTC)[reply]
More information: Make sure your computer is set to high performance mode. This is under your battery settings (Control Panel -> System and Security -> Power Options). If it is set to balanced it will stop full power from being reached. Also, once you are done stress testing, I had to force stop the Prime95 program in the task manager to delete it. Just a warning if you have the same issue. --Stabila711 (talk) 07:38, 25 August 2015 (UTC)[reply]
I have the power option set for high performance. I regularly use Prime95, and Intel's program that monitors TurboBoost shows no change, either in stress test or 1, 2, 3, or 4 workers. I've run other CPU-intensive things too and it never changes from 4.0GHz. I've watched TurboBoost on an older i7 and two i5s, and if the CPU is doing anything at all, they boost 0.2 to 0.4 GHz. Bubba73 You talkin' to me? 17:22, 25 August 2015 (UTC)[reply]
Perhaps it is the Intel monitoring program. Try the task manager. Under the Performance tab there should be a real-time graph of your CPU with speed. Run the program while watching that and see if your speed increases. If it doesn't then I don't think your computer was ever overclocked. --Stabila711 (talk) 21:13, 25 August 2015 (UTC)[reply]
It shows 3.96 GHz consistently. HP has several speeds available in this machine, I selected the highest - 4.0GHz. Running three cores on Prime95 puts the CPU heat right around Intel's max of 74C. So I suspect that HP disabled the turbo mode to keep it from overheating with the cooling that they use with the slower CPUs in the line. Bubba73 You talkin' to me? 00:33, 29 August 2015 (UTC)[reply]

Microsoft Wi-Fi Sense tracking wi-fi devices globally?

[edit]

I am not really that knowledgeable about Wi-Fi, but [1] concerns me. An image of the control settings says that Wi-Fi Sense requires releasing the user's location data to Microsoft. And Microsoft holds passwords to various devices that come into contact with it on their servers. Am I right to infer that Microsoft gets some kind of identifying code from every Wi-Fi device within range, and stores it to their servers? Because this would mean that any Wi-Fi device can be searched by NSA/Microsoft (if there's a difference) and they can watch everywhere it turns up that is within range of a wi-fi module - which in certain 'connected cities' is essentially everywhere, and even on an ordinary road is likely to include key commercial intersections. Wnt (talk) 11:07, 25 August 2015 (UTC)[reply]

From what I understand about WiFi Sense you have to physically permit the sharing of your connection with individuals. So "connected cities" would never really use this feature as their connection would be unprotected anyways so anyone can connect at anytime. As for tracking, if the NSA (or any government agency) really wanted to there is a much easier way to identify a particular device. It is called the MAC address and it is specific to each device. I can connect from my home or I can bring my laptop to the library and use their network, my MAC address would be the same. In any case, the WiFi Sense feature is designed to make the connection to your home network by guests easier. Like a temporary unblock on an otherwise secure network. Also, they say that the information sent to them is encrypted and as long as they are using the latest AES-256 bit encryption there shouldn't be a problem. --Stabila711 (talk) 11:15, 25 August 2015 (UTC)[reply]
@Stabila711: To clarify, I am concerned with whether they can track a wi-fi enabled device that is not connected to the internet, which the user may think of as only having 'short-range' capabilities. And since the feature is enabled by default, the question isn't whether the wired cities and other users would have a reason to turn it on but whether they'd see a reason to turn it off. Wnt (talk) 11:19, 25 August 2015 (UTC)[reply]
(edit conflict)If the device does not have GPS tracking abilities in it and it is not sending signal out (not connected to a network) then there isn't anything to track. Phones are one thing, they have embedded GPS chips in them that are active unless you power off the device. Computers don't have those. If the computer is not connected to a network, it isn't sending out any signals to track. Also, the feature is a Windows 10 thing. I've worked for a major metropolitan city recently and they were still running XP. I really wouldn't worry about them getting upgraded to 10 in the near future anyways so Wifi Sense is not coming to a city network near you any time soon. --Stabila711 (talk) 11:25, 25 August 2015 (UTC)[reply]
The scenario I'm picturing is that the "target" T of the surveillance is carrying a small device that has no GPS or networking, but interacts at short range via Wi-Fi. The sensors A, B, C may have both GPS and internet capabilities. As innocent victim T walks around, I am asking for confirmation whether A B and C are able to obtain a unique number from T, which might be tied by the manufacturer or other contacts to the victim, and whether they in fact send the serial number of T by default to Microsoft, together with whatever location information they have available. Wnt (talk) 13:28, 25 August 2015 (UTC)[reply]

@Wnt: I am going to try to answer and I apologize in advanced if I am just not understanding your question. If a user interacts with a WiFi access point, any WiFi access point, a header is attached to the data packet that is sent (also see network packet). This packet contains information regarding the device that the person is using to connect to the network (even if that device was connected inadvertently as long as it sends data the information is sent). Contained within this header is the MAC address of the device along with other identifying information. That information is sent to the service provider that processes the data request. Theoretically, a subpoena can be issued to the service provider for all header logs sent from a particular device (all logs that contain a particular MAC address). As for location information, such as GPS coordinates, I am not sure. The location of the access point can usually be pinpointed. For example, if the person connects at home and then at the library the location data would be different and can be resolved. But headers are not designed to carry a lot of information and GPS coordinates are not usually sent with every request unless the request specifically needs them (like map directions). In any case, devices usually don't connect to WiFi access points without you telling them to (or if they do there is a setting where you can turn that off). For example, on iPhones there is a setting that says "ask to join networks" that you can turn on that will stop auto-connections. Keep in mind that this is just talking about WiFi access. Data access over the cellular network will have the same packet headers as any other data request. --Stabila711 (talk) 05:38, 26 August 2015 (UTC)[reply]

C# how to load an external libary (DLL) if it exist in directory?

[edit]

Hello everyone. I have written a program to automatically calculate Musical Scales that uses an external C# library. This library contains all the scale data(the names of the scales, as well as the formulas). I also have a built in scale library. What I want to do, is I want to first check if the ScaleData.dll library exist in the folder that the program is installed in. I know how to do this already. I simply use the File class in the System.IO namespace. Next, if it does exist, I want the program to load the library and tell the program to use its classes and such instead of the built in library. How would I do this? I was thinking that I would have to use the LoadLibrary function in the WinAPI. But the problem with this is that, the function returns a handle to the loaded assembly. I would have no idea on how to access the class stored in the library. So my question is, how would I load a library and reference it in my app at Runtime? I am using VS 2010 and .NET framework 4.

Thanks for your help in advance, —SGA314 I am not available on weekends (talk) 14:16, 25 August 2015 (UTC)[reply]

You need to use Assembly.LoadFrom, not LoadLibrary. This is the appropriate page on MSDN. If you can't access MSDN, I've copied the C# example code below:
Example code
[C#] 
// LoadInvoke loads MyAssembly.dll and invokes the MyMethod1 method. 
// After compiling this class, run LoadInvoke.exe with MyAssembly.dll 
// as the command line argument, as shown below:
// LoadInvoke Myassembly.dll

using System;
using System.Reflection;
public class LoadInvoke
{
    public static void Main(string[] args)
    {
        Assembly a = Assembly.LoadFrom(args[0]);
        Type[] mytypes = a.GetTypes();
        BindingFlags flags = (BindingFlags.NonPublic | BindingFlags.Public | 
            BindingFlags.Static | BindingFlags.Instance | BindingFlags.DeclaredOnly);

        foreach(Type t in mytypes)
        {
            MethodInfo[] mi = t.GetMethods(flags);
            Object obj = Activator.CreateInstance(t);

            foreach(MethodInfo m in mi)
            {
                m.Invoke(obj, null);
            }
        }
    }
}

[C#] 
// Use this class with the LoadInvoke program.
// Compile this class using csc /t:library MyAssembly.cs
// to obtain MyAssembly.dll.
using System;

public class MyAssembly
{
    public void MyMethod1()
    {
        Console.WriteLine("Invoking MyAssembly.MyMethod1");
    }    
}


@Tevildo:Ok so the code you posted works but I am having a problem with types. I have a separate project called ScaleData in the solution. This separate project compiles the External DLL. I can't seem to convert the instance of the class without referencing the other project. If I delete or rename the DLL, the program errors out because it now relies on that external DLL. So, my question is, how to I make Object obj = Activator.CreateInstance(t); return a type of a specific class such as ScaleData? I have already tried ScaleData ExternalScaleForms = Activator.CreateInstance<ScaleData>(); but again, this requires me to reference the other project. How do I fix this? In the end, I need to access the proprieties and create an instance of the ScaleData class. The example code you posted sent me in the right direction. Its just that I am having a slight problem with types(well ok, a big problem).
Note: I am running a Windows Application. not aconsole app. I say this because I know that this makes a big difference in the Program.cs code.
Here is what I have so far:
Program.cs
Application.EnableVisualStyles();
Application.SetCompatibleTextRenderingDefault(false);
ScaleData.ScaleData ExternalScaleForms = null;
string ExternalDLLLoc = Environment.CurrentDirectory + "\\" + "ScaleData.dll";
string[] Files = Directory.GetFiles(Environment.CurrentDirectory, "*.dll");
if (Files.Contains<string>(ExternalDLLLoc) == true)
{
	Assembly a = Assembly.LoadFrom(ExternalDLLLoc);
	Type[] mytypes = a.GetTypes();
	BindingFlags flags = (BindingFlags.NonPublic | BindingFlags.Public |
		BindingFlags.Static | BindingFlags.Instance | BindingFlags.DeclaredOnly);

	foreach (Type t in mytypes)
	{
		MethodInfo[] mi = t.GetMethods(flags);
		//Object obj = Activator.CreateInstance<ScaleFormulas>();
		ExternalScaleForms = Activator.CreateInstance<ScaleData.ScaleData>();
	}

	//Don't know if I need this? As for I am using the lines above,
	//and I don't actually have any usable methods in the ScaleData class.
	//I only have the classes constructor's method.
	//This is where all my code that makes the class useful runs.
	foreach (Type t in mytypes)
	{
		MethodInfo[] mi = t.GetMethods(flags);
		Object obj = Activator.CreateInstance(t);

		foreach (MethodInfo m in mi)
		{
			m.Invoke(obj, null);
		}
	}
}
//Run The app with the instance of the external DLL.
//The app will check if it is null or not.
Application.Run(new MusicalScaleCalculator(ExternalScaleForms));
SGA314 I am not available on weekends (talk) 16:42, 26 August 2015 (UTC)[reply]
Well, referencing the other DLL is really how you're supposed to do it. If you have to defer this until runtime, you can create a class called something like LocalScaleData which contains the properties and methods you need, then do something like:
    Assembly a = Assembly.LoadFrom(ExternalDLLLoc);
    Type t = a.GetType("ScaleData.ScaleData");
    Object obj = Activator.CreateInstance(t);
    LocalScaleData ExternalScaleForms = (obj as LocalScaleData);

Tevildo (talk) 23:31, 26 August 2015 (UTC)[reply]

This dosen't work. The LocalScaleData class doesn't have the same data as the ExternalScaleData class therefore, when I cast the obj variable to the LocalScaleData type, all the data in the ExternalScaleData object becomes identical to that of the LocalScaleData class. For example, there is a bool variable that is named ExternalData in both the LocalScaleData and the ExternalScaleData classes. In the ExternalScaleData class, this variable's value is set to true. However, in the LocalScaleData class, this variable's value is set to false. When I inspect the obj variable before I try and cast it to a LocalScaleData type, the ExternalData variable is set to true. When I do try and cast the obj variable to the LocalScaleData type, the ExternalData variable all the sudden becomes false. And on top of that, all the data in the obj variable changes to that of all the data in the LocalScaleData class. Not the ExternalScaleData class. How do I fix this without making a reference to the external DLL? —SGA314 I am not available on weekends (talk) 14:50, 27 August 2015 (UTC)[reply]

Tiled high-res images

[edit]

Dezoomify seems to fail when I try to save from from here and other paintings from the same source and I couldn't locate the file in Firefox' page info multimedia either. After the tiles are fully loaded in Dezoomify choosing "save image" or anything else doesn't work. Any suggestions to get those images? Brandmeistertalk 15:36, 25 August 2015 (UTC)[reply]

I hate giving an answer like "works for me", but it does (using Chrome and Win7 Ultimate 64bit). On the first try, the Chrome window crashed, upon retry dezoomify succeeded in importing a picture with a resolution of 8917x5532. Did you try the 'usual' stuff, like closing resource-hungry applications, restarting your browser and/or PC etc? Rh73 (talk) 16:19, 25 August 2015 (UTC)[reply]
Nah, didn't work for me again, even in Google Chrome (running dual core 2.GHz, 2 GB RAM, 32-bit Win 7 with no other applications, restarting doesn't change anything, even though otherwise my Firefox often handles such images). Tiles are loaded, but stucks when saving. Could you upload those to Commons? It's a series of five paintings. Brandmeistertalk 18:12, 25 August 2015 (UTC)[reply]
2GB ram and/or 32bit Windows could explain your problems with high res images. It should be enough but who knows what kind of overhead this dezoomify thing creates and what kind of system it expects. I'll try to download the other paintings, but I've never dealt with Commons (yet). Would you be ok with something like a link to a public dropbox instead, and am I allowed to post it here? Rh73 (talk) 19:38, 25 August 2015 (UTC)[reply]
It worked for me too but Fireofx freezed when I saved the image. I didn't find the license of the images so I don't know if we can upload them to Commons. Hunsu (talk) 08:06, 26 August 2015 (UTC)[reply]
@Rh73: I'll be fine with dropbox, Imgur like that (you can drop a link here). Will expect. Brandmeistertalk 09:43, 26 August 2015 (UTC)[reply]
I had tried to upload the first painting to imgur yesterday night, but it didn't work (I'm assuming it exceeds max allowed dimension or filesize there). Right now I'm a bit busy, but gonna send you a link later today. Rh73 (talk) 09:59, 26 August 2015 (UTC)[reply]

@Brandmeister: I sent you the images. My Firefox crashed each time I downloaded the an image. Hunsu (talk) 14:21, 26 August 2015 (UTC)[reply]

Thanks, all received. Brandmeistertalk 14:47, 26 August 2015 (UTC)[reply]