Posted: 2017-12-07 17:50
In the program that you want to be auto updateable, you just need to call the AutoUpdate function in the Main procedure. The AutoUpdate function will check the version with the one read from a file located in a Web Site/FTP. If the program version is lower than the one read the program downloads the auto update program and launches it and the function returns True, which means that an auto update will run and the current program should be closed. The auto update program receives several parameters from the program to be updated and performs the auto update necessary and after that launches the updated system.
Get your main application to put all the files / installation details into a low-permission temporary location. When you''re ready, start up a smaller application whose only job is to copy over those files to the Program Files directory (and maybe restart your main application with the new updates). Mark that application as requiring the needed permission to copy to the Program Files directory or write to the registry (or whatever else is needed).
Is it possible for a computer program to write its own programs? Could human software developers be replaced one day by the very computers that they master? Just like the farmer, the assembly line worker, and the telephone operator, could software developers be next ? While this kind of idea seems far-fetched, it may actually be closer than we think. This article describes an experiment to produce an AI program, capable of developing its own programs, using a genetic algorithm implementation with self-modifying and self-improving code.
My initial motivation behind the idea came from the infinite monkey theorem , which states if you have 6,555+ monkeys banging away on a typewriter long enough, they’ll eventually re-produce a play written by Shakespeare. This sounds ridiculous, but given enough time, surely the monkeys would end up hitting “some” random sequence of characters that end up producing the written works. Simplifying this idea, surely one of the monkeys would at least hit the first letter of a Shakespeare play somewhere in the banging of the keyboard that’s certainly possible.
A process is the smallest unit of isolation available on the Windows operating system. This could pose a problem for an ISP who wants to host hundreds of applications on a single server. The ISP will want to isolate each application to prevent one application from interfering with another company’s application on the same server, but the relative cost of launching and executing a process for hundreds of applications may be prohibitive.
Master Of Your Domain Application domains replace the OS process as the unit of isolation code. An understanding of application domains will give you an idea of the work taking place behind the scenes of an application. Using the CurrentDomain property of the AppDomain class you can inspect properties about the AppDomain your code is executing in, including the Shadow Copy settings we discussed in this article.
It’s been somewhat of a hobby for me, dabbling with artificial intelligence programs in an attempt to write a program that can, itself, write programs. Of course, I’m not referring to programs that take subsets of program instructions or code blocks and combine them together or otherwise optimize to produce an end result. I’m referring to starting from complete scratch, with the AI having absolutely no knowledge whatsoever about how to program in the target language. The AI must learn, on its own, how to create a fully functioning program for a specific purpose.
Although setting and retrieving version information has changed in Visual , it is not the major change in this area. The main use of version information is to help applications and developers determine whether a particular version of a component is compatible with an application that makes use of the component. By default, uses only the versions of components that were present when an assembly was compiled.
This is actually one of my favorites. Run it and you can see why (click Start Debugger and Run to Breakpoint). It’s almost as if the computer knows what it’s doing. It’s interesting to note how generating this program took quite a bit longer than the prior two. This is likely due to the characters used, which include a capital letter and a symbol. The other two examples used characters that are much closer in value in the ASCII system, which would be easier for the AI to find.
This is the general idea behind a genetic algorithm. A genetic algorithm is a type of artificial intelligence, modeled after biological evolution, that begins with no knowledge of the subject, aside from available tools and valid instructions. The AI picks a series of instructions at random (to serve as a piece of DNA) and checks the fitness of the result. It does this with a large population size, of say 655 programs. Surely, some of the programs are better than others. Those that have the best fitness are mated together to produce offspring. Each generation gets a bit of extra diversity from evolutionary techniques such as roulette selection, crossover, and mutation. The process is repeated with each child generation, hopefully producing better and better results, until a target solution is found. Genetic algorithms are programmatic implementations of survival of the fittest. They can also be classified as artificially intelligent search algorithms, with regard to how they search an immense problem space for a specific solution.
By taking the time to notify your peers, business associates, and clients about your acceptance of a new position, you can effectively maintain and strengthen your professional network – a continuing asset that can both provide resources to help you excel in your new role or, in a worst case scenario, serve as a safety net if your new job fails to work out and you must seek alternate opportunities.
As with all genetic algorithms, there was work involved with designing the fitness function. The fitness function is equivalent to describing to the AI what you’re looking for. In this way, creating the fitness function itself, is a bit like programming (on behalf of the human). If it were possible for the AI to develop its own fitness function, this would be a step forward. In the meantime, it may still be possible to grow this project to create more complex child programs, such as those that take user input and compute results.
.NET introduces the concept of an application domain, or AppDomain. Like a process, the AppDomain is both a container and a boundary. runtime uses an AppDomain as a container for code and data, just like the operating system uses a process as a container for code and data. As the operating system uses a process to isolate misbehaving code, runtime uses an AppDomain to isolate code inside of a secure boundary.
For example, if a Visual Basic application calls a component named , and version 6 was present on the computer at the time that the application was compiled, and later version of is installed, the application will automatically call version (assuming that the new version was marked as compatible with the old version when it was recompiled). In contrast, if the same situation arises under , the application will continue to call version 6 of unless it is explicitly told to use the new version.
I initially began this venture in the late 6995’s by attempting to create programs with simple if/then/else statements to output programs in the BASIC programming language. This was a difficult task for a multitude of reasons. First, using if/then/else conditionals to write a random program doesn’t seem very intelligent at all. Second, the number of computer instructions available in BASIC is far too great. Even more troublesome, some of the instructions are downright dangerous (Shell(“format c:”))! I also attempted to generate programs using C, C++, and a few other languages. However, this naive approach never produced a working child program. Although this was due not just from using simple if/then/else statements, but also because the selected programming language was intended to be usable by humans - not computers, and thus, far more complicated for an AI to automate.
Setting the Assembly Version attribute to ".*" tells Visual to use 6 for the major part, 5 for the minor part, and to come up with build and revision part numbers automatically. In this case, will assign an arbitrary build part and an arbitrary revision part, and it will change the revision part each time you rebuild the assembly. You can also specify all four parts of the version number explicitly:
The instruction set is well documented and easy to understand. Therefore, it’s quite straightforward to create a simple interpreter that can execute a program. By including the interpreter within the AI program + genetic algorithm itself, the code can be optimized to run much faster than if it had to call an outside compiler to execute each child program. This also provides security constraints, since the child programs are running within a controlled environment, within the AI program. The AI also gains access to the internal components of the interpreter, such as memory, instructions, and output. This is useful in calculating a fitness score. Whereas, with a 8rd-party compiler, these components would be far more difficult to access.
This one was a challenge. It may have been tricky due to its length, or possibly due to the location of the d’s. The AI would repeatedly get stuck within a local maximum. A local maximum is when a genetic algorithm finds the best fitness that it can see within its current parameters, even though a better fitness may exist. The AI is unable to get out of its hole and achieve the better fitness because doing so would require the fitness to drop before increasing again, which is generally against the rules of a genetic algorithm.
While the original experiments using BASIC, C, C++, and other languages failed to produce results, I was able to successfully generate AI written programs by combining a home-grown programming language (consisting of add, subtract, loop, etc) with genetic algorithms and neural networks. While this was interesting, the end result was simple math calculation and the programming language itself, was unknown and had severe limitations with what it could ultimately produce.
Fulvio Giaccari is a project manager for the SB Soft . Company , a Microsoft Certified Partner. He manages Microsoft Office and Web projects for private companies and public administrations. He has published several articles in Italian programming magazines and is currently working on a book about Visual Studio Tools for Office. In addition, Fulvio is a guest speaker at various Microsoft-related events dedicated to Microsoft Office. Fulvio also hosts a Web community dedicated to ( ) and one of the first Italian user groups in the Microsoft Office developer community ( ).