Search Results

Search found 56327 results on 2254 pages for 'console application'.

Page 20/2254 | < Previous Page | 16 17 18 19 20 21 22 23 24 25 26 27  | Next Page >

  • Metro: Understanding the default.js File

    - by Stephen.Walther
    The goal of this blog entry is to describe — in painful detail — the contents of the default.js file in a Metro style application written with JavaScript. When you use Visual Studio to create a new Metro application then you get a default.js file automatically. The file is located in a folder named \js\default.js. The default.js file kicks off all of your custom JavaScript code. It is the main entry point to a Metro application. The default contents of the default.js file are included below: // For an introduction to the Blank template, see the following documentation: // http://go.microsoft.com/fwlink/?LinkId=232509 (function () { "use strict"; var app = WinJS.Application; app.onactivated = function (eventObject) { if (eventObject.detail.kind === Windows.ApplicationModel.Activation.ActivationKind.launch) { if (eventObject.detail.previousExecutionState !== Windows.ApplicationModel.Activation.ApplicationExecutionState.terminated) { // TODO: This application has been newly launched. Initialize // your application here. } else { // TODO: This application has been reactivated from suspension. // Restore application state here. } WinJS.UI.processAll(); } }; app.oncheckpoint = function (eventObject) { // TODO: This application is about to be suspended. Save any state // that needs to persist across suspensions here. You might use the // WinJS.Application.sessionState object, which is automatically // saved and restored across suspension. If you need to complete an // asynchronous operation before your application is suspended, call // eventObject.setPromise(). }; app.start(); })(); There are several mysterious things happening in this file. The purpose of this blog entry is to dispel this mystery. Understanding the Module Pattern The first thing that you should notice about the default.js file is that the entire contents of this file are enclosed within a self-executing JavaScript function: (function () { ... })(); Metro applications written with JavaScript use something called the module pattern. The module pattern is a common pattern used in JavaScript applications to create private variables, objects, and methods. Anything that you create within the module is encapsulated within the module. Enclosing all of your custom code within a module prevents you from stomping on code from other libraries accidently. Your application might reference several JavaScript libraries and the JavaScript libraries might have variables, objects, or methods with the same names. By encapsulating your code in a module, you avoid overwriting variables, objects, or methods in the other libraries accidently. Enabling Strict Mode with “use strict” The first statement within the default.js module enables JavaScript strict mode: 'use strict'; Strict mode is a new feature of ECMAScript 5 (the latest standard for JavaScript) which enables you to make JavaScript more strict. For example, when strict mode is enabled, you cannot declare variables without using the var keyword. The following statement would result in an exception: hello = "world!"; When strict mode is enabled, this statement throws a ReferenceError. When strict mode is not enabled, a global variable is created which, most likely, is not what you want to happen. I’d rather get the exception instead of the unwanted global variable. The full specification for strict mode is contained in the ECMAScript 5 specification (look at Annex C): http://www.ecma-international.org/publications/files/ECMA-ST/ECMA-262.pdf Aliasing the WinJS.Application Object The next line of code in the default.js file is used to alias the WinJS.Application object: var app = WinJS.Application; This line of code enables you to use a short-hand syntax when referring to the WinJS.Application object: for example,  app.onactivated instead of WinJS.Application.onactivated. The WinJS.Application object  represents your running Metro application. Handling Application Events The default.js file contains an event handler for the WinJS.Application activated event: app.onactivated = function (eventObject) { if (eventObject.detail.kind === Windows.ApplicationModel.Activation.ActivationKind.launch) { if (eventObject.detail.previousExecutionState !== Windows.ApplicationModel.Activation.ApplicationExecutionState.terminated) { // TODO: This application has been newly launched. Initialize // your application here. } else { // TODO: This application has been reactivated from suspension. // Restore application state here. } WinJS.UI.processAll(); } }; This WinJS.Application class supports the following events: · loaded – Happens after browser DOMContentLoaded event. After this event, the DOM is ready and you can access elements in a page. This event is raised before external images have been loaded. · activated – Triggered by the Windows.UI.WebUI.WebUIApplication activated event. After this event, the WinRT is ready. · ready – Happens after both loaded and activated events. · unloaded – Happens before application is unloaded. The following default.js file has been modified to capture each of these events and write a message to the Visual Studio JavaScript Console window: (function () { "use strict"; var app = WinJS.Application; WinJS.Application.onloaded = function (e) { console.log("Loaded"); }; WinJS.Application.onactivated = function (e) { console.log("Activated"); }; WinJS.Application.onready = function (e) { console.log("Ready"); } WinJS.Application.onunload = function (e) { console.log("Unload"); } app.start(); })(); When you execute the code above, a message is written to the Visual Studio JavaScript Console window when each event occurs with the exception of the Unload event (presumably because the console is not attached when that event is raised).   Handling Different Activation Contexts The code for the activated handler in the default.js file looks like this: app.onactivated = function (eventObject) { if (eventObject.detail.kind === Windows.ApplicationModel.Activation.ActivationKind.launch) { if (eventObject.detail.previousExecutionState !== Windows.ApplicationModel.Activation.ApplicationExecutionState.terminated) { // TODO: This application has been newly launched. Initialize // your application here. } else { // TODO: This application has been reactivated from suspension. // Restore application state here. } WinJS.UI.processAll(); } }; Notice that the code contains a conditional which checks the Kind of the event (the value of e.detail.kind). The startup code is executed only when the activated event is triggered by a Launch event, The ActivationKind enumeration has the following values: · launch · search · shareTarget · file · protocol · fileOpenPicker · fileSavePicker · cacheFileUpdater · contactPicker · device · printTaskSettings · cameraSettings Metro style applications can be activated in different contexts. For example, a camera application can be activated when modifying camera settings. In that case, the ActivationKind would be CameraSettings. Because we want to execute our JavaScript code when our application first launches, we verify that the kind of the activation event is an ActivationKind.Launch event. There is a second conditional within the activated event handler which checks whether an application is being newly launched or whether the application is being resumed from a suspended state. When running a Metro application with Visual Studio, you can use Visual Studio to simulate different application execution states by taking advantage of the Debug toolbar and the new Debug Location toolbar.  Handling the checkpoint Event The default.js file also includes an event handler for the WinJS.Application checkpoint event: app.oncheckpoint = function (eventObject) { // TODO: This application is about to be suspended. Save any state // that needs to persist across suspensions here. You might use the // WinJS.Application.sessionState object, which is automatically // saved and restored across suspension. If you need to complete an // asynchronous operation before your application is suspended, call // eventObject.setPromise(). }; The checkpoint event is raised when your Metro application goes into a suspended state. The idea is that you can save your application data when your application is suspended and reload your application data when your application resumes. Starting the Application The final statement in the default.js file is the statement that gets everything going: app.start(); Events are queued up in a JavaScript array named eventQueue . Until you call the start() method, the events in the queue are not processed. If you don’t call the start() method then the Loaded, Activated, Ready, and Unloaded events are never raised. Summary The goal of this blog entry was to describe the contents of the default.js file which is the JavaScript file which you use to kick off your custom code in a Windows Metro style application written with JavaScript. In this blog entry, I discussed the module pattern, JavaScript strict mode, handling first chance exceptions, WinJS Application events, and activation contexts.

    Read the article

  • C# Using colors in console , how to store in a simplified notation

    - by Chris
    Hello, The code below shows a line in different colors. But thats alot of code to type just for one line and to repeat that all over a program again. How exactly can i simplify this , so i dont need to write the same amount of code over and over? Console.ForegroundColor = ConsoleColor.Cyan; Console.Write(">>> Order: "); Console.ResetColor(); Console.Write("Data"); Console.ForegroundColor = ConsoleColor.DarkGreen; Console.Write("Parity"); Console.ForegroundColor = ConsoleColor.Cyan; Console.Write(" <<<"); Is there any way to store ... = Console.ForegroundColor = ConsoleColor.Cyan; ? "text" + color? + "text"; etc... Any input appreciated regards.

    Read the article

  • C#: Searching through arrays

    - by Jonathan Oberhaus
    I have a dvd app that stores dvds and blu-rays, I want to search the arrays by director. Below is the code for the inventory class I have seen many different ways to do this. There seems to be some debate as the best/most efficient way to accomplish this, any suggestions? Blockquote namespace MovieInventoryApplication { class Inventory { public Bluray[] BlurayMovies; public DVD[] DVDMovies; private int blurayCount; private int dvdCount; public Inventory() { BlurayMovies = new Bluray[5]; DVDMovies = new DVD[5]; blurayCount = 0; dvdCount = 0; } public void AddBluray() { String strTitle; int intReleaseYear; int intRunningTimeMinutes; String strDirector; int intPrice; int intRegionCode; try { Console.Write("Enter a title: "); strTitle = Console.ReadLine(); Console.Write("Enter a release year: "); intReleaseYear = Convert.ToInt32(Console.ReadLine()); Console.Write("Enter the running time in minutes: "); intRunningTimeMinutes = Convert.ToInt32(Console.ReadLine()); Console.Write("Enter the directors name: "); strDirector = Console.ReadLine(); Console.Write("Enter a rental price: "); intPrice = Convert.ToInt32(Console.ReadLine()); BlurayMovies[blurayCount] = new Bluray(strTitle, intReleaseYear, intRunningTimeMinutes, strDirector, intPrice); blurayCount++; Console.Write("Enter the DVD region code: "); intRegionCode = Convert.ToInt32(Console.ReadLine()); DVDMovies[dvdCount] = new DVD(strTitle, intReleaseYear, intRunningTimeMinutes, strDirector, intPrice, intRegionCode); dvdCount++; } catch (FormatException FormatException) { Console.WriteLine(FormatException.Message); Console.WriteLine("Please enter a number in this field."); } } public void AddDVD() { String strTitle; int intReleaseYear; int intRunningTimeMinutes; String strDirector; int intPrice; int intRegionCode; try { Console.Write("Enter a title: "); strTitle = Console.ReadLine(); Console.Write("Enter a release year: "); intReleaseYear = Convert.ToInt32(Console.ReadLine()); Console.Write("Enter the running time in minutes: "); intRunningTimeMinutes = Convert.ToInt32(Console.ReadLine()); Console.Write("Enter the directors name: "); strDirector = Console.ReadLine(); Console.Write("Enter a rental price: "); intPrice = Convert.ToInt32(Console.ReadLine()); Console.Write("Enter the region code: "); intRegionCode = Convert.ToInt32(Console.ReadLine()); DVDMovies[dvdCount] = new DVD(strTitle, intReleaseYear, intRunningTimeMinutes, strDirector, intPrice, intRegionCode); dvdCount++; } catch (FormatException FormatException) { Console.WriteLine(FormatException.Message); Console.WriteLine("Please enter a number in this field."); } } public void ListAllBluray() { int position = 0; while (BlurayMovies[position] != null) { Console.WriteLine(position + " " + BlurayMovies[position].strTitle); position++; } } public void ListAllDVD() { int position = 0; while (DVDMovies[position] != null) { //position + 1 + " " + Console.WriteLine(position + " " + DVDMovies[position].strTitle); position++; } } public void BlurayInfo(int position) { Console.WriteLine("Title: {0}", DVDMovies[position].strTitle); Console.WriteLine("Release Year: {0}", DVDMovies[position].intReleaseYear); Console.WriteLine("Running Time (Minutes): {0}", DVDMovies[position].intRunningTimeMinutes); Console.WriteLine("Director: {0}", DVDMovies[position].strDirector); Console.WriteLine("Price: {0}", DVDMovies[position].intPrice); } public void DVDInfo(int position) { Console.WriteLine("Title: {0}", DVDMovies[position].strTitle); Console.WriteLine("Release Year: {0}", DVDMovies[position].intReleaseYear); Console.WriteLine("Running Time (Minutes): {0}", DVDMovies[position].intRunningTimeMinutes); Console.WriteLine("Director: {0}", DVDMovies[position].strDirector); Console.WriteLine("Price: {0}", DVDMovies[position].intPrice); Console.WriteLine("Region Code: {0}", DVDMovies[position].intRegionCode); } } }

    Read the article

  • Console keyboard input OOP

    - by Alexandre P. Levasseur
    I am trying to build a very simple console-based game with a focus on using OOP instead of procedural programming because I intend to build up on that code for more complex projects. I am wondering if there is a design pattern that nicely handles this use case: There is a Player class with a MakeMove() method interacting with the board game. The MakeMove() method has to somehow get the user input yet I do not want to code it into the Player class as this would reduce cohesion and augment coupling. I was thinking of maybe having some controller class handle the sequence of events and thus the calls to keyboard input. However, that controller class would need to be able to handle differently the subclasses of Player (e.g. the AI class does not require keyboard input). Thoughts ?

    Read the article

  • grubx64.efi cannot find grub config or grub files, boots to grub console

    - by endor43
    Sony VAIO with Insyde H2O EFI bios will not boot into GRUB EFI The answer to this question was immensely helpful to me and my new Vaio Z3. The issue that I am having now is that after replacing bootmgfw.efi with grubx64.efi and renaming, it boots directly to grub console. I dont even get a menu where i can chose ubuntu. I tried putting a grub.cfg file next to the new bootmgfw.efi(grubx64.efi), no go? Any ideas how i can get the renamed grubx64.efi to find all the rest of the grub stuff outside of the ESP in my linux parition? Or do i have to move all grub files to /EFI/Microsoft/Boot on ESP? Thank you!

    Read the article

  • Common usecases and techniques when integrating a 3rd party application with Oracle Sales Cloud

    - by asantaga
    Over the last year or so I've see a lot of partners migrating and integrate their applications with Oracle Sales Cloud. Interestingly I'd say 60% of the partners use the same set of design patterns over and over again. Most of the time I see that they want to embed their application into Oracle Sales Cloud, within a tab usually, perhaps click on a link to their application (passing some piece of data + credentials) and then within their application update sales cloud again using webservices. Here are some examples of the different use-cases I've seen , and how partners are embedding their applications into Sales Cloud, NB : The following examples use the "Desktop" User Interface rather than the Newer "Simplified User Interface", I'll update the sample application soon but the integration patterns are precisely the same Use Case 1 :  Navigator "Link out" to third party application This is an example of where the developer has added a link to the global navigator and this links out to the 3rd Party Application. Typically one doesn't pass any contextual data with the exception of perhaps user credentials, or better still JWT Token. Techniques Used   Adding Link to Menu Item Using JWT Token in Sales Cloud Use Case 2 : Application Embedded within the Sales Cloud Dashboard Within the Oracle Sales Cloud application there is a tab called "Sales", within this tab its possible to embed a SubTab and embed a iFrame pointing to your application. To do this the developer simply needs to edit the page in customization mode, add the tab and then add the iFrame, simples! The developer can pass credentials/JWT Token and some other pieces of data but not object data (ie the current OpportunityID etc)  Techniques Used Adding a page to the dashboard  Using JWT Token in Sales Cloud  Use Case 3 : Embedding a Tab and Context Linking out from a Sales Cloud object to the 3rd party application In this usecase the developer embeds two components into Oracle Sales Cloud. The first is a SubTab showing summary data to the user (a quote in our case) and then secondly a hyperlink, (although it could be a button) which when clicked navigates the user to the 3rd party application. In this case the developer almost always passes context specific data (i.e. the opportunityId) and a security token (username password combo or JWT Token). The third party application usually takes the data, perhaps queries more data using the Sales Cloud SOAP/WebService interface and then displays the resulting mashup to the user for further processing. When the user has finished their work in the 3rd party application they normally navigate back to Oracle Sales Cloud using what's called a "DeepLink", ie taking them back to the object [opportunity in our case] they came from. This image visually shows a "Happy Path" a user may follow, and combines linking out to an application , webservice calls and deep linking back to Sales Cloud. Techniques Used Extending a SalesCloud application with a custom button Using JWT Token in Sales Cloud Extending Oracle Sales Cloud [Opportnity] with a custom tab exposing External Content Retrieving Data from Oracle Sales cloud using WebServices Coding some groovy script to generate the URLs required (Doc 1571200.1 on MyOracle Support) DeepLinking to specific Oracle Sales Cloud Pages (Doc 1516151.1 on My Oracle Support) Use-Case 4 :  Server Side processing/synchronization This usecase focuses on the Server Side processing of data, in this case synchronizing data. Here the 3rd party application is running on a "timer", e.g. cron or similar, and when triggered it queries data from Oracle Sales Cloud, then it queries data from the 3rd party application, determines the deltas and then inserts the data where required. Specifically here we are calling Oracle Sales Cloud using SOAP/WebServices and the 3rd party application is being communicated to using the REST API, for Oracle Sales Cloud one would use standard JAX-WS WebService calls and for REST one would use the JAX-RS api and perhap the Jackson api for managing JSON objects.. This is a very common use case and one which specifically lends itself to using the Oracle Java Cloud Service as the ideal application server where to host the mediator between the two applications.  Techniques Used Using JWT Token in Sales Cloud Integrating with the Oracle Java Cloud Service Retrieving Data from Oracle Sales cloud using WebServices General Resources The above is just a small set of techniques and use-cases which are used today. There are plenty of other sources of documentation and resources available on the internet but to get you started here are a few of my favourite places  Sales Cloud General Documentation Sales Cloud Customize Tab is useful for general customization of Sales Cloud Sales Cloud Integration Tab focuses on the 3rd party integration techniques  Official Oracle Fusion Developer Relations Blog Official Oracle Fusion Developer Relations YouTube Channel Enjoy integrating! 

    Read the article

  • Turning off the backlight on the console

    - by Albertas Agejevas
    I'm using an IBM Thinkpad X21 as a 3G router. It's running a server install of lucid. The laptop has the lid up most of the time. There is no X, just a plain console. The colsole blanks itself, but the LCD backlight is always on. The graphics chip is ATI Technologies Inc Rage Mobility P/M AGP 2x (rev 64). The following modules related to the framebuffer are now loaded: $ lsmod | grep fb fbcon 35102 71 tileblit 2031 1 fbcon font 7557 1 fbcon bitblit 4707 1 fbcon vga16fb 11385 1 vgastate 8961 1 vga16fb Can I make the LCD backlight turn off when the colsole is unused and have it turn on automatically when needed?

    Read the article

  • Graphical Mode breaks after suspend/ returning from Console

    - by Jack G
    When I try to go to a virtual console (ctrl alt f1) and return to f7, my screen freaks out. Its black with frequent white 'lightning bolts' flashing across the screen. Nothing works, but to force shutdown. Same when trying to resume from suspend. This doesnt happen every time, but very often. I dont know what information might be useful but: Ubuntu 12.10 ATI RS880M [Mobility Radeon HD 4200 Series] Gallium 0.4 on AMD RS880 this line in xsession-errors might be pertinent: (gnome-settings-daemon:1825): color-plugin-WARNING **: Done switch to new account, reload devices p.s. Ive tried the fglrx drivers but need the legacy drivers as described here, but nothing past a black screen.

    Read the article

  • Rendering of Oracle Secure Global Desktop's Administration Console on Modern Browser Versions

    - by Mohan Prabhala
    For customers using Oracle Secure Global Desktop version 4.6x, one of the issues reported is the improper rendering of the administration console when using modern browser versions such as Safari 5, Firefox 4+ or Internet Explorer 9. We are pleased to provide a fix for use of these modern browser versions when using Oracle Secure Global Desktop 4.6x. Please refer to Doc ID 1367923.1 on My Oracle Support. The solution involves a new .jar file, oracletheme.jar and following a few simple instructions. Download the new oracletheme.jar to /tmp and backup the existing one located at  /opt/tarantella/webserver/tomcat/<tomcat_ver>/webapps/sgdadmin/WEB-INF/lib/oracletheme.jar Stop the webserver  /opt/tarantella/bin/tarantella stop webserver Copy the new oracletheme.jar to the correct directory cp /tmp/oracletheme.jar /opt/tarantella/webserver/tomcat/<tomcat_ver>/webapps/sgdadmin/WEB- INF/lib/oracletheme.jar Verify permissions for the file -rw-r----- 1 root ttaserv 280449 Sep 9 2010 oracletheme.jar Finally, restart the webserver /opt/tarantella/bin/tarantella start webserver

    Read the article

  • Is it okay for an application to check for automatic updates in less than 20 hour interval?

    - by FlameStream
    I have a desktop application that has the ability to automatically update itself on the next restart (without the user's consent - but this is another issue altogether). Assuming that the user would never notice anything related to application updating (such as a progress bar, or pop-up requiring restart), and that our server would support the request spam load, is there any reason why it should not check for updates in less than 20 hour interval? The reason I'm asking this is because all applications that I know that have auto-update capability check for update every 20 to 24 hours and at startup. I was just wondering if there was an ethical rule about it, or simply because of the risk of overloading the server.

    Read the article

  • CPU Limits for Application Pools in IIS 7.5

    - by Kyle Brandt
    I see that in iis 7.5 I can set a CPU % utilization limit for a specified amount of time for an application pool. I can have also have it kill the worker process if this limit is violated. If tell it to do this, will the worker process automatically restart after it is killed, or is manual intervention required? Over at Stack Overflow there is the mention that it can restarted at the completion of the interval...

    Read the article

  • IIS Application Pool Memory Size Problem

    - by Roni
    I increased my application pool memory size from default to 500 mb. and i have IIS 7.5. My server sometimes falling down (service unavailable) and i don't know the reason. I did couple of changes at the same day that i changed memory size in iis and from that days i am getting this problem in one of my servers. Is there anybody can tell me what is the right way to increase memory and what can be the problems???? Thankss Roni

    Read the article

  • Application that creates restore points in xp

    - by user23950
    Is there any application for windows xp/windows 7 that could create system restore points on the go. Because the system restore in xp is not very fast in creating restore points. You still have to set many things before you can create one. I want one with just one button and when you click it. A restore point is created.

    Read the article

  • Cannot Delete Application Pool

    - by redsquare
    I am trying to tidy up an IIS server. I have removed some test/uat virtual directories however I am not able to remove the application pools. I get the following error message. Any hints on how I go about resolving this?

    Read the article

  • Facebook Connect application page Errors while loading page from application

    - by Lily
    Hi I am getting this error from my Facebook Application profile page Errors while loading page from application The URL is not valid. Please try again later. We appreciate your patience as the developers of SocialAnalysis and Facebook resolve this issue. Thanks! The application page is http://www.facebook.com/apps/application.php?id=333786146530 and when I try to go to the application, it gives me that error

    Read the article

  • What does WIX's CloseApplication functionality do and how would can the application respond to such

    - by tronda
    In the WIX setup I've got, when upgrading the application I have set a requirement to close down applications which might hold on to files which needs to be updated: <util:CloseApplication Id="CloseMyApp" Target="[MyAppExe]" CloseMessage="no" Description="!(loc.MyAppStillRunning)" RebootPrompt="no" ElevatedCloseMessage="no" /> The application on the other hand will capture closing down the window with a "user friendly" dialog box where the user can confirm that he or she wants to close down the application. I've experienced problems with the CloseApplication, and one theory is that the dialog box stops the application from closing. So the question is: Could this be a possible problem? If so - how can I have this confirmation dialog box and still behave properly when the installer asks the application to close down? Must I listen to Win32 messages (such as WM_QUIT/WM_CLOSE) or is there a .NET API which I can use to respond properly to these events?

    Read the article

  • using Mutex causing application to hang on Win XP X64

    - by Mohsan
    hi. I used the following code to verify the single instance of application. On Win XP X86 it is working fine, but on X64 after 3 to 4 minutes System generates StackOverflowException and causes the application to hang. after removing this check application is working fine.. Please tell me what should be the reason. code is static void Main() { bool instanceCountOne = false; using (Mutex mtex = new Mutex(true, "AppName", out instanceCountOne)) { if (instanceCountOne) { #if (DEBUG) RunInDebugMode(); #else RunInReleaseMode(); #endif mtex.ReleaseMutex(); } else { MessageBox.Show( "An application instance is already running", "App Name", MessageBoxButtons.OK, MessageBoxIcon.Information); } } } it crashes when single instance of application is running.

    Read the article

  • Facebook tab application scripting

    - by zznq
    I have a web application that I am trying to port to Facebook. The app uses a few external javascript files. So initially I wanted to create an iframe Facebook application. However, it turns out that you cannot use iframes when creating a tab application(which is a requirement). By tab application I mean placing your app on the profile page next to the wall, info, photos, ect. tabs. Does any one know of a good tool to help convert my javascript to the FBJS scripting? Or better yet does anyone have a work around so that I can include my own javascript in this tabbed application? Thanks for the help.

    Read the article

  • Restart Delphi Application Programmatically

    - by Smasher
    It should not be possible to run multiple instances of my application. Therefore the project source contains: CreateMutex (nil, False, PChar (ID)); if (GetLastError = ERROR_ALREADY_EXISTS) then Halt; Now I want to restart my application programmatically. The usual way would be: AppName := PChar(Application.ExeName) ; ShellExecute(Handle,'open', AppName, nil, nil, SW_SHOWNORMAL) ; Application.Terminate; But this won't work in my case because of the mutex. Even if I release the mutex before starting the second instace it won't work because shutdown takes some time and two instance cannot run in parallel (because of common resources and other effects). Is there a way to restart an application with such characteristics? (If possible without an additional executable) Thanks in advance.

    Read the article

  • Getting started with a facebook application

    - by Cyclone
    I'm really new to Facebook application development, and I'm quite confused about application permissions and why the php sdk is so limiting and has so few precoded functions. First off, how do I check if a user has set proper permissions for my application, and if not, display that standard dialog immediately instead of using FBML and making them click the link? Secondly, how do I publish to a user's stream with the php apis? Finally, are there any good tutorial sites for making a php based canvas application that use the latest versions of all the sdks? Thank you for your help! I really don't see why so much of this is Javascript, it would really make much more sense to me to have things like: if(!$facebook->appHasPerm('publish_stream'){$facebook->showPermDialog('publish_stream');} I'd feel like I have much more control over the application if it worked like that.

    Read the article

  • How can I run a local Windows Application and have the output be piped into the Browser.

    - by Trey Sherrill
    I have Windows Application (.EXE file is written in C and built with MS-Visual Studio), that outputs ASCII text to stdout. I’m looking to enhance the ASCII text to include limited HTML with a few links. I’d like to invoke this application (.EXE File) and take the output of that application and pipe it into a Browser. This is not a one time thing, each new web page would be another run of the Local Application! The HTML/java-script application below has worked for me to execute the application, but the output has gone into a DOS Box windows and not to pipe it into the Browser. I’d like to update this HTML Application to enable the Browser to capture that text (that is enhanced with HTML) and display it with the browser. <body> <script> function go() { w = new ActiveXObject("WScript.Shell"); w.run('C:/DL/Browser/mk_html.exe'); return true; } </script> <form> Run My Application (Window with explorer only) <input type="button" value="Go" onClick="return go()"> </FORM> </body>

    Read the article

  • An Interactive Console I/O Wrapper/Interceptor in C# - What is the issue?

    - by amazedsaint
    I was trying to put together an interactive Console interceptor/wrapper in C# over the weekend, by re-mixing few code samples I've found in SO and other sites. With what I've as of now, I'm unable to read back from the console reliably. Any quick pointers? public class ConsoleInterceptor { Process _interProc; public event Action<string> OutputReceivedEvent; public ConsoleInterceptor() { _interProc = new Process(); _interProc.StartInfo = new ProcessStartInfo("cmd"); InitializeInterpreter(); } public ConsoleInterceptor(string command) { _interProc = new Process(); _interProc.StartInfo = new ProcessStartInfo(command); InitializeInterpreter(); } public Process InterProc { get { return _interProc; } } private void InitializeInterpreter() { InterProc.StartInfo.RedirectStandardInput = true; InterProc.StartInfo.RedirectStandardOutput = true; InterProc.StartInfo.RedirectStandardError = true; InterProc.StartInfo.CreateNoWindow = true; InterProc.StartInfo.UseShellExecute = false; InterProc.StartInfo.WindowStyle = ProcessWindowStyle.Hidden; bool started = InterProc.Start(); Redirect(InterProc.StandardOutput); Redirect(InterProc.StandardError); } private void Redirect(StreamReader input) { new Thread((a) => { var buffer = new char[1]; while (true) { if (input.Read(buffer, 0, 1) > 0) OutputReceived(new string(buffer)); }; }).Start(); } private void OutputReceived(string text) { if (OutputReceivedEvent != null) OutputReceivedEvent(text); } public void Input(string input) { InterProc.StandardInput.WriteLine(input); InterProc.StandardInput.Flush(); } }

    Read the article

< Previous Page | 16 17 18 19 20 21 22 23 24 25 26 27  | Next Page >