w3hello.com logo
Home PHP C# C++ Android Java Javascript Python IOS SQL HTML videos Categories
Javascript, accessing nested frames in framesets from a iFrame
You could give your frame element with name='targetframe' an id='targetframe' and do something like: function E(e){ return document.getElementById(e); } function getChildFrame(id){ var t = E(id); var f = t.contentWindow || t.contentDocument; if(f.document)f = f.document; return f; } var tf = getChildFrame('targetframe'); tf.style.backgroundColor = '#007'; See http://www.w3schools.com/jsref/prop_frame_contentwindow.asp and http://www.w3schools.com/jsref/prop_win_frames.asp for more details. Of course, the Same Origin Policy applies. In other words you can't access someone else's frame, without permission. By the way, you can access the frames array with a number as well.

Categories : Javascript

Interacting with web service from PHP
It seems you just need to call that url with parameters. There's couple of ways to do it. One of them is to use the file_get_contents function, other - to use cURL Here are some examples how to do it: http://www.blogs.zeenor.com/it/how-to-call-the-web-services-through-php.html

Categories : PHP

Interacting with USER OU in Powershell
This is because Users is not an organizational unit, but rather a container. Try runnning Get-ADObject -Filter {Name -eq 'Users'} to get back the Users object; you'll see that it's ObjectClass is 'container', and not 'Organizational Unit.' You cannot create OU's under containers, such as Users. So you'll need to create these new OU's somewhere else.

Categories : Windows

Interacting with a Canvas with Selenium
I was also looking into the same issue, after searching for some time I understood that Selenium accesses canvas element. but it can't access the inner elements/child elements of it. Because selenium used DOM model and canvas's child elements wont visible in DOM. After looking into one example mentioned here, we can interact with the canvas using coordinates. But that's absurd, most of the times we will draw elements dynamically, and how can we get perticular shape's coordinates. If you are having coordinates of the shapes you can play with them using above link.

Categories : HTML

Mvvmcross: Interacting with android service
In general I treat Android services, ios long running tasks and Windows background tasks as separate 'services' and they don't generally interact directly with the ViewModels, but instead interact via messaging, via data stores, etc. Specifically for Android, you may need to use View/Activity level hooks like service local binding (see Android - Service and Activity interaction) When the background services share the same process (same memory space) as the ViewModels, then one thing that can seem a little awkward is initialising shared IoC and any required application singletons. However, generally this doesn't seem to be too hard to do - e.g. see questions like Using MvvmCross from content providers and activities and MvvmCross initialization I haven't personally seen enough examples of

Categories : Android

AJAX form not interacting PHP callback
Change the button type="button" like <input type="button" value="Submit">. Keeping a type="submit" will submit the form and hence page will refresh

Categories : PHP

Interacting with an element via JQuery after being shown via ASP
use this <div id="error" class="notifications" runat="server" href="javascript:void(0);" onclick="fademe('errordiv')" visible="false" ClientIDMode=Static></div> and add the javascript function function fademe(id){ alert('errordiv is clicked'); var container=document.getElementById('error'); containe.fadeOut(); } or function fademe(id){ alert('errordiv is clicked'); $('#error').fadeOut(); } or function fademe(id){ alert('errordiv is clicked'); error.fadeOut(); }

Categories : C#

About interacting and testing with django tastypie
Tastypie has a descent testing documentation - ResourceTestCase API Reference

Categories : Misc

OpenCV and Numpy interacting badly
This isn't an answer, but it's too big for a comment. I played with the values a bit to find the limits. Without loading numpy and cv: >>> unpack("f", pack("i", 8388608)) (1.1754943508222875e-38,) >>> unpack("f", pack("i", 8388607)) (1.1754942106924411e-38,) After loading numpy and cv, the first line is the same, but the second: >>> unpack("f", pack("i", 8388607)) (0.0,) You'll notice that the first result is the lower limit for 32 bit floats. I then tried the same with d. Without loading the libraries: >>> unpack("d", pack("xi", 1048576)) (2.2250738585072014e-308,) >>> unpack("d", pack("xi", 1048575)) (2.2250717365114104e-308,) And after loading the libraries: >>> unpack("d",pack("xi", 1048575)) (0.0,) Now the first resul

Categories : Python

Interacting programmatically with serial terminal
I would strongly consider looking into Twisted and the projects using Twisted for Python projects talking to terminals. I have seen a terminal screen scraper written on Twisted, and at least one public telnet client on GitHub - https://github.com/fjogstad/twisted-telnet-client. I'm not sure which terminal interface you are trying to talk to, but here at least is an example of a terminal emulator in Twisted: https://launchpad.net/python-tvi955. A nice thing about using an asynchronous framework like Twisted would be that you could have one test server driving testing on several virtual machines or physical machines in parallel.

Categories : Python

My JRadioButtons arent interacting with my JButton
The problem is you are creating a new instance of Quiz in your actionPerformed method... public void checkButtonActionPerformed(ActionEvent event){ Quiz quiz = new Quiz(); This means that what you are comparing isn't what's actually on the screen. If the Handler is an inner class, you can reference the variables directly... if(choiceA.isSelected()){...} Otherwise you should be passing a reference of the Quiz to the Handler for it to use, but I would suggest this gets more complicated as you would, realistically need some kind of getter methods that could tell what has being selected

Categories : Java

How to handle many concurrently interacting entities in C#
All of your options are going to bring pain to you. Even if the code would be technically correct, you'll experience logical race condition in your domain. Something like order could be shipped before it paid. It hurts maintainability. Threading code is hard to debug, hard to test, hard to read. When it's interleaved with application this gets much more complicated. The right way is to separate threading code from application code completely. Put tasks in a single-threaded fiber. A task performs all jobs synchronously across all involved entities. After the task finished, you can perform IO asynchronously. I've written a library for such approach.

Categories : C#

AngularJS controller - interacting with view elements?
Angular uses data binding between the $scope to the DOM to do these sort of things. If you want to hide your popup when something happens, you should use the ng-hide directive on the root of your modal dialog, and bind it to a boolean value that exists on the scope. First, if you want to set up this value on the scope, all you have to do in your controller: $scope.isModalHidden = <true|false> If this is something that happens as a result of an async operation (e.g. timeout / server response), you should wrap the previous statement, like so: $scope.$apply(function(){ $scope.isModalHidden = <true|false> }); This will cause Angular to reevaluate isModalHidden even though it wasn't changed as a part of the "natural" flow of events. After that is finished, all you have to d

Categories : Javascript

Overloading [] but its result isn't resolving before interacting with other operators (c++)
The practical way to do this kind of thing is with expression templates. I'd change your return values from operator[] to an expression template even. This will use C++11 features, because it makes it shorter. enum class ExpressionType { Index, Addition }; template< ExpressionType Op, typename LHS, typename RHS > struct Expression { LHS lhs; RHS rhs; template<typename T> operator T(); }; // to separate out the evaluation code: template< typename T, ExpressionType Op, typename LHS, typename RHS > struct Evaluate { T operator()( Expression<Op, LHS, RHS> exp ) const; }; template< ExpressionType Op, typename LHS, typename RHS > template<typename T> Expression<Op,LHS,RHS>::operator T() { return Evaluate<T,Op,LHS,RHS>()( std::move(*t

Categories : C++

Automatic storage duration interacting with other objects
You cannot "push that object" onto a vector. You're pushing a copy of the object onto the vector (unless you have something arcane like a vector of reference wrappers). So everything is fine. (There are of course other ways to shoot yourself in the foot with poorly designed classes that don't properly manage ownership of further, dynamic objects, but that's a general problem not specific to your question.)

Categories : C++

Excel - Display certain information when interacting with a graph
Yes it is possible using Chart Events. Events are enabled for chart sheets by default, but for an embedded chart you can study this Microsoft article. The same page includes this link for Chart Object Events. This requires programming using Excel VBA.

Categories : Excel

Interacting with Tkinter window during a long process
You can use the window.update() method too keep your GUI active and functional after every time you change something on it. During the roots mainloop, this happens automatically but if you're prolonging the mainloop it's probably a good idea to do it manually your self. Put the window.update() in the loop that is taking a while. Note: window is a Tk() object

Categories : Python

PHP: Interacting with 'selected values' in a html form
if ($_POST["$value"] = $funny_colour) is incorrect, you've to use == or === to compare. = is an assign and will always return true. Moreover, $value is set only in the foreach loop, you already lost it when you tried to use it in your if.

Categories : PHP

Button Class interacting with various-types of objects
I think using Boost Signals would be a good solution. That way, your menu can hold a vector of buttons since they won't be depending on a type. class Button { public: boost::signal<void ()> pushed; } You can have a different signal for whatever "interactions" you need your button for.

Categories : C++

User interactions on page interacting with HttpModule
You are probably using bad event in IHttpModule that runs before you set Context.Items item. Try do it in event EndRequest where page was already processed. In Page: protected void Unnamed_Click(object sender, EventArgs e) { Context.Items["button_clicked"] = "yes"; } in HttpModule: public class DefaultHttpApplicationModule : System.Web.IHttpModule { public virtual void Init(HttpApplication context) { context.EndRequest += context_EndRequest; } void context_EndRequest(object sender, EventArgs e) { var app = ((HttpApplication)sender); var ctx = app.Context; string clicked = ctx.Items["button_clicked"] as string; } } You can also access the Page instance directly, becasu System.Web.UI.Page is also IHttpHandler. There are

Categories : C#

Floated ::after interacting with block-level sibling
I never use floats on pseudo elements. I would position them absolute. Something like this: .wrap { width:500px; height:2em; border:1px solid black; position: relative; } .wrap:before { content:"1"; position: absolute; left: 0; top: 0; border:1px solid black; } .wrap:after { content:"2"; position: absolute; right: 0; top: 0; border:1px solid black; } I tested it in your fiddle and looks fine! http://jsfiddle.net/WtrfL/1/

Categories : HTML

Another class interacting with variables in main method
As the testing reference in your class is referring to the same list you created in main method, so making any change will change the main method list. If you want to create a new list using the list passed in your setTesting method, then do something like this: public void setTesting(List<Long> list) { this.testing = new ArrayList<Long>(list); } using the new keyword in setTesting, a new list will be created using the input list. Any change to this new list will not impact the original main method list. Also you can remove the initialization of testing list from the class level, simply declare it: private List<Long> testing;

Categories : Java

Multiple Independent View Models Interacting (Knockout)
I'm not sure if this is what you're asking, but it sounds like you're looking to implement something like a reusable control using Knockout. One approach we're currently taking is using custom binding handlers in conjunction with template scripts. For example, given some templates: <script type="text/html" id="selector-template"> <!-- ko if: isLoading --> Loading data... <!-- /ko --> <!-- ko ifnot: isLoading --> <ul data-bind="foreach: items"> <li data-bind=" css: { selected: $parent.selectedItem == $data }, template: $parent.itemTemplate, click: selectItem"> </li> </ul> <!-- /ko --> </script> ...and a binding handler: ko.bindingHandlers.selector

Categories : Asp Net

Interacting with MatplotlibWidget created with Qt Designer in python code
You need to define your own class for MatplotlibWidget first (in your main script, not the UI code) and then instantialize it in Window() definintion. To do that you also need to import FigureCanvas from _qt4agg matplotlib backend module and Figure class: from matplotlib.backends.backend_qt4agg import FigureCanvasQTAgg as Canvas from matplotlib.figure import Figure Then in the Matplotlib class definition you create instances of the Figure subplots and Figure canvas, that can then be used to interact with your plot from the main window. So using your code this would look like this: from PyQt4 import QtGui, QtCore from TestUI2 import MainWindow from matplotlib.backends.backend_qt4agg import FigureCanvasQTAgg as Canvas from matplotlib.figure import Figure class Window(MainWindow):

Categories : Python

Submitting data to form and interacting with website, automation
Looks like you need Web Services. Try exploring WSDL or REST api. EDIT : Looks like you are trying to use Selenium which is a functional test framework. Set it up like the program describes at the end of the getting started page. After that you should be able to access the html page elements as provided in the tutorial.

Categories : Java

WakeLock.release() switches off screen even if the user was interacting with the app
Yes, you want to use the ON_AFTER_RELEASE flag. When this wake lock is released, poke the user activity timer so the screen stays on for a little longer.

Categories : Android

Interacting with windows messages with command based compiler
To use GetMessage or PeekMessage you don't need any windows in your thread: http://msdn.microsoft.com/en-us/library/ms644946%28v=vs.85%29.aspx The thread to which the message is posted must have created a message queue, or else the call to PostThreadMessage fails. Use the following method to handle this situation. Create an event object, then create the thread. Use the WaitForSingleObject function to wait for the event to be set to the signaled state before calling PostThreadMessage. In the thread to which the message will be posted, call PeekMessage as shown here to force the system to create the message queue: PeekMessage(&msg, NULL, WM_USER, WM_USER, PM_NOREMOVE) > Set the event, to indicate that the thread is ready to receive posted

Categories : C

Interacting with ActiveX control on web page using external PowerShell script
You cannot upload files through Aurigma Uploader without end user interaction. This is done by design due to security reasons. I.e. there is no API for adding files to upload list even if you can get reference to control.

Categories : Internet Explorer

JAAS Authorization in the web-service interacting with FileNet Content Engine
You're right, since you already have user info you don't need callbacks (which are used in form-based authentication). As fas as WAS settings are concerned, you'll have to decide that one yourself. Here is a very good tutorial. But have you considered using simpler, SSO mechanism to persist the auth. context between WAS profiles/servers?

Categories : Java

How is interacting with a prompt of a third party command line program different from a Windows Command prompt?
Most likely the program starts its own shell and does no longer interact with the original one. (You would notice this if the program opens a new window) Or the program needs some specific library to be present to be able to interact with a shell (readline seems to be the case here) and that is not present in your Java Environment. As a quick hack you might try to start bash (or cmd) that then starts the tool. bash and cmd have readline library. I don't have a windows ready here but as a guess just try to call your program like cmd urjtag.exe instead of just urjtag.exe that way you start a cmd process (with that you can interact) and that cmd starts the urjtag.exe where you already know that it can interact with. Either way the problem lies in the way the program you want to call intera

Categories : Java



© Copyright 2017 w3hello.com Publishing Limited. All rights reserved.