Search Results

Search found 12948 results on 518 pages for 'mouse events'.

Page 165/518 | < Previous Page | 161 162 163 164 165 166 167 168 169 170 171 172  | Next Page >

  • string combinations

    - by vbNewbie
    I would like to generate a combination of words. For example if I had the following list: {cat, dog, horse, ape, hen, mouse} then the result would be n(n-1)/2 cat dog horse ape hen mouse (cat dog) (dog horse) (horse ape) (ape hen) (hen mouse) (cat dog horse) (dog horse ape) (horse ape hen) etc Hope this makes sense...everything I found involves permutations The list I have would be a 500 long

    Read the article

  • Fading in and fading out for a form

    - by karthik
    hi i have a requirement in which my form is transparent,if my mouse enters into it the form should became visible,if my mouse leaves out of the form it becomes transparent, i have three different controls placed in my form , each controls mouse leave and mouse enter is the same that of the form . if my mouse enters into the form and enters into a control form_mouseleaveevent and control_mouseenterd gets fired so iam not able to achieve it,how to overcome this. below is the piece of code for this: private void TransToOpac() { if (!isTransparent) return; if (TtoOON == false ) { TtoOON = true; for (i = this.Opacity; i <= 1; i = i + 0.02) { this.Opacity = i; Thread.Sleep(50); } isTransparent = false; TtoOON = false; } } private void OpacToTrans() { if (isTransparent) return; if (OtoTON == false ) { OtoTON = true; for (i = this.Opacity; i >= 0.5; i = i - 0.02) { this.Opacity = i; Thread.Sleep(50); } isTransparent = true; OtoTON = false; } } private void OnMouseEntered(object sender, EventArgs e) { TransToOpac(); } private void OnMouseLeft(object sender, EventArgs e) { OpacToTrans(); }

    Read the article

  • Silverlight MouseMove: find missing points during a movement

    - by Jalfp
    In an application in Silverlight I'm working on, I need to track the moves of the mouse. My problem is that using the MouseMove event, I don't have a continuous set of points if the user moves the mouse fast enough (if I add each point in a list I can have (10,10) en then (20,20)...) I'd like to have ALL points where the mouse has been during the move. Do you have any idea ?

    Read the article

  • Global keylogger in Java

    - by Manish
    I'm writing an application which monitors the person’s mouse and keyboard. If they have not used the keyboard or mouse for 1 minute, it should pops up a message which says “You have not used the mouse or keyboard for 1 minute” and an OK button. How do I do this in Java?

    Read the article

  • Creating an invisible button in Java Swing

    - by AniDev
    Hello, I have seen many times on Java Swing GUIs buttons that look like images until the mouse rolls over them. They appear to not have their content area filled. When the mouse rolls over them, the content area fills in but the button looks as though the mouse is not hovering over it. An example of this would be the toolbar of buttons used to activate each demo in SwingSet2. How is this effect possible? Thanks!

    Read the article

  • manipulate variable made up of html before adding it to the dom (new in jQuery 1.4???)

    - by pedalpete
    I thought I had seen this in the first announcement of jQuery 1.4, but can't seem to find anything now. I have a calendar table which is built dynamically from a json ajax response. The table is built in a variable called putHtml. Currently, once the table is added to the DOM, I run a showEvents function which takes each event and adds it to the appropriate cell in the table. Unfortunately, when I have 100 events, that means I am updating the DOM 100 seperate times. Which is getting rather slow. I use the showEvents function to add events dynamically, so it would be really nice if I could just use the same function, and specify to look in the DOM for the cell to add the event to, or look in the variable (assuming I've got it right, and you can actually do this with jQuery). The code I use currenlty is this jQuery('div#calendars').append('putHtml.join('')); for(var e in thisCal.events){ showEvent(thisCal.events[e]); } What I had attempted to do instead was for(var e in thisCal.events){ showEvent(thisCal.events[e],putHtml); } jQuery('div#calendars').append('putHtml.join('')); the showEvents function looks like this function showEvents(event){ var eventDate=event.date; var eventTime=event.time; var eventGroup=event.group; var eventName=event.name; var eventType=event.type; var whereEvent=jQuery('div.a'+eventDate, 'table.'+eventGroup); var putEvent='<div class="event" id="a+'eventDate+'_'+eventTime+'">'+eventName+'</div>' jQuery(whereEvent, 'div#calendar').append(putEvent); if(eventType2){ jQuery(whereEvent, 'div#listings').append(putEvent); } } when attempting to manipulate the variable putHtml before adding to the dom, I was passing putHtml into the showEvent function, so instead of '(whereEvent, 'div#calendar'), I had (whereEvent, putHtml), but that didn't work. of course, the other method to accomplish this would be that when I make each cell, I iterate over the events json, and apply the appropriate html to the cell at the time, but that means repetitively running over the entire json in order to get the event to put in the cell. Is there another/better way to do something like this?

    Read the article

  • ActionScript / AIR - One Button Limit (Exclusive Touch) For Mobile Devices?

    - by TheDarkIn1978
    two years ago, when i was developing an application for the iPhone, i used the following built-in system method on all of my buttons: [button setExclusiveTouch:YES]; essentially, if you had many buttons on screen, this method insured that the application wouldn't be permitted do crazy things when several button events firing at the same time as any new button press would cancel all others. problematic: ButtonA and ButtonB are available. each button has a mouse up event which fire a specific animated (tweened) reorganization/layout of the UI. if both button's events are fired at the same time, their events will likely conflict, causing a strange new layout, perhaps a runtime error. solution: application buttons cancel any current pending mouse up events when said button enters mouse down. private function mouseDownEventHandler(evt:MouseEvent):void { //if other buttons are currently in a mouse down state ready to fire //a mouse up event, cancel them all here. } of course it's simple to manually handle this if there are only a few buttons on stage, but managing buttons becomes more and more complicated / bug-prone if there are several / many buttons available. is there a convenience method available in AIR specifically for this functionality?

    Read the article

  • Flash: Correctly handling click-and-drag outside the browser?

    - by David Wolever
    What's the correct way to detect, from Flash, when someone has started a drag within the browser (eg, a MOUSE_DOWN event), dragged the mouse outside the browser window, released the button, then moved the mouse back over the browser? For example (assuming StackOverflow was a Flash application): I've tried the "obvious" thing, checking event.buttonDown in the MOUSE_MOVE handler, but even though the mouse button is up, event.buttonDown is true in step 2 (above). So, is there any other way to check the "real" status of the mouse button? Or any other way to handle this situation?

    Read the article

  • HTML 5: how to make stackable images?

    - by Bobafett
    Is it possible to load up 10 images (same dimension), stack them on top of one another only showing 1 image at a time and then by holding down the left mouse button and dragging the mouse up you scroll in one direction and moving the mouse down scrolls in the opposite direction?' if so how can this be done? canvas element would be the begining, no?

    Read the article

  • MySQL server has gone away

    - by user491992
    Hello Friends, I executed this query on my MySql Server and it is giving me "MySQL server has gone away" Error.In following query my both table have more then 1000000 rows. SELECT a_tab_11_10.url as url,a_tab_11_10.c5 as 't1',a_tab_12_10.c3 as 't2' FROM a_tab_11_10 join a_tab_12_10 on (a_tab_11_10.url)=(a_tab_12_10.url) order by (a_tab_11_10.c5-a_tab_12_10.c3) desc limit 10 here is my log file but i am not getting it. Thank you @Faisal for answer and i check my log file but i am not getting it.. 110111 10:19:50 [Note] Plugin 'FEDERATED' is disabled. 110111 10:19:51 InnoDB: Started; log sequence number 0 945537221 110111 10:19:51 [Note] Event Scheduler: Loaded 0 events 110111 10:19:51 [Note] wampmysqld: ready for connections. Version: '5.1.36-community-log' socket: '' port: 3306 MySQL Community Server (GPL) 110111 12:35:42 [Note] wampmysqld: Normal shutdown 110111 12:35:43 [Note] Event Scheduler: Purging the queue. 0 events 110111 12:35:43 InnoDB: Starting shutdown... 110111 12:35:45 InnoDB: Shutdown completed; log sequence number 0 945538624 110111 12:35:45 [Warning] Forcing shutdown of 1 plugins 110111 12:35:45 [Note] wampmysqld: Shutdown complete 110111 12:36:39 [Note] Plugin 'FEDERATED' is disabled. 110111 12:36:40 InnoDB: Started; log sequence number 0 945538624 110111 12:36:40 [Note] Event Scheduler: Loaded 0 events 110111 12:36:40 [Note] wampmysqld: ready for connections. Version: '5.1.36-community-log' socket: '' port: 3306 MySQL Community Server (GPL) 110111 12:36:40 [Note] wampmysqld: Normal shutdown 110111 12:36:40 [Note] Event Scheduler: Purging the queue. 0 events 110111 12:36:40 InnoDB: Starting shutdown... 110111 12:36:42 InnoDB: Shutdown completed; log sequence number 0 945538634 110111 12:36:42 [Warning] Forcing shutdown of 1 plugins 110111 12:36:42 [Note] wampmysqld: Shutdown complete 110111 12:36:52 [Note] Plugin 'FEDERATED' is disabled. 110111 12:36:52 InnoDB: Started; log sequence number 0 945538634 110111 12:36:52 [Note] Event Scheduler: Loaded 0 events 110111 12:36:52 [Note] wampmysqld: ready for connections. Version: '5.1.36-community-log' socket: '' port: 3306 MySQL Community Server (GPL) 110111 12:37:42 [Note] wampmysqld: Normal shutdown 110111 12:37:42 [Note] Event Scheduler: Purging the queue. 0 events 110111 12:37:42 InnoDB: Starting shutdown... 110111 12:37:43 InnoDB: Shutdown completed; log sequence number 0 945538634 110111 12:37:43 [Warning] Forcing shutdown of 1 plugins 110111 12:37:43 [Note] wampmysqld: Shutdown complete 110111 12:37:46 [Note] Plugin 'FEDERATED' is disabled. 110111 12:37:46 InnoDB: Started; log sequence number 0 945538634 110111 12:37:46 [Note] Event Scheduler: Loaded 0 events 110111 12:37:46 [Note] wampmysqld: ready for connections. Version: '5.1.36-community-log' socket: '' port: 3306 MySQL Community Server (GPL)

    Read the article

  • Another Synergy issue: screen lock on Windows Server 2003

    - by pmr
    I have set up Synergy on Unix systems with no problems, however when I set up a Synergy server on a Windows Server 2003 box using I get an error message that the mouse cursor is locked when trying to move to the client system. I use a Microsoft Natural keyboard in case that matters (seems Scroll Lock might be involved). Does anyone have experience with using Synergy on Windows systems that have reported mouse screen locking in the log when unable to mouse over to a client system?

    Read the article

  • Calendar Day View in PHP

    - by JamesArmes
    I'm working on adding a day view option to an existing calendar solution. Like many people implementing their own calendars, I am trying to model Google Calendars. They have an excellent calendar solution and their day view provides a lot of flexibility. For most part, the implementation is going well; however, I'm having issues when it comes to conflicting events. Essentially, I want the events to share the same space, side by side. Events that start at the same time should have the longest event first. In the example data set I'm working with, I have four events: A: 10:30 - 11:30 B: 13:30 - 14:30 C: 10:30 - 11:00 D: 10:45 - 14:00 I can handle A, C, and D just fine, the problem comes with D. A should be left of C which should be left of D; each taking one third of the width (it's fixed width so I can do simple math to figure that out). The problem is that B should be under A and C, to the left of D. Ideally, B would take up the same amount of space as A and C (two thirds width), but I would even settle for it only taking up only one third width. My array of events looks similar to the following: $events = array( '1030' => array( 'uniqueID1' => array( 'start_time' => '1030', 'end_time' => '1130', ), 'uniqueID2' => array( 'start_time' => '1030', 'end_time' => '1100', ), ), '1045' => array( 'uniqueID3' => array( 'start_time' => '1045', 'end_time' => '1400', ), ), '1330' => array( 'uniqueID3' => array( 'start_time' => '1330', 'end_time' => '1430', ), ), ); My plan is to add some indexes to each event that include how many events it conflicts with (so I can calculate the width) and which position in that series it should be (so I can calculate the left value). However, that doesn't help the B. I'm thinking I might need an algorithm that uses some basic geometry and matrices, but I'm not sure where to begin. Any help is greatly appreciated.

    Read the article

  • jquery small error

    - by HeinekenBluess
    Hi, i am very new at jquery and code, here i am trying to get the setTimeout event to be inside the .mouseout event but i'm not sure how to do that as i keep getting syntax error in my editor. Here's what i have: jQuery(document).ready(function() { $('.slidedown').hide(); $('.trigger').hover( function(){ // enter animation $('.slidedown').stop(true,true).animate({ height: ['toggle', 'swing'], }, 600, function() { /* animation done */ }); }, function(){ // leave animation $('.slidedown').mouseout() setTimeout( function(){ $('.slidedown').stop(true,true).animate({ height: '0px', }, 600, function() { /* animation done */ }); }, 1000 ); }); }); A small nuance, in this code the user mouses over a div, then another div bellow it slides down. Moving the mouse to the .slidedown div should keep it open until the mouse is removed. But will this code collapse the .slidedown div if the user doesn't mouse over .slidedown after .trigger but instead moves the mouse directly from .trigger to another area of page? I.e i need some kind of 'setTimeout' that is trigged only if the user doesn't move mouse over .slidedown after hovering over .trigger. Hope i make sense. Thanks for your help!

    Read the article

  • PHP class extends not working why and is this how to correctly extend a class?

    - by Matthew
    Hi so I'm trying to understand how inherteince works in PHP using object oriented programming. The main class is Computer, the class that is inheriting is Mouse. I'm extedning the Computer class with the mouse class. I use __construct in each class, when I istinate the class I use the pc type first and if it has mouse after. For some reason computer returns null? why is this? class Computer { protected $type = 'null'; public function __construct($type) { $this->type = $type; } public function computertype() { $this->type = strtoupper($this->type); return $this->type; } } class Mouse extends Computer { protected $hasmouse = 'null'; public function __construct($hasmouse){ $this->hasmouse = $hasmouse; } public function computermouse() { if($this->hasmouse == 'Y') { return 'This Computer has a mouse'; } } } $pc = new Computer('PC', 'Y'); echo $pc->computertype; echo $pc->computermouse;

    Read the article

  • how to solve this jquery problem

    - by From.ME.to.YOU
    Hello i have 2 divs above each others, at a given moment one is shown and the other is hidden, the script should display #div2 when the mouse enters #div1 and should show #div1 when the mouse leaves #div2 the problem comes when the mouse enters #div1 and leaves before #div2 is displayed so the #div2 will stay displayed but the mouse has left #div2 already any help ? my jqurey code $('#div1').mouseenter(function(){ $('#div1').fadeOut("fast",function(){ $('#div2').fadeIn("fast"); }); }); $('#div2').mouseleave(function(){ $('#div2').fadeOut("fast",function(){ $('#div1').fadeIn("fast"); }); });

    Read the article

  • How to copy a bunch of pages? Is there a 3rd party tool?

    - by unknown (yahoo)
    (I asked the following question at the DNN forum, and also at snowcovered. Nobody knew of such an obvious time-saver being for sale. I'm posting here in case anybody knows of a freeware module that might do this.) By "groups of dnn pages", I mean pages that form a hierarchy (not necessary a hierarchy that is headed with a page at the same level as the Home page.) I know that I can copy web pages, one by one, using the admin login via the web-based dnn interface. But, I'd prefer a script or wizard, of some sort (that runs scripts behind the scenes) that can allow me to 1) specify a web page that I want to copy (along with the hierarchy of pages under it) 2) specify the names and titles of the new top-level pages 3) specify whether the contained modules of the top-level page that I want to copy is to be : ( ) New ( ) Copy ( ) Reference (as in the web-based interface) 4) repeat 3) for each of the source pages in the hierarchy that I want to copy You might say that I am looking to do something similar to creating a portal web site based on a template, except that it's not an entirely new website - instead it's a section of the current web site. I might want to do this because I have an organization which is broken into chapters, and I want each chapter to have, say, it's own General Information page (which acts like it's home page), and underneath that, in it's hierarchy, a Contact Info page and an Events page. so: Home Page   General Information Page     Contact Info     Events -- Home Page   General Information Page     Contact Info     Events   General Information Page Kiwanis - Bloomfield     Contact Info     Events   General Information Page Kiwanis - Dayton     Contact Info     Events If I have 200 chapters, I certainly don't want to copy those 3 web pages using the web based interface, as that would take a long time. (And imagine if each chapter's new sub-website had 30 pages!) I just want to specify the parameters of a copy process, then press a button, and let the system do the rest.

    Read the article

  • The meaning of thermal throttle counters and package power limit notifications in Linux

    - by Trustin Lee
    Whenever I do some performance testing on my Linux-installed MacBook Pro, I often see the following messages in dmesg: Aug 8 09:29:31 infinity kernel: [79791.789404] CPU1: Package power limit notification (total events = 40365) Aug 8 09:29:31 infinity kernel: [79791.789408] CPU3: Package power limit notification (total events = 40367) Aug 8 09:29:31 infinity kernel: [79791.789411] CPU2: Package power limit notification (total events = 40453) Aug 8 09:29:31 infinity kernel: [79791.789414] CPU0: Package power limit notification (total events = 40453) I also see the throttle counters in the sysfs increases over time: trustin@infinity:/sys/devices/system/cpu/cpu0/thermal_throttle $ ls core_power_limit_count package_power_limit_count core_throttle_count package_throttle_count $ cat core_power_limit_count 0 $ cat core_throttle_count 41912 $ cat package_power_limit_count 67945 $ cat package_throttle_count 67565 What do these counters mean? Do they affect the performance of CPU or system? Do they result in increased deviation of performance numbers? (i.e. Do they prevent me from getting reliable performance numbers?) If so, how do I avoid these messages and increasing counters? Would running the performance tests on a well-cooled desktop system help?

    Read the article

  • Windows 2003 Domain controller

    - by user40766
    I have a win 2K3 domain controller that has sudddenly started logging about 60 events a second. All events are ID 538, 540 and 576 All events pertain to Security Audit of the machine itself logging in successfully. a typical entry is Event Id 540 Successful Network Logon: User Name: <machinename>$ Any pointers to how I can diagnose this? CPU and memory are normal on the machine.

    Read the article

  • psloglist -w into a file

    - by user11588
    I'm trying to redirect windows event log continuously into a file. psloglist.exe has the -w feature (that listens for new events and outputs to console) so I tried combining it with redirection into a file like so: psloglist -w > out.txt It doesn't work. As new events are logged they do not show up in the file. However, if I remove > out.txt new events do shows up in the console!

    Read the article

  • Nested loop traversing arrays

    - by alecco
    There are 2 very big series of elements, the second 100 times bigger than the first. For each element of the first series, there are 0 or more elements on the second series. This can be traversed and processed with 2 nested loops. But the unpredictability of the amount of matching elements for each member of the first array makes things very, very slow. The actual processing of the 2nd series of elements involves logical and (&) and a population count. I couldn't find good optimizations using C but I am considering doing inline asm, doing rep* mov* or similar for each element of the first series and then doing the batch processing of the matching bytes of the second series, perhaps in buffers of 1MB or something. But the code would be get quite messy. Does anybody know of a better way? C preferred but x86 ASM OK too. Many thanks! Sample/demo code with simplified problem, first series are "people" and second series are "events", for clarity's sake. (the original problem is actually 100m and 10,000m entries!) #include <stdio.h> #include <stdint.h> #define PEOPLE 1000000 // 1m struct Person { uint8_t age; // Filtering condition uint8_t cnt; // Number of events for this person in E } P[PEOPLE]; // Each has 0 or more bytes with bit flags #define EVENTS 100000000 // 100m uint8_t P1[EVENTS]; // Property 1 flags uint8_t P2[EVENTS]; // Property 2 flags void init_arrays() { for (int i = 0; i < PEOPLE; i++) { // just some stuff P[i].age = i & 0x07; P[i].cnt = i % 220; // assert( sum < EVENTS ); } for (int i = 0; i < EVENTS; i++) { P1[i] = i % 7; // just some stuff P2[i] = i % 9; // just some other stuff } } int main(int argc, char *argv[]) { uint64_t sum = 0, fcur = 0; int age_filter = 7; // just some init_arrays(); // Init P, P1, P2 for (int64_t p = 0; p < PEOPLE ; p++) if (P[p].age < age_filter) for (int64_t e = 0; e < P[p].cnt ; e++, fcur++) sum += __builtin_popcount( P1[fcur] & P2[fcur] ); else fcur += P[p].cnt; // skip this person's events printf("(dummy %ld %ld)\n", sum, fcur ); return 0; } gcc -O5 -march=native -std=c99 test.c -o test

    Read the article

  • 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

  • Oracle’s Java Community Outreach Plan

    - by Yolande Poirier
    As the steward of Java, Oracle recognizes the importance and value of the Java community, and the relevant role it plays in keeping Java the largest, most vibrant developer community in the world.   In order to increase Oracle’s touch with Java developers worldwide, we are shifting our focus from a flagship JavaOne event followed by several regional JavaOne conferences, to a new outreach model which continues with the JavaOne flagship event, as well as a mix of online content, regional Java Tours, and regional 3rd party event participation.  1. JavaOne JavaOne continues to remain the premier hub for Java developers where you are given the opportunity to improve your Java technical skills, and interact with other members of the Java community. JavaOne is centered on open collaboration and sharing, and Oracle will continue to invest in JavaOne as a unique stand-alone event for the Java community. Oracle recognizes that many developers cannot attend JavaOne in person, therefore Oracle will share the wealth of the unique event material to those developers through a new and easy-to-access online Java program. While online JavaOne content cannot address the importance of actual face-to-face community/developer engagements and networking, online content does aide in extending the Java technical learning opportunity to a broader collection of developers. 2. Java Developer Day Tours Oracle will execute regional Java Developer Days with recognized Java User Groups (JUGs) with participation from Java Evangelist and Java Champions. This allows local, regional specific Java topics to be addressed both by Oracle and the Java community. In addition, Oracle will deliver more virtual technical content programs to reach developers where an existing JUG may not have a presence. 3. Sponsorship of Community-Driven Regional Events/Conferences Oracle also recognizes that improved community dialog and relations are achievable by continued Oracle sponsorship and onsite participation at both established/well-recognized 3rd party events and new emerging/growing 3rd party events. Oracle’s ultimate goal is to be an even better steward for Java by reaching more of the Java ecosystem with face-to-face and online community engagements. We look forward to planning tours and events with you, members of the Java community.

    Read the article

< Previous Page | 161 162 163 164 165 166 167 168 169 170 171 172  | Next Page >