w3hello.com logo
Home PHP C# C++ Android Java Javascript Python IOS SQL HTML Categories
Windows Phone 8 page lifecycle
Not so sure if what you ask is the following: Each Windows Phone Page has a constructor method which is called only once when the page is created - meaning that this method is called only once. Then comes the OnNavigatedTo() and OnNavigatedFrom() methods. The first one is the next in line after the constructor when you are navigating from another page to the current one. The navigated from is being called while you are navigating away from the current page - when this page will be added to the page stack (a.k.a. journal). Next follows the Loaded() method which is called after the OnNavigatedTo() method and also gets called every time you navigate to the current page. Finally you have the OnBackKeyPress() and RemovedFromJournal() methods that gets called when you are trying to navigate

Categories : Windows Phone 8

Two Web User Controls inside a page: lifecycle
To find out turn on page tracing by using the page directive Trace="true". To make trace output show up, then you need to add Trace.Warn statements to the events of the objects you are interested in, such as: In Page_Load of the .aspx page: Trace.Warn("MyPage.aspx - Inside Page_Load event"); Here is the documentation for How to: Enable Tracing for an ASP.NET Page.

Categories : C#

global variables between page lifecycle is not updated when parse from JSON
Move your global variables in map.js right at the beginning. Also move your entire logic from pagebeforecreate to pagebeforeshow or pageshow. Also note page init will fire only once, so if you want values every time in your page, have the logic in pagebeforeshow or pageshow.

Categories : Google Maps

Porting a C code to CUDA without modifying the original code line by line
If you do not like to change the code line by line you could try using OpenACC. OpenACC enables easily parallelizing legacy scientific and technical Fortran and C codes by compiler directives without modifying or adapting the underlying code itself. You just need to identify which areas of the code to accelerate, insert compiler directives and then the compiler does the job of mapping the original sequential computation into the parallel accelerator. I do not have personal experience with that, but, from some Conference presentations I attended, the ease of parallelization is paid a bit with performance.

Categories : C

My code is working and the first line is displaying correctly but the second line is concatenated with the first line etc
Change $(".Weight").text(weight + unit); to $(".Weight", this).text(weight + unit); so that only the .Weight cell of the current row is changed. A prevision following comments : it's useless to cache selectors here, there wouldn't be any noticeable gain and it makes the code harder to read and maintain using children is slower, which isn't very important. What's important is that using children departs from the semantic use of classes, it makes your code rely on the fact the .Weight element is a direct child and not, for example a span in a td. That's exactly the same reason than why you should generally prefer closest over parent.

Categories : Jquery

Java vertical line behind text? Like the line in an editor that indates where a page ends
I'm not entirely sure what you're doing, but it seems to me like you could get a decent solution by adding an element in your JList that looks something like "-------------------" where a page break would be so that it displays. I'm not sure if that's what you're looking for though.

Categories : Java

Why can one line of code work, but then the same line throws a null pointer exception later?
On the third line of your onStart method you are setting the context to the activity. Try setting it to the context instead. this.context = getActivity().getApplicationContext();

Categories : Java

How to wait for line of code to finish before moving onto the next line
Use methods instead of "button-clicks": Private Sub Form1_Shown(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Shown MoveLastItem() MovePreviousItem() End Sub Private Sub MoveLastItem() bindingSource1.MoveLast(); End Sub Private Sub MovePreviousItem() bindingSource1.MovePrevious(); End Sub You just have call these methods from the button-click events handlers as well. Private Sub BindingNavigatorMoveLastItem_Clicked(sender As Object, args As EventArgs) Handles BindingNavigatorMoveLastItem.Click MoveLastItem() End Sub Private Sub BindingNavigatorMovePreviousItem_Clicked(sender As Object, args As EventArgs) Handles BindingNavigatorMovePreviousItem.Click MovePreviousItem() End Sub

Categories : Vb.Net

How to let the program to to show the Gui Code before executing the next line of code in GWT?
You can set the label to the loading text, then you use the GWT Scheduler (http://www.gwtproject.org/javadoc/latest/com/google/gwt/core/client/Scheduler.html) Scheduler.get().scheduleDeferred(new ScheduledCommand() { @Override public void execute() { for (int i = 0; i < cities.length; ++i) { citiesOracle.add(cities[i]);} infoLabel.setText("data was loaded"); } } }); JavaScript (in a browser) is single threaded, so your label changed is queued to be updated after the click event. Using the Scheduler makes the browser able to process the label change before the loop. EDIT: This resource gives a better example how to use the Scheduler to execute long, CPU intensive processing, without triggeri

Categories : Gwt

Convert this line of Java code to C# code
That Java expression is converting a signed byte to unsigned and then to hexadecimal with zero fill. You should be able to code that in C#. FWIW, the Java code gives the same answer as this: Integer.toString(256 + arrayOfByte[i], 16).substring(1) or String.format("%02x", arrayOfByte[i]) Here's how the original works. The subexpression (0xFF & arrayOfByte[i]) is equivalent to (0xFF & ((int) arrayOfByte[i])) which converts a signed byte (-128 to +127) to an unsigned byte (0 to +255). The purpose of the magic 256 + in the original is to ensure that the result of toString will be 3 hex digits long. Finally, the leading digit is removed, leaving you with a zero padded 2 digit hex number.

Categories : C#

Don't understand meaning of 1 code line in example code
The syntax { <field>, <field> } for initializing a struct may only be used in a variable initializer. Edit: Based on the question that tia linked, this ought to work: lowerMiddle = (CGPointSPUserResizableViewAnchorPointPair) { CGPointMake(self.bounds.size.width/2, self.bounds.size.height), SPUserResizableViewLowerMiddleAnchorPoint };

Categories : C

Unicode signs shown on development page, but not on actual page with same code
Try putting this in your <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8"> Also, try changing the de-DE in the <html> tag to <html lang="de" prefix="og: http://ogp.me/ns#"> let me know if that works

Categories : CSS

how to run method in master page before execute child page code in IsPostBack?
You need to have a look at the ASP.NET Webforms page lifecycle in order to understand what happens when. Here is some docs regarding that: http://msdn.microsoft.com/en-us/library/ms178472(v=vs.100).aspx#lifecycle_events The problem you have at the moment is that the Button click event happens after the Page_Load event, so when you click the button you probably experience that Label1.Text is one click "behind". Look at the docs and place the Label1.Text assignment in PreRender for example. Like @ArabicProgrammer is answering, it is better yet to actually make use of the Culture support that is available in the .NET Framework. If you use that method instead, you can display the language using something like this. <%= System.Threading.Thread.CurrentThread.CurrentCulture.DisplayName %

Categories : C#

AJAX code for calling code-behind method from aspx page doesn't work
try this: in your anchor do this: <a href="javascript:void(0)" id="kontakt">Go to Kontakt</a> and modify your ajax script to this: $('a').click(function (e) { var data = { 'id': $(this).attr("id") }; var dataVal = JSON.stringify(data); $.ajax({ type: "POST", url: "Default.aspx/loadNewPage", contentType: "application/json; charset=utf-8", data: dataVal, dataType: "json", success: function (id) { } }); });

Categories : Javascript

Adding JavaScript Code to A Single Page in Joomla (Google Remarketing Code)
You could use a module which allows to run custom code in it. There are several solutions to this in the JED: http://extensions.joomla.org/extensions/core-enhancements/coding-a-scripts-integration/custom-code-in-modules

Categories : Javascript

node.js page in different tabs shows the same page source code
Yes, it's because your browser caches page sources and when you are trying to view it, shows the latest loaded page. If you add some logging, you'll understand what i mean. http.createServer(function (req, res) { res.writeHead(200, {'Content-Type': 'text/html'}); res.write('<p>' + Math.random() + '</p>'); res.end(); console.log('Message has been sent'); }).listen(3000); When you open your page in new tab, you can see in console that browser loads new version of it. But when you trying to view the source browser doesn't load anything. If you want to avoid this behaviour, try to reload the source, after you open it.

Categories : Node Js

generate code using form button and then display generated code on page
You can use tag to show HTML entities You need to encode all Your HTML entities like < => < like way. Also you can show a text area in which all those HTML code need to echo, it will not execute your code simply it will print it.

Categories : PHP

How to get source code after simulate web page button click in code
A hacky approach would be to: Attach an event handler to the 'onclick' event of the button. Then, once the event is triggered, use the Microsoft Internet Controls (SHDocVw) type library in order to get the last URL opened in IE. Lastly, navigate to the URL and once the document is loaded, get the source of the document from the webBrowser1.DocumentText property. In your project, add a reference to the Microsoft Internet Controls type library (you'll find it in the COM tab). Add at the top of your file: using SHDocVw; The code: webBrowser1.Navigate(url); while (webBrowser1.ReadyState != WebBrowserReadyState.Complete) { Application.DoEvents(); } // assign the button to a variable var button = webBrowser1.Document.GetElementById("downloadButton"); // attach an event handler for

Categories : C#

insert html code to a page via php script in other page
As Filippo Toso said, you may include the HTML file in your code.php. Perhaps, if you don't want to have two files, you may make only one file and set the form to act like that: <form id="createNewGallery" name="newgallery" method="GET" action="./"><p><strong>please choose the number of pictures you want to upload: </strong> <select name="numOfPictures" id="numOfPictures"> <option>3</option> <option>4</option> <option>5</option> <option>6</option> <option>7</option> <option>8</option> <option>9</option> <option>10</option> </select></p> <input name="submitNumOfPictures" type="submit" /> <

Categories : PHP

C# Code only getting pagesource for visible page, not for scrolled down page
using HtmlAgilityPack; using System; using System.Collections.Generic; using System.Linq; using System.Net; using System.Text; using System.Threading.Tasks; namespace ConsoleApplication5 { class Program { static void Main(string[] args) { WebClient wc = new WebClient(); var sourceCode = wc.DownloadString("http://dota-trade.com/equipment?order=name"); HtmlDocument doc = new HtmlDocument(); doc.LoadHtml(sourceCode); var node = doc.DocumentNode; var nodes = node.SelectNodes("//a"); List<string> links = new List<string>(); foreach (var item in nodes) { var link = item.Attributes["href"].Value; links.Add(link.Contains("h

Categories : C#

what means .line in smali code syntax ? (android smali code)
.line n markers are used for debugging and stacktraces. When an exception goes uncaught, or the stacktrace needs to be filled in, the line number is taken from the .line statement. If this were missing, then stacktraces would lack line numbers.

Categories : Java

 will not display the page - will not let me see the page
Your problems is most likely that TinyMCE escapes all HTML tags. To allow code to be embedded without adding the security risk of allowing other HTML tags to be inserted, I think this is what you want: https://code.google.com/p/tinymce-pre-plugin/

Categories : Javascript

What is the lifecycle of a C++ object?
This is a fairly broad question, but I'll give you a starting point. What's known in C as a "stack variable" is also called an object with "automatic storage". The lifetime of an object with automatic storage is fairly easy to understand: it's created when control reaches the point it's defined, and then destroyed when it goes out of scope: int main() { int foo = 5; // creation of automatic storage do_stuff(); foo = 1; // end of function; foo is destroyed. } Now, a thing to note is that = 5 is considered part of the initialization syntax, while = 1 is considered an assignment operation. I don't want you to get confused by = being used for two different things in the language's grammar. Anyway, C++ takes automatic storage a bit further and allows arbitrary code to be run durin

Categories : C++

What is this line of Js code exactly doing?
You are making changeName accessible as part of person. Consider it as exposing changeName. Without it, you cannot do me.changeName as me.changeName no longer exists outside of the scope of person.

Categories : Javascript

Google Analytics - event tracking code in separate